CAMEL-11373: Remove unnecessary converters and polish code/doc
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a6d70295 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a6d70295 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a6d70295 Branch: refs/heads/master Commit: a6d70295912a84e4ae712f80e7f80e3878bdc3f4 Parents: 3d73e49 Author: Tadayoshi Sato <sato.tadayo...@gmail.com> Authored: Fri Jun 2 10:27:50 2017 +0900 Committer: Claus Ibsen <davscl...@apache.org> Committed: Fri Jun 2 09:05:14 2017 +0200 ---------------------------------------------------------------------- .../src/main/descriptors/common-bin.xml | 3 +- .../src/main/docs/twilio-component.adoc | 14 +- .../component/twilio/TwilioConfiguration.java | 1 - .../camel/component/twilio/TwilioConverter.java | 259 ------------------- 4 files changed, 9 insertions(+), 268 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/a6d70295/apache-camel/src/main/descriptors/common-bin.xml ---------------------------------------------------------------------- diff --git a/apache-camel/src/main/descriptors/common-bin.xml b/apache-camel/src/main/descriptors/common-bin.xml index a3dd322..2073939 100644 --- a/apache-camel/src/main/descriptors/common-bin.xml +++ b/apache-camel/src/main/descriptors/common-bin.xml @@ -75,7 +75,7 @@ <include>org.apache.camel:camel-docker</include> <include>org.apache.camel:camel-dozer</include> <include>org.apache.camel:camel-drill</include> - <include>org.apache.camel:camel-dropbox</include> + <include>org.apache.camel:camel-dropbox</include> <include>org.apache.camel:camel-eclipse</include> <include>org.apache.camel:camel-ehcache</include> <include>org.apache.camel:camel-ejb</include> @@ -536,6 +536,7 @@ <include>org.apache.camel:camel-tagsoup-starter</include> <include>org.apache.camel:camel-tarfile-starter</include> <include>org.apache.camel:camel-telegram-starter</include> + <include>org.apache.camel:camel-twilio-starter</include> <include>org.apache.camel:camel-twitter-starter</include> <include>org.apache.camel:camel-undertow-starter</include> <include>org.apache.camel:camel-univocity-parsers-starter</include> http://git-wip-us.apache.org/repos/asf/camel/blob/a6d70295/components/camel-twilio/src/main/docs/twilio-component.adoc ---------------------------------------------------------------------- diff --git a/components/camel-twilio/src/main/docs/twilio-component.adoc b/components/camel-twilio/src/main/docs/twilio-component.adoc index 16c0d8e..4fd68e8 100644 --- a/components/camel-twilio/src/main/docs/twilio-component.adoc +++ b/components/camel-twilio/src/main/docs/twilio-component.adoc @@ -148,14 +148,14 @@ would override a *`CamelTwilio.option`* header. Endpoint can be one of: -[width="100%",cols="50%,50%",options="header"] +[width="100%",cols="20%,20%,60%",options="header"] |======================================================================= -| Endpoint | Shorthand Alias -| *creator* | create -| *deleter* | delete -| *fetcher* | fetch -| *reader* | read -| *updater* | update +| Endpoint | Shorthand Alias | Description +| *creator* | create | Make the request to the Twilio API to perform the create +| *deleter* | delete | Make the request to the Twilio API to perform the delete +| *fetcher* | fetch | Make the request to the Twilio API to perform the fetch +| *reader* | read | Make the request to the Twilio API to perform the read +| *updater* | update | Make the request to the Twilio API to perform the update |======================================================================= Available endpoints differ depending on the endpoint prefixes. http://git-wip-us.apache.org/repos/asf/camel/blob/a6d70295/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConfiguration.java b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConfiguration.java index cef2b3a..4ff4427 100644 --- a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConfiguration.java +++ b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConfiguration.java @@ -63,7 +63,6 @@ public class TwilioConfiguration implements Cloneable { * @return the API Name */ public TwilioApiName getApiName() { - return apiName; } http://git-wip-us.apache.org/repos/asf/camel/blob/a6d70295/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConverter.java ---------------------------------------------------------------------- diff --git a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConverter.java b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConverter.java index c9313bb..db2660f 100644 --- a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConverter.java +++ b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConverter.java @@ -16,35 +16,6 @@ */ package org.apache.camel.component.twilio; -import java.net.URI; -import java.net.URISyntaxException; - -import com.twilio.rest.api.v2010.Account; -import com.twilio.rest.api.v2010.account.AuthorizedConnectApp; -import com.twilio.rest.api.v2010.account.Call; -import com.twilio.rest.api.v2010.account.Conference; -import com.twilio.rest.api.v2010.account.ConnectApp; -import com.twilio.rest.api.v2010.account.IncomingPhoneNumber; -import com.twilio.rest.api.v2010.account.Message; -import com.twilio.rest.api.v2010.account.Recording; -import com.twilio.rest.api.v2010.account.Transcription; -import com.twilio.rest.api.v2010.account.call.Feedback; -import com.twilio.rest.api.v2010.account.call.FeedbackSummary; -import com.twilio.rest.api.v2010.account.conference.Participant; -import com.twilio.rest.api.v2010.account.incomingphonenumber.Local; -import com.twilio.rest.api.v2010.account.incomingphonenumber.Mobile; -import com.twilio.rest.api.v2010.account.incomingphonenumber.TollFree; -import com.twilio.rest.api.v2010.account.recording.AddOnResult; -import com.twilio.rest.api.v2010.account.usage.Record; -import com.twilio.rest.api.v2010.account.usage.Trigger; -import com.twilio.rest.api.v2010.account.usage.record.AllTime; -import com.twilio.rest.api.v2010.account.usage.record.Daily; -import com.twilio.rest.api.v2010.account.usage.record.LastMonth; -import com.twilio.rest.api.v2010.account.usage.record.Monthly; -import com.twilio.rest.api.v2010.account.usage.record.ThisMonth; -import com.twilio.rest.api.v2010.account.usage.record.Today; -import com.twilio.rest.api.v2010.account.usage.record.Yearly; -import com.twilio.rest.api.v2010.account.usage.record.Yesterday; import com.twilio.type.PhoneNumber; import com.twilio.type.Sip; import org.apache.camel.Converter; @@ -57,15 +28,6 @@ public final class TwilioConverter { } @Converter - public static URI toURI(String value) throws URISyntaxException { - return new URI(value); - } - - // ----------------------------------------------------- - // com.twilio.type - // ----------------------------------------------------- - - @Converter public static PhoneNumber toPhoneNumber(String value) { return new PhoneNumber(value); } @@ -74,225 +36,4 @@ public final class TwilioConverter { public static Sip toSip(String value) { return new Sip(value); } - - // ----------------------------------------------------- - // com.twilio.rest.api.v2010 - // ----------------------------------------------------- - - @Converter - public static Account.Status toAccountStatus(String value) { - return Account.Status.forValue(value); - } - - @Converter - public static Account.Type toAccountType(String value) { - return Account.Type.forValue(value); - } - - // ----------------------------------------------------- - // com.twilio.rest.api.v2010.account - // ----------------------------------------------------- - - @Converter - public static AuthorizedConnectApp.Permission toAuthorizedConnectAppPermission(String value) { - return AuthorizedConnectApp.Permission.forValue(value); - } - - @Converter - public static Call.Event toCallEvent(String value) { - return Call.Event.forValue(value); - } - - @Converter - public static Call.Status toCallStatus(String value) { - return Call.Status.forValue(value); - } - - @Converter - public static Call.UpdateStatus toCallUpdateStatus(String value) { - return Call.UpdateStatus.forValue(value); - } - - @Converter - public static Conference.Status toConferenceStatus(String value) { - return Conference.Status.forValue(value); - } - - @Converter - public static Conference.UpdateStatus toConferenceUpdateStatus(String value) { - return Conference.UpdateStatus.forValue(value); - } - - @Converter - public static ConnectApp.Permission toConnectAppPermission(String value) { - return ConnectApp.Permission.forValue(value); - } - - @Converter - public static IncomingPhoneNumber.AddressRequirement toIncomingPhoneNumberAddressRequirement(String value) { - return IncomingPhoneNumber.AddressRequirement.forValue(value); - } - - @Converter - public static IncomingPhoneNumber.EmergencyStatus toIncomingPhoneNumberEmergencyStatus(String value) { - return IncomingPhoneNumber.EmergencyStatus.forValue(value); - } - - @Converter - public static Message.Direction toMessageDirection(String value) { - return Message.Direction.forValue(value); - } - - @Converter - public static Message.Status toMessageStatus(String value) { - return Message.Status.forValue(value); - } - - @Converter - public static Recording.Source toRecordingSource(String value) { - return Recording.Source.forValue(value); - } - - @Converter - public static Recording.Status toRecordingStatus(String value) { - return Recording.Status.forValue(value); - } - - @Converter - public static Transcription.Status toTranscriptionStatus(String value) { - return Transcription.Status.forValue(value); - } - - // ----------------------------------------------------- - // com.twilio.rest.api.v2010.account.call - // ----------------------------------------------------- - - @Converter - public static Feedback.Issues toFeedbackIssues(String value) { - return Feedback.Issues.forValue(value); - } - - @Converter - public static FeedbackSummary.Status toFeedbackSummaryStatus(String value) { - return FeedbackSummary.Status.forValue(value); - } - - // ----------------------------------------------------- - // com.twilio.rest.api.v2010.account.conference - // ----------------------------------------------------- - - @Converter - public static Participant.Status toParticipantStatus(String value) { - return Participant.Status.forValue(value); - } - - // ----------------------------------------------------- - // com.twilio.rest.api.v2010.account.incomingphonenumber - // ----------------------------------------------------- - - @Converter - public static Local.AddressRequirement toLocalAddressRequirement(String value) { - return Local.AddressRequirement.forValue(value); - } - - @Converter - public static Mobile.AddressRequirement toMobileAddressRequirement(String value) { - return Mobile.AddressRequirement.forValue(value); - } - - @Converter - public static TollFree.AddressRequirement toTollFreeAddressRequirement(String value) { - return TollFree.AddressRequirement.forValue(value); - } - - // ----------------------------------------------------- - // com.twilio.rest.api.v2010.account.message - // ----------------------------------------------------- - - @Converter - public static com.twilio.rest.api.v2010.account.message.Feedback.Outcome toFeedbackOutcome(String value) { - return com.twilio.rest.api.v2010.account.message.Feedback.Outcome.forValue(value); - } - - // ----------------------------------------------------- - // com.twilio.rest.api.v2010.account.recording - // ----------------------------------------------------- - - @Converter - public static AddOnResult.Status toAddOnResultStatus(String value) { - return AddOnResult.Status.forValue(value); - } - - @Converter - public static com.twilio.rest.api.v2010.account.recording.Transcription.Status toRecordingTranscriptionStatus(String value) { - return com.twilio.rest.api.v2010.account.recording.Transcription.Status.forValue(value); - } - - // ----------------------------------------------------- - // com.twilio.rest.api.v2010.account.usage - // ----------------------------------------------------- - - @Converter - public static Record.Category toRecordCategory(String value) { - return Record.Category.forValue(value); - } - - @Converter - public static Trigger.Recurring toTriggerRecurring(String value) { - return Trigger.Recurring.forValue(value); - } - - @Converter - public static Trigger.TriggerField toTriggerTriggerField(String value) { - return Trigger.TriggerField.forValue(value); - } - - @Converter - public static Trigger.UsageCategory toTriggerUsageCategory(String value) { - return Trigger.UsageCategory.forValue(value); - } - - // ----------------------------------------------------- - // com.twilio.rest.api.v2010.account.usage.record - // ----------------------------------------------------- - - @Converter - public static AllTime.Category toAllTimeCategory(String value) { - return AllTime.Category.forValue(value); - } - - @Converter - public static Daily.Category toDailyCategory(String value) { - return Daily.Category.forValue(value); - } - - @Converter - public static LastMonth.Category toLastMonthCategory(String value) { - return LastMonth.Category.forValue(value); - } - - @Converter - public static Monthly.Category toMonthlyCategory(String value) { - return Monthly.Category.forValue(value); - } - - @Converter - public static ThisMonth.Category toThisMonthCategory(String value) { - return ThisMonth.Category.forValue(value); - } - - @Converter - public static Today.Category toTodayCategory(String value) { - return Today.Category.forValue(value); - } - - @Converter - public static Yearly.Category toYearlyCategory(String value) { - return Yearly.Category.forValue(value); - } - - @Converter - public static Yesterday.Category toYesterdayCategory(String value) { - return Yesterday.Category.forValue(value); - } }