From baf498e7b08d24682b585f2e01fd425e03a199da Mon Sep 17 00:00:00 2001 From: Shubham Date: Wed, 2 Jul 2025 19:48:33 +0530 Subject: [PATCH 01/12] chore: use Object for anyType (#873) * fix: use Object for types instead of Map * fix: use Object for anyType * fix: use Object for anyType --- .../twilio/rest/accounts/v1/BulkConsents.java | 4 +- .../rest/accounts/v1/BulkConsentsCreator.java | 16 +- .../twilio/rest/accounts/v1/BulkContacts.java | 4 +- .../rest/accounts/v1/BulkContactsCreator.java | 16 +- .../com/twilio/rest/api/v2010/Account.java | 12 +- .../v2010/account/AuthorizedConnectApp.java | 8 +- .../twilio/rest/api/v2010/account/Call.java | 8 +- .../rest/api/v2010/account/Conference.java | 12 +- .../rest/api/v2010/account/ConnectApp.java | 8 +- .../v2010/account/IncomingPhoneNumber.java | 26 ++-- .../rest/api/v2010/account/Message.java | 14 +- .../api/v2010/account/MessageCreator.java | 2 +- .../rest/api/v2010/account/Recording.java | 12 +- .../rest/api/v2010/account/Transcription.java | 8 +- .../account/ValidationRequestCreator.java | 2 +- .../account/address/DependentPhoneNumber.java | 14 +- .../v2010/account/call/PaymentCreator.java | 11 +- .../api/v2010/account/call/Recording.java | 18 +-- .../rest/api/v2010/account/call/Siprec.java | 10 +- .../rest/api/v2010/account/call/Stream.java | 10 +- .../api/v2010/account/call/Transcription.java | 10 +- .../v2010/account/conference/Participant.java | 6 +- .../v2010/account/conference/Recording.java | 18 +-- .../account/incomingphonenumber/Local.java | 26 ++-- .../incomingphonenumber/LocalCreator.java | 2 +- .../account/incomingphonenumber/Mobile.java | 26 ++-- .../incomingphonenumber/MobileCreator.java | 2 +- .../account/incomingphonenumber/TollFree.java | 26 ++-- .../incomingphonenumber/TollFreeCreator.java | 2 +- .../api/v2010/account/message/Feedback.java | 6 +- .../v2010/account/recording/AddOnResult.java | 6 +- .../account/recording/Transcription.java | 8 +- .../rest/api/v2010/account/usage/Record.java | 8 +- .../rest/api/v2010/account/usage/Trigger.java | 24 ++- .../v2010/account/usage/record/AllTime.java | 8 +- .../api/v2010/account/usage/record/Daily.java | 8 +- .../v2010/account/usage/record/LastMonth.java | 8 +- .../v2010/account/usage/record/Monthly.java | 8 +- .../v2010/account/usage/record/ThisMonth.java | 8 +- .../api/v2010/account/usage/record/Today.java | 8 +- .../v2010/account/usage/record/Yearly.java | 8 +- .../v2010/account/usage/record/Yesterday.java | 8 +- .../twilio/rest/assistants/v1/Assistant.java | 15 +- .../twilio/rest/assistants/v1/Knowledge.java | 23 +-- .../com/twilio/rest/assistants/v1/Tool.java | 29 ++-- .../assistants/v1/assistant/Feedback.java | 2 +- .../rest/assistants/v1/assistant/Message.java | 2 +- .../v1/export/ExportCustomJob.java | 9 +- .../rest/bulkexports/v1/export/Job.java | 9 +- .../com/twilio/rest/chat/v1/Credential.java | 8 +- .../twilio/rest/chat/v1/service/Channel.java | 6 +- .../com/twilio/rest/chat/v1/service/Role.java | 8 +- .../chat/v1/service/user/UserChannel.java | 6 +- .../com/twilio/rest/chat/v2/Credential.java | 8 +- .../twilio/rest/chat/v2/service/Binding.java | 6 +- .../twilio/rest/chat/v2/service/Channel.java | 6 +- .../com/twilio/rest/chat/v2/service/Role.java | 8 +- .../rest/chat/v2/service/channel/Webhook.java | 2 +- .../chat/v2/service/user/UserBinding.java | 6 +- .../chat/v2/service/user/UserChannel.java | 12 +- .../java/com/twilio/rest/chat/v3/Channel.java | 6 +- .../com/twilio/rest/content/v1/Content.java | 2 +- .../content/v1/content/ApprovalCreate.java | 2 +- .../v1/AddressConfiguration.java | 38 ++--- .../rest/conversations/v1/Conversation.java | 6 +- .../v1/ConversationWithParticipants.java | 6 +- .../rest/conversations/v1/Credential.java | 8 +- .../v1/ParticipantConversation.java | 8 +- .../twilio/rest/conversations/v1/Role.java | 8 +- .../v1/configuration/Webhook.java | 12 +- .../v1/conversation/Webhook.java | 6 +- .../conversation/message/DeliveryReceipt.java | 6 +- .../conversations/v1/service/Binding.java | 6 +- .../v1/service/Conversation.java | 6 +- .../service/ConversationWithParticipants.java | 6 +- .../v1/service/ParticipantConversation.java | 8 +- .../rest/conversations/v1/service/Role.java | 8 +- .../v1/service/configuration/Webhook.java | 6 +- .../v1/service/conversation/Webhook.java | 6 +- .../conversation/message/DeliveryReceipt.java | 6 +- .../v1/service/user/UserConversation.java | 14 +- .../v1/user/UserConversation.java | 14 +- .../java/com/twilio/rest/events/v1/Sink.java | 16 +- .../twilio/rest/events/v1/SinkCreator.java | 12 +- .../twilio/rest/events/v1/Subscription.java | 2 +- .../rest/events/v1/SubscriptionCreator.java | 16 +- .../twilio/rest/flexapi/v1/Configuration.java | 6 +- .../com/twilio/rest/flexapi/v1/FlexFlow.java | 16 +- .../twilio/rest/flexapi/v1/Interaction.java | 4 +- .../rest/flexapi/v1/InteractionCreator.java | 16 +- .../v1/PluginConfigurationCreator.java | 18 +-- .../rest/flexapi/v1/ProvisioningStatus.java | 6 +- .../v1/interaction/InteractionChannel.java | 14 +- .../InteractionChannelUpdater.java | 9 +- .../InteractionChannelInvite.java | 2 +- .../InteractionChannelInviteCreator.java | 12 +- .../InteractionChannelParticipant.java | 12 +- .../InteractionChannelParticipantCreator.java | 16 +- .../InteractionTransfer.java | 12 +- .../com/twilio/rest/frontlineapi/v1/User.java | 6 +- .../rest/insights/v1/CallSummaries.java | 26 ++-- .../twilio/rest/insights/v1/Conference.java | 40 +++-- .../com/twilio/rest/insights/v1/Room.java | 50 +++--- .../rest/insights/v1/call/Annotation.java | 12 +- .../rest/insights/v1/call/CallSummary.java | 26 ++-- .../twilio/rest/insights/v1/call/Event.java | 12 +- .../twilio/rest/insights/v1/call/Metric.java | 12 +- .../v1/conference/ConferenceParticipant.java | 54 +++---- .../rest/insights/v1/room/Participant.java | 26 ++-- .../rest/intelligence/v2/CustomOperator.java | 12 +- .../v2/CustomOperatorCreator.java | 10 +- .../v2/CustomOperatorUpdater.java | 9 +- .../twilio/rest/intelligence/v2/Operator.java | 6 +- .../rest/intelligence/v2/OperatorType.java | 20 ++- .../intelligence/v2/PrebuiltOperator.java | 8 +- .../twilio/rest/intelligence/v2/Service.java | 8 +- .../rest/intelligence/v2/Transcript.java | 8 +- .../intelligence/v2/TranscriptCreator.java | 13 +- .../v2/transcript/OperatorResult.java | 8 +- .../rest/ipmessaging/v1/Credential.java | 8 +- .../rest/ipmessaging/v1/service/Channel.java | 6 +- .../rest/ipmessaging/v1/service/Role.java | 8 +- .../v1/service/user/UserChannel.java | 6 +- .../rest/ipmessaging/v2/Credential.java | 8 +- .../rest/ipmessaging/v2/service/Binding.java | 6 +- .../rest/ipmessaging/v2/service/Channel.java | 6 +- .../rest/ipmessaging/v2/service/Role.java | 8 +- .../v2/service/channel/Webhook.java | 2 +- .../v2/service/user/UserBinding.java | 6 +- .../v2/service/user/UserChannel.java | 12 +- .../twilio/rest/knowledge/v1/Knowledge.java | 23 +-- .../twilio/rest/lookups/v2/PhoneNumber.java | 6 +- .../marketplace/v1/ReferralConversion.java | 2 +- .../installedaddon/InstalledAddOnUsage.java | 2 +- .../rest/messaging/v1/BrandRegistration.java | 22 ++- .../com/twilio/rest/messaging/v1/Service.java | 6 +- .../messaging/v1/TollfreeVerification.java | 16 +- .../v1/brandregistration/BrandVetting.java | 10 +- .../rest/messaging/v2/ChannelsSender.java | 145 +++++++++++++++--- .../com/twilio/rest/notify/v1/Credential.java | 8 +- .../rest/notify/v1/service/Binding.java | 2 +- .../rest/notify/v1/service/Notification.java | 6 +- .../v1/service/NotificationCreator.java | 44 +++--- .../rest/numbers/v1/PortingPortability.java | 8 +- .../numbers/v1/PortingPortabilityFetcher.java | 2 +- .../v1/PortingWebhookConfigurationDelete.java | 2 +- .../numbers/v2/AuthorizationDocument.java | 6 +- .../v2/AuthorizationDocumentCreator.java | 2 +- .../numbers/v2/BulkHostedNumberOrder.java | 8 +- .../twilio/rest/numbers/v2/BundleClone.java | 6 +- .../rest/numbers/v2/HostedNumberOrder.java | 14 +- .../numbers/v2/HostedNumberOrderCreator.java | 4 +- .../DependentHostedNumberOrder.java | 6 +- .../v2/regulatorycompliance/Bundle.java | 6 +- .../v2/regulatorycompliance/EndUser.java | 8 +- .../regulatorycompliance/EndUserCreator.java | 11 +- .../regulatorycompliance/EndUserUpdater.java | 10 +- .../v2/regulatorycompliance/Regulation.java | 6 +- .../SupportingDocument.java | 6 +- .../SupportingDocumentCreator.java | 13 +- .../SupportingDocumentUpdater.java | 12 +- .../bundle/BundleCopy.java | 6 +- .../bundle/Evaluation.java | 6 +- .../bundle/ReplaceItems.java | 6 +- .../hostedNumbers/AuthorizationDocument.java | 6 +- .../hostedNumbers/HostedNumberOrder.java | 12 +- .../HostedNumberOrderCreator.java | 2 +- .../DependentHostedNumberOrder.java | 12 +- .../marketplace/InstalledAddOnCreator.java | 10 +- .../marketplace/InstalledAddOnUpdater.java | 9 +- .../previewiam/organizations/Account.java | 6 +- .../organizations/RoleAssignment.java | 2 +- .../rest/previewiam/organizations/User.java | 4 +- .../rest/pricing/v1/messaging/Country.java | 2 +- .../rest/pricing/v1/phonenumber/Country.java | 2 +- .../twilio/rest/pricing/v1/voice/Country.java | 2 +- .../twilio/rest/pricing/v1/voice/Number.java | 2 +- .../rest/pricing/v1/voice/NumberFetcher.java | 3 +- .../com/twilio/rest/pricing/v2/Country.java | 2 +- .../com/twilio/rest/pricing/v2/Number.java | 2 +- .../twilio/rest/pricing/v2/NumberFetcher.java | 2 +- .../twilio/rest/pricing/v2/voice/Country.java | 2 +- .../twilio/rest/pricing/v2/voice/Number.java | 2 +- .../rest/pricing/v2/voice/NumberFetcher.java | 2 +- .../com/twilio/rest/proxy/v1/Service.java | 14 +- .../twilio/rest/proxy/v1/service/Session.java | 12 +- .../rest/proxy/v1/service/SessionCreator.java | 18 +-- .../proxy/v1/service/session/Interaction.java | 18 +-- .../participant/MessageInteraction.java | 18 +-- .../rest/serverless/v1/service/Build.java | 12 +- .../v1/service/asset/AssetVersion.java | 6 +- .../v1/service/build/BuildStatus.java | 6 +- .../v1/service/environment/Log.java | 30 +--- .../v1/service/function/FunctionVersion.java | 6 +- .../java/com/twilio/rest/studio/v1/Flow.java | 6 +- .../rest/studio/v1/flow/Engagement.java | 6 +- .../studio/v1/flow/EngagementCreator.java | 17 +- .../twilio/rest/studio/v1/flow/Execution.java | 8 +- .../rest/studio/v1/flow/ExecutionCreator.java | 17 +- .../java/com/twilio/rest/studio/v2/Flow.java | 12 +- .../twilio/rest/studio/v2/FlowCreator.java | 13 +- .../twilio/rest/studio/v2/FlowUpdater.java | 10 +- .../twilio/rest/studio/v2/FlowValidate.java | 6 +- .../rest/studio/v2/FlowValidateUpdater.java | 14 +- .../twilio/rest/studio/v2/flow/Execution.java | 8 +- .../rest/studio/v2/flow/ExecutionCreator.java | 17 +- .../rest/studio/v2/flow/FlowRevision.java | 6 +- .../twilio/rest/supersim/v1/EsimProfile.java | 6 +- .../com/twilio/rest/supersim/v1/Fleet.java | 6 +- .../twilio/rest/supersim/v1/IpCommand.java | 18 +-- .../rest/supersim/v1/SettingsUpdate.java | 6 +- .../java/com/twilio/rest/supersim/v1/Sim.java | 6 +- .../twilio/rest/supersim/v1/SmsCommand.java | 12 +- .../twilio/rest/supersim/v1/UsageRecord.java | 2 +- .../rest/supersim/v1/sim/BillingPeriod.java | 6 +- .../rest/supersim/v1/sim/SimIpAddress.java | 6 +- .../rest/sync/v1/service/DocumentCreator.java | 8 +- .../rest/sync/v1/service/DocumentUpdater.java | 7 +- .../v1/service/synclist/SyncListItem.java | 2 +- .../service/synclist/SyncListItemCreator.java | 10 +- .../service/synclist/SyncListItemUpdater.java | 7 +- .../sync/v1/service/syncmap/SyncMapItem.java | 2 +- .../service/syncmap/SyncMapItemCreator.java | 10 +- .../service/syncmap/SyncMapItemUpdater.java | 7 +- .../v1/service/syncstream/StreamMessage.java | 2 +- .../syncstream/StreamMessageCreator.java | 10 +- .../twilio/rest/taskrouter/v1/Workspace.java | 6 +- .../rest/taskrouter/v1/workspace/Task.java | 6 +- .../taskrouter/v1/workspace/TaskQueue.java | 6 +- .../v1/workspace/task/Reservation.java | 8 +- .../v1/workspace/worker/Reservation.java | 8 +- .../com/twilio/rest/trunking/v1/Trunk.java | 12 +- .../rest/trunking/v1/trunk/PhoneNumber.java | 6 +- .../rest/trunking/v1/trunk/Recording.java | 12 +- .../v1/ComplianceRegistrationInquiries.java | 4 +- .../ComplianceTollfreeInquiriesCreator.java | 2 +- .../rest/trusthub/v1/CustomerProfiles.java | 6 +- .../rest/trusthub/v1/EndUserCreator.java | 11 +- .../rest/trusthub/v1/EndUserUpdater.java | 10 +- .../rest/trusthub/v1/SupportingDocument.java | 6 +- .../v1/SupportingDocumentCreator.java | 13 +- .../v1/SupportingDocumentUpdater.java | 12 +- .../rest/trusthub/v1/TrustProducts.java | 6 +- .../CustomerProfilesEvaluations.java | 6 +- .../TrustProductsEvaluations.java | 6 +- .../java/com/twilio/rest/verify/v2/Form.java | 8 +- .../rest/verify/v2/VerificationAttempt.java | 12 +- .../rest/verify/v2/service/AccessToken.java | 8 +- .../rest/verify/v2/service/Verification.java | 8 +- .../verify/v2/service/VerificationCheck.java | 6 +- .../v2/service/VerificationCreator.java | 19 ++- .../rest/verify/v2/service/Webhook.java | 18 +-- .../verify/v2/service/entity/Challenge.java | 18 +-- .../v2/service/entity/ChallengeCreator.java | 27 +--- .../v2/service/entity/ChallengeUpdater.java | 7 +- .../rest/verify/v2/service/entity/Factor.java | 12 +- .../verify/v2/service/entity/NewFactor.java | 14 +- .../v2/service/entity/NewFactorCreator.java | 8 +- .../com/twilio/rest/video/v1/Composition.java | 12 +- .../twilio/rest/video/v1/CompositionHook.java | 6 +- .../com/twilio/rest/video/v1/Recording.java | 26 ++-- .../java/com/twilio/rest/video/v1/Room.java | 20 +-- .../rest/video/v1/room/Participant.java | 6 +- .../rest/video/v1/room/RoomRecording.java | 26 ++-- .../video/v1/room/participant/Anonymize.java | 6 +- .../v1/room/participant/PublishedTrack.java | 6 +- .../v1/room/participant/SubscribedTrack.java | 6 +- .../com/twilio/rest/wireless/v1/Command.java | 24 +-- .../java/com/twilio/rest/wireless/v1/Sim.java | 12 +- src/test/java/com/twilio/ClusterTest.java | 10 +- 270 files changed, 1365 insertions(+), 1478 deletions(-) diff --git a/src/main/java/com/twilio/rest/accounts/v1/BulkConsents.java b/src/main/java/com/twilio/rest/accounts/v1/BulkConsents.java index 2ef3ff3e24..8c8eee79da 100644 --- a/src/main/java/com/twilio/rest/accounts/v1/BulkConsents.java +++ b/src/main/java/com/twilio/rest/accounts/v1/BulkConsents.java @@ -38,9 +38,7 @@ public class BulkConsents extends Resource { private static final long serialVersionUID = 126137950684284L; - public static BulkConsentsCreator creator( - final List> items - ) { + public static BulkConsentsCreator creator(final List items) { return new BulkConsentsCreator(items); } diff --git a/src/main/java/com/twilio/rest/accounts/v1/BulkConsentsCreator.java b/src/main/java/com/twilio/rest/accounts/v1/BulkConsentsCreator.java index 93a1b73bbf..ad5acc7da5 100644 --- a/src/main/java/com/twilio/rest/accounts/v1/BulkConsentsCreator.java +++ b/src/main/java/com/twilio/rest/accounts/v1/BulkConsentsCreator.java @@ -16,8 +16,6 @@ import com.twilio.base.Creator; import com.twilio.constant.EnumConstants; -import com.twilio.converter.Converter; -import com.twilio.converter.Converter; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; @@ -29,23 +27,21 @@ import com.twilio.rest.Domains; import java.util.List; import java.util.List; -import java.util.Map; -import java.util.Map; public class BulkConsentsCreator extends Creator { - private List> items; + private List items; - public BulkConsentsCreator(final List> items) { + public BulkConsentsCreator(final List items) { this.items = items; } - public BulkConsentsCreator setItems(final List> items) { + public BulkConsentsCreator setItems(final List items) { this.items = items; return this; } - public BulkConsentsCreator setItems(final Map items) { + public BulkConsentsCreator setItems(final Object items) { return setItems(Promoter.listOfOne(items)); } @@ -89,8 +85,8 @@ public BulkConsents create(final TwilioRestClient client) { private void addPostParams(final Request request) { if (items != null) { - for (Map prop : items) { - request.addPostParam("Items", Converter.mapToJson(prop)); + for (Object prop : items) { + request.addPostParam("Items", prop.toString()); } } } diff --git a/src/main/java/com/twilio/rest/accounts/v1/BulkContacts.java b/src/main/java/com/twilio/rest/accounts/v1/BulkContacts.java index fbb28d1b7f..b4ff307a19 100644 --- a/src/main/java/com/twilio/rest/accounts/v1/BulkContacts.java +++ b/src/main/java/com/twilio/rest/accounts/v1/BulkContacts.java @@ -38,9 +38,7 @@ public class BulkContacts extends Resource { private static final long serialVersionUID = 126137950684284L; - public static BulkContactsCreator creator( - final List> items - ) { + public static BulkContactsCreator creator(final List items) { return new BulkContactsCreator(items); } diff --git a/src/main/java/com/twilio/rest/accounts/v1/BulkContactsCreator.java b/src/main/java/com/twilio/rest/accounts/v1/BulkContactsCreator.java index 0f3653b994..2939c5c60d 100644 --- a/src/main/java/com/twilio/rest/accounts/v1/BulkContactsCreator.java +++ b/src/main/java/com/twilio/rest/accounts/v1/BulkContactsCreator.java @@ -16,8 +16,6 @@ import com.twilio.base.Creator; import com.twilio.constant.EnumConstants; -import com.twilio.converter.Converter; -import com.twilio.converter.Converter; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; @@ -29,23 +27,21 @@ import com.twilio.rest.Domains; import java.util.List; import java.util.List; -import java.util.Map; -import java.util.Map; public class BulkContactsCreator extends Creator { - private List> items; + private List items; - public BulkContactsCreator(final List> items) { + public BulkContactsCreator(final List items) { this.items = items; } - public BulkContactsCreator setItems(final List> items) { + public BulkContactsCreator setItems(final List items) { this.items = items; return this; } - public BulkContactsCreator setItems(final Map items) { + public BulkContactsCreator setItems(final Object items) { return setItems(Promoter.listOfOne(items)); } @@ -89,8 +85,8 @@ public BulkContacts create(final TwilioRestClient client) { private void addPostParams(final Request request) { if (items != null) { - for (Map prop : items) { - request.addPostParam("Items", Converter.mapToJson(prop)); + for (Object prop : items) { + request.addPostParam("Items", prop.toString()); } } } diff --git a/src/main/java/com/twilio/rest/api/v2010/Account.java b/src/main/java/com/twilio/rest/api/v2010/Account.java index 7ab47a5b18..814acb9477 100644 --- a/src/main/java/com/twilio/rest/api/v2010/Account.java +++ b/src/main/java/com/twilio/rest/api/v2010/Account.java @@ -113,9 +113,9 @@ public static Account fromJson( private final String friendlyName; private final String ownerAccountSid; private final String sid; - private final Account.Status status; + private final Status status; private final Map subresourceUris; - private final Account.Type type; + private final Type type; private final String uri; @JsonCreator @@ -126,12 +126,12 @@ private Account( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("owner_account_sid") final String ownerAccountSid, @JsonProperty("sid") final String sid, - @JsonProperty("status") final Account.Status status, + @JsonProperty("status") final Status status, @JsonProperty("subresource_uris") final Map< String, String > subresourceUris, - @JsonProperty("type") final Account.Type type, + @JsonProperty("type") final Type type, @JsonProperty("uri") final String uri ) { this.authToken = authToken; @@ -170,7 +170,7 @@ public final String getSid() { return this.sid; } - public final Account.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -178,7 +178,7 @@ public final Map getSubresourceUris() { return this.subresourceUris; } - public final Account.Type getType() { + public final Type getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/AuthorizedConnectApp.java b/src/main/java/com/twilio/rest/api/v2010/account/AuthorizedConnectApp.java index f7e1d9f67f..a58a35511e 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/AuthorizedConnectApp.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/AuthorizedConnectApp.java @@ -113,7 +113,7 @@ public static AuthorizedConnectApp fromJson( private final String connectAppFriendlyName; private final URI connectAppHomepageUrl; private final String connectAppSid; - private final List permissions; + private final List permissions; private final String uri; @JsonCreator @@ -132,9 +132,7 @@ private AuthorizedConnectApp( "connect_app_homepage_url" ) final URI connectAppHomepageUrl, @JsonProperty("connect_app_sid") final String connectAppSid, - @JsonProperty("permissions") final List< - AuthorizedConnectApp.Permission - > permissions, + @JsonProperty("permissions") final List permissions, @JsonProperty("uri") final String uri ) { this.accountSid = accountSid; @@ -171,7 +169,7 @@ public final String getConnectAppSid() { return this.connectAppSid; } - public final List getPermissions() { + public final List getPermissions() { return this.permissions; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/Call.java b/src/main/java/com/twilio/rest/api/v2010/account/Call.java index 8eaf7c203d..59e9b2a099 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/Call.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/Call.java @@ -189,7 +189,7 @@ public static Call fromJson( private final String from; private final String fromFormatted; private final String phoneNumberSid; - private final Call.Status status; + private final Status status; private final ZonedDateTime startTime; private final ZonedDateTime endTime; private final String duration; @@ -218,13 +218,13 @@ private Call( @JsonProperty("from") final String from, @JsonProperty("from_formatted") final String fromFormatted, @JsonProperty("phone_number_sid") final String phoneNumberSid, - @JsonProperty("status") final Call.Status status, + @JsonProperty("status") final Status status, @JsonProperty("start_time") final String startTime, @JsonProperty("end_time") final String endTime, @JsonProperty("duration") final String duration, @JsonProperty("price") final String price, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("direction") final String direction, @JsonProperty("answered_by") final String answeredBy, @@ -308,7 +308,7 @@ public final String getPhoneNumberSid() { return this.phoneNumberSid; } - public final Call.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/Conference.java b/src/main/java/com/twilio/rest/api/v2010/account/Conference.java index bcb13ce3df..a35e39b51c 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/Conference.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/Conference.java @@ -120,10 +120,10 @@ public static Conference fromJson( private final String friendlyName; private final String region; private final String sid; - private final Conference.Status status; + private final Status status; private final String uri; private final Map subresourceUris; - private final Conference.ReasonConferenceEnded reasonConferenceEnded; + private final ReasonConferenceEnded reasonConferenceEnded; private final String callSidEndingConference; @JsonCreator @@ -135,7 +135,7 @@ private Conference( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("region") final String region, @JsonProperty("sid") final String sid, - @JsonProperty("status") final Conference.Status status, + @JsonProperty("status") final Status status, @JsonProperty("uri") final String uri, @JsonProperty("subresource_uris") final Map< String, @@ -143,7 +143,7 @@ private Conference( > subresourceUris, @JsonProperty( "reason_conference_ended" - ) final Conference.ReasonConferenceEnded reasonConferenceEnded, + ) final ReasonConferenceEnded reasonConferenceEnded, @JsonProperty( "call_sid_ending_conference" ) final String callSidEndingConference @@ -190,7 +190,7 @@ public final String getSid() { return this.sid; } - public final Conference.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -202,7 +202,7 @@ public final Map getSubresourceUris() { return this.subresourceUris; } - public final Conference.ReasonConferenceEnded getReasonConferenceEnded() { + public final ReasonConferenceEnded getReasonConferenceEnded() { return this.reasonConferenceEnded; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/ConnectApp.java b/src/main/java/com/twilio/rest/api/v2010/account/ConnectApp.java index 64e5e6198c..da84d010e6 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/ConnectApp.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/ConnectApp.java @@ -131,7 +131,7 @@ public static ConnectApp fromJson( private final String description; private final String friendlyName; private final URI homepageUrl; - private final List permissions; + private final List permissions; private final String sid; private final String uri; @@ -149,9 +149,7 @@ private ConnectApp( @JsonProperty("description") final String description, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("homepage_url") final URI homepageUrl, - @JsonProperty("permissions") final List< - ConnectApp.Permission - > permissions, + @JsonProperty("permissions") final List permissions, @JsonProperty("sid") final String sid, @JsonProperty("uri") final String uri ) { @@ -200,7 +198,7 @@ public final URI getHomepageUrl() { return this.homepageUrl; } - public final List getPermissions() { + public final List getPermissions() { return this.permissions; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/IncomingPhoneNumber.java b/src/main/java/com/twilio/rest/api/v2010/account/IncomingPhoneNumber.java index 6c202374e5..f59bdac73f 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/IncomingPhoneNumber.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/IncomingPhoneNumber.java @@ -153,7 +153,7 @@ public static IncomingPhoneNumber fromJson( private final String accountSid; private final String addressSid; - private final IncomingPhoneNumber.AddressRequirement addressRequirements; + private final AddressRequirement addressRequirements; private final String apiVersion; private final Boolean beta; private final PhoneNumberCapabilities capabilities; @@ -173,16 +173,16 @@ public static IncomingPhoneNumber fromJson( private final HttpMethod statusCallbackMethod; private final String trunkSid; private final String uri; - private final IncomingPhoneNumber.VoiceReceiveMode voiceReceiveMode; + private final VoiceReceiveMode voiceReceiveMode; private final String voiceApplicationSid; private final Boolean voiceCallerIdLookup; private final HttpMethod voiceFallbackMethod; private final URI voiceFallbackUrl; private final HttpMethod voiceMethod; private final URI voiceUrl; - private final IncomingPhoneNumber.EmergencyStatus emergencyStatus; + private final EmergencyStatus emergencyStatus; private final String emergencyAddressSid; - private final IncomingPhoneNumber.EmergencyAddressStatus emergencyAddressStatus; + private final EmergencyAddressStatus emergencyAddressStatus; private final String bundleSid; private final String status; @@ -192,7 +192,7 @@ private IncomingPhoneNumber( @JsonProperty("address_sid") final String addressSid, @JsonProperty( "address_requirements" - ) final IncomingPhoneNumber.AddressRequirement addressRequirements, + ) final AddressRequirement addressRequirements, @JsonProperty("api_version") final String apiVersion, @JsonProperty("beta") final Boolean beta, @JsonProperty( @@ -220,7 +220,7 @@ private IncomingPhoneNumber( @JsonProperty("uri") final String uri, @JsonProperty( "voice_receive_mode" - ) final IncomingPhoneNumber.VoiceReceiveMode voiceReceiveMode, + ) final VoiceReceiveMode voiceReceiveMode, @JsonProperty("voice_application_sid") final String voiceApplicationSid, @JsonProperty( "voice_caller_id_lookup" @@ -231,13 +231,11 @@ private IncomingPhoneNumber( @JsonProperty("voice_fallback_url") final URI voiceFallbackUrl, @JsonProperty("voice_method") final HttpMethod voiceMethod, @JsonProperty("voice_url") final URI voiceUrl, - @JsonProperty( - "emergency_status" - ) final IncomingPhoneNumber.EmergencyStatus emergencyStatus, + @JsonProperty("emergency_status") final EmergencyStatus emergencyStatus, @JsonProperty("emergency_address_sid") final String emergencyAddressSid, @JsonProperty( "emergency_address_status" - ) final IncomingPhoneNumber.EmergencyAddressStatus emergencyAddressStatus, + ) final EmergencyAddressStatus emergencyAddressStatus, @JsonProperty("bundle_sid") final String bundleSid, @JsonProperty("status") final String status ) { @@ -285,7 +283,7 @@ public final String getAddressSid() { return this.addressSid; } - public final IncomingPhoneNumber.AddressRequirement getAddressRequirements() { + public final AddressRequirement getAddressRequirements() { return this.addressRequirements; } @@ -365,7 +363,7 @@ public final String getUri() { return this.uri; } - public final IncomingPhoneNumber.VoiceReceiveMode getVoiceReceiveMode() { + public final VoiceReceiveMode getVoiceReceiveMode() { return this.voiceReceiveMode; } @@ -393,7 +391,7 @@ public final URI getVoiceUrl() { return this.voiceUrl; } - public final IncomingPhoneNumber.EmergencyStatus getEmergencyStatus() { + public final EmergencyStatus getEmergencyStatus() { return this.emergencyStatus; } @@ -401,7 +399,7 @@ public final String getEmergencyAddressSid() { return this.emergencyAddressSid; } - public final IncomingPhoneNumber.EmergencyAddressStatus getEmergencyAddressStatus() { + public final EmergencyAddressStatus getEmergencyAddressStatus() { return this.emergencyAddressStatus; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/Message.java b/src/main/java/com/twilio/rest/api/v2010/account/Message.java index 548b52b068..dce011b3df 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/Message.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/Message.java @@ -209,7 +209,7 @@ public static Message fromJson( private final String body; private final String numSegments; - private final Message.Direction direction; + private final Direction direction; private final com.twilio.type.PhoneNumber from; private final String to; private final ZonedDateTime dateUpdated; @@ -218,7 +218,7 @@ public static Message fromJson( private final String uri; private final String accountSid; private final String numMedia; - private final Message.Status status; + private final Status status; private final String messagingServiceSid; private final String sid; private final ZonedDateTime dateSent; @@ -232,7 +232,7 @@ public static Message fromJson( private Message( @JsonProperty("body") final String body, @JsonProperty("num_segments") final String numSegments, - @JsonProperty("direction") final Message.Direction direction, + @JsonProperty("direction") final Direction direction, @JsonProperty("from") final com.twilio.type.PhoneNumber from, @JsonProperty("to") final String to, @JsonProperty("date_updated") final String dateUpdated, @@ -241,14 +241,14 @@ private Message( @JsonProperty("uri") final String uri, @JsonProperty("account_sid") final String accountSid, @JsonProperty("num_media") final String numMedia, - @JsonProperty("status") final Message.Status status, + @JsonProperty("status") final Status status, @JsonProperty("messaging_service_sid") final String messagingServiceSid, @JsonProperty("sid") final String sid, @JsonProperty("date_sent") final String dateSent, @JsonProperty("date_created") final String dateCreated, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("api_version") final String apiVersion, @JsonProperty("subresource_uris") final Map< @@ -286,7 +286,7 @@ public final String getNumSegments() { return this.numSegments; } - public final Message.Direction getDirection() { + public final Direction getDirection() { return this.direction; } @@ -322,7 +322,7 @@ public final String getNumMedia() { return this.numMedia; } - public final Message.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/MessageCreator.java b/src/main/java/com/twilio/rest/api/v2010/account/MessageCreator.java index 4ee0387373..c938512a64 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/MessageCreator.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/MessageCreator.java @@ -318,7 +318,7 @@ public Message create(final TwilioRestClient client) { "{" + "AccountSid" + "}", this.pathAccountSid.toString() ); - path = path.replace("{" + "To" + "}", this.to.encode("utf-8")); + path = path.replace("{" + "To" + "}", this.to.toString()); Request request = new Request( HttpMethod.POST, diff --git a/src/main/java/com/twilio/rest/api/v2010/account/Recording.java b/src/main/java/com/twilio/rest/api/v2010/account/Recording.java index 88e79667f7..e36eee0d13 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/Recording.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/Recording.java @@ -125,9 +125,9 @@ public static Recording fromJson( private final String sid; private final String price; private final String priceUnit; - private final Recording.Status status; + private final Status status; private final Integer channels; - private final Recording.Source source; + private final Source source; private final Integer errorCode; private final String uri; private final Map encryptionDetails; @@ -147,9 +147,9 @@ private Recording( @JsonProperty("sid") final String sid, @JsonProperty("price") final String price, @JsonProperty("price_unit") final String priceUnit, - @JsonProperty("status") final Recording.Status status, + @JsonProperty("status") final Status status, @JsonProperty("channels") final Integer channels, - @JsonProperty("source") final Recording.Source source, + @JsonProperty("source") final Source source, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("uri") final String uri, @JsonProperty("encryption_details") final Map< @@ -227,7 +227,7 @@ public final String getPriceUnit() { return this.priceUnit; } - public final Recording.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -235,7 +235,7 @@ public final Integer getChannels() { return this.channels; } - public final Recording.Source getSource() { + public final Source getSource() { return this.source; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/Transcription.java b/src/main/java/com/twilio/rest/api/v2010/account/Transcription.java index a9525ed472..e801e42350 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/Transcription.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/Transcription.java @@ -124,7 +124,7 @@ public static Transcription fromJson( private final Currency priceUnit; private final String recordingSid; private final String sid; - private final Transcription.Status status; + private final Status status; private final String transcriptionText; private final String type; private final String uri; @@ -138,11 +138,11 @@ private Transcription( @JsonProperty("duration") final String duration, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("recording_sid") final String recordingSid, @JsonProperty("sid") final String sid, - @JsonProperty("status") final Transcription.Status status, + @JsonProperty("status") final Status status, @JsonProperty("transcription_text") final String transcriptionText, @JsonProperty("type") final String type, @JsonProperty("uri") final String uri @@ -198,7 +198,7 @@ public final String getSid() { return this.sid; } - public final Transcription.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/ValidationRequestCreator.java b/src/main/java/com/twilio/rest/api/v2010/account/ValidationRequestCreator.java index b98f8f62b9..15486f1597 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/ValidationRequestCreator.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/ValidationRequestCreator.java @@ -115,7 +115,7 @@ public ValidationRequest create(final TwilioRestClient client) { path = path.replace( "{" + "PhoneNumber" + "}", - this.phoneNumber.encode("utf-8") + this.phoneNumber.toString() ); Request request = new Request( diff --git a/src/main/java/com/twilio/rest/api/v2010/account/address/DependentPhoneNumber.java b/src/main/java/com/twilio/rest/api/v2010/account/address/DependentPhoneNumber.java index 3c65422d55..ff8e7f4f78 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/address/DependentPhoneNumber.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/address/DependentPhoneNumber.java @@ -113,7 +113,7 @@ public static DependentPhoneNumber fromJson( private final URI smsFallbackUrl; private final HttpMethod smsMethod; private final URI smsUrl; - private final DependentPhoneNumber.AddressRequirement addressRequirements; + private final AddressRequirement addressRequirements; private final Map capabilities; private final URI statusCallback; private final HttpMethod statusCallbackMethod; @@ -121,7 +121,7 @@ public static DependentPhoneNumber fromJson( private final String smsApplicationSid; private final String voiceApplicationSid; private final String trunkSid; - private final DependentPhoneNumber.EmergencyStatus emergencyStatus; + private final EmergencyStatus emergencyStatus; private final String emergencyAddressSid; private final String uri; @@ -150,7 +150,7 @@ private DependentPhoneNumber( @JsonProperty("sms_url") final URI smsUrl, @JsonProperty( "address_requirements" - ) final DependentPhoneNumber.AddressRequirement addressRequirements, + ) final AddressRequirement addressRequirements, @JsonProperty("capabilities") final Map capabilities, @JsonProperty("status_callback") final URI statusCallback, @JsonProperty( @@ -160,9 +160,7 @@ private DependentPhoneNumber( @JsonProperty("sms_application_sid") final String smsApplicationSid, @JsonProperty("voice_application_sid") final String voiceApplicationSid, @JsonProperty("trunk_sid") final String trunkSid, - @JsonProperty( - "emergency_status" - ) final DependentPhoneNumber.EmergencyStatus emergencyStatus, + @JsonProperty("emergency_status") final EmergencyStatus emergencyStatus, @JsonProperty("emergency_address_sid") final String emergencyAddressSid, @JsonProperty("uri") final String uri ) { @@ -254,7 +252,7 @@ public final URI getSmsUrl() { return this.smsUrl; } - public final DependentPhoneNumber.AddressRequirement getAddressRequirements() { + public final AddressRequirement getAddressRequirements() { return this.addressRequirements; } @@ -286,7 +284,7 @@ public final String getTrunkSid() { return this.trunkSid; } - public final DependentPhoneNumber.EmergencyStatus getEmergencyStatus() { + public final EmergencyStatus getEmergencyStatus() { return this.emergencyStatus; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/call/PaymentCreator.java b/src/main/java/com/twilio/rest/api/v2010/account/call/PaymentCreator.java index b92f9468f1..c34dfa3202 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/call/PaymentCreator.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/call/PaymentCreator.java @@ -31,8 +31,6 @@ import java.math.BigDecimal; import java.net.URI; import java.net.URI; -import java.util.Map; -import java.util.Map; public class PaymentCreator extends Creator { @@ -46,7 +44,7 @@ public class PaymentCreator extends Creator { private String description; private String input; private Integer minPostalCodeLength; - private Map parameter; + private Object parameter; private String paymentConnector; private Payment.PaymentMethod paymentMethod; private Boolean postalCode; @@ -125,7 +123,7 @@ public PaymentCreator setMinPostalCodeLength( return this; } - public PaymentCreator setParameter(final Map parameter) { + public PaymentCreator setParameter(final Object parameter) { this.parameter = parameter; return this; } @@ -251,7 +249,10 @@ private void addPostParams(final Request request) { ); } if (parameter != null) { - request.addPostParam("Parameter", Converter.mapToJson(parameter)); + request.addPostParam( + "Parameter", + Converter.objectToJson(parameter) + ); } if (paymentConnector != null) { request.addPostParam("PaymentConnector", paymentConnector); diff --git a/src/main/java/com/twilio/rest/api/v2010/account/call/Recording.java b/src/main/java/com/twilio/rest/api/v2010/account/call/Recording.java index 12054b2b44..23d275246f 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/call/Recording.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/call/Recording.java @@ -99,7 +99,7 @@ public static RecordingReader reader( public static RecordingUpdater updater( final String pathCallSid, final String pathSid, - final Recording.Status status + final Status status ) { return new RecordingUpdater(pathCallSid, pathSid, status); } @@ -108,7 +108,7 @@ public static RecordingUpdater updater( final String pathAccountSid, final String pathCallSid, final String pathSid, - final Recording.Status status + final Status status ) { return new RecordingUpdater( pathAccountSid, @@ -174,9 +174,9 @@ public static Recording fromJson( private final String uri; private final Map encryptionDetails; private final Currency priceUnit; - private final Recording.Status status; + private final Status status; private final Integer channels; - private final Recording.Source source; + private final Source source; private final Integer errorCode; private final String track; @@ -198,11 +198,11 @@ private Recording( Object > encryptionDetails, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, - @JsonProperty("status") final Recording.Status status, + @JsonProperty("status") final Status status, @JsonProperty("channels") final Integer channels, - @JsonProperty("source") final Recording.Source source, + @JsonProperty("source") final Source source, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("track") final String track ) { @@ -278,7 +278,7 @@ public final Currency getPriceUnit() { return this.priceUnit; } - public final Recording.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -286,7 +286,7 @@ public final Integer getChannels() { return this.channels; } - public final Recording.Source getSource() { + public final Source getSource() { return this.source; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/call/Siprec.java b/src/main/java/com/twilio/rest/api/v2010/account/call/Siprec.java index 376b870d65..87912457a3 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/call/Siprec.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/call/Siprec.java @@ -52,7 +52,7 @@ public static SiprecCreator creator( public static SiprecUpdater updater( final String pathCallSid, final String pathSid, - final Siprec.UpdateStatus status + final UpdateStatus status ) { return new SiprecUpdater(pathCallSid, pathSid, status); } @@ -61,7 +61,7 @@ public static SiprecUpdater updater( final String pathAccountSid, final String pathCallSid, final String pathSid, - final Siprec.UpdateStatus status + final UpdateStatus status ) { return new SiprecUpdater(pathAccountSid, pathCallSid, pathSid, status); } @@ -113,7 +113,7 @@ public static Siprec fromJson( private final String accountSid; private final String callSid; private final String name; - private final Siprec.Status status; + private final Status status; private final ZonedDateTime dateUpdated; private final String uri; @@ -123,7 +123,7 @@ private Siprec( @JsonProperty("account_sid") final String accountSid, @JsonProperty("call_sid") final String callSid, @JsonProperty("name") final String name, - @JsonProperty("status") final Siprec.Status status, + @JsonProperty("status") final Status status, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("uri") final String uri ) { @@ -152,7 +152,7 @@ public final String getName() { return this.name; } - public final Siprec.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/call/Stream.java b/src/main/java/com/twilio/rest/api/v2010/account/call/Stream.java index c646360c75..6fcf583011 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/call/Stream.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/call/Stream.java @@ -57,7 +57,7 @@ public static StreamCreator creator( public static StreamUpdater updater( final String pathCallSid, final String pathSid, - final Stream.UpdateStatus status + final UpdateStatus status ) { return new StreamUpdater(pathCallSid, pathSid, status); } @@ -66,7 +66,7 @@ public static StreamUpdater updater( final String pathAccountSid, final String pathCallSid, final String pathSid, - final Stream.UpdateStatus status + final UpdateStatus status ) { return new StreamUpdater(pathAccountSid, pathCallSid, pathSid, status); } @@ -118,7 +118,7 @@ public static Stream fromJson( private final String accountSid; private final String callSid; private final String name; - private final Stream.Status status; + private final Status status; private final ZonedDateTime dateUpdated; private final String uri; @@ -128,7 +128,7 @@ private Stream( @JsonProperty("account_sid") final String accountSid, @JsonProperty("call_sid") final String callSid, @JsonProperty("name") final String name, - @JsonProperty("status") final Stream.Status status, + @JsonProperty("status") final Status status, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("uri") final String uri ) { @@ -157,7 +157,7 @@ public final String getName() { return this.name; } - public final Stream.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/call/Transcription.java b/src/main/java/com/twilio/rest/api/v2010/account/call/Transcription.java index 1f1083335a..e7aec1241e 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/call/Transcription.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/call/Transcription.java @@ -52,7 +52,7 @@ public static TranscriptionCreator creator( public static TranscriptionUpdater updater( final String pathCallSid, final String pathSid, - final Transcription.UpdateStatus status + final UpdateStatus status ) { return new TranscriptionUpdater(pathCallSid, pathSid, status); } @@ -61,7 +61,7 @@ public static TranscriptionUpdater updater( final String pathAccountSid, final String pathCallSid, final String pathSid, - final Transcription.UpdateStatus status + final UpdateStatus status ) { return new TranscriptionUpdater( pathAccountSid, @@ -118,7 +118,7 @@ public static Transcription fromJson( private final String accountSid; private final String callSid; private final String name; - private final Transcription.Status status; + private final Status status; private final ZonedDateTime dateUpdated; private final String uri; @@ -128,7 +128,7 @@ private Transcription( @JsonProperty("account_sid") final String accountSid, @JsonProperty("call_sid") final String callSid, @JsonProperty("name") final String name, - @JsonProperty("status") final Transcription.Status status, + @JsonProperty("status") final Status status, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("uri") final String uri ) { @@ -157,7 +157,7 @@ public final String getName() { return this.name; } - public final Transcription.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/conference/Participant.java b/src/main/java/com/twilio/rest/api/v2010/account/conference/Participant.java index 1eb8a9218a..f386803124 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/conference/Participant.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/conference/Participant.java @@ -183,7 +183,7 @@ public static Participant fromJson( private final Boolean muted; private final Boolean hold; private final Boolean startConferenceOnEnter; - private final Participant.Status status; + private final Status status; private final String queueTime; private final String uri; @@ -205,7 +205,7 @@ private Participant( @JsonProperty( "start_conference_on_enter" ) final Boolean startConferenceOnEnter, - @JsonProperty("status") final Participant.Status status, + @JsonProperty("status") final Status status, @JsonProperty("queue_time") final String queueTime, @JsonProperty("uri") final String uri ) { @@ -274,7 +274,7 @@ public final Boolean getStartConferenceOnEnter() { return this.startConferenceOnEnter; } - public final Participant.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/conference/Recording.java b/src/main/java/com/twilio/rest/api/v2010/account/conference/Recording.java index 0a4e1b2876..cb19e56da8 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/conference/Recording.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/conference/Recording.java @@ -87,7 +87,7 @@ public static RecordingReader reader( public static RecordingUpdater updater( final String pathConferenceSid, final String pathSid, - final Recording.Status status + final Status status ) { return new RecordingUpdater(pathConferenceSid, pathSid, status); } @@ -96,7 +96,7 @@ public static RecordingUpdater updater( final String pathAccountSid, final String pathConferenceSid, final String pathSid, - final Recording.Status status + final Status status ) { return new RecordingUpdater( pathAccountSid, @@ -160,9 +160,9 @@ public static Recording fromJson( private final String sid; private final String price; private final Currency priceUnit; - private final Recording.Status status; + private final Status status; private final Integer channels; - private final Recording.Source source; + private final Source source; private final Integer errorCode; private final Map encryptionDetails; private final String uri; @@ -180,11 +180,11 @@ private Recording( @JsonProperty("sid") final String sid, @JsonProperty("price") final String price, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, - @JsonProperty("status") final Recording.Status status, + @JsonProperty("status") final Status status, @JsonProperty("channels") final Integer channels, - @JsonProperty("source") final Recording.Source source, + @JsonProperty("source") final Source source, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("encryption_details") final Map< String, @@ -255,7 +255,7 @@ public final Currency getPriceUnit() { return this.priceUnit; } - public final Recording.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -263,7 +263,7 @@ public final Integer getChannels() { return this.channels; } - public final Recording.Source getSource() { + public final Source getSource() { return this.source; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Local.java b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Local.java index 801ff7fc75..cb3531a74c 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Local.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Local.java @@ -107,7 +107,7 @@ public static Local fromJson( private final String accountSid; private final String addressSid; - private final Local.AddressRequirement addressRequirements; + private final AddressRequirement addressRequirements; private final String apiVersion; private final Boolean beta; private final PhoneNumberCapabilities capabilities; @@ -127,16 +127,16 @@ public static Local fromJson( private final HttpMethod statusCallbackMethod; private final String trunkSid; private final String uri; - private final Local.VoiceReceiveMode voiceReceiveMode; + private final VoiceReceiveMode voiceReceiveMode; private final String voiceApplicationSid; private final Boolean voiceCallerIdLookup; private final HttpMethod voiceFallbackMethod; private final URI voiceFallbackUrl; private final HttpMethod voiceMethod; private final URI voiceUrl; - private final Local.EmergencyStatus emergencyStatus; + private final EmergencyStatus emergencyStatus; private final String emergencyAddressSid; - private final Local.EmergencyAddressStatus emergencyAddressStatus; + private final EmergencyAddressStatus emergencyAddressStatus; private final String bundleSid; private final String status; @@ -146,7 +146,7 @@ private Local( @JsonProperty("address_sid") final String addressSid, @JsonProperty( "address_requirements" - ) final Local.AddressRequirement addressRequirements, + ) final AddressRequirement addressRequirements, @JsonProperty("api_version") final String apiVersion, @JsonProperty("beta") final Boolean beta, @JsonProperty( @@ -174,7 +174,7 @@ private Local( @JsonProperty("uri") final String uri, @JsonProperty( "voice_receive_mode" - ) final Local.VoiceReceiveMode voiceReceiveMode, + ) final VoiceReceiveMode voiceReceiveMode, @JsonProperty("voice_application_sid") final String voiceApplicationSid, @JsonProperty( "voice_caller_id_lookup" @@ -185,13 +185,11 @@ private Local( @JsonProperty("voice_fallback_url") final URI voiceFallbackUrl, @JsonProperty("voice_method") final HttpMethod voiceMethod, @JsonProperty("voice_url") final URI voiceUrl, - @JsonProperty( - "emergency_status" - ) final Local.EmergencyStatus emergencyStatus, + @JsonProperty("emergency_status") final EmergencyStatus emergencyStatus, @JsonProperty("emergency_address_sid") final String emergencyAddressSid, @JsonProperty( "emergency_address_status" - ) final Local.EmergencyAddressStatus emergencyAddressStatus, + ) final EmergencyAddressStatus emergencyAddressStatus, @JsonProperty("bundle_sid") final String bundleSid, @JsonProperty("status") final String status ) { @@ -239,7 +237,7 @@ public final String getAddressSid() { return this.addressSid; } - public final Local.AddressRequirement getAddressRequirements() { + public final AddressRequirement getAddressRequirements() { return this.addressRequirements; } @@ -319,7 +317,7 @@ public final String getUri() { return this.uri; } - public final Local.VoiceReceiveMode getVoiceReceiveMode() { + public final VoiceReceiveMode getVoiceReceiveMode() { return this.voiceReceiveMode; } @@ -347,7 +345,7 @@ public final URI getVoiceUrl() { return this.voiceUrl; } - public final Local.EmergencyStatus getEmergencyStatus() { + public final EmergencyStatus getEmergencyStatus() { return this.emergencyStatus; } @@ -355,7 +353,7 @@ public final String getEmergencyAddressSid() { return this.emergencyAddressSid; } - public final Local.EmergencyAddressStatus getEmergencyAddressStatus() { + public final EmergencyAddressStatus getEmergencyAddressStatus() { return this.emergencyAddressStatus; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/LocalCreator.java b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/LocalCreator.java index 27ecf933c4..25a74eb499 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/LocalCreator.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/LocalCreator.java @@ -241,7 +241,7 @@ public Local create(final TwilioRestClient client) { path = path.replace( "{" + "PhoneNumber" + "}", - this.phoneNumber.encode("utf-8") + this.phoneNumber.toString() ); Request request = new Request( diff --git a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Mobile.java b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Mobile.java index 62c6156f9e..78bdb0710f 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Mobile.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Mobile.java @@ -107,7 +107,7 @@ public static Mobile fromJson( private final String accountSid; private final String addressSid; - private final Mobile.AddressRequirement addressRequirements; + private final AddressRequirement addressRequirements; private final String apiVersion; private final Boolean beta; private final PhoneNumberCapabilities capabilities; @@ -127,16 +127,16 @@ public static Mobile fromJson( private final HttpMethod statusCallbackMethod; private final String trunkSid; private final String uri; - private final Mobile.VoiceReceiveMode voiceReceiveMode; + private final VoiceReceiveMode voiceReceiveMode; private final String voiceApplicationSid; private final Boolean voiceCallerIdLookup; private final HttpMethod voiceFallbackMethod; private final URI voiceFallbackUrl; private final HttpMethod voiceMethod; private final URI voiceUrl; - private final Mobile.EmergencyStatus emergencyStatus; + private final EmergencyStatus emergencyStatus; private final String emergencyAddressSid; - private final Mobile.EmergencyAddressStatus emergencyAddressStatus; + private final EmergencyAddressStatus emergencyAddressStatus; private final String bundleSid; private final String status; @@ -146,7 +146,7 @@ private Mobile( @JsonProperty("address_sid") final String addressSid, @JsonProperty( "address_requirements" - ) final Mobile.AddressRequirement addressRequirements, + ) final AddressRequirement addressRequirements, @JsonProperty("api_version") final String apiVersion, @JsonProperty("beta") final Boolean beta, @JsonProperty( @@ -174,7 +174,7 @@ private Mobile( @JsonProperty("uri") final String uri, @JsonProperty( "voice_receive_mode" - ) final Mobile.VoiceReceiveMode voiceReceiveMode, + ) final VoiceReceiveMode voiceReceiveMode, @JsonProperty("voice_application_sid") final String voiceApplicationSid, @JsonProperty( "voice_caller_id_lookup" @@ -185,13 +185,11 @@ private Mobile( @JsonProperty("voice_fallback_url") final URI voiceFallbackUrl, @JsonProperty("voice_method") final HttpMethod voiceMethod, @JsonProperty("voice_url") final URI voiceUrl, - @JsonProperty( - "emergency_status" - ) final Mobile.EmergencyStatus emergencyStatus, + @JsonProperty("emergency_status") final EmergencyStatus emergencyStatus, @JsonProperty("emergency_address_sid") final String emergencyAddressSid, @JsonProperty( "emergency_address_status" - ) final Mobile.EmergencyAddressStatus emergencyAddressStatus, + ) final EmergencyAddressStatus emergencyAddressStatus, @JsonProperty("bundle_sid") final String bundleSid, @JsonProperty("status") final String status ) { @@ -239,7 +237,7 @@ public final String getAddressSid() { return this.addressSid; } - public final Mobile.AddressRequirement getAddressRequirements() { + public final AddressRequirement getAddressRequirements() { return this.addressRequirements; } @@ -319,7 +317,7 @@ public final String getUri() { return this.uri; } - public final Mobile.VoiceReceiveMode getVoiceReceiveMode() { + public final VoiceReceiveMode getVoiceReceiveMode() { return this.voiceReceiveMode; } @@ -347,7 +345,7 @@ public final URI getVoiceUrl() { return this.voiceUrl; } - public final Mobile.EmergencyStatus getEmergencyStatus() { + public final EmergencyStatus getEmergencyStatus() { return this.emergencyStatus; } @@ -355,7 +353,7 @@ public final String getEmergencyAddressSid() { return this.emergencyAddressSid; } - public final Mobile.EmergencyAddressStatus getEmergencyAddressStatus() { + public final EmergencyAddressStatus getEmergencyAddressStatus() { return this.emergencyAddressStatus; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/MobileCreator.java b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/MobileCreator.java index 5a40e409a0..6fe7fa36c0 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/MobileCreator.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/MobileCreator.java @@ -241,7 +241,7 @@ public Mobile create(final TwilioRestClient client) { path = path.replace( "{" + "PhoneNumber" + "}", - this.phoneNumber.encode("utf-8") + this.phoneNumber.toString() ); Request request = new Request( diff --git a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/TollFree.java b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/TollFree.java index 4e1e3cf74c..af9f39055a 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/TollFree.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/TollFree.java @@ -107,7 +107,7 @@ public static TollFree fromJson( private final String accountSid; private final String addressSid; - private final TollFree.AddressRequirement addressRequirements; + private final AddressRequirement addressRequirements; private final String apiVersion; private final Boolean beta; private final PhoneNumberCapabilities capabilities; @@ -127,16 +127,16 @@ public static TollFree fromJson( private final HttpMethod statusCallbackMethod; private final String trunkSid; private final String uri; - private final TollFree.VoiceReceiveMode voiceReceiveMode; + private final VoiceReceiveMode voiceReceiveMode; private final String voiceApplicationSid; private final Boolean voiceCallerIdLookup; private final HttpMethod voiceFallbackMethod; private final URI voiceFallbackUrl; private final HttpMethod voiceMethod; private final URI voiceUrl; - private final TollFree.EmergencyStatus emergencyStatus; + private final EmergencyStatus emergencyStatus; private final String emergencyAddressSid; - private final TollFree.EmergencyAddressStatus emergencyAddressStatus; + private final EmergencyAddressStatus emergencyAddressStatus; private final String bundleSid; private final String status; @@ -146,7 +146,7 @@ private TollFree( @JsonProperty("address_sid") final String addressSid, @JsonProperty( "address_requirements" - ) final TollFree.AddressRequirement addressRequirements, + ) final AddressRequirement addressRequirements, @JsonProperty("api_version") final String apiVersion, @JsonProperty("beta") final Boolean beta, @JsonProperty( @@ -174,7 +174,7 @@ private TollFree( @JsonProperty("uri") final String uri, @JsonProperty( "voice_receive_mode" - ) final TollFree.VoiceReceiveMode voiceReceiveMode, + ) final VoiceReceiveMode voiceReceiveMode, @JsonProperty("voice_application_sid") final String voiceApplicationSid, @JsonProperty( "voice_caller_id_lookup" @@ -185,13 +185,11 @@ private TollFree( @JsonProperty("voice_fallback_url") final URI voiceFallbackUrl, @JsonProperty("voice_method") final HttpMethod voiceMethod, @JsonProperty("voice_url") final URI voiceUrl, - @JsonProperty( - "emergency_status" - ) final TollFree.EmergencyStatus emergencyStatus, + @JsonProperty("emergency_status") final EmergencyStatus emergencyStatus, @JsonProperty("emergency_address_sid") final String emergencyAddressSid, @JsonProperty( "emergency_address_status" - ) final TollFree.EmergencyAddressStatus emergencyAddressStatus, + ) final EmergencyAddressStatus emergencyAddressStatus, @JsonProperty("bundle_sid") final String bundleSid, @JsonProperty("status") final String status ) { @@ -239,7 +237,7 @@ public final String getAddressSid() { return this.addressSid; } - public final TollFree.AddressRequirement getAddressRequirements() { + public final AddressRequirement getAddressRequirements() { return this.addressRequirements; } @@ -319,7 +317,7 @@ public final String getUri() { return this.uri; } - public final TollFree.VoiceReceiveMode getVoiceReceiveMode() { + public final VoiceReceiveMode getVoiceReceiveMode() { return this.voiceReceiveMode; } @@ -347,7 +345,7 @@ public final URI getVoiceUrl() { return this.voiceUrl; } - public final TollFree.EmergencyStatus getEmergencyStatus() { + public final EmergencyStatus getEmergencyStatus() { return this.emergencyStatus; } @@ -355,7 +353,7 @@ public final String getEmergencyAddressSid() { return this.emergencyAddressSid; } - public final TollFree.EmergencyAddressStatus getEmergencyAddressStatus() { + public final EmergencyAddressStatus getEmergencyAddressStatus() { return this.emergencyAddressStatus; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/TollFreeCreator.java b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/TollFreeCreator.java index c6426ab2ce..61034d20c3 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/TollFreeCreator.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/TollFreeCreator.java @@ -243,7 +243,7 @@ public TollFree create(final TwilioRestClient client) { path = path.replace( "{" + "PhoneNumber" + "}", - this.phoneNumber.encode("utf-8") + this.phoneNumber.toString() ); Request request = new Request( diff --git a/src/main/java/com/twilio/rest/api/v2010/account/message/Feedback.java b/src/main/java/com/twilio/rest/api/v2010/account/message/Feedback.java index 66db8761d3..86601603c3 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/message/Feedback.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/message/Feedback.java @@ -94,7 +94,7 @@ public static Feedback fromJson( private final String accountSid; private final String messageSid; - private final Feedback.Outcome outcome; + private final Outcome outcome; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String uri; @@ -103,7 +103,7 @@ public static Feedback fromJson( private Feedback( @JsonProperty("account_sid") final String accountSid, @JsonProperty("message_sid") final String messageSid, - @JsonProperty("outcome") final Feedback.Outcome outcome, + @JsonProperty("outcome") final Outcome outcome, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("uri") final String uri @@ -124,7 +124,7 @@ public final String getMessageSid() { return this.messageSid; } - public final Feedback.Outcome getOutcome() { + public final Outcome getOutcome() { return this.outcome; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/recording/AddOnResult.java b/src/main/java/com/twilio/rest/api/v2010/account/recording/AddOnResult.java index c20e30dcb0..42b02433c7 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/recording/AddOnResult.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/recording/AddOnResult.java @@ -134,7 +134,7 @@ public static AddOnResult fromJson( private final String sid; private final String accountSid; - private final AddOnResult.Status status; + private final Status status; private final String addOnSid; private final String addOnConfigurationSid; private final ZonedDateTime dateCreated; @@ -147,7 +147,7 @@ public static AddOnResult fromJson( private AddOnResult( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty("status") final AddOnResult.Status status, + @JsonProperty("status") final Status status, @JsonProperty("add_on_sid") final String addOnSid, @JsonProperty( "add_on_configuration_sid" @@ -182,7 +182,7 @@ public final String getAccountSid() { return this.accountSid; } - public final AddOnResult.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/recording/Transcription.java b/src/main/java/com/twilio/rest/api/v2010/account/recording/Transcription.java index c265b98c28..ba9df4ae95 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/recording/Transcription.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/recording/Transcription.java @@ -143,7 +143,7 @@ public static Transcription fromJson( private final Currency priceUnit; private final String recordingSid; private final String sid; - private final Transcription.Status status; + private final Status status; private final String transcriptionText; private final String type; private final String uri; @@ -157,11 +157,11 @@ private Transcription( @JsonProperty("duration") final String duration, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("recording_sid") final String recordingSid, @JsonProperty("sid") final String sid, - @JsonProperty("status") final Transcription.Status status, + @JsonProperty("status") final Status status, @JsonProperty("transcription_text") final String transcriptionText, @JsonProperty("type") final String type, @JsonProperty("uri") final String uri @@ -217,7 +217,7 @@ public final String getSid() { return this.sid; } - public final Transcription.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/Record.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/Record.java index 5c05e36626..de6b0f6a44 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/Record.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/Record.java @@ -98,7 +98,7 @@ public static Record fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Record.Category category; + private final Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private Record( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Record.Category category, + @JsonProperty("category") final Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Record.Category getCategory() { + public final Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/Trigger.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/Trigger.java index e18017d6e6..287dcf8236 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/Trigger.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/Trigger.java @@ -43,7 +43,7 @@ public class Trigger extends Resource { public static TriggerCreator creator( final URI callbackUrl, final String triggerValue, - final Trigger.UsageCategory usageCategory + final UsageCategory usageCategory ) { return new TriggerCreator(callbackUrl, triggerValue, usageCategory); } @@ -52,7 +52,7 @@ public static TriggerCreator creator( final String pathAccountSid, final URI callbackUrl, final String triggerValue, - final Trigger.UsageCategory usageCategory + final UsageCategory usageCategory ) { return new TriggerCreator( pathAccountSid, @@ -155,12 +155,12 @@ public static Trigger fromJson( private final ZonedDateTime dateFired; private final ZonedDateTime dateUpdated; private final String friendlyName; - private final Trigger.Recurring recurring; + private final Recurring recurring; private final String sid; - private final Trigger.TriggerField triggerBy; + private final TriggerField triggerBy; private final String triggerValue; private final String uri; - private final Trigger.UsageCategory usageCategory; + private final UsageCategory usageCategory; private final String usageRecordUri; @JsonCreator @@ -174,14 +174,12 @@ private Trigger( @JsonProperty("date_fired") final String dateFired, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("recurring") final Trigger.Recurring recurring, + @JsonProperty("recurring") final Recurring recurring, @JsonProperty("sid") final String sid, - @JsonProperty("trigger_by") final Trigger.TriggerField triggerBy, + @JsonProperty("trigger_by") final TriggerField triggerBy, @JsonProperty("trigger_value") final String triggerValue, @JsonProperty("uri") final String uri, - @JsonProperty( - "usage_category" - ) final Trigger.UsageCategory usageCategory, + @JsonProperty("usage_category") final UsageCategory usageCategory, @JsonProperty("usage_record_uri") final String usageRecordUri ) { this.accountSid = accountSid; @@ -238,7 +236,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Trigger.Recurring getRecurring() { + public final Recurring getRecurring() { return this.recurring; } @@ -246,7 +244,7 @@ public final String getSid() { return this.sid; } - public final Trigger.TriggerField getTriggerBy() { + public final TriggerField getTriggerBy() { return this.triggerBy; } @@ -258,7 +256,7 @@ public final String getUri() { return this.uri; } - public final Trigger.UsageCategory getUsageCategory() { + public final UsageCategory getUsageCategory() { return this.usageCategory; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/AllTime.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/AllTime.java index 2e5e8e1938..576f6ddd09 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/AllTime.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/AllTime.java @@ -98,7 +98,7 @@ public static AllTime fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final AllTime.Category category; + private final Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private AllTime( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final AllTime.Category category, + @JsonProperty("category") final Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final AllTime.Category getCategory() { + public final Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Daily.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Daily.java index c562e8b219..22c683d023 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Daily.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Daily.java @@ -98,7 +98,7 @@ public static Daily fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Daily.Category category; + private final Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private Daily( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Daily.Category category, + @JsonProperty("category") final Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Daily.Category getCategory() { + public final Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/LastMonth.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/LastMonth.java index 471a20a4d8..fcbf30024c 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/LastMonth.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/LastMonth.java @@ -98,7 +98,7 @@ public static LastMonth fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final LastMonth.Category category; + private final Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private LastMonth( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final LastMonth.Category category, + @JsonProperty("category") final Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final LastMonth.Category getCategory() { + public final Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Monthly.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Monthly.java index 315837e39e..64b1070365 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Monthly.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Monthly.java @@ -98,7 +98,7 @@ public static Monthly fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Monthly.Category category; + private final Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private Monthly( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Monthly.Category category, + @JsonProperty("category") final Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Monthly.Category getCategory() { + public final Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/ThisMonth.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/ThisMonth.java index f0799a55f9..f545f03970 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/ThisMonth.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/ThisMonth.java @@ -98,7 +98,7 @@ public static ThisMonth fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final ThisMonth.Category category; + private final Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private ThisMonth( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final ThisMonth.Category category, + @JsonProperty("category") final Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final ThisMonth.Category getCategory() { + public final Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Today.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Today.java index 38c0f84024..09fced5595 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Today.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Today.java @@ -98,7 +98,7 @@ public static Today fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Today.Category category; + private final Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private Today( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Today.Category category, + @JsonProperty("category") final Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Today.Category getCategory() { + public final Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yearly.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yearly.java index bc447957ac..c55164426b 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yearly.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yearly.java @@ -98,7 +98,7 @@ public static Yearly fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Yearly.Category category; + private final Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private Yearly( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Yearly.Category category, + @JsonProperty("category") final Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Yearly.Category getCategory() { + public final Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yesterday.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yesterday.java index f271504c4b..d908600933 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yesterday.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yesterday.java @@ -98,7 +98,7 @@ public static Yesterday fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Yesterday.Category category; + private final Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private Yesterday( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Yesterday.Category category, + @JsonProperty("category") final Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Yesterday.Category getCategory() { + public final Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/assistants/v1/Assistant.java b/src/main/java/com/twilio/rest/assistants/v1/Assistant.java index 94f290b45d..ac3ca71dda 100644 --- a/src/main/java/com/twilio/rest/assistants/v1/Assistant.java +++ b/src/main/java/com/twilio/rest/assistants/v1/Assistant.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.twilio.base.Resource; -import com.twilio.converter.Converter; import com.twilio.converter.DateConverter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; @@ -136,7 +135,9 @@ public static class AssistantsV1ServiceCreateAssistantRequest { @Setter private AssistantsV1ServiceSegmentCredential segmentCredential; - public AssistantsV1ServiceCreateAssistantRequest() {} + public AssistantsV1ServiceCreateAssistantRequest(final String name) { + this.name = name; + } public static AssistantsV1ServiceCreateAssistantRequest fromJson( String jsonString, @@ -222,10 +223,6 @@ public static class AssistantsV1ServiceKnowledge { @Setter private Map knowledgeSourceDetails; - public String getKnowledgeSourceDetails() { - return Converter.mapToJson(knowledgeSourceDetails); - } - @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("name") @Getter @@ -320,10 +317,6 @@ public static class AssistantsV1ServiceTool { @Setter private Map meta; - public String getMeta() { - return Converter.mapToJson(meta); - } - @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("name") @Getter @@ -377,7 +370,7 @@ public static AssistantsV1ServiceTool fromJson( } public static AssistantCreator creator( - final Assistant.AssistantsV1ServiceCreateAssistantRequest assistantsV1ServiceCreateAssistantRequest + final AssistantsV1ServiceCreateAssistantRequest assistantsV1ServiceCreateAssistantRequest ) { return new AssistantCreator(assistantsV1ServiceCreateAssistantRequest); } diff --git a/src/main/java/com/twilio/rest/assistants/v1/Knowledge.java b/src/main/java/com/twilio/rest/assistants/v1/Knowledge.java index 0f5b469bb2..b412f115bb 100644 --- a/src/main/java/com/twilio/rest/assistants/v1/Knowledge.java +++ b/src/main/java/com/twilio/rest/assistants/v1/Knowledge.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.twilio.base.Resource; -import com.twilio.converter.Converter; import com.twilio.converter.DateConverter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; @@ -71,10 +70,6 @@ public static class AssistantsV1ServiceCreatePolicyRequest { @Setter private Object policyDetails; - public String getPolicyDetails() { - return Converter.objectToJson(policyDetails); - } - @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("type") @Getter @@ -113,10 +108,6 @@ public static class AssistantsV1ServiceCreateKnowledgeRequest { @Setter private Map knowledgeSourceDetails; - public String getKnowledgeSourceDetails() { - return Converter.mapToJson(knowledgeSourceDetails); - } - @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("name") @Getter @@ -141,7 +132,13 @@ public String getKnowledgeSourceDetails() { @Setter private String embeddingModel; - public AssistantsV1ServiceCreateKnowledgeRequest() {} + public AssistantsV1ServiceCreateKnowledgeRequest( + final String name, + final String type + ) { + this.name = name; + this.type = type; + } public static AssistantsV1ServiceCreateKnowledgeRequest fromJson( String jsonString, @@ -169,10 +166,6 @@ public static class AssistantsV1ServiceUpdateKnowledgeRequest { @Setter private Map knowledgeSourceDetails; - public String getKnowledgeSourceDetails() { - return Converter.mapToJson(knowledgeSourceDetails); - } - @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("name") @Getter @@ -211,7 +204,7 @@ public static AssistantsV1ServiceUpdateKnowledgeRequest fromJson( } public static KnowledgeCreator creator( - final Knowledge.AssistantsV1ServiceCreateKnowledgeRequest assistantsV1ServiceCreateKnowledgeRequest + final AssistantsV1ServiceCreateKnowledgeRequest assistantsV1ServiceCreateKnowledgeRequest ) { return new KnowledgeCreator(assistantsV1ServiceCreateKnowledgeRequest); } diff --git a/src/main/java/com/twilio/rest/assistants/v1/Tool.java b/src/main/java/com/twilio/rest/assistants/v1/Tool.java index c4dbbf3be2..2f9b5aacb0 100644 --- a/src/main/java/com/twilio/rest/assistants/v1/Tool.java +++ b/src/main/java/com/twilio/rest/assistants/v1/Tool.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.twilio.base.Resource; -import com.twilio.converter.Converter; import com.twilio.converter.DateConverter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; @@ -72,10 +71,6 @@ public static class AssistantsV1ServiceCreatePolicyRequest { @Setter private Object policyDetails; - public String getPolicyDetails() { - return Converter.objectToJson(policyDetails); - } - @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("type") @Getter @@ -120,10 +115,6 @@ public static class AssistantsV1ServiceCreateToolRequest { @Setter private Map meta; - public String getMeta() { - return Converter.mapToJson(meta); - } - @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("name") @Getter @@ -142,7 +133,15 @@ public String getMeta() { @Setter private String type; - public AssistantsV1ServiceCreateToolRequest() {} + public AssistantsV1ServiceCreateToolRequest( + final Boolean enabled, + final String name, + final String type + ) { + this.enabled = enabled; + this.name = name; + this.type = type; + } public static AssistantsV1ServiceCreateToolRequest fromJson( String jsonString, @@ -182,10 +181,6 @@ public static class AssistantsV1ServiceUpdateToolRequest { @Setter private Map meta; - public String getMeta() { - return Converter.mapToJson(meta); - } - @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("name") @Getter @@ -262,10 +257,6 @@ public static class AssistantsV1ServicePolicy { @Setter private Map policyDetails; - public String getPolicyDetails() { - return Converter.mapToJson(policyDetails); - } - @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("dateCreated") @Getter @@ -298,7 +289,7 @@ public static AssistantsV1ServicePolicy fromJson( } public static ToolCreator creator( - final Tool.AssistantsV1ServiceCreateToolRequest assistantsV1ServiceCreateToolRequest + final AssistantsV1ServiceCreateToolRequest assistantsV1ServiceCreateToolRequest ) { return new ToolCreator(assistantsV1ServiceCreateToolRequest); } diff --git a/src/main/java/com/twilio/rest/assistants/v1/assistant/Feedback.java b/src/main/java/com/twilio/rest/assistants/v1/assistant/Feedback.java index c607c9c472..57cb442b4a 100644 --- a/src/main/java/com/twilio/rest/assistants/v1/assistant/Feedback.java +++ b/src/main/java/com/twilio/rest/assistants/v1/assistant/Feedback.java @@ -87,7 +87,7 @@ public static AssistantsV1ServiceCreateFeedbackRequest fromJson( public static FeedbackCreator creator( final String pathId, - final Feedback.AssistantsV1ServiceCreateFeedbackRequest assistantsV1ServiceCreateFeedbackRequest + final AssistantsV1ServiceCreateFeedbackRequest assistantsV1ServiceCreateFeedbackRequest ) { return new FeedbackCreator( pathId, diff --git a/src/main/java/com/twilio/rest/assistants/v1/assistant/Message.java b/src/main/java/com/twilio/rest/assistants/v1/assistant/Message.java index 3891e48b3e..b2922bd6e9 100644 --- a/src/main/java/com/twilio/rest/assistants/v1/assistant/Message.java +++ b/src/main/java/com/twilio/rest/assistants/v1/assistant/Message.java @@ -93,7 +93,7 @@ public static AssistantsV1ServiceAssistantSendMessageRequest fromJson( public static MessageCreator creator( final String pathId, - final Message.AssistantsV1ServiceAssistantSendMessageRequest assistantsV1ServiceAssistantSendMessageRequest + final AssistantsV1ServiceAssistantSendMessageRequest assistantsV1ServiceAssistantSendMessageRequest ) { return new MessageCreator( pathId, diff --git a/src/main/java/com/twilio/rest/bulkexports/v1/export/ExportCustomJob.java b/src/main/java/com/twilio/rest/bulkexports/v1/export/ExportCustomJob.java index 058ef9a15c..ee3bc089bb 100644 --- a/src/main/java/com/twilio/rest/bulkexports/v1/export/ExportCustomJob.java +++ b/src/main/java/com/twilio/rest/bulkexports/v1/export/ExportCustomJob.java @@ -25,6 +25,7 @@ import com.twilio.exception.ApiException; import java.io.IOException; import java.io.InputStream; +import java.util.List; import java.util.Map; import java.util.Map; import java.util.Objects; @@ -35,7 +36,7 @@ @ToString public class ExportCustomJob extends Resource { - private static final long serialVersionUID = 125242558228L; + private static final long serialVersionUID = 87737406045908L; public static ExportCustomJobCreator creator( final String pathResourceType, @@ -106,7 +107,7 @@ public static ExportCustomJob fromJson( private final String webhookMethod; private final String email; private final String jobSid; - private final Map details; + private final List> details; private final String jobQueuePosition; private final String estimatedCompletionTime; @@ -120,7 +121,7 @@ private ExportCustomJob( @JsonProperty("webhook_method") final String webhookMethod, @JsonProperty("email") final String email, @JsonProperty("job_sid") final String jobSid, - @JsonProperty("details") final Map details, + @JsonProperty("details") final List> details, @JsonProperty("job_queue_position") final String jobQueuePosition, @JsonProperty( "estimated_completion_time" @@ -171,7 +172,7 @@ public final String getJobSid() { return this.jobSid; } - public final Map getDetails() { + public final List> getDetails() { return this.details; } diff --git a/src/main/java/com/twilio/rest/bulkexports/v1/export/Job.java b/src/main/java/com/twilio/rest/bulkexports/v1/export/Job.java index 52fce1b2eb..685913964b 100644 --- a/src/main/java/com/twilio/rest/bulkexports/v1/export/Job.java +++ b/src/main/java/com/twilio/rest/bulkexports/v1/export/Job.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.URI; +import java.util.List; import java.util.Map; import java.util.Map; import java.util.Objects; @@ -36,7 +37,7 @@ @ToString public class Job extends Resource { - private static final long serialVersionUID = 103628862500013L; + private static final long serialVersionUID = 152000944333983L; public static JobDeleter deleter(final String pathJobSid) { return new JobDeleter(pathJobSid); @@ -91,7 +92,7 @@ public static Job fromJson( private final String resourceType; private final String friendlyName; - private final Map details; + private final List> details; private final String startDay; private final String endDay; private final String jobSid; @@ -106,7 +107,7 @@ public static Job fromJson( private Job( @JsonProperty("resource_type") final String resourceType, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("details") final Map details, + @JsonProperty("details") final List> details, @JsonProperty("start_day") final String startDay, @JsonProperty("end_day") final String endDay, @JsonProperty("job_sid") final String jobSid, @@ -141,7 +142,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Map getDetails() { + public final List> getDetails() { return this.details; } diff --git a/src/main/java/com/twilio/rest/chat/v1/Credential.java b/src/main/java/com/twilio/rest/chat/v1/Credential.java index 270e61e3fe..8b91dfa3ef 100644 --- a/src/main/java/com/twilio/rest/chat/v1/Credential.java +++ b/src/main/java/com/twilio/rest/chat/v1/Credential.java @@ -39,7 +39,7 @@ public class Credential extends Resource { private static final long serialVersionUID = 161183169234848L; - public static CredentialCreator creator(final Credential.PushService type) { + public static CredentialCreator creator(final PushService type) { return new CredentialCreator(type); } @@ -105,7 +105,7 @@ public static Credential fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final Credential.PushService type; + private final PushService type; private final String sandbox; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -116,7 +116,7 @@ private Credential( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final Credential.PushService type, + @JsonProperty("type") final PushService type, @JsonProperty("sandbox") final String sandbox, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Credential.PushService getType() { + public final PushService getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/chat/v1/service/Channel.java b/src/main/java/com/twilio/rest/chat/v1/service/Channel.java index d8f46724b0..0b026f0db2 100644 --- a/src/main/java/com/twilio/rest/chat/v1/service/Channel.java +++ b/src/main/java/com/twilio/rest/chat/v1/service/Channel.java @@ -119,7 +119,7 @@ public static Channel fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final Channel.ChannelType type; + private final ChannelType type; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; @@ -136,7 +136,7 @@ private Channel( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("type") final Channel.ChannelType type, + @JsonProperty("type") final ChannelType type, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("created_by") final String createdBy, @@ -185,7 +185,7 @@ public final String getAttributes() { return this.attributes; } - public final Channel.ChannelType getType() { + public final ChannelType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/chat/v1/service/Role.java b/src/main/java/com/twilio/rest/chat/v1/service/Role.java index eaf3e01555..d2a44ff7dc 100644 --- a/src/main/java/com/twilio/rest/chat/v1/service/Role.java +++ b/src/main/java/com/twilio/rest/chat/v1/service/Role.java @@ -43,7 +43,7 @@ public class Role extends Resource { public static RoleCreator creator( final String pathServiceSid, final String friendlyName, - final Role.RoleType type, + final RoleType type, final List permission ) { return new RoleCreator(pathServiceSid, friendlyName, type, permission); @@ -122,7 +122,7 @@ public static Role fromJson( private final String accountSid; private final String serviceSid; private final String friendlyName; - private final Role.RoleType type; + private final RoleType type; private final List permissions; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -134,7 +134,7 @@ private Role( @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final Role.RoleType type, + @JsonProperty("type") final RoleType type, @JsonProperty("permissions") final List permissions, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -167,7 +167,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Role.RoleType getType() { + public final RoleType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/chat/v1/service/user/UserChannel.java b/src/main/java/com/twilio/rest/chat/v1/service/user/UserChannel.java index 245f4d1b5d..667c61e4eb 100644 --- a/src/main/java/com/twilio/rest/chat/v1/service/user/UserChannel.java +++ b/src/main/java/com/twilio/rest/chat/v1/service/user/UserChannel.java @@ -92,7 +92,7 @@ public static UserChannel fromJson( private final String serviceSid; private final String channelSid; private final String memberSid; - private final UserChannel.ChannelStatus status; + private final ChannelStatus status; private final Integer lastConsumedMessageIndex; private final Integer unreadMessagesCount; private final Map links; @@ -103,7 +103,7 @@ private UserChannel( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("channel_sid") final String channelSid, @JsonProperty("member_sid") final String memberSid, - @JsonProperty("status") final UserChannel.ChannelStatus status, + @JsonProperty("status") final ChannelStatus status, @JsonProperty( "last_consumed_message_index" ) final Integer lastConsumedMessageIndex, @@ -138,7 +138,7 @@ public final String getMemberSid() { return this.memberSid; } - public final UserChannel.ChannelStatus getStatus() { + public final ChannelStatus getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/chat/v2/Credential.java b/src/main/java/com/twilio/rest/chat/v2/Credential.java index b02f30cb1e..8be42a05aa 100644 --- a/src/main/java/com/twilio/rest/chat/v2/Credential.java +++ b/src/main/java/com/twilio/rest/chat/v2/Credential.java @@ -39,7 +39,7 @@ public class Credential extends Resource { private static final long serialVersionUID = 161183169234848L; - public static CredentialCreator creator(final Credential.PushService type) { + public static CredentialCreator creator(final PushService type) { return new CredentialCreator(type); } @@ -105,7 +105,7 @@ public static Credential fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final Credential.PushService type; + private final PushService type; private final String sandbox; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -116,7 +116,7 @@ private Credential( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final Credential.PushService type, + @JsonProperty("type") final PushService type, @JsonProperty("sandbox") final String sandbox, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Credential.PushService getType() { + public final PushService getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/chat/v2/service/Binding.java b/src/main/java/com/twilio/rest/chat/v2/service/Binding.java index 3ace8bfd8d..87b187143a 100644 --- a/src/main/java/com/twilio/rest/chat/v2/service/Binding.java +++ b/src/main/java/com/twilio/rest/chat/v2/service/Binding.java @@ -111,7 +111,7 @@ public static Binding fromJson( private final String endpoint; private final String identity; private final String credentialSid; - private final Binding.BindingType bindingType; + private final BindingType bindingType; private final List messageTypes; private final URI url; private final Map links; @@ -126,7 +126,7 @@ private Binding( @JsonProperty("endpoint") final String endpoint, @JsonProperty("identity") final String identity, @JsonProperty("credential_sid") final String credentialSid, - @JsonProperty("binding_type") final Binding.BindingType bindingType, + @JsonProperty("binding_type") final BindingType bindingType, @JsonProperty("message_types") final List messageTypes, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links @@ -177,7 +177,7 @@ public final String getCredentialSid() { return this.credentialSid; } - public final Binding.BindingType getBindingType() { + public final BindingType getBindingType() { return this.bindingType; } diff --git a/src/main/java/com/twilio/rest/chat/v2/service/Channel.java b/src/main/java/com/twilio/rest/chat/v2/service/Channel.java index d950169893..b4a9182d10 100644 --- a/src/main/java/com/twilio/rest/chat/v2/service/Channel.java +++ b/src/main/java/com/twilio/rest/chat/v2/service/Channel.java @@ -119,7 +119,7 @@ public static Channel fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final Channel.ChannelType type; + private final ChannelType type; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; @@ -136,7 +136,7 @@ private Channel( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("type") final Channel.ChannelType type, + @JsonProperty("type") final ChannelType type, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("created_by") final String createdBy, @@ -185,7 +185,7 @@ public final String getAttributes() { return this.attributes; } - public final Channel.ChannelType getType() { + public final ChannelType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/chat/v2/service/Role.java b/src/main/java/com/twilio/rest/chat/v2/service/Role.java index 83550db69d..b6dd5785ac 100644 --- a/src/main/java/com/twilio/rest/chat/v2/service/Role.java +++ b/src/main/java/com/twilio/rest/chat/v2/service/Role.java @@ -43,7 +43,7 @@ public class Role extends Resource { public static RoleCreator creator( final String pathServiceSid, final String friendlyName, - final Role.RoleType type, + final RoleType type, final List permission ) { return new RoleCreator(pathServiceSid, friendlyName, type, permission); @@ -122,7 +122,7 @@ public static Role fromJson( private final String accountSid; private final String serviceSid; private final String friendlyName; - private final Role.RoleType type; + private final RoleType type; private final List permissions; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -134,7 +134,7 @@ private Role( @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final Role.RoleType type, + @JsonProperty("type") final RoleType type, @JsonProperty("permissions") final List permissions, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -167,7 +167,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Role.RoleType getType() { + public final RoleType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/chat/v2/service/channel/Webhook.java b/src/main/java/com/twilio/rest/chat/v2/service/channel/Webhook.java index 969a28cc11..b75b26253e 100644 --- a/src/main/java/com/twilio/rest/chat/v2/service/channel/Webhook.java +++ b/src/main/java/com/twilio/rest/chat/v2/service/channel/Webhook.java @@ -44,7 +44,7 @@ public class Webhook extends Resource { public static WebhookCreator creator( final String pathServiceSid, final String pathChannelSid, - final Webhook.Type type + final Type type ) { return new WebhookCreator(pathServiceSid, pathChannelSid, type); } diff --git a/src/main/java/com/twilio/rest/chat/v2/service/user/UserBinding.java b/src/main/java/com/twilio/rest/chat/v2/service/user/UserBinding.java index f95fefa538..183db9c103 100644 --- a/src/main/java/com/twilio/rest/chat/v2/service/user/UserBinding.java +++ b/src/main/java/com/twilio/rest/chat/v2/service/user/UserBinding.java @@ -115,7 +115,7 @@ public static UserBinding fromJson( private final String identity; private final String userSid; private final String credentialSid; - private final UserBinding.BindingType bindingType; + private final BindingType bindingType; private final List messageTypes; private final URI url; @@ -130,7 +130,7 @@ private UserBinding( @JsonProperty("identity") final String identity, @JsonProperty("user_sid") final String userSid, @JsonProperty("credential_sid") final String credentialSid, - @JsonProperty("binding_type") final UserBinding.BindingType bindingType, + @JsonProperty("binding_type") final BindingType bindingType, @JsonProperty("message_types") final List messageTypes, @JsonProperty("url") final URI url ) { @@ -184,7 +184,7 @@ public final String getCredentialSid() { return this.credentialSid; } - public final UserBinding.BindingType getBindingType() { + public final BindingType getBindingType() { return this.bindingType; } diff --git a/src/main/java/com/twilio/rest/chat/v2/service/user/UserChannel.java b/src/main/java/com/twilio/rest/chat/v2/service/user/UserChannel.java index ebe37d60ac..3dc09e5aa2 100644 --- a/src/main/java/com/twilio/rest/chat/v2/service/user/UserChannel.java +++ b/src/main/java/com/twilio/rest/chat/v2/service/user/UserChannel.java @@ -130,12 +130,12 @@ public static UserChannel fromJson( private final String channelSid; private final String userSid; private final String memberSid; - private final UserChannel.ChannelStatus status; + private final ChannelStatus status; private final Integer lastConsumedMessageIndex; private final Integer unreadMessagesCount; private final Map links; private final URI url; - private final UserChannel.NotificationLevel notificationLevel; + private final NotificationLevel notificationLevel; @JsonCreator private UserChannel( @@ -144,7 +144,7 @@ private UserChannel( @JsonProperty("channel_sid") final String channelSid, @JsonProperty("user_sid") final String userSid, @JsonProperty("member_sid") final String memberSid, - @JsonProperty("status") final UserChannel.ChannelStatus status, + @JsonProperty("status") final ChannelStatus status, @JsonProperty( "last_consumed_message_index" ) final Integer lastConsumedMessageIndex, @@ -155,7 +155,7 @@ private UserChannel( @JsonProperty("url") final URI url, @JsonProperty( "notification_level" - ) final UserChannel.NotificationLevel notificationLevel + ) final NotificationLevel notificationLevel ) { this.accountSid = accountSid; this.serviceSid = serviceSid; @@ -190,7 +190,7 @@ public final String getMemberSid() { return this.memberSid; } - public final UserChannel.ChannelStatus getStatus() { + public final ChannelStatus getStatus() { return this.status; } @@ -210,7 +210,7 @@ public final URI getUrl() { return this.url; } - public final UserChannel.NotificationLevel getNotificationLevel() { + public final NotificationLevel getNotificationLevel() { return this.notificationLevel; } diff --git a/src/main/java/com/twilio/rest/chat/v3/Channel.java b/src/main/java/com/twilio/rest/chat/v3/Channel.java index a46f618735..b606cf5123 100644 --- a/src/main/java/com/twilio/rest/chat/v3/Channel.java +++ b/src/main/java/com/twilio/rest/chat/v3/Channel.java @@ -95,7 +95,7 @@ public static Channel fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final Channel.ChannelType type; + private final ChannelType type; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; @@ -112,7 +112,7 @@ private Channel( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("type") final Channel.ChannelType type, + @JsonProperty("type") final ChannelType type, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("created_by") final String createdBy, @@ -161,7 +161,7 @@ public final String getAttributes() { return this.attributes; } - public final Channel.ChannelType getType() { + public final ChannelType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/content/v1/Content.java b/src/main/java/com/twilio/rest/content/v1/Content.java index addc44ae73..15b9fb92e2 100644 --- a/src/main/java/com/twilio/rest/content/v1/Content.java +++ b/src/main/java/com/twilio/rest/content/v1/Content.java @@ -942,7 +942,7 @@ public static ContentCreateRequest fromJson( } public static ContentCreator creator( - final Content.ContentCreateRequest contentCreateRequest + final ContentCreateRequest contentCreateRequest ) { return new ContentCreator(contentCreateRequest); } diff --git a/src/main/java/com/twilio/rest/content/v1/content/ApprovalCreate.java b/src/main/java/com/twilio/rest/content/v1/content/ApprovalCreate.java index aff2efdaf5..f8856de11a 100644 --- a/src/main/java/com/twilio/rest/content/v1/content/ApprovalCreate.java +++ b/src/main/java/com/twilio/rest/content/v1/content/ApprovalCreate.java @@ -72,7 +72,7 @@ public static ContentApprovalRequest fromJson( public static ApprovalCreateCreator creator( final String pathContentSid, - final ApprovalCreate.ContentApprovalRequest contentApprovalRequest + final ContentApprovalRequest contentApprovalRequest ) { return new ApprovalCreateCreator( pathContentSid, diff --git a/src/main/java/com/twilio/rest/conversations/v1/AddressConfiguration.java b/src/main/java/com/twilio/rest/conversations/v1/AddressConfiguration.java index e621325249..2aac078a95 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/AddressConfiguration.java +++ b/src/main/java/com/twilio/rest/conversations/v1/AddressConfiguration.java @@ -42,7 +42,7 @@ public class AddressConfiguration extends Resource { private static final long serialVersionUID = 162346024858734L; public static AddressConfigurationCreator creator( - final AddressConfiguration.Type type, + final Type type, final String address ) { return new AddressConfigurationCreator(type, address); @@ -246,19 +246,13 @@ public static AutoCreationType forValue(final String value) { } } - public enum Type { - SMS("sms"), - WHATSAPP("whatsapp"), - MESSENGER("messenger"), - GBM("gbm"), - EMAIL("email"), - RCS("rcs"), - APPLE("apple"), - CHAT("chat"); + public enum Method { + GET("get"), + POST("post"); private final String value; - private Type(final String value) { + private Method(final String value) { this.value = value; } @@ -267,18 +261,24 @@ public String toString() { } @JsonCreator - public static Type forValue(final String value) { - return Promoter.enumFromString(value, Type.values()); + public static Method forValue(final String value) { + return Promoter.enumFromString(value, Method.values()); } } - public enum Method { - GET("GET"), - POST("POST"); + public enum Type { + SMS("sms"), + WHATSAPP("whatsapp"), + MESSENGER("messenger"), + GBM("gbm"), + EMAIL("email"), + RCS("rcs"), + APPLE("apple"), + CHAT("chat"); private final String value; - private Method(final String value) { + private Type(final String value) { this.value = value; } @@ -287,8 +287,8 @@ public String toString() { } @JsonCreator - public static Method forValue(final String value) { - return Promoter.enumFromString(value, Method.values()); + public static Type forValue(final String value) { + return Promoter.enumFromString(value, Type.values()); } } } diff --git a/src/main/java/com/twilio/rest/conversations/v1/Conversation.java b/src/main/java/com/twilio/rest/conversations/v1/Conversation.java index dc54e2affc..652dbc936b 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/Conversation.java +++ b/src/main/java/com/twilio/rest/conversations/v1/Conversation.java @@ -111,7 +111,7 @@ public static Conversation fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final Conversation.State state; + private final State state; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Map timers; @@ -128,7 +128,7 @@ private Conversation( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("state") final Conversation.State state, + @JsonProperty("state") final State state, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("timers") final Map timers, @@ -180,7 +180,7 @@ public final String getAttributes() { return this.attributes; } - public final Conversation.State getState() { + public final State getState() { return this.state; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/ConversationWithParticipants.java b/src/main/java/com/twilio/rest/conversations/v1/ConversationWithParticipants.java index ac73b9afa2..26439f0d4f 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/ConversationWithParticipants.java +++ b/src/main/java/com/twilio/rest/conversations/v1/ConversationWithParticipants.java @@ -101,7 +101,7 @@ public static ConversationWithParticipants fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final ConversationWithParticipants.State state; + private final State state; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Map timers; @@ -118,7 +118,7 @@ private ConversationWithParticipants( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("state") final ConversationWithParticipants.State state, + @JsonProperty("state") final State state, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("timers") final Map timers, @@ -170,7 +170,7 @@ public final String getAttributes() { return this.attributes; } - public final ConversationWithParticipants.State getState() { + public final State getState() { return this.state; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/Credential.java b/src/main/java/com/twilio/rest/conversations/v1/Credential.java index 9b3cc9b62d..5d22d8174e 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/Credential.java +++ b/src/main/java/com/twilio/rest/conversations/v1/Credential.java @@ -39,7 +39,7 @@ public class Credential extends Resource { private static final long serialVersionUID = 265726674321801L; - public static CredentialCreator creator(final Credential.PushType type) { + public static CredentialCreator creator(final PushType type) { return new CredentialCreator(type); } @@ -105,7 +105,7 @@ public static Credential fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final Credential.PushType type; + private final PushType type; private final String sandbox; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -116,7 +116,7 @@ private Credential( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final Credential.PushType type, + @JsonProperty("type") final PushType type, @JsonProperty("sandbox") final String sandbox, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Credential.PushType getType() { + public final PushType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/ParticipantConversation.java b/src/main/java/com/twilio/rest/conversations/v1/ParticipantConversation.java index 49b97fb0c4..e6dd3cfc82 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/ParticipantConversation.java +++ b/src/main/java/com/twilio/rest/conversations/v1/ParticipantConversation.java @@ -100,7 +100,7 @@ public static ParticipantConversation fromJson( private final ZonedDateTime conversationDateCreated; private final ZonedDateTime conversationDateUpdated; private final String conversationCreatedBy; - private final ParticipantConversation.State conversationState; + private final State conversationState; private final Map conversationTimers; private final Map links; @@ -134,9 +134,7 @@ private ParticipantConversation( @JsonProperty( "conversation_created_by" ) final String conversationCreatedBy, - @JsonProperty( - "conversation_state" - ) final ParticipantConversation.State conversationState, + @JsonProperty("conversation_state") final State conversationState, @JsonProperty("conversation_timers") final Map< String, Object @@ -215,7 +213,7 @@ public final String getConversationCreatedBy() { return this.conversationCreatedBy; } - public final ParticipantConversation.State getConversationState() { + public final State getConversationState() { return this.conversationState; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/Role.java b/src/main/java/com/twilio/rest/conversations/v1/Role.java index 96ca04b94e..c20cf35b53 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/Role.java +++ b/src/main/java/com/twilio/rest/conversations/v1/Role.java @@ -42,7 +42,7 @@ public class Role extends Resource { public static RoleCreator creator( final String friendlyName, - final Role.RoleType type, + final RoleType type, final List permission ) { return new RoleCreator(friendlyName, type, permission); @@ -114,7 +114,7 @@ public static Role fromJson( private final String accountSid; private final String chatServiceSid; private final String friendlyName; - private final Role.RoleType type; + private final RoleType type; private final List permissions; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -126,7 +126,7 @@ private Role( @JsonProperty("account_sid") final String accountSid, @JsonProperty("chat_service_sid") final String chatServiceSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final Role.RoleType type, + @JsonProperty("type") final RoleType type, @JsonProperty("permissions") final List permissions, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -159,7 +159,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Role.RoleType getType() { + public final RoleType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/configuration/Webhook.java b/src/main/java/com/twilio/rest/conversations/v1/configuration/Webhook.java index 485c684771..7633382178 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/configuration/Webhook.java +++ b/src/main/java/com/twilio/rest/conversations/v1/configuration/Webhook.java @@ -90,21 +90,21 @@ public static Webhook fromJson( } private final String accountSid; - private final Webhook.Method method; + private final Method method; private final List filters; private final String preWebhookUrl; private final String postWebhookUrl; - private final Webhook.Target target; + private final Target target; private final URI url; @JsonCreator private Webhook( @JsonProperty("account_sid") final String accountSid, - @JsonProperty("method") final Webhook.Method method, + @JsonProperty("method") final Method method, @JsonProperty("filters") final List filters, @JsonProperty("pre_webhook_url") final String preWebhookUrl, @JsonProperty("post_webhook_url") final String postWebhookUrl, - @JsonProperty("target") final Webhook.Target target, + @JsonProperty("target") final Target target, @JsonProperty("url") final URI url ) { this.accountSid = accountSid; @@ -120,7 +120,7 @@ public final String getAccountSid() { return this.accountSid; } - public final Webhook.Method getMethod() { + public final Method getMethod() { return this.method; } @@ -136,7 +136,7 @@ public final String getPostWebhookUrl() { return this.postWebhookUrl; } - public final Webhook.Target getTarget() { + public final Target getTarget() { return this.target; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/conversation/Webhook.java b/src/main/java/com/twilio/rest/conversations/v1/conversation/Webhook.java index f6da62268d..25b7ac3b9a 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/conversation/Webhook.java +++ b/src/main/java/com/twilio/rest/conversations/v1/conversation/Webhook.java @@ -43,7 +43,7 @@ public class Webhook extends Resource { public static WebhookCreator creator( final String pathConversationSid, - final Webhook.Target target + final Target target ) { return new WebhookCreator(pathConversationSid, target); } @@ -238,8 +238,8 @@ public static Target forValue(final String value) { } public enum Method { - GET("GET"), - POST("POST"); + GET("get"), + POST("post"); private final String value; diff --git a/src/main/java/com/twilio/rest/conversations/v1/conversation/message/DeliveryReceipt.java b/src/main/java/com/twilio/rest/conversations/v1/conversation/message/DeliveryReceipt.java index 5e5098d0a9..b65ea7716d 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/conversation/message/DeliveryReceipt.java +++ b/src/main/java/com/twilio/rest/conversations/v1/conversation/message/DeliveryReceipt.java @@ -107,7 +107,7 @@ public static DeliveryReceipt fromJson( private final String messageSid; private final String channelMessageSid; private final String participantSid; - private final DeliveryReceipt.DeliveryStatus status; + private final DeliveryStatus status; private final Integer errorCode; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -121,7 +121,7 @@ private DeliveryReceipt( @JsonProperty("message_sid") final String messageSid, @JsonProperty("channel_message_sid") final String channelMessageSid, @JsonProperty("participant_sid") final String participantSid, - @JsonProperty("status") final DeliveryReceipt.DeliveryStatus status, + @JsonProperty("status") final DeliveryStatus status, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -164,7 +164,7 @@ public final String getParticipantSid() { return this.participantSid; } - public final DeliveryReceipt.DeliveryStatus getStatus() { + public final DeliveryStatus getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/Binding.java b/src/main/java/com/twilio/rest/conversations/v1/service/Binding.java index 0c10c7165f..dd66e34198 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/Binding.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/Binding.java @@ -109,7 +109,7 @@ public static Binding fromJson( private final ZonedDateTime dateUpdated; private final String endpoint; private final String identity; - private final Binding.BindingType bindingType; + private final BindingType bindingType; private final List messageTypes; private final URI url; @@ -123,7 +123,7 @@ private Binding( @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("endpoint") final String endpoint, @JsonProperty("identity") final String identity, - @JsonProperty("binding_type") final Binding.BindingType bindingType, + @JsonProperty("binding_type") final BindingType bindingType, @JsonProperty("message_types") final List messageTypes, @JsonProperty("url") final URI url ) { @@ -172,7 +172,7 @@ public final String getIdentity() { return this.identity; } - public final Binding.BindingType getBindingType() { + public final BindingType getBindingType() { return this.bindingType; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/Conversation.java b/src/main/java/com/twilio/rest/conversations/v1/service/Conversation.java index 181767e7e6..f4aed3b123 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/Conversation.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/Conversation.java @@ -120,7 +120,7 @@ public static Conversation fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final Conversation.State state; + private final State state; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Map timers; @@ -137,7 +137,7 @@ private Conversation( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("state") final Conversation.State state, + @JsonProperty("state") final State state, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("timers") final Map timers, @@ -189,7 +189,7 @@ public final String getAttributes() { return this.attributes; } - public final Conversation.State getState() { + public final State getState() { return this.state; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/ConversationWithParticipants.java b/src/main/java/com/twilio/rest/conversations/v1/service/ConversationWithParticipants.java index 939f0389d7..50554a0254 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/ConversationWithParticipants.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/ConversationWithParticipants.java @@ -103,7 +103,7 @@ public static ConversationWithParticipants fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final ConversationWithParticipants.State state; + private final State state; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Map timers; @@ -120,7 +120,7 @@ private ConversationWithParticipants( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("state") final ConversationWithParticipants.State state, + @JsonProperty("state") final State state, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("timers") final Map timers, @@ -172,7 +172,7 @@ public final String getAttributes() { return this.attributes; } - public final ConversationWithParticipants.State getState() { + public final State getState() { return this.state; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/ParticipantConversation.java b/src/main/java/com/twilio/rest/conversations/v1/service/ParticipantConversation.java index 7ee5b2860d..8949265dc2 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/ParticipantConversation.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/ParticipantConversation.java @@ -102,7 +102,7 @@ public static ParticipantConversation fromJson( private final ZonedDateTime conversationDateCreated; private final ZonedDateTime conversationDateUpdated; private final String conversationCreatedBy; - private final ParticipantConversation.State conversationState; + private final State conversationState; private final Map conversationTimers; private final Map links; @@ -136,9 +136,7 @@ private ParticipantConversation( @JsonProperty( "conversation_created_by" ) final String conversationCreatedBy, - @JsonProperty( - "conversation_state" - ) final ParticipantConversation.State conversationState, + @JsonProperty("conversation_state") final State conversationState, @JsonProperty("conversation_timers") final Map< String, Object @@ -217,7 +215,7 @@ public final String getConversationCreatedBy() { return this.conversationCreatedBy; } - public final ParticipantConversation.State getConversationState() { + public final State getConversationState() { return this.conversationState; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/Role.java b/src/main/java/com/twilio/rest/conversations/v1/service/Role.java index 43c80476c7..31e0a6501c 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/Role.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/Role.java @@ -43,7 +43,7 @@ public class Role extends Resource { public static RoleCreator creator( final String pathChatServiceSid, final String friendlyName, - final Role.RoleType type, + final RoleType type, final List permission ) { return new RoleCreator( @@ -127,7 +127,7 @@ public static Role fromJson( private final String accountSid; private final String chatServiceSid; private final String friendlyName; - private final Role.RoleType type; + private final RoleType type; private final List permissions; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -139,7 +139,7 @@ private Role( @JsonProperty("account_sid") final String accountSid, @JsonProperty("chat_service_sid") final String chatServiceSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final Role.RoleType type, + @JsonProperty("type") final RoleType type, @JsonProperty("permissions") final List permissions, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -172,7 +172,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Role.RoleType getType() { + public final RoleType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/configuration/Webhook.java b/src/main/java/com/twilio/rest/conversations/v1/service/configuration/Webhook.java index 9947722db0..a9965ee61f 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/configuration/Webhook.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/configuration/Webhook.java @@ -94,7 +94,7 @@ public static Webhook fromJson( private final URI preWebhookUrl; private final URI postWebhookUrl; private final List filters; - private final Webhook.Method method; + private final Method method; private final URI url; @JsonCreator @@ -104,7 +104,7 @@ private Webhook( @JsonProperty("pre_webhook_url") final URI preWebhookUrl, @JsonProperty("post_webhook_url") final URI postWebhookUrl, @JsonProperty("filters") final List filters, - @JsonProperty("method") final Webhook.Method method, + @JsonProperty("method") final Method method, @JsonProperty("url") final URI url ) { this.accountSid = accountSid; @@ -136,7 +136,7 @@ public final List getFilters() { return this.filters; } - public final Webhook.Method getMethod() { + public final Method getMethod() { return this.method; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/conversation/Webhook.java b/src/main/java/com/twilio/rest/conversations/v1/service/conversation/Webhook.java index dfaee4587f..f60058cb16 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/conversation/Webhook.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/conversation/Webhook.java @@ -44,7 +44,7 @@ public class Webhook extends Resource { public static WebhookCreator creator( final String pathChatServiceSid, final String pathConversationSid, - final Webhook.Target target + final Target target ) { return new WebhookCreator( pathChatServiceSid, @@ -270,8 +270,8 @@ public static Target forValue(final String value) { } public enum Method { - GET("GET"), - POST("POST"); + GET("get"), + POST("post"); private final String value; diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/conversation/message/DeliveryReceipt.java b/src/main/java/com/twilio/rest/conversations/v1/service/conversation/message/DeliveryReceipt.java index f3a9dd829d..da0e2d35ee 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/conversation/message/DeliveryReceipt.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/conversation/message/DeliveryReceipt.java @@ -115,7 +115,7 @@ public static DeliveryReceipt fromJson( private final String sid; private final String channelMessageSid; private final String participantSid; - private final DeliveryReceipt.DeliveryStatus status; + private final DeliveryStatus status; private final Integer errorCode; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -130,7 +130,7 @@ private DeliveryReceipt( @JsonProperty("sid") final String sid, @JsonProperty("channel_message_sid") final String channelMessageSid, @JsonProperty("participant_sid") final String participantSid, - @JsonProperty("status") final DeliveryReceipt.DeliveryStatus status, + @JsonProperty("status") final DeliveryStatus status, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -178,7 +178,7 @@ public final String getParticipantSid() { return this.participantSid; } - public final DeliveryReceipt.DeliveryStatus getStatus() { + public final DeliveryStatus getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/user/UserConversation.java b/src/main/java/com/twilio/rest/conversations/v1/service/user/UserConversation.java index 555ae5a2c6..42aecbd226 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/user/UserConversation.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/user/UserConversation.java @@ -135,13 +135,13 @@ public static UserConversation fromJson( private final String participantSid; private final String userSid; private final String friendlyName; - private final UserConversation.State conversationState; + private final State conversationState; private final Map timers; private final String attributes; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; - private final UserConversation.NotificationLevel notificationLevel; + private final NotificationLevel notificationLevel; private final String uniqueName; private final URI url; private final Map links; @@ -160,9 +160,7 @@ private UserConversation( @JsonProperty("participant_sid") final String participantSid, @JsonProperty("user_sid") final String userSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty( - "conversation_state" - ) final UserConversation.State conversationState, + @JsonProperty("conversation_state") final State conversationState, @JsonProperty("timers") final Map timers, @JsonProperty("attributes") final String attributes, @JsonProperty("date_created") final String dateCreated, @@ -170,7 +168,7 @@ private UserConversation( @JsonProperty("created_by") final String createdBy, @JsonProperty( "notification_level" - ) final UserConversation.NotificationLevel notificationLevel, + ) final NotificationLevel notificationLevel, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links @@ -227,7 +225,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final UserConversation.State getConversationState() { + public final State getConversationState() { return this.conversationState; } @@ -251,7 +249,7 @@ public final String getCreatedBy() { return this.createdBy; } - public final UserConversation.NotificationLevel getNotificationLevel() { + public final NotificationLevel getNotificationLevel() { return this.notificationLevel; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/user/UserConversation.java b/src/main/java/com/twilio/rest/conversations/v1/user/UserConversation.java index 2b21907430..58fc49a1d0 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/user/UserConversation.java +++ b/src/main/java/com/twilio/rest/conversations/v1/user/UserConversation.java @@ -117,13 +117,13 @@ public static UserConversation fromJson( private final String participantSid; private final String userSid; private final String friendlyName; - private final UserConversation.State conversationState; + private final State conversationState; private final Map timers; private final String attributes; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; - private final UserConversation.NotificationLevel notificationLevel; + private final NotificationLevel notificationLevel; private final String uniqueName; private final URI url; private final Map links; @@ -142,9 +142,7 @@ private UserConversation( @JsonProperty("participant_sid") final String participantSid, @JsonProperty("user_sid") final String userSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty( - "conversation_state" - ) final UserConversation.State conversationState, + @JsonProperty("conversation_state") final State conversationState, @JsonProperty("timers") final Map timers, @JsonProperty("attributes") final String attributes, @JsonProperty("date_created") final String dateCreated, @@ -152,7 +150,7 @@ private UserConversation( @JsonProperty("created_by") final String createdBy, @JsonProperty( "notification_level" - ) final UserConversation.NotificationLevel notificationLevel, + ) final NotificationLevel notificationLevel, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links @@ -209,7 +207,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final UserConversation.State getConversationState() { + public final State getConversationState() { return this.conversationState; } @@ -233,7 +231,7 @@ public final String getCreatedBy() { return this.createdBy; } - public final UserConversation.NotificationLevel getNotificationLevel() { + public final NotificationLevel getNotificationLevel() { return this.notificationLevel; } diff --git a/src/main/java/com/twilio/rest/events/v1/Sink.java b/src/main/java/com/twilio/rest/events/v1/Sink.java index 1a0f0eb112..1d8a20eb62 100644 --- a/src/main/java/com/twilio/rest/events/v1/Sink.java +++ b/src/main/java/com/twilio/rest/events/v1/Sink.java @@ -43,8 +43,8 @@ public class Sink extends Resource { public static SinkCreator creator( final String description, - final Map sinkConfiguration, - final Sink.SinkType sinkType + final Object sinkConfiguration, + final SinkType sinkType ) { return new SinkCreator(description, sinkConfiguration, sinkType); } @@ -116,8 +116,8 @@ public static Sink fromJson( private final String description; private final String sid; private final Map sinkConfiguration; - private final Sink.SinkType sinkType; - private final Sink.Status status; + private final SinkType sinkType; + private final Status status; private final URI url; private final Map links; @@ -131,8 +131,8 @@ private Sink( String, Object > sinkConfiguration, - @JsonProperty("sink_type") final Sink.SinkType sinkType, - @JsonProperty("status") final Sink.Status status, + @JsonProperty("sink_type") final SinkType sinkType, + @JsonProperty("status") final Status status, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links ) { @@ -167,11 +167,11 @@ public final Map getSinkConfiguration() { return this.sinkConfiguration; } - public final Sink.SinkType getSinkType() { + public final SinkType getSinkType() { return this.sinkType; } - public final Sink.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/events/v1/SinkCreator.java b/src/main/java/com/twilio/rest/events/v1/SinkCreator.java index 781066e4cd..632c1d9aec 100644 --- a/src/main/java/com/twilio/rest/events/v1/SinkCreator.java +++ b/src/main/java/com/twilio/rest/events/v1/SinkCreator.java @@ -26,18 +26,16 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class SinkCreator extends Creator { private String description; - private Map sinkConfiguration; + private Object sinkConfiguration; private Sink.SinkType sinkType; public SinkCreator( final String description, - final Map sinkConfiguration, + final Object sinkConfiguration, final Sink.SinkType sinkType ) { this.description = description; @@ -50,9 +48,7 @@ public SinkCreator setDescription(final String description) { return this; } - public SinkCreator setSinkConfiguration( - final Map sinkConfiguration - ) { + public SinkCreator setSinkConfiguration(final Object sinkConfiguration) { this.sinkConfiguration = sinkConfiguration; return this; } @@ -114,7 +110,7 @@ private void addPostParams(final Request request) { if (sinkConfiguration != null) { request.addPostParam( "SinkConfiguration", - Converter.mapToJson(sinkConfiguration) + Converter.objectToJson(sinkConfiguration) ); } if (sinkType != null) { diff --git a/src/main/java/com/twilio/rest/events/v1/Subscription.java b/src/main/java/com/twilio/rest/events/v1/Subscription.java index 0a37de2b4a..123ccdbbfc 100644 --- a/src/main/java/com/twilio/rest/events/v1/Subscription.java +++ b/src/main/java/com/twilio/rest/events/v1/Subscription.java @@ -44,7 +44,7 @@ public class Subscription extends Resource { public static SubscriptionCreator creator( final String description, final String sinkSid, - final List> types + final List types ) { return new SubscriptionCreator(description, sinkSid, types); } diff --git a/src/main/java/com/twilio/rest/events/v1/SubscriptionCreator.java b/src/main/java/com/twilio/rest/events/v1/SubscriptionCreator.java index 449e4aa7cd..e82e798efa 100644 --- a/src/main/java/com/twilio/rest/events/v1/SubscriptionCreator.java +++ b/src/main/java/com/twilio/rest/events/v1/SubscriptionCreator.java @@ -16,8 +16,6 @@ import com.twilio.base.Creator; import com.twilio.constant.EnumConstants; -import com.twilio.converter.Converter; -import com.twilio.converter.Converter; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; @@ -29,19 +27,17 @@ import com.twilio.rest.Domains; import java.util.List; import java.util.List; -import java.util.Map; -import java.util.Map; public class SubscriptionCreator extends Creator { private String description; private String sinkSid; - private List> types; + private List types; public SubscriptionCreator( final String description, final String sinkSid, - final List> types + final List types ) { this.description = description; this.sinkSid = sinkSid; @@ -58,12 +54,12 @@ public SubscriptionCreator setSinkSid(final String sinkSid) { return this; } - public SubscriptionCreator setTypes(final List> types) { + public SubscriptionCreator setTypes(final List types) { this.types = types; return this; } - public SubscriptionCreator setTypes(final Map types) { + public SubscriptionCreator setTypes(final Object types) { return setTypes(Promoter.listOfOne(types)); } @@ -119,8 +115,8 @@ private void addPostParams(final Request request) { request.addPostParam("SinkSid", sinkSid); } if (types != null) { - for (Map prop : types) { - request.addPostParam("Types", Converter.mapToJson(prop)); + for (Object prop : types) { + request.addPostParam("Types", prop.toString()); } } } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/Configuration.java b/src/main/java/com/twilio/rest/flexapi/v1/Configuration.java index 79e780fa58..42346f69ce 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/Configuration.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/Configuration.java @@ -110,7 +110,7 @@ public static String toJson(Object object, ObjectMapper mapper) { private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Map attributes; - private final Configuration.Status status; + private final Status status; private final String taskrouterWorkspaceSid; private final String taskrouterTargetWorkflowSid; private final String taskrouterTargetTaskqueueSid; @@ -162,7 +162,7 @@ private Configuration( @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("attributes") final Map attributes, - @JsonProperty("status") final Configuration.Status status, + @JsonProperty("status") final Status status, @JsonProperty( "taskrouter_workspace_sid" ) final String taskrouterWorkspaceSid, @@ -343,7 +343,7 @@ public final Map getAttributes() { return this.attributes; } - public final Configuration.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/FlexFlow.java b/src/main/java/com/twilio/rest/flexapi/v1/FlexFlow.java index ecfe3be905..ef505f09b5 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/FlexFlow.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/FlexFlow.java @@ -44,7 +44,7 @@ public class FlexFlow extends Resource { public static FlexFlowCreator creator( final String friendlyName, final String chatServiceSid, - final FlexFlow.ChannelType channelType + final ChannelType channelType ) { return new FlexFlowCreator(friendlyName, chatServiceSid, channelType); } @@ -114,10 +114,10 @@ public static FlexFlow fromJson( private final String sid; private final String friendlyName; private final String chatServiceSid; - private final FlexFlow.ChannelType channelType; + private final ChannelType channelType; private final String contactIdentity; private final Boolean enabled; - private final FlexFlow.IntegrationType integrationType; + private final IntegrationType integrationType; private final Map integration; private final Boolean longLived; private final Boolean janitorEnabled; @@ -131,12 +131,10 @@ private FlexFlow( @JsonProperty("sid") final String sid, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("chat_service_sid") final String chatServiceSid, - @JsonProperty("channel_type") final FlexFlow.ChannelType channelType, + @JsonProperty("channel_type") final ChannelType channelType, @JsonProperty("contact_identity") final String contactIdentity, @JsonProperty("enabled") final Boolean enabled, - @JsonProperty( - "integration_type" - ) final FlexFlow.IntegrationType integrationType, + @JsonProperty("integration_type") final IntegrationType integrationType, @JsonProperty("integration") final Map integration, @JsonProperty("long_lived") final Boolean longLived, @JsonProperty("janitor_enabled") final Boolean janitorEnabled, @@ -182,7 +180,7 @@ public final String getChatServiceSid() { return this.chatServiceSid; } - public final FlexFlow.ChannelType getChannelType() { + public final ChannelType getChannelType() { return this.channelType; } @@ -194,7 +192,7 @@ public final Boolean getEnabled() { return this.enabled; } - public final FlexFlow.IntegrationType getIntegrationType() { + public final IntegrationType getIntegrationType() { return this.integrationType; } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/Interaction.java b/src/main/java/com/twilio/rest/flexapi/v1/Interaction.java index 9bce2d74ec..99af3da8ff 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/Interaction.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/Interaction.java @@ -38,9 +38,7 @@ public class Interaction extends Resource { private static final long serialVersionUID = 256485735361091L; - public static InteractionCreator creator( - final Map channel - ) { + public static InteractionCreator creator(final Object channel) { return new InteractionCreator(channel); } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/InteractionCreator.java b/src/main/java/com/twilio/rest/flexapi/v1/InteractionCreator.java index fa70c4a23e..4ac64c4b4a 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/InteractionCreator.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/InteractionCreator.java @@ -26,26 +26,24 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class InteractionCreator extends Creator { - private Map channel; - private Map routing; + private Object channel; + private Object routing; private String interactionContextSid; private String webhookTtid; - public InteractionCreator(final Map channel) { + public InteractionCreator(final Object channel) { this.channel = channel; } - public InteractionCreator setChannel(final Map channel) { + public InteractionCreator setChannel(final Object channel) { this.channel = channel; return this; } - public InteractionCreator setRouting(final Map routing) { + public InteractionCreator setRouting(final Object routing) { this.routing = routing; return this; } @@ -102,10 +100,10 @@ public Interaction create(final TwilioRestClient client) { private void addPostParams(final Request request) { if (channel != null) { - request.addPostParam("Channel", Converter.mapToJson(channel)); + request.addPostParam("Channel", Converter.objectToJson(channel)); } if (routing != null) { - request.addPostParam("Routing", Converter.mapToJson(routing)); + request.addPostParam("Routing", Converter.objectToJson(routing)); } if (interactionContextSid != null) { request.addPostParam( diff --git a/src/main/java/com/twilio/rest/flexapi/v1/PluginConfigurationCreator.java b/src/main/java/com/twilio/rest/flexapi/v1/PluginConfigurationCreator.java index 0450fd0ae1..d55ca90f44 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/PluginConfigurationCreator.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/PluginConfigurationCreator.java @@ -16,8 +16,6 @@ import com.twilio.base.Creator; import com.twilio.constant.EnumConstants; -import com.twilio.converter.Converter; -import com.twilio.converter.Converter; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; @@ -29,14 +27,12 @@ import com.twilio.rest.Domains; import java.util.List; import java.util.List; -import java.util.Map; -import java.util.Map; public class PluginConfigurationCreator extends Creator { private String name; private String flexMetadata; - private List> plugins; + private List plugins; private String description; public PluginConfigurationCreator(final String name) { @@ -55,16 +51,12 @@ public PluginConfigurationCreator setFlexMetadata( return this; } - public PluginConfigurationCreator setPlugins( - final List> plugins - ) { + public PluginConfigurationCreator setPlugins(final List plugins) { this.plugins = plugins; return this; } - public PluginConfigurationCreator setPlugins( - final Map plugins - ) { + public PluginConfigurationCreator setPlugins(final Object plugins) { return setPlugins(Promoter.listOfOne(plugins)); } @@ -117,8 +109,8 @@ private void addPostParams(final Request request) { request.addPostParam("Name", name); } if (plugins != null) { - for (Map prop : plugins) { - request.addPostParam("Plugins", Converter.mapToJson(prop)); + for (Object prop : plugins) { + request.addPostParam("Plugins", prop.toString()); } } if (description != null) { diff --git a/src/main/java/com/twilio/rest/flexapi/v1/ProvisioningStatus.java b/src/main/java/com/twilio/rest/flexapi/v1/ProvisioningStatus.java index 48fd242415..4d04e64e6a 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/ProvisioningStatus.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/ProvisioningStatus.java @@ -84,19 +84,19 @@ public static ProvisioningStatus fromJson( } } - private final ProvisioningStatus.Status status; + private final Status status; private final URI url; @JsonCreator private ProvisioningStatus( - @JsonProperty("status") final ProvisioningStatus.Status status, + @JsonProperty("status") final Status status, @JsonProperty("url") final URI url ) { this.status = status; this.url = url; } - public final ProvisioningStatus.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/interaction/InteractionChannel.java b/src/main/java/com/twilio/rest/flexapi/v1/interaction/InteractionChannel.java index 9c1d778e34..628600a80e 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/interaction/InteractionChannel.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/interaction/InteractionChannel.java @@ -55,7 +55,7 @@ public static InteractionChannelReader reader( public static InteractionChannelUpdater updater( final String pathInteractionSid, final String pathSid, - final InteractionChannel.UpdateChannelStatus status + final UpdateChannelStatus status ) { return new InteractionChannelUpdater( pathInteractionSid, @@ -109,8 +109,8 @@ public static InteractionChannel fromJson( private final String sid; private final String interactionSid; - private final InteractionChannel.Type type; - private final InteractionChannel.ChannelStatus status; + private final Type type; + private final ChannelStatus status; private final Integer errorCode; private final String errorMessage; private final URI url; @@ -120,8 +120,8 @@ public static InteractionChannel fromJson( private InteractionChannel( @JsonProperty("sid") final String sid, @JsonProperty("interaction_sid") final String interactionSid, - @JsonProperty("type") final InteractionChannel.Type type, - @JsonProperty("status") final InteractionChannel.ChannelStatus status, + @JsonProperty("type") final Type type, + @JsonProperty("status") final ChannelStatus status, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("error_message") final String errorMessage, @JsonProperty("url") final URI url, @@ -145,11 +145,11 @@ public final String getInteractionSid() { return this.interactionSid; } - public final InteractionChannel.Type getType() { + public final Type getType() { return this.type; } - public final InteractionChannel.ChannelStatus getStatus() { + public final ChannelStatus getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/interaction/InteractionChannelUpdater.java b/src/main/java/com/twilio/rest/flexapi/v1/interaction/InteractionChannelUpdater.java index 22a50f6d76..3c61717b83 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/interaction/InteractionChannelUpdater.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/interaction/InteractionChannelUpdater.java @@ -25,14 +25,13 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class InteractionChannelUpdater extends Updater { private String pathInteractionSid; private String pathSid; private InteractionChannel.UpdateChannelStatus status; - private Map routing; + private Object routing; public InteractionChannelUpdater( final String pathInteractionSid, @@ -51,9 +50,7 @@ public InteractionChannelUpdater setStatus( return this; } - public InteractionChannelUpdater setRouting( - final Map routing - ) { + public InteractionChannelUpdater setRouting(final Object routing) { this.routing = routing; return this; } @@ -107,7 +104,7 @@ private void addPostParams(final Request request) { request.addPostParam("Status", status.toString()); } if (routing != null) { - request.addPostParam("Routing", Converter.mapToJson(routing)); + request.addPostParam("Routing", Converter.objectToJson(routing)); } } } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelInvite.java b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelInvite.java index 6a9e79717b..da656b886a 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelInvite.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelInvite.java @@ -41,7 +41,7 @@ public class InteractionChannelInvite extends Resource { public static InteractionChannelInviteCreator creator( final String pathInteractionSid, final String pathChannelSid, - final Map routing + final Object routing ) { return new InteractionChannelInviteCreator( pathInteractionSid, diff --git a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelInviteCreator.java b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelInviteCreator.java index 94643ed2dd..89dd3e12be 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelInviteCreator.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelInviteCreator.java @@ -26,29 +26,25 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class InteractionChannelInviteCreator extends Creator { private String pathInteractionSid; private String pathChannelSid; - private Map routing; + private Object routing; public InteractionChannelInviteCreator( final String pathInteractionSid, final String pathChannelSid, - final Map routing + final Object routing ) { this.pathInteractionSid = pathInteractionSid; this.pathChannelSid = pathChannelSid; this.routing = routing; } - public InteractionChannelInviteCreator setRouting( - final Map routing - ) { + public InteractionChannelInviteCreator setRouting(final Object routing) { this.routing = routing; return this; } @@ -104,7 +100,7 @@ public InteractionChannelInvite create(final TwilioRestClient client) { private void addPostParams(final Request request) { if (routing != null) { - request.addPostParam("Routing", Converter.mapToJson(routing)); + request.addPostParam("Routing", Converter.objectToJson(routing)); } } } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelParticipant.java b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelParticipant.java index 390638a66e..d23c9ae21d 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelParticipant.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelParticipant.java @@ -42,8 +42,8 @@ public class InteractionChannelParticipant extends Resource { public static InteractionChannelParticipantCreator creator( final String pathInteractionSid, final String pathChannelSid, - final InteractionChannelParticipant.Type type, - final Map mediaProperties + final Type type, + final Object mediaProperties ) { return new InteractionChannelParticipantCreator( pathInteractionSid, @@ -67,7 +67,7 @@ public static InteractionChannelParticipantUpdater updater( final String pathInteractionSid, final String pathChannelSid, final String pathSid, - final InteractionChannelParticipant.Status status + final Status status ) { return new InteractionChannelParticipantUpdater( pathInteractionSid, @@ -127,7 +127,7 @@ public static InteractionChannelParticipant fromJson( } private final String sid; - private final InteractionChannelParticipant.Type type; + private final Type type; private final String interactionSid; private final String channelSid; private final URI url; @@ -136,7 +136,7 @@ public static InteractionChannelParticipant fromJson( @JsonCreator private InteractionChannelParticipant( @JsonProperty("sid") final String sid, - @JsonProperty("type") final InteractionChannelParticipant.Type type, + @JsonProperty("type") final Type type, @JsonProperty("interaction_sid") final String interactionSid, @JsonProperty("channel_sid") final String channelSid, @JsonProperty("url") final URI url, @@ -157,7 +157,7 @@ public final String getSid() { return this.sid; } - public final InteractionChannelParticipant.Type getType() { + public final Type getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelParticipantCreator.java b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelParticipantCreator.java index 587a591060..0de36280bf 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelParticipantCreator.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelParticipantCreator.java @@ -26,8 +26,6 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class InteractionChannelParticipantCreator extends Creator { @@ -35,14 +33,14 @@ public class InteractionChannelParticipantCreator private String pathInteractionSid; private String pathChannelSid; private InteractionChannelParticipant.Type type; - private Map mediaProperties; - private Map routingProperties; + private Object mediaProperties; + private Object routingProperties; public InteractionChannelParticipantCreator( final String pathInteractionSid, final String pathChannelSid, final InteractionChannelParticipant.Type type, - final Map mediaProperties + final Object mediaProperties ) { this.pathInteractionSid = pathInteractionSid; this.pathChannelSid = pathChannelSid; @@ -58,14 +56,14 @@ public InteractionChannelParticipantCreator setType( } public InteractionChannelParticipantCreator setMediaProperties( - final Map mediaProperties + final Object mediaProperties ) { this.mediaProperties = mediaProperties; return this; } public InteractionChannelParticipantCreator setRoutingProperties( - final Map routingProperties + final Object routingProperties ) { this.routingProperties = routingProperties; return this; @@ -132,13 +130,13 @@ private void addPostParams(final Request request) { if (mediaProperties != null) { request.addPostParam( "MediaProperties", - Converter.mapToJson(mediaProperties) + Converter.objectToJson(mediaProperties) ); } if (routingProperties != null) { request.addPostParam( "RoutingProperties", - Converter.mapToJson(routingProperties) + Converter.objectToJson(routingProperties) ); } } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionTransfer.java b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionTransfer.java index 40779ee7de..7541c81831 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionTransfer.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionTransfer.java @@ -135,8 +135,8 @@ public static String toJson(Object object, ObjectMapper mapper) { private final String interactionSid; private final String channelSid; private final String executionSid; - private final InteractionTransfer.TransferType type; - private final InteractionTransfer.TransferStatus status; + private final TransferType type; + private final TransferStatus status; private final String from; private final String to; private final String noteSid; @@ -153,8 +153,8 @@ private InteractionTransfer( @JsonProperty("interaction_sid") final String interactionSid, @JsonProperty("channel_sid") final String channelSid, @JsonProperty("execution_sid") final String executionSid, - @JsonProperty("type") final InteractionTransfer.TransferType type, - @JsonProperty("status") final InteractionTransfer.TransferStatus status, + @JsonProperty("type") final TransferType type, + @JsonProperty("status") final TransferStatus status, @JsonProperty("from") final String from, @JsonProperty("to") final String to, @JsonProperty("note_sid") final String noteSid, @@ -204,11 +204,11 @@ public final String getExecutionSid() { return this.executionSid; } - public final InteractionTransfer.TransferType getType() { + public final TransferType getType() { return this.type; } - public final InteractionTransfer.TransferStatus getStatus() { + public final TransferStatus getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/frontlineapi/v1/User.java b/src/main/java/com/twilio/rest/frontlineapi/v1/User.java index 3534892247..6bc81d1212 100644 --- a/src/main/java/com/twilio/rest/frontlineapi/v1/User.java +++ b/src/main/java/com/twilio/rest/frontlineapi/v1/User.java @@ -92,7 +92,7 @@ public static User fromJson( private final String identity; private final String friendlyName; private final String avatar; - private final User.StateType state; + private final StateType state; private final Boolean isAvailable; private final URI url; @@ -102,7 +102,7 @@ private User( @JsonProperty("identity") final String identity, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("avatar") final String avatar, - @JsonProperty("state") final User.StateType state, + @JsonProperty("state") final StateType state, @JsonProperty("is_available") final Boolean isAvailable, @JsonProperty("url") final URI url ) { @@ -131,7 +131,7 @@ public final String getAvatar() { return this.avatar; } - public final User.StateType getState() { + public final StateType getState() { return this.state; } diff --git a/src/main/java/com/twilio/rest/insights/v1/CallSummaries.java b/src/main/java/com/twilio/rest/insights/v1/CallSummaries.java index 9741233555..2c9a77afed 100644 --- a/src/main/java/com/twilio/rest/insights/v1/CallSummaries.java +++ b/src/main/java/com/twilio/rest/insights/v1/CallSummaries.java @@ -91,10 +91,10 @@ public static CallSummaries fromJson( private final String accountSid; private final String callSid; - private final CallSummaries.AnsweredBy answeredBy; - private final CallSummaries.CallType callType; - private final CallSummaries.CallState callState; - private final CallSummaries.ProcessingState processingState; + private final AnsweredBy answeredBy; + private final CallType callType; + private final CallState callState; + private final ProcessingState processingState; private final ZonedDateTime createdTime; private final ZonedDateTime startTime; private final ZonedDateTime endTime; @@ -117,12 +117,10 @@ public static CallSummaries fromJson( private CallSummaries( @JsonProperty("account_sid") final String accountSid, @JsonProperty("call_sid") final String callSid, - @JsonProperty("answered_by") final CallSummaries.AnsweredBy answeredBy, - @JsonProperty("call_type") final CallSummaries.CallType callType, - @JsonProperty("call_state") final CallSummaries.CallState callState, - @JsonProperty( - "processing_state" - ) final CallSummaries.ProcessingState processingState, + @JsonProperty("answered_by") final AnsweredBy answeredBy, + @JsonProperty("call_type") final CallType callType, + @JsonProperty("call_state") final CallState callState, + @JsonProperty("processing_state") final ProcessingState processingState, @JsonProperty("created_time") final String createdTime, @JsonProperty("start_time") final String startTime, @JsonProperty("end_time") final String endTime, @@ -174,19 +172,19 @@ public final String getCallSid() { return this.callSid; } - public final CallSummaries.AnsweredBy getAnsweredBy() { + public final AnsweredBy getAnsweredBy() { return this.answeredBy; } - public final CallSummaries.CallType getCallType() { + public final CallType getCallType() { return this.callType; } - public final CallSummaries.CallState getCallState() { + public final CallState getCallState() { return this.callState; } - public final CallSummaries.ProcessingState getProcessingState() { + public final ProcessingState getProcessingState() { return this.processingState; } diff --git a/src/main/java/com/twilio/rest/insights/v1/Conference.java b/src/main/java/com/twilio/rest/insights/v1/Conference.java index c6a41efe28..7a3e57b142 100644 --- a/src/main/java/com/twilio/rest/insights/v1/Conference.java +++ b/src/main/java/com/twilio/rest/insights/v1/Conference.java @@ -101,19 +101,19 @@ public static Conference fromJson( private final ZonedDateTime endTime; private final Integer durationSeconds; private final Integer connectDurationSeconds; - private final Conference.ConferenceStatus status; + private final ConferenceStatus status; private final Integer maxParticipants; private final Integer maxConcurrentParticipants; private final Integer uniqueParticipants; - private final Conference.ConferenceEndReason endReason; + private final ConferenceEndReason endReason; private final String endedBy; - private final Conference.Region mixerRegion; - private final Conference.Region mixerRegionRequested; + private final Region mixerRegion; + private final Region mixerRegionRequested; private final Boolean recordingEnabled; private final Map detectedIssues; - private final List tags; + private final List tags; private final Map tagInfo; - private final Conference.ProcessingState processingState; + private final ProcessingState processingState; private final URI url; private final Map links; @@ -129,30 +129,26 @@ private Conference( @JsonProperty( "connect_duration_seconds" ) final Integer connectDurationSeconds, - @JsonProperty("status") final Conference.ConferenceStatus status, + @JsonProperty("status") final ConferenceStatus status, @JsonProperty("max_participants") final Integer maxParticipants, @JsonProperty( "max_concurrent_participants" ) final Integer maxConcurrentParticipants, @JsonProperty("unique_participants") final Integer uniqueParticipants, - @JsonProperty( - "end_reason" - ) final Conference.ConferenceEndReason endReason, + @JsonProperty("end_reason") final ConferenceEndReason endReason, @JsonProperty("ended_by") final String endedBy, - @JsonProperty("mixer_region") final Conference.Region mixerRegion, + @JsonProperty("mixer_region") final Region mixerRegion, @JsonProperty( "mixer_region_requested" - ) final Conference.Region mixerRegionRequested, + ) final Region mixerRegionRequested, @JsonProperty("recording_enabled") final Boolean recordingEnabled, @JsonProperty("detected_issues") final Map< String, Object > detectedIssues, - @JsonProperty("tags") final List tags, + @JsonProperty("tags") final List tags, @JsonProperty("tag_info") final Map tagInfo, - @JsonProperty( - "processing_state" - ) final Conference.ProcessingState processingState, + @JsonProperty("processing_state") final ProcessingState processingState, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links ) { @@ -213,7 +209,7 @@ public final Integer getConnectDurationSeconds() { return this.connectDurationSeconds; } - public final Conference.ConferenceStatus getStatus() { + public final ConferenceStatus getStatus() { return this.status; } @@ -229,7 +225,7 @@ public final Integer getUniqueParticipants() { return this.uniqueParticipants; } - public final Conference.ConferenceEndReason getEndReason() { + public final ConferenceEndReason getEndReason() { return this.endReason; } @@ -237,11 +233,11 @@ public final String getEndedBy() { return this.endedBy; } - public final Conference.Region getMixerRegion() { + public final Region getMixerRegion() { return this.mixerRegion; } - public final Conference.Region getMixerRegionRequested() { + public final Region getMixerRegionRequested() { return this.mixerRegionRequested; } @@ -253,7 +249,7 @@ public final Map getDetectedIssues() { return this.detectedIssues; } - public final List getTags() { + public final List getTags() { return this.tags; } @@ -261,7 +257,7 @@ public final Map getTagInfo() { return this.tagInfo; } - public final Conference.ProcessingState getProcessingState() { + public final ProcessingState getProcessingState() { return this.processingState; } diff --git a/src/main/java/com/twilio/rest/insights/v1/Room.java b/src/main/java/com/twilio/rest/insights/v1/Room.java index 32a1fb2ece..e3ad533bec 100644 --- a/src/main/java/com/twilio/rest/insights/v1/Room.java +++ b/src/main/java/com/twilio/rest/insights/v1/Room.java @@ -99,25 +99,25 @@ public static Room fromJson( private final String roomName; private final ZonedDateTime createTime; private final ZonedDateTime endTime; - private final Room.RoomType roomType; - private final Room.RoomStatus roomStatus; + private final RoomType roomType; + private final RoomStatus roomStatus; private final URI statusCallback; private final HttpMethod statusCallbackMethod; - private final Room.CreatedMethod createdMethod; - private final Room.EndReason endReason; + private final CreatedMethod createdMethod; + private final EndReason endReason; private final Integer maxParticipants; private final Integer uniqueParticipants; private final Integer uniqueParticipantIdentities; private final Integer concurrentParticipants; private final Integer maxConcurrentParticipants; - private final List codecs; - private final Room.TwilioRealm mediaRegion; + private final List codecs; + private final TwilioRealm mediaRegion; private final Long durationSec; private final Long totalParticipantDurationSec; private final Long totalRecordingDurationSec; - private final Room.ProcessingState processingState; + private final ProcessingState processingState; private final Boolean recordingEnabled; - private final Room.EdgeLocation edgeLocation; + private final EdgeLocation edgeLocation; private final URI url; private final Map links; @@ -128,14 +128,14 @@ private Room( @JsonProperty("room_name") final String roomName, @JsonProperty("create_time") final String createTime, @JsonProperty("end_time") final String endTime, - @JsonProperty("room_type") final Room.RoomType roomType, - @JsonProperty("room_status") final Room.RoomStatus roomStatus, + @JsonProperty("room_type") final RoomType roomType, + @JsonProperty("room_status") final RoomStatus roomStatus, @JsonProperty("status_callback") final URI statusCallback, @JsonProperty( "status_callback_method" ) final HttpMethod statusCallbackMethod, - @JsonProperty("created_method") final Room.CreatedMethod createdMethod, - @JsonProperty("end_reason") final Room.EndReason endReason, + @JsonProperty("created_method") final CreatedMethod createdMethod, + @JsonProperty("end_reason") final EndReason endReason, @JsonProperty("max_participants") final Integer maxParticipants, @JsonProperty("unique_participants") final Integer uniqueParticipants, @JsonProperty( @@ -147,8 +147,8 @@ private Room( @JsonProperty( "max_concurrent_participants" ) final Integer maxConcurrentParticipants, - @JsonProperty("codecs") final List codecs, - @JsonProperty("media_region") final Room.TwilioRealm mediaRegion, + @JsonProperty("codecs") final List codecs, + @JsonProperty("media_region") final TwilioRealm mediaRegion, @JsonProperty("duration_sec") final Long durationSec, @JsonProperty( "total_participant_duration_sec" @@ -156,11 +156,9 @@ private Room( @JsonProperty( "total_recording_duration_sec" ) final Long totalRecordingDurationSec, - @JsonProperty( - "processing_state" - ) final Room.ProcessingState processingState, + @JsonProperty("processing_state") final ProcessingState processingState, @JsonProperty("recording_enabled") final Boolean recordingEnabled, - @JsonProperty("edge_location") final Room.EdgeLocation edgeLocation, + @JsonProperty("edge_location") final EdgeLocation edgeLocation, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links ) { @@ -212,11 +210,11 @@ public final ZonedDateTime getEndTime() { return this.endTime; } - public final Room.RoomType getRoomType() { + public final RoomType getRoomType() { return this.roomType; } - public final Room.RoomStatus getRoomStatus() { + public final RoomStatus getRoomStatus() { return this.roomStatus; } @@ -228,11 +226,11 @@ public final HttpMethod getStatusCallbackMethod() { return this.statusCallbackMethod; } - public final Room.CreatedMethod getCreatedMethod() { + public final CreatedMethod getCreatedMethod() { return this.createdMethod; } - public final Room.EndReason getEndReason() { + public final EndReason getEndReason() { return this.endReason; } @@ -256,11 +254,11 @@ public final Integer getMaxConcurrentParticipants() { return this.maxConcurrentParticipants; } - public final List getCodecs() { + public final List getCodecs() { return this.codecs; } - public final Room.TwilioRealm getMediaRegion() { + public final TwilioRealm getMediaRegion() { return this.mediaRegion; } @@ -276,7 +274,7 @@ public final Long getTotalRecordingDurationSec() { return this.totalRecordingDurationSec; } - public final Room.ProcessingState getProcessingState() { + public final ProcessingState getProcessingState() { return this.processingState; } @@ -284,7 +282,7 @@ public final Boolean getRecordingEnabled() { return this.recordingEnabled; } - public final Room.EdgeLocation getEdgeLocation() { + public final EdgeLocation getEdgeLocation() { return this.edgeLocation; } diff --git a/src/main/java/com/twilio/rest/insights/v1/call/Annotation.java b/src/main/java/com/twilio/rest/insights/v1/call/Annotation.java index 0821e30210..0bb36cd0a0 100644 --- a/src/main/java/com/twilio/rest/insights/v1/call/Annotation.java +++ b/src/main/java/com/twilio/rest/insights/v1/call/Annotation.java @@ -91,8 +91,8 @@ public static Annotation fromJson( private final String callSid; private final String accountSid; - private final Annotation.AnsweredBy answeredBy; - private final Annotation.ConnectivityIssue connectivityIssue; + private final AnsweredBy answeredBy; + private final ConnectivityIssue connectivityIssue; private final List qualityIssues; private final Boolean spam; private final Integer callScore; @@ -104,10 +104,10 @@ public static Annotation fromJson( private Annotation( @JsonProperty("call_sid") final String callSid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty("answered_by") final Annotation.AnsweredBy answeredBy, + @JsonProperty("answered_by") final AnsweredBy answeredBy, @JsonProperty( "connectivity_issue" - ) final Annotation.ConnectivityIssue connectivityIssue, + ) final ConnectivityIssue connectivityIssue, @JsonProperty("quality_issues") final List qualityIssues, @JsonProperty("spam") final Boolean spam, @JsonProperty("call_score") final Integer callScore, @@ -135,11 +135,11 @@ public final String getAccountSid() { return this.accountSid; } - public final Annotation.AnsweredBy getAnsweredBy() { + public final AnsweredBy getAnsweredBy() { return this.answeredBy; } - public final Annotation.ConnectivityIssue getConnectivityIssue() { + public final ConnectivityIssue getConnectivityIssue() { return this.connectivityIssue; } diff --git a/src/main/java/com/twilio/rest/insights/v1/call/CallSummary.java b/src/main/java/com/twilio/rest/insights/v1/call/CallSummary.java index ae8c1be46a..68ec399227 100644 --- a/src/main/java/com/twilio/rest/insights/v1/call/CallSummary.java +++ b/src/main/java/com/twilio/rest/insights/v1/call/CallSummary.java @@ -91,10 +91,10 @@ public static CallSummary fromJson( private final String accountSid; private final String callSid; - private final CallSummary.CallType callType; - private final CallSummary.CallState callState; - private final CallSummary.AnsweredBy answeredBy; - private final CallSummary.ProcessingState processingState; + private final CallType callType; + private final CallState callState; + private final AnsweredBy answeredBy; + private final ProcessingState processingState; private final ZonedDateTime createdTime; private final ZonedDateTime startTime; private final ZonedDateTime endTime; @@ -117,12 +117,10 @@ public static CallSummary fromJson( private CallSummary( @JsonProperty("account_sid") final String accountSid, @JsonProperty("call_sid") final String callSid, - @JsonProperty("call_type") final CallSummary.CallType callType, - @JsonProperty("call_state") final CallSummary.CallState callState, - @JsonProperty("answered_by") final CallSummary.AnsweredBy answeredBy, - @JsonProperty( - "processing_state" - ) final CallSummary.ProcessingState processingState, + @JsonProperty("call_type") final CallType callType, + @JsonProperty("call_state") final CallState callState, + @JsonProperty("answered_by") final AnsweredBy answeredBy, + @JsonProperty("processing_state") final ProcessingState processingState, @JsonProperty("created_time") final String createdTime, @JsonProperty("start_time") final String startTime, @JsonProperty("end_time") final String endTime, @@ -174,19 +172,19 @@ public final String getCallSid() { return this.callSid; } - public final CallSummary.CallType getCallType() { + public final CallType getCallType() { return this.callType; } - public final CallSummary.CallState getCallState() { + public final CallState getCallState() { return this.callState; } - public final CallSummary.AnsweredBy getAnsweredBy() { + public final AnsweredBy getAnsweredBy() { return this.answeredBy; } - public final CallSummary.ProcessingState getProcessingState() { + public final ProcessingState getProcessingState() { return this.processingState; } diff --git a/src/main/java/com/twilio/rest/insights/v1/call/Event.java b/src/main/java/com/twilio/rest/insights/v1/call/Event.java index 3d5803e58c..72db3a8646 100644 --- a/src/main/java/com/twilio/rest/insights/v1/call/Event.java +++ b/src/main/java/com/twilio/rest/insights/v1/call/Event.java @@ -88,9 +88,9 @@ public static Event fromJson( private final String timestamp; private final String callSid; private final String accountSid; - private final Event.TwilioEdge edge; + private final TwilioEdge edge; private final String group; - private final Event.Level level; + private final Level level; private final String name; private final Map carrierEdge; private final Map sipEdge; @@ -102,9 +102,9 @@ private Event( @JsonProperty("timestamp") final String timestamp, @JsonProperty("call_sid") final String callSid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty("edge") final Event.TwilioEdge edge, + @JsonProperty("edge") final TwilioEdge edge, @JsonProperty("group") final String group, - @JsonProperty("level") final Event.Level level, + @JsonProperty("level") final Level level, @JsonProperty("name") final String name, @JsonProperty("carrier_edge") final Map carrierEdge, @JsonProperty("sip_edge") final Map sipEdge, @@ -136,7 +136,7 @@ public final String getAccountSid() { return this.accountSid; } - public final Event.TwilioEdge getEdge() { + public final TwilioEdge getEdge() { return this.edge; } @@ -144,7 +144,7 @@ public final String getGroup() { return this.group; } - public final Event.Level getLevel() { + public final Level getLevel() { return this.level; } diff --git a/src/main/java/com/twilio/rest/insights/v1/call/Metric.java b/src/main/java/com/twilio/rest/insights/v1/call/Metric.java index c5bc8315e8..e09bf425a6 100644 --- a/src/main/java/com/twilio/rest/insights/v1/call/Metric.java +++ b/src/main/java/com/twilio/rest/insights/v1/call/Metric.java @@ -88,8 +88,8 @@ public static Metric fromJson( private final String timestamp; private final String callSid; private final String accountSid; - private final Metric.TwilioEdge edge; - private final Metric.StreamDirection direction; + private final TwilioEdge edge; + private final StreamDirection direction; private final Map carrierEdge; private final Map sipEdge; private final Map sdkEdge; @@ -100,8 +100,8 @@ private Metric( @JsonProperty("timestamp") final String timestamp, @JsonProperty("call_sid") final String callSid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty("edge") final Metric.TwilioEdge edge, - @JsonProperty("direction") final Metric.StreamDirection direction, + @JsonProperty("edge") final TwilioEdge edge, + @JsonProperty("direction") final StreamDirection direction, @JsonProperty("carrier_edge") final Map carrierEdge, @JsonProperty("sip_edge") final Map sipEdge, @JsonProperty("sdk_edge") final Map sdkEdge, @@ -130,11 +130,11 @@ public final String getAccountSid() { return this.accountSid; } - public final Metric.TwilioEdge getEdge() { + public final TwilioEdge getEdge() { return this.edge; } - public final Metric.StreamDirection getDirection() { + public final StreamDirection getDirection() { return this.direction; } diff --git a/src/main/java/com/twilio/rest/insights/v1/conference/ConferenceParticipant.java b/src/main/java/com/twilio/rest/insights/v1/conference/ConferenceParticipant.java index d62a3c56fd..b5996e37a3 100644 --- a/src/main/java/com/twilio/rest/insights/v1/conference/ConferenceParticipant.java +++ b/src/main/java/com/twilio/rest/insights/v1/conference/ConferenceParticipant.java @@ -106,10 +106,10 @@ public static ConferenceParticipant fromJson( private final String conferenceSid; private final String callSid; private final String accountSid; - private final ConferenceParticipant.CallDirection callDirection; + private final CallDirection callDirection; private final String from; private final String to; - private final ConferenceParticipant.CallStatus callStatus; + private final CallStatus callStatus; private final String countryCode; private final Boolean isModerator; private final ZonedDateTime joinTime; @@ -117,13 +117,13 @@ public static ConferenceParticipant fromJson( private final Integer durationSeconds; private final Integer outboundQueueLength; private final Integer outboundTimeInQueue; - private final ConferenceParticipant.JitterBufferSize jitterBufferSize; + private final JitterBufferSize jitterBufferSize; private final Boolean isCoach; private final List coachedParticipants; - private final ConferenceParticipant.Region participantRegion; - private final ConferenceParticipant.Region conferenceRegion; - private final ConferenceParticipant.CallType callType; - private final ConferenceParticipant.ProcessingState processingState; + private final Region participantRegion; + private final Region conferenceRegion; + private final CallType callType; + private final ProcessingState processingState; private final Map properties; private final Map events; private final Map metrics; @@ -136,14 +136,10 @@ private ConferenceParticipant( @JsonProperty("conference_sid") final String conferenceSid, @JsonProperty("call_sid") final String callSid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty( - "call_direction" - ) final ConferenceParticipant.CallDirection callDirection, + @JsonProperty("call_direction") final CallDirection callDirection, @JsonProperty("from") final String from, @JsonProperty("to") final String to, - @JsonProperty( - "call_status" - ) final ConferenceParticipant.CallStatus callStatus, + @JsonProperty("call_status") final CallStatus callStatus, @JsonProperty("country_code") final String countryCode, @JsonProperty("is_moderator") final Boolean isModerator, @JsonProperty("join_time") final String joinTime, @@ -157,23 +153,15 @@ private ConferenceParticipant( ) final Integer outboundTimeInQueue, @JsonProperty( "jitter_buffer_size" - ) final ConferenceParticipant.JitterBufferSize jitterBufferSize, + ) final JitterBufferSize jitterBufferSize, @JsonProperty("is_coach") final Boolean isCoach, @JsonProperty("coached_participants") final List< String > coachedParticipants, - @JsonProperty( - "participant_region" - ) final ConferenceParticipant.Region participantRegion, - @JsonProperty( - "conference_region" - ) final ConferenceParticipant.Region conferenceRegion, - @JsonProperty( - "call_type" - ) final ConferenceParticipant.CallType callType, - @JsonProperty( - "processing_state" - ) final ConferenceParticipant.ProcessingState processingState, + @JsonProperty("participant_region") final Region participantRegion, + @JsonProperty("conference_region") final Region conferenceRegion, + @JsonProperty("call_type") final CallType callType, + @JsonProperty("processing_state") final ProcessingState processingState, @JsonProperty("properties") final Map properties, @JsonProperty("events") final Map events, @JsonProperty("metrics") final Map metrics, @@ -228,7 +216,7 @@ public final String getAccountSid() { return this.accountSid; } - public final ConferenceParticipant.CallDirection getCallDirection() { + public final CallDirection getCallDirection() { return this.callDirection; } @@ -240,7 +228,7 @@ public final String getTo() { return this.to; } - public final ConferenceParticipant.CallStatus getCallStatus() { + public final CallStatus getCallStatus() { return this.callStatus; } @@ -272,7 +260,7 @@ public final Integer getOutboundTimeInQueue() { return this.outboundTimeInQueue; } - public final ConferenceParticipant.JitterBufferSize getJitterBufferSize() { + public final JitterBufferSize getJitterBufferSize() { return this.jitterBufferSize; } @@ -284,19 +272,19 @@ public final List getCoachedParticipants() { return this.coachedParticipants; } - public final ConferenceParticipant.Region getParticipantRegion() { + public final Region getParticipantRegion() { return this.participantRegion; } - public final ConferenceParticipant.Region getConferenceRegion() { + public final Region getConferenceRegion() { return this.conferenceRegion; } - public final ConferenceParticipant.CallType getCallType() { + public final CallType getCallType() { return this.callType; } - public final ConferenceParticipant.ProcessingState getProcessingState() { + public final ProcessingState getProcessingState() { return this.processingState; } diff --git a/src/main/java/com/twilio/rest/insights/v1/room/Participant.java b/src/main/java/com/twilio/rest/insights/v1/room/Participant.java index db0b8b2325..bef00bd135 100644 --- a/src/main/java/com/twilio/rest/insights/v1/room/Participant.java +++ b/src/main/java/com/twilio/rest/insights/v1/room/Participant.java @@ -103,14 +103,14 @@ public static Participant fromJson( private final Long durationSec; private final String accountSid; private final String roomSid; - private final Participant.RoomStatus status; - private final List codecs; + private final RoomStatus status; + private final List codecs; private final String endReason; private final Integer errorCode; private final String errorCodeUrl; - private final Participant.TwilioRealm mediaRegion; + private final TwilioRealm mediaRegion; private final Map properties; - private final Participant.EdgeLocation edgeLocation; + private final EdgeLocation edgeLocation; private final Map publisherInfo; private final URI url; @@ -123,16 +123,14 @@ private Participant( @JsonProperty("duration_sec") final Long durationSec, @JsonProperty("account_sid") final String accountSid, @JsonProperty("room_sid") final String roomSid, - @JsonProperty("status") final Participant.RoomStatus status, - @JsonProperty("codecs") final List codecs, + @JsonProperty("status") final RoomStatus status, + @JsonProperty("codecs") final List codecs, @JsonProperty("end_reason") final String endReason, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("error_code_url") final String errorCodeUrl, - @JsonProperty("media_region") final Participant.TwilioRealm mediaRegion, + @JsonProperty("media_region") final TwilioRealm mediaRegion, @JsonProperty("properties") final Map properties, - @JsonProperty( - "edge_location" - ) final Participant.EdgeLocation edgeLocation, + @JsonProperty("edge_location") final EdgeLocation edgeLocation, @JsonProperty("publisher_info") final Map publisherInfo, @JsonProperty("url") final URI url ) { @@ -183,11 +181,11 @@ public final String getRoomSid() { return this.roomSid; } - public final Participant.RoomStatus getStatus() { + public final RoomStatus getStatus() { return this.status; } - public final List getCodecs() { + public final List getCodecs() { return this.codecs; } @@ -203,7 +201,7 @@ public final String getErrorCodeUrl() { return this.errorCodeUrl; } - public final Participant.TwilioRealm getMediaRegion() { + public final TwilioRealm getMediaRegion() { return this.mediaRegion; } @@ -211,7 +209,7 @@ public final Map getProperties() { return this.properties; } - public final Participant.EdgeLocation getEdgeLocation() { + public final EdgeLocation getEdgeLocation() { return this.edgeLocation; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/CustomOperator.java b/src/main/java/com/twilio/rest/intelligence/v2/CustomOperator.java index fa1df6c2b0..ca2d94f285 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/CustomOperator.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/CustomOperator.java @@ -44,7 +44,7 @@ public class CustomOperator extends Resource { public static CustomOperatorCreator creator( final String friendlyName, final String operatorType, - final Map config + final Object config ) { return new CustomOperatorCreator(friendlyName, operatorType, config); } @@ -64,7 +64,7 @@ public static CustomOperatorReader reader() { public static CustomOperatorUpdater updater( final String pathSid, final String friendlyName, - final Map config + final Object config ) { return new CustomOperatorUpdater(pathSid, friendlyName, config); } @@ -119,7 +119,7 @@ public static CustomOperator fromJson( private final String author; private final String operatorType; private final Integer version; - private final CustomOperator.Availability availability; + private final Availability availability; private final Map config; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -134,9 +134,7 @@ private CustomOperator( @JsonProperty("author") final String author, @JsonProperty("operator_type") final String operatorType, @JsonProperty("version") final Integer version, - @JsonProperty( - "availability" - ) final CustomOperator.Availability availability, + @JsonProperty("availability") final Availability availability, @JsonProperty("config") final Map config, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -184,7 +182,7 @@ public final Integer getVersion() { return this.version; } - public final CustomOperator.Availability getAvailability() { + public final Availability getAvailability() { return this.availability; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/CustomOperatorCreator.java b/src/main/java/com/twilio/rest/intelligence/v2/CustomOperatorCreator.java index 1f8707d982..85535d3191 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/CustomOperatorCreator.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/CustomOperatorCreator.java @@ -26,19 +26,17 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class CustomOperatorCreator extends Creator { private String friendlyName; private String operatorType; - private Map config; + private Object config; public CustomOperatorCreator( final String friendlyName, final String operatorType, - final Map config + final Object config ) { this.friendlyName = friendlyName; this.operatorType = operatorType; @@ -55,7 +53,7 @@ public CustomOperatorCreator setOperatorType(final String operatorType) { return this; } - public CustomOperatorCreator setConfig(final Map config) { + public CustomOperatorCreator setConfig(final Object config) { this.config = config; return this; } @@ -116,7 +114,7 @@ private void addPostParams(final Request request) { request.addPostParam("OperatorType", operatorType); } if (config != null) { - request.addPostParam("Config", Converter.mapToJson(config)); + request.addPostParam("Config", Converter.objectToJson(config)); } } } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/CustomOperatorUpdater.java b/src/main/java/com/twilio/rest/intelligence/v2/CustomOperatorUpdater.java index 45dbf98813..73c396b60d 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/CustomOperatorUpdater.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/CustomOperatorUpdater.java @@ -25,19 +25,18 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class CustomOperatorUpdater extends Updater { private String pathSid; private String friendlyName; - private Map config; + private Object config; private String ifMatch; public CustomOperatorUpdater( final String pathSid, final String friendlyName, - final Map config + final Object config ) { this.pathSid = pathSid; this.friendlyName = friendlyName; @@ -49,7 +48,7 @@ public CustomOperatorUpdater setFriendlyName(final String friendlyName) { return this; } - public CustomOperatorUpdater setConfig(final Map config) { + public CustomOperatorUpdater setConfig(final Object config) { this.config = config; return this; } @@ -109,7 +108,7 @@ private void addPostParams(final Request request) { request.addPostParam("FriendlyName", friendlyName); } if (config != null) { - request.addPostParam("Config", Converter.mapToJson(config)); + request.addPostParam("Config", Converter.objectToJson(config)); } } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/Operator.java b/src/main/java/com/twilio/rest/intelligence/v2/Operator.java index a9c425c153..d5d656a4ed 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/Operator.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/Operator.java @@ -99,7 +99,7 @@ public static Operator fromJson( private final String author; private final String operatorType; private final Integer version; - private final Operator.Availability availability; + private final Availability availability; private final Map config; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -114,7 +114,7 @@ private Operator( @JsonProperty("author") final String author, @JsonProperty("operator_type") final String operatorType, @JsonProperty("version") final Integer version, - @JsonProperty("availability") final Operator.Availability availability, + @JsonProperty("availability") final Availability availability, @JsonProperty("config") final Map config, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -162,7 +162,7 @@ public final Integer getVersion() { return this.version; } - public final Operator.Availability getAvailability() { + public final Availability getAvailability() { return this.availability; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/OperatorType.java b/src/main/java/com/twilio/rest/intelligence/v2/OperatorType.java index 566ab5cb66..03d6717137 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/OperatorType.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/OperatorType.java @@ -98,10 +98,10 @@ public static OperatorType fromJson( private final String friendlyName; private final String description; private final URI docsLink; - private final OperatorType.OutputType outputType; + private final OutputType outputType; private final List supportedLanguages; - private final OperatorType.Provider provider; - private final OperatorType.Availability availability; + private final Provider provider; + private final Availability availability; private final Boolean configurable; private final Map configSchema; private final ZonedDateTime dateCreated; @@ -115,14 +115,12 @@ private OperatorType( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("description") final String description, @JsonProperty("docs_link") final URI docsLink, - @JsonProperty("output_type") final OperatorType.OutputType outputType, + @JsonProperty("output_type") final OutputType outputType, @JsonProperty("supported_languages") final List< String > supportedLanguages, - @JsonProperty("provider") final OperatorType.Provider provider, - @JsonProperty( - "availability" - ) final OperatorType.Availability availability, + @JsonProperty("provider") final Provider provider, + @JsonProperty("availability") final Availability availability, @JsonProperty("configurable") final Boolean configurable, @JsonProperty("config_schema") final Map configSchema, @JsonProperty("date_created") final String dateCreated, @@ -165,7 +163,7 @@ public final URI getDocsLink() { return this.docsLink; } - public final OperatorType.OutputType getOutputType() { + public final OutputType getOutputType() { return this.outputType; } @@ -173,11 +171,11 @@ public final List getSupportedLanguages() { return this.supportedLanguages; } - public final OperatorType.Provider getProvider() { + public final Provider getProvider() { return this.provider; } - public final OperatorType.Availability getAvailability() { + public final Availability getAvailability() { return this.availability; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/PrebuiltOperator.java b/src/main/java/com/twilio/rest/intelligence/v2/PrebuiltOperator.java index c9b414a546..9d2fc4e69c 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/PrebuiltOperator.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/PrebuiltOperator.java @@ -99,7 +99,7 @@ public static PrebuiltOperator fromJson( private final String author; private final String operatorType; private final Integer version; - private final PrebuiltOperator.Availability availability; + private final Availability availability; private final Map config; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -114,9 +114,7 @@ private PrebuiltOperator( @JsonProperty("author") final String author, @JsonProperty("operator_type") final String operatorType, @JsonProperty("version") final Integer version, - @JsonProperty( - "availability" - ) final PrebuiltOperator.Availability availability, + @JsonProperty("availability") final Availability availability, @JsonProperty("config") final Map config, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -164,7 +162,7 @@ public final Integer getVersion() { return this.version; } - public final PrebuiltOperator.Availability getAvailability() { + public final Availability getAvailability() { return this.availability; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/Service.java b/src/main/java/com/twilio/rest/intelligence/v2/Service.java index 6a14108124..b72a89dcaa 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/Service.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/Service.java @@ -117,7 +117,7 @@ public static Service fromJson( private final String uniqueName; private final URI url; private final String webhookUrl; - private final Service.HttpMethod webhookHttpMethod; + private final HttpMethod webhookHttpMethod; private final List readOnlyAttachedOperatorSids; private final Integer version; @@ -136,9 +136,7 @@ private Service( @JsonProperty("unique_name") final String uniqueName, @JsonProperty("url") final URI url, @JsonProperty("webhook_url") final String webhookUrl, - @JsonProperty( - "webhook_http_method" - ) final Service.HttpMethod webhookHttpMethod, + @JsonProperty("webhook_http_method") final HttpMethod webhookHttpMethod, @JsonProperty("read_only_attached_operator_sids") final List< String > readOnlyAttachedOperatorSids, @@ -214,7 +212,7 @@ public final String getWebhookUrl() { return this.webhookUrl; } - public final Service.HttpMethod getWebhookHttpMethod() { + public final HttpMethod getWebhookHttpMethod() { return this.webhookHttpMethod; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/Transcript.java b/src/main/java/com/twilio/rest/intelligence/v2/Transcript.java index fa0fddb1df..5ef033357a 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/Transcript.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/Transcript.java @@ -43,7 +43,7 @@ public class Transcript extends Resource { public static TranscriptCreator creator( final String serviceSid, - final Map channel + final Object channel ) { return new TranscriptCreator(serviceSid, channel); } @@ -108,7 +108,7 @@ public static Transcript fromJson( private final String sid; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; - private final Transcript.Status status; + private final Status status; private final Map channel; private final Boolean dataLogging; private final String languageCode; @@ -126,7 +126,7 @@ private Transcript( @JsonProperty("sid") final String sid, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, - @JsonProperty("status") final Transcript.Status status, + @JsonProperty("status") final Status status, @JsonProperty("channel") final Map channel, @JsonProperty("data_logging") final Boolean dataLogging, @JsonProperty("language_code") final String languageCode, @@ -175,7 +175,7 @@ public final ZonedDateTime getDateUpdated() { return this.dateUpdated; } - public final Transcript.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/TranscriptCreator.java b/src/main/java/com/twilio/rest/intelligence/v2/TranscriptCreator.java index 8ab04ae15c..7a9249f442 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/TranscriptCreator.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/TranscriptCreator.java @@ -27,20 +27,15 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; import java.time.ZonedDateTime; -import java.util.Map; -import java.util.Map; public class TranscriptCreator extends Creator { private String serviceSid; - private Map channel; + private Object channel; private String customerKey; private ZonedDateTime mediaStartTime; - public TranscriptCreator( - final String serviceSid, - final Map channel - ) { + public TranscriptCreator(final String serviceSid, final Object channel) { this.serviceSid = serviceSid; this.channel = channel; } @@ -50,7 +45,7 @@ public TranscriptCreator setServiceSid(final String serviceSid) { return this; } - public TranscriptCreator setChannel(final Map channel) { + public TranscriptCreator setChannel(final Object channel) { this.channel = channel; return this; } @@ -112,7 +107,7 @@ private void addPostParams(final Request request) { request.addPostParam("ServiceSid", serviceSid); } if (channel != null) { - request.addPostParam("Channel", Converter.mapToJson(channel)); + request.addPostParam("Channel", Converter.objectToJson(channel)); } if (customerKey != null) { request.addPostParam("CustomerKey", customerKey); diff --git a/src/main/java/com/twilio/rest/intelligence/v2/transcript/OperatorResult.java b/src/main/java/com/twilio/rest/intelligence/v2/transcript/OperatorResult.java index 8e734ee75a..6ceb37f984 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/transcript/OperatorResult.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/transcript/OperatorResult.java @@ -95,7 +95,7 @@ public static OperatorResult fromJson( } } - private final OperatorResult.OperatorType operatorType; + private final OperatorType operatorType; private final String name; private final String operatorSid; private final Boolean extractMatch; @@ -114,9 +114,7 @@ public static OperatorResult fromJson( @JsonCreator private OperatorResult( - @JsonProperty( - "operator_type" - ) final OperatorResult.OperatorType operatorType, + @JsonProperty("operator_type") final OperatorType operatorType, @JsonProperty("name") final String name, @JsonProperty("operator_sid") final String operatorSid, @JsonProperty("extract_match") final Boolean extractMatch, @@ -164,7 +162,7 @@ private OperatorResult( this.url = url; } - public final OperatorResult.OperatorType getOperatorType() { + public final OperatorType getOperatorType() { return this.operatorType; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v1/Credential.java b/src/main/java/com/twilio/rest/ipmessaging/v1/Credential.java index c18921f709..00a5ede142 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v1/Credential.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v1/Credential.java @@ -39,7 +39,7 @@ public class Credential extends Resource { private static final long serialVersionUID = 161183169234848L; - public static CredentialCreator creator(final Credential.PushService type) { + public static CredentialCreator creator(final PushService type) { return new CredentialCreator(type); } @@ -105,7 +105,7 @@ public static Credential fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final Credential.PushService type; + private final PushService type; private final String sandbox; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -116,7 +116,7 @@ private Credential( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final Credential.PushService type, + @JsonProperty("type") final PushService type, @JsonProperty("sandbox") final String sandbox, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Credential.PushService getType() { + public final PushService getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v1/service/Channel.java b/src/main/java/com/twilio/rest/ipmessaging/v1/service/Channel.java index 716231236c..3e872e729e 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v1/service/Channel.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v1/service/Channel.java @@ -119,7 +119,7 @@ public static Channel fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final Channel.ChannelType type; + private final ChannelType type; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; @@ -136,7 +136,7 @@ private Channel( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("type") final Channel.ChannelType type, + @JsonProperty("type") final ChannelType type, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("created_by") final String createdBy, @@ -185,7 +185,7 @@ public final String getAttributes() { return this.attributes; } - public final Channel.ChannelType getType() { + public final ChannelType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v1/service/Role.java b/src/main/java/com/twilio/rest/ipmessaging/v1/service/Role.java index 85ffef93d3..cca17cdc8e 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v1/service/Role.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v1/service/Role.java @@ -43,7 +43,7 @@ public class Role extends Resource { public static RoleCreator creator( final String pathServiceSid, final String friendlyName, - final Role.RoleType type, + final RoleType type, final List permission ) { return new RoleCreator(pathServiceSid, friendlyName, type, permission); @@ -122,7 +122,7 @@ public static Role fromJson( private final String accountSid; private final String serviceSid; private final String friendlyName; - private final Role.RoleType type; + private final RoleType type; private final List permissions; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -134,7 +134,7 @@ private Role( @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final Role.RoleType type, + @JsonProperty("type") final RoleType type, @JsonProperty("permissions") final List permissions, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -167,7 +167,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Role.RoleType getType() { + public final RoleType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v1/service/user/UserChannel.java b/src/main/java/com/twilio/rest/ipmessaging/v1/service/user/UserChannel.java index 05ee6541e0..1aed0d0471 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v1/service/user/UserChannel.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v1/service/user/UserChannel.java @@ -92,7 +92,7 @@ public static UserChannel fromJson( private final String serviceSid; private final String channelSid; private final String memberSid; - private final UserChannel.ChannelStatus status; + private final ChannelStatus status; private final Integer lastConsumedMessageIndex; private final Integer unreadMessagesCount; private final Map links; @@ -103,7 +103,7 @@ private UserChannel( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("channel_sid") final String channelSid, @JsonProperty("member_sid") final String memberSid, - @JsonProperty("status") final UserChannel.ChannelStatus status, + @JsonProperty("status") final ChannelStatus status, @JsonProperty( "last_consumed_message_index" ) final Integer lastConsumedMessageIndex, @@ -138,7 +138,7 @@ public final String getMemberSid() { return this.memberSid; } - public final UserChannel.ChannelStatus getStatus() { + public final ChannelStatus getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/Credential.java b/src/main/java/com/twilio/rest/ipmessaging/v2/Credential.java index 9f6267c773..f7beefe431 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/Credential.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/Credential.java @@ -39,7 +39,7 @@ public class Credential extends Resource { private static final long serialVersionUID = 161183169234848L; - public static CredentialCreator creator(final Credential.PushService type) { + public static CredentialCreator creator(final PushService type) { return new CredentialCreator(type); } @@ -105,7 +105,7 @@ public static Credential fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final Credential.PushService type; + private final PushService type; private final String sandbox; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -116,7 +116,7 @@ private Credential( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final Credential.PushService type, + @JsonProperty("type") final PushService type, @JsonProperty("sandbox") final String sandbox, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Credential.PushService getType() { + public final PushService getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/service/Binding.java b/src/main/java/com/twilio/rest/ipmessaging/v2/service/Binding.java index 3004b0a963..fecd63144c 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/service/Binding.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/service/Binding.java @@ -111,7 +111,7 @@ public static Binding fromJson( private final String endpoint; private final String identity; private final String credentialSid; - private final Binding.BindingType bindingType; + private final BindingType bindingType; private final List messageTypes; private final URI url; private final Map links; @@ -126,7 +126,7 @@ private Binding( @JsonProperty("endpoint") final String endpoint, @JsonProperty("identity") final String identity, @JsonProperty("credential_sid") final String credentialSid, - @JsonProperty("binding_type") final Binding.BindingType bindingType, + @JsonProperty("binding_type") final BindingType bindingType, @JsonProperty("message_types") final List messageTypes, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links @@ -177,7 +177,7 @@ public final String getCredentialSid() { return this.credentialSid; } - public final Binding.BindingType getBindingType() { + public final BindingType getBindingType() { return this.bindingType; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/service/Channel.java b/src/main/java/com/twilio/rest/ipmessaging/v2/service/Channel.java index 19ae5463c6..8b738c76e5 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/service/Channel.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/service/Channel.java @@ -119,7 +119,7 @@ public static Channel fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final Channel.ChannelType type; + private final ChannelType type; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; @@ -136,7 +136,7 @@ private Channel( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("type") final Channel.ChannelType type, + @JsonProperty("type") final ChannelType type, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("created_by") final String createdBy, @@ -185,7 +185,7 @@ public final String getAttributes() { return this.attributes; } - public final Channel.ChannelType getType() { + public final ChannelType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/service/Role.java b/src/main/java/com/twilio/rest/ipmessaging/v2/service/Role.java index 3f44c5de6f..b36d8e3ae7 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/service/Role.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/service/Role.java @@ -43,7 +43,7 @@ public class Role extends Resource { public static RoleCreator creator( final String pathServiceSid, final String friendlyName, - final Role.RoleType type, + final RoleType type, final List permission ) { return new RoleCreator(pathServiceSid, friendlyName, type, permission); @@ -122,7 +122,7 @@ public static Role fromJson( private final String accountSid; private final String serviceSid; private final String friendlyName; - private final Role.RoleType type; + private final RoleType type; private final List permissions; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -134,7 +134,7 @@ private Role( @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final Role.RoleType type, + @JsonProperty("type") final RoleType type, @JsonProperty("permissions") final List permissions, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -167,7 +167,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Role.RoleType getType() { + public final RoleType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/service/channel/Webhook.java b/src/main/java/com/twilio/rest/ipmessaging/v2/service/channel/Webhook.java index e4202e4268..8674cc57fc 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/service/channel/Webhook.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/service/channel/Webhook.java @@ -44,7 +44,7 @@ public class Webhook extends Resource { public static WebhookCreator creator( final String pathServiceSid, final String pathChannelSid, - final Webhook.Type type + final Type type ) { return new WebhookCreator(pathServiceSid, pathChannelSid, type); } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserBinding.java b/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserBinding.java index e43512d118..a9ccdfface 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserBinding.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserBinding.java @@ -115,7 +115,7 @@ public static UserBinding fromJson( private final String identity; private final String userSid; private final String credentialSid; - private final UserBinding.BindingType bindingType; + private final BindingType bindingType; private final List messageTypes; private final URI url; @@ -130,7 +130,7 @@ private UserBinding( @JsonProperty("identity") final String identity, @JsonProperty("user_sid") final String userSid, @JsonProperty("credential_sid") final String credentialSid, - @JsonProperty("binding_type") final UserBinding.BindingType bindingType, + @JsonProperty("binding_type") final BindingType bindingType, @JsonProperty("message_types") final List messageTypes, @JsonProperty("url") final URI url ) { @@ -184,7 +184,7 @@ public final String getCredentialSid() { return this.credentialSid; } - public final UserBinding.BindingType getBindingType() { + public final BindingType getBindingType() { return this.bindingType; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserChannel.java b/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserChannel.java index 780eca1a29..5b8761e478 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserChannel.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserChannel.java @@ -130,12 +130,12 @@ public static UserChannel fromJson( private final String channelSid; private final String userSid; private final String memberSid; - private final UserChannel.ChannelStatus status; + private final ChannelStatus status; private final Integer lastConsumedMessageIndex; private final Integer unreadMessagesCount; private final Map links; private final URI url; - private final UserChannel.NotificationLevel notificationLevel; + private final NotificationLevel notificationLevel; @JsonCreator private UserChannel( @@ -144,7 +144,7 @@ private UserChannel( @JsonProperty("channel_sid") final String channelSid, @JsonProperty("user_sid") final String userSid, @JsonProperty("member_sid") final String memberSid, - @JsonProperty("status") final UserChannel.ChannelStatus status, + @JsonProperty("status") final ChannelStatus status, @JsonProperty( "last_consumed_message_index" ) final Integer lastConsumedMessageIndex, @@ -155,7 +155,7 @@ private UserChannel( @JsonProperty("url") final URI url, @JsonProperty( "notification_level" - ) final UserChannel.NotificationLevel notificationLevel + ) final NotificationLevel notificationLevel ) { this.accountSid = accountSid; this.serviceSid = serviceSid; @@ -190,7 +190,7 @@ public final String getMemberSid() { return this.memberSid; } - public final UserChannel.ChannelStatus getStatus() { + public final ChannelStatus getStatus() { return this.status; } @@ -210,7 +210,7 @@ public final URI getUrl() { return this.url; } - public final UserChannel.NotificationLevel getNotificationLevel() { + public final NotificationLevel getNotificationLevel() { return this.notificationLevel; } diff --git a/src/main/java/com/twilio/rest/knowledge/v1/Knowledge.java b/src/main/java/com/twilio/rest/knowledge/v1/Knowledge.java index a2a7a572e3..4e6b69d6a9 100644 --- a/src/main/java/com/twilio/rest/knowledge/v1/Knowledge.java +++ b/src/main/java/com/twilio/rest/knowledge/v1/Knowledge.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.twilio.base.Resource; -import com.twilio.converter.Converter; import com.twilio.converter.DateConverter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; @@ -71,10 +70,6 @@ public static class KnowledgeV1ServiceCreatePolicyRequest { @Setter private Object policyDetails; - public String getPolicyDetails() { - return Converter.objectToJson(policyDetails); - } - @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("type") @Getter @@ -107,10 +102,6 @@ public static class KnowledgeV1ServiceCreateKnowledgeRequest { @Setter private Map knowledgeSourceDetails; - public String getKnowledgeSourceDetails() { - return Converter.mapToJson(knowledgeSourceDetails); - } - @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("name") @Getter @@ -135,7 +126,13 @@ public String getKnowledgeSourceDetails() { @Setter private String embeddingModel; - public KnowledgeV1ServiceCreateKnowledgeRequest() {} + public KnowledgeV1ServiceCreateKnowledgeRequest( + final String name, + final String type + ) { + this.name = name; + this.type = type; + } public static KnowledgeV1ServiceCreateKnowledgeRequest fromJson( String jsonString, @@ -163,10 +160,6 @@ public static class KnowledgeV1ServiceUpdateKnowledgeRequest { @Setter private Map knowledgeSourceDetails; - public String getKnowledgeSourceDetails() { - return Converter.mapToJson(knowledgeSourceDetails); - } - @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("name") @Getter @@ -205,7 +198,7 @@ public static KnowledgeV1ServiceUpdateKnowledgeRequest fromJson( } public static KnowledgeCreator creator( - final Knowledge.KnowledgeV1ServiceCreateKnowledgeRequest knowledgeV1ServiceCreateKnowledgeRequest + final KnowledgeV1ServiceCreateKnowledgeRequest knowledgeV1ServiceCreateKnowledgeRequest ) { return new KnowledgeCreator(knowledgeV1ServiceCreateKnowledgeRequest); } diff --git a/src/main/java/com/twilio/rest/lookups/v2/PhoneNumber.java b/src/main/java/com/twilio/rest/lookups/v2/PhoneNumber.java index 0bed3d57d4..4b25a770ee 100644 --- a/src/main/java/com/twilio/rest/lookups/v2/PhoneNumber.java +++ b/src/main/java/com/twilio/rest/lookups/v2/PhoneNumber.java @@ -92,7 +92,7 @@ public static PhoneNumber fromJson( private final com.twilio.type.PhoneNumber phoneNumber; private final String nationalFormat; private final Boolean valid; - private final List validationErrors; + private final List validationErrors; private final Map callerName; private final Map simSwap; private final Map callForwarding; @@ -115,7 +115,7 @@ private PhoneNumber( @JsonProperty("national_format") final String nationalFormat, @JsonProperty("valid") final Boolean valid, @JsonProperty("validation_errors") final List< - PhoneNumber.ValidationError + ValidationError > validationErrors, @JsonProperty("caller_name") final Map callerName, @JsonProperty("sim_swap") final Map simSwap, @@ -183,7 +183,7 @@ public final Boolean getValid() { return this.valid; } - public final List getValidationErrors() { + public final List getValidationErrors() { return this.validationErrors; } diff --git a/src/main/java/com/twilio/rest/marketplace/v1/ReferralConversion.java b/src/main/java/com/twilio/rest/marketplace/v1/ReferralConversion.java index 2981e42916..4210a1e21c 100644 --- a/src/main/java/com/twilio/rest/marketplace/v1/ReferralConversion.java +++ b/src/main/java/com/twilio/rest/marketplace/v1/ReferralConversion.java @@ -62,7 +62,7 @@ public static CreateReferralConversionRequest fromJson( } public static ReferralConversionCreator creator( - final ReferralConversion.CreateReferralConversionRequest createReferralConversionRequest + final CreateReferralConversionRequest createReferralConversionRequest ) { return new ReferralConversionCreator(createReferralConversionRequest); } diff --git a/src/main/java/com/twilio/rest/marketplace/v1/installedaddon/InstalledAddOnUsage.java b/src/main/java/com/twilio/rest/marketplace/v1/installedaddon/InstalledAddOnUsage.java index 26949939ae..02d957a065 100644 --- a/src/main/java/com/twilio/rest/marketplace/v1/installedaddon/InstalledAddOnUsage.java +++ b/src/main/java/com/twilio/rest/marketplace/v1/installedaddon/InstalledAddOnUsage.java @@ -111,7 +111,7 @@ public static MarketplaceV1InstalledAddOnInstalledAddOnUsage fromJson( public static InstalledAddOnUsageCreator creator( final String pathInstalledAddOnSid, - final InstalledAddOnUsage.MarketplaceV1InstalledAddOnInstalledAddOnUsage marketplaceV1InstalledAddOnInstalledAddOnUsage + final MarketplaceV1InstalledAddOnInstalledAddOnUsage marketplaceV1InstalledAddOnInstalledAddOnUsage ) { return new InstalledAddOnUsageCreator( pathInstalledAddOnSid, diff --git a/src/main/java/com/twilio/rest/messaging/v1/BrandRegistration.java b/src/main/java/com/twilio/rest/messaging/v1/BrandRegistration.java index 1f04545099..a485f926b2 100644 --- a/src/main/java/com/twilio/rest/messaging/v1/BrandRegistration.java +++ b/src/main/java/com/twilio/rest/messaging/v1/BrandRegistration.java @@ -114,14 +114,14 @@ public static BrandRegistration fromJson( private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String brandType; - private final BrandRegistration.Status status; + private final Status status; private final String tcrId; private final String failureReason; private final List> errors; private final URI url; private final Integer brandScore; - private final List brandFeedback; - private final BrandRegistration.IdentityStatus identityStatus; + private final List brandFeedback; + private final IdentityStatus identityStatus; private final Boolean russell3000; private final Boolean governmentEntity; private final String taxExemptStatus; @@ -142,18 +142,14 @@ private BrandRegistration( @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("brand_type") final String brandType, - @JsonProperty("status") final BrandRegistration.Status status, + @JsonProperty("status") final Status status, @JsonProperty("tcr_id") final String tcrId, @JsonProperty("failure_reason") final String failureReason, @JsonProperty("errors") final List> errors, @JsonProperty("url") final URI url, @JsonProperty("brand_score") final Integer brandScore, - @JsonProperty("brand_feedback") final List< - BrandRegistration.BrandFeedback - > brandFeedback, - @JsonProperty( - "identity_status" - ) final BrandRegistration.IdentityStatus identityStatus, + @JsonProperty("brand_feedback") final List brandFeedback, + @JsonProperty("identity_status") final IdentityStatus identityStatus, @JsonProperty("russell3000") final Boolean russell3000, @JsonProperty("government_entity") final Boolean governmentEntity, @JsonProperty("tax_exempt_status") final String taxExemptStatus, @@ -214,7 +210,7 @@ public final String getBrandType() { return this.brandType; } - public final BrandRegistration.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -238,11 +234,11 @@ public final Integer getBrandScore() { return this.brandScore; } - public final List getBrandFeedback() { + public final List getBrandFeedback() { return this.brandFeedback; } - public final BrandRegistration.IdentityStatus getIdentityStatus() { + public final IdentityStatus getIdentityStatus() { return this.identityStatus; } diff --git a/src/main/java/com/twilio/rest/messaging/v1/Service.java b/src/main/java/com/twilio/rest/messaging/v1/Service.java index 3775bf4572..9d320105f4 100644 --- a/src/main/java/com/twilio/rest/messaging/v1/Service.java +++ b/src/main/java/com/twilio/rest/messaging/v1/Service.java @@ -118,7 +118,7 @@ public static Service fromJson( private final Boolean stickySender; private final Boolean mmsConverter; private final Boolean smartEncoding; - private final Service.ScanMessageContent scanMessageContent; + private final ScanMessageContent scanMessageContent; private final Boolean fallbackToLongCode; private final Boolean areaCodeGeomatch; private final Boolean synchronousValidation; @@ -146,7 +146,7 @@ private Service( @JsonProperty("smart_encoding") final Boolean smartEncoding, @JsonProperty( "scan_message_content" - ) final Service.ScanMessageContent scanMessageContent, + ) final ScanMessageContent scanMessageContent, @JsonProperty("fallback_to_long_code") final Boolean fallbackToLongCode, @JsonProperty("area_code_geomatch") final Boolean areaCodeGeomatch, @JsonProperty( @@ -240,7 +240,7 @@ public final Boolean getSmartEncoding() { return this.smartEncoding; } - public final Service.ScanMessageContent getScanMessageContent() { + public final ScanMessageContent getScanMessageContent() { return this.scanMessageContent; } diff --git a/src/main/java/com/twilio/rest/messaging/v1/TollfreeVerification.java b/src/main/java/com/twilio/rest/messaging/v1/TollfreeVerification.java index da3ddb6f84..2a189ab49f 100644 --- a/src/main/java/com/twilio/rest/messaging/v1/TollfreeVerification.java +++ b/src/main/java/com/twilio/rest/messaging/v1/TollfreeVerification.java @@ -50,7 +50,7 @@ public static TollfreeVerificationCreator creator( final String useCaseSummary, final String productionMessageSample, final List optInImageUrls, - final TollfreeVerification.OptInType optInType, + final OptInType optInType, final String messageVolume, final String tollfreePhoneNumberSid ) { @@ -151,11 +151,11 @@ public static TollfreeVerification fromJson( private final String useCaseSummary; private final String productionMessageSample; private final List optInImageUrls; - private final TollfreeVerification.OptInType optInType; + private final OptInType optInType; private final String messageVolume; private final String additionalInformation; private final String tollfreePhoneNumberSid; - private final TollfreeVerification.Status status; + private final Status status; private final URI url; private final String rejectionReason; private final Integer errorCode; @@ -209,9 +209,7 @@ private TollfreeVerification( "production_message_sample" ) final String productionMessageSample, @JsonProperty("opt_in_image_urls") final List optInImageUrls, - @JsonProperty( - "opt_in_type" - ) final TollfreeVerification.OptInType optInType, + @JsonProperty("opt_in_type") final OptInType optInType, @JsonProperty("message_volume") final String messageVolume, @JsonProperty( "additional_information" @@ -219,7 +217,7 @@ private TollfreeVerification( @JsonProperty( "tollfree_phone_number_sid" ) final String tollfreePhoneNumberSid, - @JsonProperty("status") final TollfreeVerification.Status status, + @JsonProperty("status") final Status status, @JsonProperty("url") final URI url, @JsonProperty("rejection_reason") final String rejectionReason, @JsonProperty("error_code") final Integer errorCode, @@ -367,7 +365,7 @@ public final List getOptInImageUrls() { return this.optInImageUrls; } - public final TollfreeVerification.OptInType getOptInType() { + public final OptInType getOptInType() { return this.optInType; } @@ -383,7 +381,7 @@ public final String getTollfreePhoneNumberSid() { return this.tollfreePhoneNumberSid; } - public final TollfreeVerification.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/messaging/v1/brandregistration/BrandVetting.java b/src/main/java/com/twilio/rest/messaging/v1/brandregistration/BrandVetting.java index 7d7f8526b5..8c284bbaf7 100644 --- a/src/main/java/com/twilio/rest/messaging/v1/brandregistration/BrandVetting.java +++ b/src/main/java/com/twilio/rest/messaging/v1/brandregistration/BrandVetting.java @@ -41,7 +41,7 @@ public class BrandVetting extends Resource { public static BrandVettingCreator creator( final String pathBrandSid, - final BrandVetting.VettingProvider vettingProvider + final VettingProvider vettingProvider ) { return new BrandVettingCreator(pathBrandSid, vettingProvider); } @@ -108,7 +108,7 @@ public static BrandVetting fromJson( private final String vettingId; private final String vettingClass; private final String vettingStatus; - private final BrandVetting.VettingProvider vettingProvider; + private final VettingProvider vettingProvider; private final URI url; @JsonCreator @@ -121,9 +121,7 @@ private BrandVetting( @JsonProperty("vetting_id") final String vettingId, @JsonProperty("vetting_class") final String vettingClass, @JsonProperty("vetting_status") final String vettingStatus, - @JsonProperty( - "vetting_provider" - ) final BrandVetting.VettingProvider vettingProvider, + @JsonProperty("vetting_provider") final VettingProvider vettingProvider, @JsonProperty("url") final URI url ) { this.accountSid = accountSid; @@ -170,7 +168,7 @@ public final String getVettingStatus() { return this.vettingStatus; } - public final BrandVetting.VettingProvider getVettingProvider() { + public final VettingProvider getVettingProvider() { return this.vettingProvider; } diff --git a/src/main/java/com/twilio/rest/messaging/v2/ChannelsSender.java b/src/main/java/com/twilio/rest/messaging/v2/ChannelsSender.java index 0560e1d4ce..c2650d66d0 100644 --- a/src/main/java/com/twilio/rest/messaging/v2/ChannelsSender.java +++ b/src/main/java/com/twilio/rest/messaging/v2/ChannelsSender.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.twilio.base.Resource; -import com.twilio.converter.Converter; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; @@ -41,7 +40,7 @@ @ToString public class ChannelsSender extends Resource { - private static final long serialVersionUID = 42075077215889L; + private static final long serialVersionUID = 103954331986266L; @ToString public static class MessagingV2ChannelsSenderConfiguration { @@ -164,10 +163,6 @@ public static class MessagingV2ChannelsSenderProfile { @Setter private Object emails; - public String getEmails() { - return Converter.objectToJson(emails); - } - @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("logo_url") @Getter @@ -186,10 +181,6 @@ public String getEmails() { @Setter private Object websites; - public String getWebsites() { - return Converter.objectToJson(websites); - } - public static MessagingV2ChannelsSenderProfile fromJson( String jsonString, ObjectMapper mapper @@ -228,7 +219,9 @@ public static class MessagingV2ChannelsSenderRequestsCreate { @Setter private MessagingV2ChannelsSenderProfile profile; - public MessagingV2ChannelsSenderRequestsCreate() {} + public MessagingV2ChannelsSenderRequestsCreate(final String senderId) { + this.senderId = senderId; + } public static MessagingV2ChannelsSenderRequestsCreate fromJson( String jsonString, @@ -275,6 +268,120 @@ public static MessagingV2ChannelsSenderRequestsUpdate fromJson( } } + @ToString + public static class MessagingV2ChannelsSenderProfileResponseEmails { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("email") + @Getter + @Setter + private String email; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("label") + @Getter + @Setter + private String label; + + public static MessagingV2ChannelsSenderProfileResponseEmails fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue( + jsonString, + MessagingV2ChannelsSenderProfileResponseEmails.class + ); + } + } + + @ToString + public static class MessagingV2ChannelsSenderProfileResponseWebsites { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("website") + @Getter + @Setter + private String website; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("label") + @Getter + @Setter + private String label; + + public static MessagingV2ChannelsSenderProfileResponseWebsites fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue( + jsonString, + MessagingV2ChannelsSenderProfileResponseWebsites.class + ); + } + } + + @ToString + public static class MessagingV2ChannelsSenderProfileResponse { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("name") + @Getter + @Setter + private String name; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("about") + @Getter + @Setter + private String about; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("address") + @Getter + @Setter + private String address; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("description") + @Getter + @Setter + private String description; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("emails") + @Getter + @Setter + private List emails; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("logo_url") + @Getter + @Setter + private String logoUrl; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("vertical") + @Getter + @Setter + private String vertical; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("websites") + @Getter + @Setter + private List websites; + + public static MessagingV2ChannelsSenderProfileResponse fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue( + jsonString, + MessagingV2ChannelsSenderProfileResponse.class + ); + } + } + @ToString public static class MessagingV2ChannelsSenderProperties { @@ -334,7 +441,7 @@ public static MessagingV2ChannelsSenderOfflineReasonsItems fromJson( } public static ChannelsSenderCreator creator( - final ChannelsSender.MessagingV2ChannelsSenderRequestsCreate messagingV2ChannelsSenderRequestsCreate + final MessagingV2ChannelsSenderRequestsCreate messagingV2ChannelsSenderRequestsCreate ) { return new ChannelsSenderCreator( messagingV2ChannelsSenderRequestsCreate @@ -413,11 +520,11 @@ public static String toJson(Object object, ObjectMapper mapper) { } private final String sid; - private final ChannelsSender.Status status; + private final Status status; private final String senderId; private final MessagingV2ChannelsSenderConfiguration configuration; private final MessagingV2ChannelsSenderWebhook webhook; - private final MessagingV2ChannelsSenderProfile profile; + private final MessagingV2ChannelsSenderProfileResponse profile; private final MessagingV2ChannelsSenderProperties properties; private final List< MessagingV2ChannelsSenderOfflineReasonsItems @@ -427,13 +534,15 @@ public static String toJson(Object object, ObjectMapper mapper) { @JsonCreator private ChannelsSender( @JsonProperty("sid") final String sid, - @JsonProperty("status") final ChannelsSender.Status status, + @JsonProperty("status") final Status status, @JsonProperty("sender_id") final String senderId, @JsonProperty( "configuration" ) final MessagingV2ChannelsSenderConfiguration configuration, @JsonProperty("webhook") final MessagingV2ChannelsSenderWebhook webhook, - @JsonProperty("profile") final MessagingV2ChannelsSenderProfile profile, + @JsonProperty( + "profile" + ) final MessagingV2ChannelsSenderProfileResponse profile, @JsonProperty( "properties" ) final MessagingV2ChannelsSenderProperties properties, @@ -457,7 +566,7 @@ public final String getSid() { return this.sid; } - public final ChannelsSender.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -473,7 +582,7 @@ public final MessagingV2ChannelsSenderWebhook getWebhook() { return this.webhook; } - public final MessagingV2ChannelsSenderProfile getProfile() { + public final MessagingV2ChannelsSenderProfileResponse getProfile() { return this.profile; } diff --git a/src/main/java/com/twilio/rest/notify/v1/Credential.java b/src/main/java/com/twilio/rest/notify/v1/Credential.java index 316599eb29..26d2e47199 100644 --- a/src/main/java/com/twilio/rest/notify/v1/Credential.java +++ b/src/main/java/com/twilio/rest/notify/v1/Credential.java @@ -39,7 +39,7 @@ public class Credential extends Resource { private static final long serialVersionUID = 161183169234848L; - public static CredentialCreator creator(final Credential.PushService type) { + public static CredentialCreator creator(final PushService type) { return new CredentialCreator(type); } @@ -105,7 +105,7 @@ public static Credential fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final Credential.PushService type; + private final PushService type; private final String sandbox; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -116,7 +116,7 @@ private Credential( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final Credential.PushService type, + @JsonProperty("type") final PushService type, @JsonProperty("sandbox") final String sandbox, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Credential.PushService getType() { + public final PushService getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/notify/v1/service/Binding.java b/src/main/java/com/twilio/rest/notify/v1/service/Binding.java index a61e6c16e0..e5d9cf47db 100644 --- a/src/main/java/com/twilio/rest/notify/v1/service/Binding.java +++ b/src/main/java/com/twilio/rest/notify/v1/service/Binding.java @@ -45,7 +45,7 @@ public class Binding extends Resource { public static BindingCreator creator( final String pathServiceSid, final String identity, - final Binding.BindingType bindingType, + final BindingType bindingType, final String address ) { return new BindingCreator( diff --git a/src/main/java/com/twilio/rest/notify/v1/service/Notification.java b/src/main/java/com/twilio/rest/notify/v1/service/Notification.java index 432641c6cb..2fd78f20f6 100644 --- a/src/main/java/com/twilio/rest/notify/v1/service/Notification.java +++ b/src/main/java/com/twilio/rest/notify/v1/service/Notification.java @@ -95,7 +95,7 @@ public static Notification fromJson( private final List identities; private final List tags; private final List segments; - private final Notification.Priority priority; + private final Priority priority; private final Integer ttl; private final String title; private final String body; @@ -118,7 +118,7 @@ private Notification( @JsonProperty("identities") final List identities, @JsonProperty("tags") final List tags, @JsonProperty("segments") final List segments, - @JsonProperty("priority") final Notification.Priority priority, + @JsonProperty("priority") final Priority priority, @JsonProperty("ttl") final Integer ttl, @JsonProperty("title") final String title, @JsonProperty("body") final String body, @@ -185,7 +185,7 @@ public final List getSegments() { return this.segments; } - public final Notification.Priority getPriority() { + public final Priority getPriority() { return this.priority; } diff --git a/src/main/java/com/twilio/rest/notify/v1/service/NotificationCreator.java b/src/main/java/com/twilio/rest/notify/v1/service/NotificationCreator.java index c1debefd56..249e0f9685 100644 --- a/src/main/java/com/twilio/rest/notify/v1/service/NotificationCreator.java +++ b/src/main/java/com/twilio/rest/notify/v1/service/NotificationCreator.java @@ -29,8 +29,6 @@ import com.twilio.rest.Domains; import java.util.List; import java.util.List; -import java.util.Map; -import java.util.Map; public class NotificationCreator extends Creator { @@ -41,14 +39,14 @@ public class NotificationCreator extends Creator { private String title; private String sound; private String action; - private Map data; - private Map apn; - private Map gcm; - private Map sms; - private Map facebookMessenger; - private Map fcm; + private Object data; + private Object apn; + private Object gcm; + private Object sms; + private Object facebookMessenger; + private Object fcm; private List segment; - private Map alexa; + private Object alexa; private List toBinding; private String deliveryCallbackUrl; private List identity; @@ -90,34 +88,34 @@ public NotificationCreator setAction(final String action) { return this; } - public NotificationCreator setData(final Map data) { + public NotificationCreator setData(final Object data) { this.data = data; return this; } - public NotificationCreator setApn(final Map apn) { + public NotificationCreator setApn(final Object apn) { this.apn = apn; return this; } - public NotificationCreator setGcm(final Map gcm) { + public NotificationCreator setGcm(final Object gcm) { this.gcm = gcm; return this; } - public NotificationCreator setSms(final Map sms) { + public NotificationCreator setSms(final Object sms) { this.sms = sms; return this; } public NotificationCreator setFacebookMessenger( - final Map facebookMessenger + final Object facebookMessenger ) { this.facebookMessenger = facebookMessenger; return this; } - public NotificationCreator setFcm(final Map fcm) { + public NotificationCreator setFcm(final Object fcm) { this.fcm = fcm; return this; } @@ -131,7 +129,7 @@ public NotificationCreator setSegment(final String segment) { return setSegment(Promoter.listOfOne(segment)); } - public NotificationCreator setAlexa(final Map alexa) { + public NotificationCreator setAlexa(final Object alexa) { this.alexa = alexa; return this; } @@ -232,25 +230,25 @@ private void addPostParams(final Request request) { request.addPostParam("Action", action); } if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } if (apn != null) { - request.addPostParam("Apn", Converter.mapToJson(apn)); + request.addPostParam("Apn", Converter.objectToJson(apn)); } if (gcm != null) { - request.addPostParam("Gcm", Converter.mapToJson(gcm)); + request.addPostParam("Gcm", Converter.objectToJson(gcm)); } if (sms != null) { - request.addPostParam("Sms", Converter.mapToJson(sms)); + request.addPostParam("Sms", Converter.objectToJson(sms)); } if (facebookMessenger != null) { request.addPostParam( "FacebookMessenger", - Converter.mapToJson(facebookMessenger) + Converter.objectToJson(facebookMessenger) ); } if (fcm != null) { - request.addPostParam("Fcm", Converter.mapToJson(fcm)); + request.addPostParam("Fcm", Converter.objectToJson(fcm)); } if (segment != null) { for (String prop : segment) { @@ -258,7 +256,7 @@ private void addPostParams(final Request request) { } } if (alexa != null) { - request.addPostParam("Alexa", Converter.mapToJson(alexa)); + request.addPostParam("Alexa", Converter.objectToJson(alexa)); } if (toBinding != null) { for (String prop : toBinding) { diff --git a/src/main/java/com/twilio/rest/numbers/v1/PortingPortability.java b/src/main/java/com/twilio/rest/numbers/v1/PortingPortability.java index f047290739..1559a8f88f 100644 --- a/src/main/java/com/twilio/rest/numbers/v1/PortingPortability.java +++ b/src/main/java/com/twilio/rest/numbers/v1/PortingPortability.java @@ -92,7 +92,7 @@ public static PortingPortability fromJson( private final Boolean pinAndAccountNumberRequired; private final String notPortableReason; private final Integer notPortableReasonCode; - private final PortingPortability.NumberType numberType; + private final NumberType numberType; private final String country; private final URI url; @@ -110,9 +110,7 @@ private PortingPortability( @JsonProperty( "not_portable_reason_code" ) final Integer notPortableReasonCode, - @JsonProperty( - "number_type" - ) final PortingPortability.NumberType numberType, + @JsonProperty("number_type") final NumberType numberType, @JsonProperty("country") final String country, @JsonProperty("url") final URI url ) { @@ -151,7 +149,7 @@ public final Integer getNotPortableReasonCode() { return this.notPortableReasonCode; } - public final PortingPortability.NumberType getNumberType() { + public final NumberType getNumberType() { return this.numberType; } diff --git a/src/main/java/com/twilio/rest/numbers/v1/PortingPortabilityFetcher.java b/src/main/java/com/twilio/rest/numbers/v1/PortingPortabilityFetcher.java index eedc6e5dc1..3eec9d2bbe 100644 --- a/src/main/java/com/twilio/rest/numbers/v1/PortingPortabilityFetcher.java +++ b/src/main/java/com/twilio/rest/numbers/v1/PortingPortabilityFetcher.java @@ -56,7 +56,7 @@ public PortingPortability fetch(final TwilioRestClient client) { path = path.replace( "{" + "PhoneNumber" + "}", - this.pathPhoneNumber.encode("utf-8") + this.pathPhoneNumber.toString() ); Request request = new Request( diff --git a/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationDelete.java b/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationDelete.java index cec172e3a1..40d6a5d8e9 100644 --- a/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationDelete.java +++ b/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationDelete.java @@ -35,7 +35,7 @@ public class PortingWebhookConfigurationDelete extends Resource { private static final long serialVersionUID = 0L; public static PortingWebhookConfigurationDeleteDeleter deleter( - final PortingWebhookConfigurationDelete.WebhookType webhookType + final WebhookType webhookType ) { return new PortingWebhookConfigurationDeleteDeleter(webhookType); } diff --git a/src/main/java/com/twilio/rest/numbers/v2/AuthorizationDocument.java b/src/main/java/com/twilio/rest/numbers/v2/AuthorizationDocument.java index 0c3aa64569..e46f361687 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/AuthorizationDocument.java +++ b/src/main/java/com/twilio/rest/numbers/v2/AuthorizationDocument.java @@ -113,7 +113,7 @@ public static AuthorizationDocument fromJson( private final String sid; private final String addressSid; - private final AuthorizationDocument.Status status; + private final Status status; private final String email; private final List ccEmails; private final ZonedDateTime dateCreated; @@ -125,7 +125,7 @@ public static AuthorizationDocument fromJson( private AuthorizationDocument( @JsonProperty("sid") final String sid, @JsonProperty("address_sid") final String addressSid, - @JsonProperty("status") final AuthorizationDocument.Status status, + @JsonProperty("status") final Status status, @JsonProperty("email") final String email, @JsonProperty("cc_emails") final List ccEmails, @JsonProperty("date_created") final String dateCreated, @@ -152,7 +152,7 @@ public final String getAddressSid() { return this.addressSid; } - public final AuthorizationDocument.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/AuthorizationDocumentCreator.java b/src/main/java/com/twilio/rest/numbers/v2/AuthorizationDocumentCreator.java index fded505c8a..3e9f6c5dd8 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/AuthorizationDocumentCreator.java +++ b/src/main/java/com/twilio/rest/numbers/v2/AuthorizationDocumentCreator.java @@ -118,7 +118,7 @@ public AuthorizationDocument create(final TwilioRestClient client) { path = path.replace( "{" + "ContactPhoneNumber" + "}", - this.contactPhoneNumber.encode("utf-8") + this.contactPhoneNumber.toString() ); path = path.replace( diff --git a/src/main/java/com/twilio/rest/numbers/v2/BulkHostedNumberOrder.java b/src/main/java/com/twilio/rest/numbers/v2/BulkHostedNumberOrder.java index d491067489..a4d6136a15 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/BulkHostedNumberOrder.java +++ b/src/main/java/com/twilio/rest/numbers/v2/BulkHostedNumberOrder.java @@ -109,7 +109,7 @@ public static String toJson(Object object, ObjectMapper mapper) { } private final String bulkHostingSid; - private final BulkHostedNumberOrder.RequestStatus requestStatus; + private final RequestStatus requestStatus; private final String friendlyName; private final String notificationEmail; private final ZonedDateTime dateCreated; @@ -121,9 +121,7 @@ public static String toJson(Object object, ObjectMapper mapper) { @JsonCreator private BulkHostedNumberOrder( @JsonProperty("bulk_hosting_sid") final String bulkHostingSid, - @JsonProperty( - "request_status" - ) final BulkHostedNumberOrder.RequestStatus requestStatus, + @JsonProperty("request_status") final RequestStatus requestStatus, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("notification_email") final String notificationEmail, @JsonProperty("date_created") final String dateCreated, @@ -148,7 +146,7 @@ public final String getBulkHostingSid() { return this.bulkHostingSid; } - public final BulkHostedNumberOrder.RequestStatus getRequestStatus() { + public final RequestStatus getRequestStatus() { return this.requestStatus; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/BundleClone.java b/src/main/java/com/twilio/rest/numbers/v2/BundleClone.java index 8462b057d5..8f4376dfe5 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/BundleClone.java +++ b/src/main/java/com/twilio/rest/numbers/v2/BundleClone.java @@ -93,7 +93,7 @@ public static BundleClone fromJson( private final String accountSid; private final String regulationSid; private final String friendlyName; - private final BundleClone.Status status; + private final Status status; private final ZonedDateTime validUntil; private final String email; private final URI statusCallback; @@ -107,7 +107,7 @@ private BundleClone( @JsonProperty("account_sid") final String accountSid, @JsonProperty("regulation_sid") final String regulationSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final BundleClone.Status status, + @JsonProperty("status") final Status status, @JsonProperty("valid_until") final String validUntil, @JsonProperty("email") final String email, @JsonProperty("status_callback") final URI statusCallback, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final BundleClone.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/HostedNumberOrder.java b/src/main/java/com/twilio/rest/numbers/v2/HostedNumberOrder.java index 6363d99966..4b6531f726 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/HostedNumberOrder.java +++ b/src/main/java/com/twilio/rest/numbers/v2/HostedNumberOrder.java @@ -69,7 +69,7 @@ public static HostedNumberOrderReader reader() { public static HostedNumberOrderUpdater updater( final String pathSid, - final HostedNumberOrder.Status status + final Status status ) { return new HostedNumberOrderUpdater(pathSid, status); } @@ -125,7 +125,7 @@ public static HostedNumberOrder fromJson( private final com.twilio.type.PhoneNumber phoneNumber; private final PhoneNumberCapabilities capabilities; private final String friendlyName; - private final HostedNumberOrder.Status status; + private final Status status; private final String failureReason; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -141,7 +141,7 @@ public static HostedNumberOrder fromJson( private final Integer verificationCallDelay; private final String verificationCallExtension; private final String verificationCode; - private final HostedNumberOrder.VerificationType verificationType; + private final VerificationType verificationType; @JsonCreator private HostedNumberOrder( @@ -159,7 +159,7 @@ private HostedNumberOrder( "capabilities" ) final PhoneNumberCapabilities capabilities, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final HostedNumberOrder.Status status, + @JsonProperty("status") final Status status, @JsonProperty("failure_reason") final String failureReason, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -189,7 +189,7 @@ private HostedNumberOrder( @JsonProperty("verification_code") final String verificationCode, @JsonProperty( "verification_type" - ) final HostedNumberOrder.VerificationType verificationType + ) final VerificationType verificationType ) { this.sid = sid; this.accountSid = accountSid; @@ -250,7 +250,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final HostedNumberOrder.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -314,7 +314,7 @@ public final String getVerificationCode() { return this.verificationCode; } - public final HostedNumberOrder.VerificationType getVerificationType() { + public final VerificationType getVerificationType() { return this.verificationType; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/HostedNumberOrderCreator.java b/src/main/java/com/twilio/rest/numbers/v2/HostedNumberOrderCreator.java index 7de5551daf..1345e5ce8a 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/HostedNumberOrderCreator.java +++ b/src/main/java/com/twilio/rest/numbers/v2/HostedNumberOrderCreator.java @@ -196,12 +196,12 @@ public HostedNumberOrder create(final TwilioRestClient client) { path = path.replace( "{" + "PhoneNumber" + "}", - this.phoneNumber.encode("utf-8") + this.phoneNumber.toString() ); path = path.replace( "{" + "ContactPhoneNumber" + "}", - this.contactPhoneNumber.encode("utf-8") + this.contactPhoneNumber.toString() ); path = path.replace("{" + "AddressSid" + "}", this.addressSid.toString()); diff --git a/src/main/java/com/twilio/rest/numbers/v2/authorizationdocument/DependentHostedNumberOrder.java b/src/main/java/com/twilio/rest/numbers/v2/authorizationdocument/DependentHostedNumberOrder.java index 01b4345f77..c27f699fe5 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/authorizationdocument/DependentHostedNumberOrder.java +++ b/src/main/java/com/twilio/rest/numbers/v2/authorizationdocument/DependentHostedNumberOrder.java @@ -105,7 +105,7 @@ public static DependentHostedNumberOrder fromJson( private final com.twilio.type.PhoneNumber phoneNumber; private final PhoneNumberCapabilities capabilities; private final String friendlyName; - private final DependentHostedNumberOrder.Status status; + private final Status status; private final String failureReason; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -134,7 +134,7 @@ private DependentHostedNumberOrder( "capabilities" ) final PhoneNumberCapabilities capabilities, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final DependentHostedNumberOrder.Status status, + @JsonProperty("status") final Status status, @JsonProperty("failure_reason") final String failureReason, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -205,7 +205,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final DependentHostedNumberOrder.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Bundle.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Bundle.java index 9371ac3164..1245b44248 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Bundle.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Bundle.java @@ -111,7 +111,7 @@ public static Bundle fromJson( private final String accountSid; private final String regulationSid; private final String friendlyName; - private final Bundle.Status status; + private final Status status; private final ZonedDateTime validUntil; private final String email; private final URI statusCallback; @@ -126,7 +126,7 @@ private Bundle( @JsonProperty("account_sid") final String accountSid, @JsonProperty("regulation_sid") final String regulationSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final Bundle.Status status, + @JsonProperty("status") final Status status, @JsonProperty("valid_until") final String validUntil, @JsonProperty("email") final String email, @JsonProperty("status_callback") final URI statusCallback, @@ -165,7 +165,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Bundle.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUser.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUser.java index 6bfd90c4ab..57f8bc63d6 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUser.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUser.java @@ -43,7 +43,7 @@ public class EndUser extends Resource { public static EndUserCreator creator( final String friendlyName, - final EndUser.Type type + final Type type ) { return new EndUserCreator(friendlyName, type); } @@ -110,7 +110,7 @@ public static EndUser fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final EndUser.Type type; + private final Type type; private final Map attributes; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -121,7 +121,7 @@ private EndUser( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final EndUser.Type type, + @JsonProperty("type") final Type type, @JsonProperty("attributes") final Map attributes, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -149,7 +149,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final EndUser.Type getType() { + public final Type getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUserCreator.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUserCreator.java index 52ac79162d..9f301c0623 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUserCreator.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUserCreator.java @@ -26,14 +26,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class EndUserCreator extends Creator { private String friendlyName; private EndUser.Type type; - private Map attributes; + private Object attributes; public EndUserCreator(final String friendlyName, final EndUser.Type type) { this.friendlyName = friendlyName; @@ -50,7 +48,7 @@ public EndUserCreator setType(final EndUser.Type type) { return this; } - public EndUserCreator setAttributes(final Map attributes) { + public EndUserCreator setAttributes(final Object attributes) { this.attributes = attributes; return this; } @@ -103,7 +101,10 @@ private void addPostParams(final Request request) { request.addPostParam("Type", type.toString()); } if (attributes != null) { - request.addPostParam("Attributes", Converter.mapToJson(attributes)); + request.addPostParam( + "Attributes", + Converter.objectToJson(attributes) + ); } } } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUserUpdater.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUserUpdater.java index 0abd35a726..189bd34787 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUserUpdater.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUserUpdater.java @@ -25,13 +25,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class EndUserUpdater extends Updater { private String pathSid; private String friendlyName; - private Map attributes; + private Object attributes; public EndUserUpdater(final String pathSid) { this.pathSid = pathSid; @@ -42,7 +41,7 @@ public EndUserUpdater setFriendlyName(final String friendlyName) { return this; } - public EndUserUpdater setAttributes(final Map attributes) { + public EndUserUpdater setAttributes(final Object attributes) { this.attributes = attributes; return this; } @@ -87,7 +86,10 @@ private void addPostParams(final Request request) { request.addPostParam("FriendlyName", friendlyName); } if (attributes != null) { - request.addPostParam("Attributes", Converter.mapToJson(attributes)); + request.addPostParam( + "Attributes", + Converter.objectToJson(attributes) + ); } } } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Regulation.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Regulation.java index 5c89d54944..16fdea60d1 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Regulation.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Regulation.java @@ -94,7 +94,7 @@ public static Regulation fromJson( private final String friendlyName; private final String isoCountry; private final String numberType; - private final Regulation.EndUserType endUserType; + private final EndUserType endUserType; private final Map requirements; private final URI url; @@ -104,7 +104,7 @@ private Regulation( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("iso_country") final String isoCountry, @JsonProperty("number_type") final String numberType, - @JsonProperty("end_user_type") final Regulation.EndUserType endUserType, + @JsonProperty("end_user_type") final EndUserType endUserType, @JsonProperty("requirements") final Map requirements, @JsonProperty("url") final URI url ) { @@ -133,7 +133,7 @@ public final String getNumberType() { return this.numberType; } - public final Regulation.EndUserType getEndUserType() { + public final EndUserType getEndUserType() { return this.endUserType; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocument.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocument.java index 50135af80f..7562f95557 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocument.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocument.java @@ -112,7 +112,7 @@ public static SupportingDocument fromJson( private final String accountSid; private final String friendlyName; private final String mimeType; - private final SupportingDocument.Status status; + private final Status status; private final String failureReason; private final List> errors; private final String type; @@ -127,7 +127,7 @@ private SupportingDocument( @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("mime_type") final String mimeType, - @JsonProperty("status") final SupportingDocument.Status status, + @JsonProperty("status") final Status status, @JsonProperty("failure_reason") final String failureReason, @JsonProperty("errors") final List> errors, @JsonProperty("type") final String type, @@ -166,7 +166,7 @@ public final String getMimeType() { return this.mimeType; } - public final SupportingDocument.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocumentCreator.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocumentCreator.java index 61701ee5a0..9c53a94eb5 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocumentCreator.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocumentCreator.java @@ -26,14 +26,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class SupportingDocumentCreator extends Creator { private String friendlyName; private String type; - private Map attributes; + private Object attributes; public SupportingDocumentCreator( final String friendlyName, @@ -55,9 +53,7 @@ public SupportingDocumentCreator setType(final String type) { return this; } - public SupportingDocumentCreator setAttributes( - final Map attributes - ) { + public SupportingDocumentCreator setAttributes(final Object attributes) { this.attributes = attributes; return this; } @@ -113,7 +109,10 @@ private void addPostParams(final Request request) { request.addPostParam("Type", type); } if (attributes != null) { - request.addPostParam("Attributes", Converter.mapToJson(attributes)); + request.addPostParam( + "Attributes", + Converter.objectToJson(attributes) + ); } } } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocumentUpdater.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocumentUpdater.java index 9e8edb947e..4a243f5fc5 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocumentUpdater.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocumentUpdater.java @@ -25,13 +25,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class SupportingDocumentUpdater extends Updater { private String pathSid; private String friendlyName; - private Map attributes; + private Object attributes; public SupportingDocumentUpdater(final String pathSid) { this.pathSid = pathSid; @@ -44,9 +43,7 @@ public SupportingDocumentUpdater setFriendlyName( return this; } - public SupportingDocumentUpdater setAttributes( - final Map attributes - ) { + public SupportingDocumentUpdater setAttributes(final Object attributes) { this.attributes = attributes; return this; } @@ -94,7 +91,10 @@ private void addPostParams(final Request request) { request.addPostParam("FriendlyName", friendlyName); } if (attributes != null) { - request.addPostParam("Attributes", Converter.mapToJson(attributes)); + request.addPostParam( + "Attributes", + Converter.objectToJson(attributes) + ); } } } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/BundleCopy.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/BundleCopy.java index 04ac0cb803..f769beb1da 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/BundleCopy.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/BundleCopy.java @@ -94,7 +94,7 @@ public static BundleCopy fromJson( private final String accountSid; private final String regulationSid; private final String friendlyName; - private final BundleCopy.Status status; + private final Status status; private final ZonedDateTime validUntil; private final String email; private final URI statusCallback; @@ -107,7 +107,7 @@ private BundleCopy( @JsonProperty("account_sid") final String accountSid, @JsonProperty("regulation_sid") final String regulationSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final BundleCopy.Status status, + @JsonProperty("status") final Status status, @JsonProperty("valid_until") final String validUntil, @JsonProperty("email") final String email, @JsonProperty("status_callback") final URI statusCallback, @@ -142,7 +142,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final BundleCopy.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/Evaluation.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/Evaluation.java index 669f216872..4cd6b14db5 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/Evaluation.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/Evaluation.java @@ -104,7 +104,7 @@ public static Evaluation fromJson( private final String accountSid; private final String regulationSid; private final String bundleSid; - private final Evaluation.Status status; + private final Status status; private final List> results; private final ZonedDateTime dateCreated; private final URI url; @@ -115,7 +115,7 @@ private Evaluation( @JsonProperty("account_sid") final String accountSid, @JsonProperty("regulation_sid") final String regulationSid, @JsonProperty("bundle_sid") final String bundleSid, - @JsonProperty("status") final Evaluation.Status status, + @JsonProperty("status") final Status status, @JsonProperty("results") final List> results, @JsonProperty("date_created") final String dateCreated, @JsonProperty("url") final URI url @@ -146,7 +146,7 @@ public final String getBundleSid() { return this.bundleSid; } - public final Evaluation.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/ReplaceItems.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/ReplaceItems.java index 9af6e75dac..77fec453f4 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/ReplaceItems.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/ReplaceItems.java @@ -93,7 +93,7 @@ public static ReplaceItems fromJson( private final String accountSid; private final String regulationSid; private final String friendlyName; - private final ReplaceItems.Status status; + private final Status status; private final ZonedDateTime validUntil; private final String email; private final URI statusCallback; @@ -106,7 +106,7 @@ private ReplaceItems( @JsonProperty("account_sid") final String accountSid, @JsonProperty("regulation_sid") final String regulationSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final ReplaceItems.Status status, + @JsonProperty("status") final Status status, @JsonProperty("valid_until") final String validUntil, @JsonProperty("email") final String email, @JsonProperty("status_callback") final URI statusCallback, @@ -141,7 +141,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final ReplaceItems.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/preview/hostedNumbers/AuthorizationDocument.java b/src/main/java/com/twilio/rest/preview/hostedNumbers/AuthorizationDocument.java index 9bb552cfaf..7370fc631f 100644 --- a/src/main/java/com/twilio/rest/preview/hostedNumbers/AuthorizationDocument.java +++ b/src/main/java/com/twilio/rest/preview/hostedNumbers/AuthorizationDocument.java @@ -115,7 +115,7 @@ public static AuthorizationDocument fromJson( private final String sid; private final String addressSid; - private final AuthorizationDocument.Status status; + private final Status status; private final String email; private final List ccEmails; private final ZonedDateTime dateCreated; @@ -127,7 +127,7 @@ public static AuthorizationDocument fromJson( private AuthorizationDocument( @JsonProperty("sid") final String sid, @JsonProperty("address_sid") final String addressSid, - @JsonProperty("status") final AuthorizationDocument.Status status, + @JsonProperty("status") final Status status, @JsonProperty("email") final String email, @JsonProperty("cc_emails") final List ccEmails, @JsonProperty("date_created") final String dateCreated, @@ -154,7 +154,7 @@ public final String getAddressSid() { return this.addressSid; } - public final AuthorizationDocument.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/preview/hostedNumbers/HostedNumberOrder.java b/src/main/java/com/twilio/rest/preview/hostedNumbers/HostedNumberOrder.java index 1accd8a6ea..d3b6e61791 100644 --- a/src/main/java/com/twilio/rest/preview/hostedNumbers/HostedNumberOrder.java +++ b/src/main/java/com/twilio/rest/preview/hostedNumbers/HostedNumberOrder.java @@ -116,7 +116,7 @@ public static HostedNumberOrder fromJson( private final PhoneNumberCapabilities capabilities; private final String friendlyName; private final String uniqueName; - private final HostedNumberOrder.Status status; + private final Status status; private final String failureReason; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -124,7 +124,7 @@ public static HostedNumberOrder fromJson( private final String email; private final List ccEmails; private final URI url; - private final HostedNumberOrder.VerificationType verificationType; + private final VerificationType verificationType; private final String verificationDocumentSid; private final String extension; private final Integer callDelay; @@ -148,7 +148,7 @@ private HostedNumberOrder( ) final PhoneNumberCapabilities capabilities, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, - @JsonProperty("status") final HostedNumberOrder.Status status, + @JsonProperty("status") final Status status, @JsonProperty("failure_reason") final String failureReason, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -160,7 +160,7 @@ private HostedNumberOrder( @JsonProperty("url") final URI url, @JsonProperty( "verification_type" - ) final HostedNumberOrder.VerificationType verificationType, + ) final VerificationType verificationType, @JsonProperty( "verification_document_sid" ) final String verificationDocumentSid, @@ -232,7 +232,7 @@ public final String getUniqueName() { return this.uniqueName; } - public final HostedNumberOrder.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -264,7 +264,7 @@ public final URI getUrl() { return this.url; } - public final HostedNumberOrder.VerificationType getVerificationType() { + public final VerificationType getVerificationType() { return this.verificationType; } diff --git a/src/main/java/com/twilio/rest/preview/hostedNumbers/HostedNumberOrderCreator.java b/src/main/java/com/twilio/rest/preview/hostedNumbers/HostedNumberOrderCreator.java index 4f48c3128b..927eba9f60 100644 --- a/src/main/java/com/twilio/rest/preview/hostedNumbers/HostedNumberOrderCreator.java +++ b/src/main/java/com/twilio/rest/preview/hostedNumbers/HostedNumberOrderCreator.java @@ -192,7 +192,7 @@ public HostedNumberOrder create(final TwilioRestClient client) { path = path.replace( "{" + "PhoneNumber" + "}", - this.phoneNumber.encode("utf-8") + this.phoneNumber.toString() ); path = path.replace( diff --git a/src/main/java/com/twilio/rest/preview/hostedNumbers/authorizationdocument/DependentHostedNumberOrder.java b/src/main/java/com/twilio/rest/preview/hostedNumbers/authorizationdocument/DependentHostedNumberOrder.java index a568b081d8..2ca263c614 100644 --- a/src/main/java/com/twilio/rest/preview/hostedNumbers/authorizationdocument/DependentHostedNumberOrder.java +++ b/src/main/java/com/twilio/rest/preview/hostedNumbers/authorizationdocument/DependentHostedNumberOrder.java @@ -104,14 +104,14 @@ public static DependentHostedNumberOrder fromJson( private final PhoneNumberCapabilities capabilities; private final String friendlyName; private final String uniqueName; - private final DependentHostedNumberOrder.Status status; + private final Status status; private final String failureReason; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Integer verificationAttempts; private final String email; private final List ccEmails; - private final DependentHostedNumberOrder.VerificationType verificationType; + private final VerificationType verificationType; private final String verificationDocumentSid; private final String extension; private final Integer callDelay; @@ -135,7 +135,7 @@ private DependentHostedNumberOrder( ) final PhoneNumberCapabilities capabilities, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, - @JsonProperty("status") final DependentHostedNumberOrder.Status status, + @JsonProperty("status") final Status status, @JsonProperty("failure_reason") final String failureReason, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -146,7 +146,7 @@ private DependentHostedNumberOrder( @JsonProperty("cc_emails") final List ccEmails, @JsonProperty( "verification_type" - ) final DependentHostedNumberOrder.VerificationType verificationType, + ) final VerificationType verificationType, @JsonProperty( "verification_document_sid" ) final String verificationDocumentSid, @@ -217,7 +217,7 @@ public final String getUniqueName() { return this.uniqueName; } - public final DependentHostedNumberOrder.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -245,7 +245,7 @@ public final List getCcEmails() { return this.ccEmails; } - public final DependentHostedNumberOrder.VerificationType getVerificationType() { + public final VerificationType getVerificationType() { return this.verificationType; } diff --git a/src/main/java/com/twilio/rest/preview/marketplace/InstalledAddOnCreator.java b/src/main/java/com/twilio/rest/preview/marketplace/InstalledAddOnCreator.java index 881b0d804c..21254453bc 100644 --- a/src/main/java/com/twilio/rest/preview/marketplace/InstalledAddOnCreator.java +++ b/src/main/java/com/twilio/rest/preview/marketplace/InstalledAddOnCreator.java @@ -26,14 +26,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class InstalledAddOnCreator extends Creator { private String availableAddOnSid; private Boolean acceptTermsOfService; - private Map configuration; + private Object configuration; private String uniqueName; public InstalledAddOnCreator( @@ -58,9 +56,7 @@ public InstalledAddOnCreator setAcceptTermsOfService( return this; } - public InstalledAddOnCreator setConfiguration( - final Map configuration - ) { + public InstalledAddOnCreator setConfiguration(final Object configuration) { this.configuration = configuration; return this; } @@ -130,7 +126,7 @@ private void addPostParams(final Request request) { if (configuration != null) { request.addPostParam( "Configuration", - Converter.mapToJson(configuration) + Converter.objectToJson(configuration) ); } if (uniqueName != null) { diff --git a/src/main/java/com/twilio/rest/preview/marketplace/InstalledAddOnUpdater.java b/src/main/java/com/twilio/rest/preview/marketplace/InstalledAddOnUpdater.java index 72748e7594..bb4dc1e55b 100644 --- a/src/main/java/com/twilio/rest/preview/marketplace/InstalledAddOnUpdater.java +++ b/src/main/java/com/twilio/rest/preview/marketplace/InstalledAddOnUpdater.java @@ -25,21 +25,18 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class InstalledAddOnUpdater extends Updater { private String pathSid; - private Map configuration; + private Object configuration; private String uniqueName; public InstalledAddOnUpdater(final String pathSid) { this.pathSid = pathSid; } - public InstalledAddOnUpdater setConfiguration( - final Map configuration - ) { + public InstalledAddOnUpdater setConfiguration(final Object configuration) { this.configuration = configuration; return this; } @@ -91,7 +88,7 @@ private void addPostParams(final Request request) { if (configuration != null) { request.addPostParam( "Configuration", - Converter.mapToJson(configuration) + Converter.objectToJson(configuration) ); } if (uniqueName != null) { diff --git a/src/main/java/com/twilio/rest/previewiam/organizations/Account.java b/src/main/java/com/twilio/rest/previewiam/organizations/Account.java index 388b31fa34..5186823e23 100644 --- a/src/main/java/com/twilio/rest/previewiam/organizations/Account.java +++ b/src/main/java/com/twilio/rest/previewiam/organizations/Account.java @@ -94,7 +94,7 @@ public static Account fromJson( private final String accountSid; private final String friendlyName; - private final Account.StatusEnum status; + private final StatusEnum status; private final String ownerSid; private final ZonedDateTime dateCreated; @@ -102,7 +102,7 @@ public static Account fromJson( private Account( @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final Account.StatusEnum status, + @JsonProperty("status") final StatusEnum status, @JsonProperty("owner_sid") final String ownerSid, @JsonProperty("date_created") final String dateCreated ) { @@ -121,7 +121,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Account.StatusEnum getStatus() { + public final StatusEnum getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/previewiam/organizations/RoleAssignment.java b/src/main/java/com/twilio/rest/previewiam/organizations/RoleAssignment.java index 875068a004..f02a6ad8fa 100644 --- a/src/main/java/com/twilio/rest/previewiam/organizations/RoleAssignment.java +++ b/src/main/java/com/twilio/rest/previewiam/organizations/RoleAssignment.java @@ -83,7 +83,7 @@ public static PublicApiCreateRoleAssignmentRequest fromJson( public static RoleAssignmentCreator creator( final String pathOrganizationSid, - final RoleAssignment.PublicApiCreateRoleAssignmentRequest publicApiCreateRoleAssignmentRequest + final PublicApiCreateRoleAssignmentRequest publicApiCreateRoleAssignmentRequest ) { return new RoleAssignmentCreator( pathOrganizationSid, diff --git a/src/main/java/com/twilio/rest/previewiam/organizations/User.java b/src/main/java/com/twilio/rest/previewiam/organizations/User.java index 2e3a501701..923872e3e5 100644 --- a/src/main/java/com/twilio/rest/previewiam/organizations/User.java +++ b/src/main/java/com/twilio/rest/previewiam/organizations/User.java @@ -213,7 +213,7 @@ public static ScimUser fromJson(String jsonString, ObjectMapper mapper) public static UserCreator creator( final String pathOrganizationSid, - final User.ScimUser scimUser + final ScimUser scimUser ) { return new UserCreator(pathOrganizationSid, scimUser); } @@ -239,7 +239,7 @@ public static UserReader reader(final String pathOrganizationSid) { public static UserUpdater updater( final String pathOrganizationSid, final String pathUserSid, - final User.ScimUser scimUser + final ScimUser scimUser ) { return new UserUpdater(pathOrganizationSid, pathUserSid, scimUser); } diff --git a/src/main/java/com/twilio/rest/pricing/v1/messaging/Country.java b/src/main/java/com/twilio/rest/pricing/v1/messaging/Country.java index b94e824fc8..80882ed263 100644 --- a/src/main/java/com/twilio/rest/pricing/v1/messaging/Country.java +++ b/src/main/java/com/twilio/rest/pricing/v1/messaging/Country.java @@ -111,7 +111,7 @@ private Country( InboundSmsPrice > inboundSmsPrices, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v1/phonenumber/Country.java b/src/main/java/com/twilio/rest/pricing/v1/phonenumber/Country.java index b7460493df..8c3d1a112f 100644 --- a/src/main/java/com/twilio/rest/pricing/v1/phonenumber/Country.java +++ b/src/main/java/com/twilio/rest/pricing/v1/phonenumber/Country.java @@ -106,7 +106,7 @@ private Country( PhoneNumberPrice > phoneNumberPrices, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v1/voice/Country.java b/src/main/java/com/twilio/rest/pricing/v1/voice/Country.java index 766b5a0ced..571bdc47f3 100644 --- a/src/main/java/com/twilio/rest/pricing/v1/voice/Country.java +++ b/src/main/java/com/twilio/rest/pricing/v1/voice/Country.java @@ -111,7 +111,7 @@ private Country( InboundCallPrice > inboundCallPrices, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v1/voice/Number.java b/src/main/java/com/twilio/rest/pricing/v1/voice/Number.java index 84501022ef..c3554827ba 100644 --- a/src/main/java/com/twilio/rest/pricing/v1/voice/Number.java +++ b/src/main/java/com/twilio/rest/pricing/v1/voice/Number.java @@ -110,7 +110,7 @@ private Number( "inbound_call_price" ) final InboundCallPrice inboundCallPrice, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v1/voice/NumberFetcher.java b/src/main/java/com/twilio/rest/pricing/v1/voice/NumberFetcher.java index 4b3b9a50fd..ff3d62d4e3 100644 --- a/src/main/java/com/twilio/rest/pricing/v1/voice/NumberFetcher.java +++ b/src/main/java/com/twilio/rest/pricing/v1/voice/NumberFetcher.java @@ -37,8 +37,7 @@ public NumberFetcher(final com.twilio.type.PhoneNumber pathNumber) { public Number fetch(final TwilioRestClient client) { String path = "/v1/Voice/Numbers/{Number}"; - path = - path.replace("{" + "Number" + "}", this.pathNumber.encode("utf-8")); + path = path.replace("{" + "Number" + "}", this.pathNumber.toString()); Request request = new Request( HttpMethod.GET, diff --git a/src/main/java/com/twilio/rest/pricing/v2/Country.java b/src/main/java/com/twilio/rest/pricing/v2/Country.java index a95ebb6743..337a60e819 100644 --- a/src/main/java/com/twilio/rest/pricing/v2/Country.java +++ b/src/main/java/com/twilio/rest/pricing/v2/Country.java @@ -111,7 +111,7 @@ private Country( InboundCallPrice > originatingCallPrices, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v2/Number.java b/src/main/java/com/twilio/rest/pricing/v2/Number.java index 3d8c0f89fe..f23418faf6 100644 --- a/src/main/java/com/twilio/rest/pricing/v2/Number.java +++ b/src/main/java/com/twilio/rest/pricing/v2/Number.java @@ -117,7 +117,7 @@ private Number( "originating_call_price" ) final InboundCallPrice originatingCallPrice, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v2/NumberFetcher.java b/src/main/java/com/twilio/rest/pricing/v2/NumberFetcher.java index b433b097a0..e41c589818 100644 --- a/src/main/java/com/twilio/rest/pricing/v2/NumberFetcher.java +++ b/src/main/java/com/twilio/rest/pricing/v2/NumberFetcher.java @@ -57,7 +57,7 @@ public Number fetch(final TwilioRestClient client) { path = path.replace( "{" + "DestinationNumber" + "}", - this.pathDestinationNumber.encode("utf-8") + this.pathDestinationNumber.toString() ); Request request = new Request( diff --git a/src/main/java/com/twilio/rest/pricing/v2/voice/Country.java b/src/main/java/com/twilio/rest/pricing/v2/voice/Country.java index 18a482f54f..678cc56bda 100644 --- a/src/main/java/com/twilio/rest/pricing/v2/voice/Country.java +++ b/src/main/java/com/twilio/rest/pricing/v2/voice/Country.java @@ -111,7 +111,7 @@ private Country( InboundCallPrice > inboundCallPrices, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v2/voice/Number.java b/src/main/java/com/twilio/rest/pricing/v2/voice/Number.java index cb87bffd51..c34fd46796 100644 --- a/src/main/java/com/twilio/rest/pricing/v2/voice/Number.java +++ b/src/main/java/com/twilio/rest/pricing/v2/voice/Number.java @@ -117,7 +117,7 @@ private Number( "inbound_call_price" ) final InboundCallPrice inboundCallPrice, @JsonProperty("price_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v2/voice/NumberFetcher.java b/src/main/java/com/twilio/rest/pricing/v2/voice/NumberFetcher.java index a0285c5f44..806d653a7b 100644 --- a/src/main/java/com/twilio/rest/pricing/v2/voice/NumberFetcher.java +++ b/src/main/java/com/twilio/rest/pricing/v2/voice/NumberFetcher.java @@ -57,7 +57,7 @@ public Number fetch(final TwilioRestClient client) { path = path.replace( "{" + "DestinationNumber" + "}", - this.pathDestinationNumber.encode("utf-8") + this.pathDestinationNumber.toString() ); Request request = new Request( diff --git a/src/main/java/com/twilio/rest/proxy/v1/Service.java b/src/main/java/com/twilio/rest/proxy/v1/Service.java index 65eb5245f6..58fe5e69af 100644 --- a/src/main/java/com/twilio/rest/proxy/v1/Service.java +++ b/src/main/java/com/twilio/rest/proxy/v1/Service.java @@ -110,8 +110,8 @@ public static Service fromJson( private final String chatInstanceSid; private final URI callbackUrl; private final Integer defaultTtl; - private final Service.NumberSelectionBehavior numberSelectionBehavior; - private final Service.GeoMatchLevel geoMatchLevel; + private final NumberSelectionBehavior numberSelectionBehavior; + private final GeoMatchLevel geoMatchLevel; private final URI interceptCallbackUrl; private final URI outOfSessionCallbackUrl; private final ZonedDateTime dateCreated; @@ -129,10 +129,8 @@ private Service( @JsonProperty("default_ttl") final Integer defaultTtl, @JsonProperty( "number_selection_behavior" - ) final Service.NumberSelectionBehavior numberSelectionBehavior, - @JsonProperty( - "geo_match_level" - ) final Service.GeoMatchLevel geoMatchLevel, + ) final NumberSelectionBehavior numberSelectionBehavior, + @JsonProperty("geo_match_level") final GeoMatchLevel geoMatchLevel, @JsonProperty("intercept_callback_url") final URI interceptCallbackUrl, @JsonProperty( "out_of_session_callback_url" @@ -182,11 +180,11 @@ public final Integer getDefaultTtl() { return this.defaultTtl; } - public final Service.NumberSelectionBehavior getNumberSelectionBehavior() { + public final NumberSelectionBehavior getNumberSelectionBehavior() { return this.numberSelectionBehavior; } - public final Service.GeoMatchLevel getGeoMatchLevel() { + public final GeoMatchLevel getGeoMatchLevel() { return this.geoMatchLevel; } diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/Session.java b/src/main/java/com/twilio/rest/proxy/v1/service/Session.java index 2c8db7c6ad..07b22595d9 100644 --- a/src/main/java/com/twilio/rest/proxy/v1/service/Session.java +++ b/src/main/java/com/twilio/rest/proxy/v1/service/Session.java @@ -121,10 +121,10 @@ public static Session fromJson( private final ZonedDateTime dateLastInteraction; private final ZonedDateTime dateExpiry; private final String uniqueName; - private final Session.Status status; + private final Status status; private final String closedReason; private final Integer ttl; - private final Session.Mode mode; + private final Mode mode; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -140,10 +140,10 @@ private Session( @JsonProperty("date_last_interaction") final String dateLastInteraction, @JsonProperty("date_expiry") final String dateExpiry, @JsonProperty("unique_name") final String uniqueName, - @JsonProperty("status") final Session.Status status, + @JsonProperty("status") final Status status, @JsonProperty("closed_reason") final String closedReason, @JsonProperty("ttl") final Integer ttl, - @JsonProperty("mode") final Session.Mode mode, + @JsonProperty("mode") final Mode mode, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url, @@ -200,7 +200,7 @@ public final String getUniqueName() { return this.uniqueName; } - public final Session.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -212,7 +212,7 @@ public final Integer getTtl() { return this.ttl; } - public final Session.Mode getMode() { + public final Mode getMode() { return this.mode; } diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/SessionCreator.java b/src/main/java/com/twilio/rest/proxy/v1/service/SessionCreator.java index 988ff069e6..7cabf721a5 100644 --- a/src/main/java/com/twilio/rest/proxy/v1/service/SessionCreator.java +++ b/src/main/java/com/twilio/rest/proxy/v1/service/SessionCreator.java @@ -16,8 +16,6 @@ import com.twilio.base.Creator; import com.twilio.constant.EnumConstants; -import com.twilio.converter.Converter; -import com.twilio.converter.Converter; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; @@ -30,8 +28,6 @@ import java.time.ZonedDateTime; import java.util.List; import java.util.List; -import java.util.Map; -import java.util.Map; public class SessionCreator extends Creator { @@ -41,7 +37,7 @@ public class SessionCreator extends Creator { private Integer ttl; private Session.Mode mode; private Session.Status status; - private List> participants; + private List participants; public SessionCreator(final String pathServiceSid) { this.pathServiceSid = pathServiceSid; @@ -72,16 +68,12 @@ public SessionCreator setStatus(final Session.Status status) { return this; } - public SessionCreator setParticipants( - final List> participants - ) { + public SessionCreator setParticipants(final List participants) { this.participants = participants; return this; } - public SessionCreator setParticipants( - final Map participants - ) { + public SessionCreator setParticipants(final Object participants) { return setParticipants(Promoter.listOfOne(participants)); } @@ -144,8 +136,8 @@ private void addPostParams(final Request request) { request.addPostParam("Status", status.toString()); } if (participants != null) { - for (Map prop : participants) { - request.addPostParam("Participants", Converter.mapToJson(prop)); + for (Object prop : participants) { + request.addPostParam("Participants", prop.toString()); } } } diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/session/Interaction.java b/src/main/java/com/twilio/rest/proxy/v1/service/session/Interaction.java index 9167ddc0a9..67ee90770a 100644 --- a/src/main/java/com/twilio/rest/proxy/v1/service/session/Interaction.java +++ b/src/main/java/com/twilio/rest/proxy/v1/service/session/Interaction.java @@ -110,15 +110,15 @@ public static Interaction fromJson( private final String serviceSid; private final String accountSid; private final String data; - private final Interaction.Type type; + private final Type type; private final String inboundParticipantSid; private final String inboundResourceSid; - private final Interaction.ResourceStatus inboundResourceStatus; + private final ResourceStatus inboundResourceStatus; private final String inboundResourceType; private final URI inboundResourceUrl; private final String outboundParticipantSid; private final String outboundResourceSid; - private final Interaction.ResourceStatus outboundResourceStatus; + private final ResourceStatus outboundResourceStatus; private final String outboundResourceType; private final URI outboundResourceUrl; private final ZonedDateTime dateCreated; @@ -132,14 +132,14 @@ private Interaction( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("data") final String data, - @JsonProperty("type") final Interaction.Type type, + @JsonProperty("type") final Type type, @JsonProperty( "inbound_participant_sid" ) final String inboundParticipantSid, @JsonProperty("inbound_resource_sid") final String inboundResourceSid, @JsonProperty( "inbound_resource_status" - ) final Interaction.ResourceStatus inboundResourceStatus, + ) final ResourceStatus inboundResourceStatus, @JsonProperty("inbound_resource_type") final String inboundResourceType, @JsonProperty("inbound_resource_url") final URI inboundResourceUrl, @JsonProperty( @@ -148,7 +148,7 @@ private Interaction( @JsonProperty("outbound_resource_sid") final String outboundResourceSid, @JsonProperty( "outbound_resource_status" - ) final Interaction.ResourceStatus outboundResourceStatus, + ) final ResourceStatus outboundResourceStatus, @JsonProperty( "outbound_resource_type" ) final String outboundResourceType, @@ -198,7 +198,7 @@ public final String getData() { return this.data; } - public final Interaction.Type getType() { + public final Type getType() { return this.type; } @@ -210,7 +210,7 @@ public final String getInboundResourceSid() { return this.inboundResourceSid; } - public final Interaction.ResourceStatus getInboundResourceStatus() { + public final ResourceStatus getInboundResourceStatus() { return this.inboundResourceStatus; } @@ -230,7 +230,7 @@ public final String getOutboundResourceSid() { return this.outboundResourceSid; } - public final Interaction.ResourceStatus getOutboundResourceStatus() { + public final ResourceStatus getOutboundResourceStatus() { return this.outboundResourceStatus; } diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/session/participant/MessageInteraction.java b/src/main/java/com/twilio/rest/proxy/v1/service/session/participant/MessageInteraction.java index 2cc5764aa6..fffb740206 100644 --- a/src/main/java/com/twilio/rest/proxy/v1/service/session/participant/MessageInteraction.java +++ b/src/main/java/com/twilio/rest/proxy/v1/service/session/participant/MessageInteraction.java @@ -142,16 +142,16 @@ public static MessageInteraction fromJson( private final String serviceSid; private final String accountSid; private final String data; - private final MessageInteraction.Type type; + private final Type type; private final String participantSid; private final String inboundParticipantSid; private final String inboundResourceSid; - private final MessageInteraction.ResourceStatus inboundResourceStatus; + private final ResourceStatus inboundResourceStatus; private final String inboundResourceType; private final URI inboundResourceUrl; private final String outboundParticipantSid; private final String outboundResourceSid; - private final MessageInteraction.ResourceStatus outboundResourceStatus; + private final ResourceStatus outboundResourceStatus; private final String outboundResourceType; private final URI outboundResourceUrl; private final ZonedDateTime dateCreated; @@ -165,7 +165,7 @@ private MessageInteraction( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("data") final String data, - @JsonProperty("type") final MessageInteraction.Type type, + @JsonProperty("type") final Type type, @JsonProperty("participant_sid") final String participantSid, @JsonProperty( "inbound_participant_sid" @@ -173,7 +173,7 @@ private MessageInteraction( @JsonProperty("inbound_resource_sid") final String inboundResourceSid, @JsonProperty( "inbound_resource_status" - ) final MessageInteraction.ResourceStatus inboundResourceStatus, + ) final ResourceStatus inboundResourceStatus, @JsonProperty("inbound_resource_type") final String inboundResourceType, @JsonProperty("inbound_resource_url") final URI inboundResourceUrl, @JsonProperty( @@ -182,7 +182,7 @@ private MessageInteraction( @JsonProperty("outbound_resource_sid") final String outboundResourceSid, @JsonProperty( "outbound_resource_status" - ) final MessageInteraction.ResourceStatus outboundResourceStatus, + ) final ResourceStatus outboundResourceStatus, @JsonProperty( "outbound_resource_type" ) final String outboundResourceType, @@ -233,7 +233,7 @@ public final String getData() { return this.data; } - public final MessageInteraction.Type getType() { + public final Type getType() { return this.type; } @@ -249,7 +249,7 @@ public final String getInboundResourceSid() { return this.inboundResourceSid; } - public final MessageInteraction.ResourceStatus getInboundResourceStatus() { + public final ResourceStatus getInboundResourceStatus() { return this.inboundResourceStatus; } @@ -269,7 +269,7 @@ public final String getOutboundResourceSid() { return this.outboundResourceSid; } - public final MessageInteraction.ResourceStatus getOutboundResourceStatus() { + public final ResourceStatus getOutboundResourceStatus() { return this.outboundResourceStatus; } diff --git a/src/main/java/com/twilio/rest/serverless/v1/service/Build.java b/src/main/java/com/twilio/rest/serverless/v1/service/Build.java index 30dfe72cf9..aefb0ce32d 100644 --- a/src/main/java/com/twilio/rest/serverless/v1/service/Build.java +++ b/src/main/java/com/twilio/rest/serverless/v1/service/Build.java @@ -110,11 +110,11 @@ public static Build fromJson( private final String sid; private final String accountSid; private final String serviceSid; - private final Build.Status status; + private final Status status; private final List> assetVersions; private final List> functionVersions; private final List> dependencies; - private final Build.Runtime runtime; + private final Runtime runtime; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -125,7 +125,7 @@ private Build( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, - @JsonProperty("status") final Build.Status status, + @JsonProperty("status") final Status status, @JsonProperty("asset_versions") final List< Map > assetVersions, @@ -135,7 +135,7 @@ private Build( @JsonProperty("dependencies") final List< Map > dependencies, - @JsonProperty("runtime") final Build.Runtime runtime, + @JsonProperty("runtime") final Runtime runtime, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url, @@ -167,7 +167,7 @@ public final String getServiceSid() { return this.serviceSid; } - public final Build.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -183,7 +183,7 @@ public final List> getDependencies() { return this.dependencies; } - public final Build.Runtime getRuntime() { + public final Runtime getRuntime() { return this.runtime; } diff --git a/src/main/java/com/twilio/rest/serverless/v1/service/asset/AssetVersion.java b/src/main/java/com/twilio/rest/serverless/v1/service/asset/AssetVersion.java index a8cc25e5b0..42be38212b 100644 --- a/src/main/java/com/twilio/rest/serverless/v1/service/asset/AssetVersion.java +++ b/src/main/java/com/twilio/rest/serverless/v1/service/asset/AssetVersion.java @@ -102,7 +102,7 @@ public static AssetVersion fromJson( private final String serviceSid; private final String assetSid; private final String path; - private final AssetVersion.Visibility visibility; + private final Visibility visibility; private final ZonedDateTime dateCreated; private final URI url; @@ -113,7 +113,7 @@ private AssetVersion( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("asset_sid") final String assetSid, @JsonProperty("path") final String path, - @JsonProperty("visibility") final AssetVersion.Visibility visibility, + @JsonProperty("visibility") final Visibility visibility, @JsonProperty("date_created") final String dateCreated, @JsonProperty("url") final URI url ) { @@ -147,7 +147,7 @@ public final String getPath() { return this.path; } - public final AssetVersion.Visibility getVisibility() { + public final Visibility getVisibility() { return this.visibility; } diff --git a/src/main/java/com/twilio/rest/serverless/v1/service/build/BuildStatus.java b/src/main/java/com/twilio/rest/serverless/v1/service/build/BuildStatus.java index f00e9175cb..583fcb0fab 100644 --- a/src/main/java/com/twilio/rest/serverless/v1/service/build/BuildStatus.java +++ b/src/main/java/com/twilio/rest/serverless/v1/service/build/BuildStatus.java @@ -90,7 +90,7 @@ public static BuildStatus fromJson( private final String sid; private final String accountSid; private final String serviceSid; - private final BuildStatus.Status status; + private final Status status; private final URI url; @JsonCreator @@ -98,7 +98,7 @@ private BuildStatus( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, - @JsonProperty("status") final BuildStatus.Status status, + @JsonProperty("status") final Status status, @JsonProperty("url") final URI url ) { this.sid = sid; @@ -120,7 +120,7 @@ public final String getServiceSid() { return this.serviceSid; } - public final BuildStatus.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/serverless/v1/service/environment/Log.java b/src/main/java/com/twilio/rest/serverless/v1/service/environment/Log.java index f1a225ac49..72abb9f912 100644 --- a/src/main/java/com/twilio/rest/serverless/v1/service/environment/Log.java +++ b/src/main/java/com/twilio/rest/serverless/v1/service/environment/Log.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.twilio.base.Resource; import com.twilio.converter.DateConverter; -import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; import java.io.IOException; @@ -37,7 +36,7 @@ @ToString public class Log extends Resource { - private static final long serialVersionUID = 129897058125132L; + private static final long serialVersionUID = 41290346867159L; public static LogFetcher fetcher( final String pathServiceSid, @@ -105,7 +104,7 @@ public static Log fromJson( private final String deploymentSid; private final String functionSid; private final String requestSid; - private final Log.Level level; + private final String level; private final String message; private final ZonedDateTime dateCreated; private final URI url; @@ -120,7 +119,7 @@ private Log( @JsonProperty("deployment_sid") final String deploymentSid, @JsonProperty("function_sid") final String functionSid, @JsonProperty("request_sid") final String requestSid, - @JsonProperty("level") final Log.Level level, + @JsonProperty("level") final String level, @JsonProperty("message") final String message, @JsonProperty("date_created") final String dateCreated, @JsonProperty("url") final URI url @@ -171,7 +170,7 @@ public final String getRequestSid() { return this.requestSid; } - public final Log.Level getLevel() { + public final String getLevel() { return this.level; } @@ -232,25 +231,4 @@ public int hashCode() { url ); } - - public enum Level { - INFO("info"), - WARN("warn"), - ERROR("error"); - - private final String value; - - private Level(final String value) { - this.value = value; - } - - public String toString() { - return value; - } - - @JsonCreator - public static Level forValue(final String value) { - return Promoter.enumFromString(value, Level.values()); - } - } } diff --git a/src/main/java/com/twilio/rest/serverless/v1/service/function/FunctionVersion.java b/src/main/java/com/twilio/rest/serverless/v1/service/function/FunctionVersion.java index af9004b2c4..46b6d6388f 100644 --- a/src/main/java/com/twilio/rest/serverless/v1/service/function/FunctionVersion.java +++ b/src/main/java/com/twilio/rest/serverless/v1/service/function/FunctionVersion.java @@ -108,7 +108,7 @@ public static FunctionVersion fromJson( private final String serviceSid; private final String functionSid; private final String path; - private final FunctionVersion.Visibility visibility; + private final Visibility visibility; private final ZonedDateTime dateCreated; private final URI url; private final Map links; @@ -120,7 +120,7 @@ private FunctionVersion( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("function_sid") final String functionSid, @JsonProperty("path") final String path, - @JsonProperty("visibility") final FunctionVersion.Visibility visibility, + @JsonProperty("visibility") final Visibility visibility, @JsonProperty("date_created") final String dateCreated, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links @@ -156,7 +156,7 @@ public final String getPath() { return this.path; } - public final FunctionVersion.Visibility getVisibility() { + public final Visibility getVisibility() { return this.visibility; } diff --git a/src/main/java/com/twilio/rest/studio/v1/Flow.java b/src/main/java/com/twilio/rest/studio/v1/Flow.java index e54921d904..6a84d3a01b 100644 --- a/src/main/java/com/twilio/rest/studio/v1/Flow.java +++ b/src/main/java/com/twilio/rest/studio/v1/Flow.java @@ -99,7 +99,7 @@ public static Flow fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final Flow.Status status; + private final Status status; private final Integer version; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -111,7 +111,7 @@ private Flow( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final Flow.Status status, + @JsonProperty("status") final Status status, @JsonProperty("version") final Integer version, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -141,7 +141,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Flow.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/studio/v1/flow/Engagement.java b/src/main/java/com/twilio/rest/studio/v1/flow/Engagement.java index 1b5c29b55b..99e517ac68 100644 --- a/src/main/java/com/twilio/rest/studio/v1/flow/Engagement.java +++ b/src/main/java/com/twilio/rest/studio/v1/flow/Engagement.java @@ -116,7 +116,7 @@ public static Engagement fromJson( private final String contactSid; private final String contactChannelAddress; private final Map context; - private final Engagement.Status status; + private final Status status; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -132,7 +132,7 @@ private Engagement( "contact_channel_address" ) final String contactChannelAddress, @JsonProperty("context") final Map context, - @JsonProperty("status") final Engagement.Status status, + @JsonProperty("status") final Status status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url, @@ -175,7 +175,7 @@ public final Map getContext() { return this.context; } - public final Engagement.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/studio/v1/flow/EngagementCreator.java b/src/main/java/com/twilio/rest/studio/v1/flow/EngagementCreator.java index cbd788a972..65b09c1a3c 100644 --- a/src/main/java/com/twilio/rest/studio/v1/flow/EngagementCreator.java +++ b/src/main/java/com/twilio/rest/studio/v1/flow/EngagementCreator.java @@ -27,15 +27,13 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class EngagementCreator extends Creator { private String pathFlowSid; private com.twilio.type.PhoneNumber to; private com.twilio.type.PhoneNumber from; - private Map parameters; + private Object parameters; public EngagementCreator( final String pathFlowSid, @@ -65,9 +63,7 @@ public EngagementCreator setFrom(final String from) { return setFrom(Promoter.phoneNumberFromString(from)); } - public EngagementCreator setParameters( - final Map parameters - ) { + public EngagementCreator setParameters(final Object parameters) { this.parameters = parameters; return this; } @@ -77,8 +73,8 @@ public Engagement create(final TwilioRestClient client) { String path = "/v1/Flows/{FlowSid}/Engagements"; path = path.replace("{" + "FlowSid" + "}", this.pathFlowSid.toString()); - path = path.replace("{" + "To" + "}", this.to.encode("utf-8")); - path = path.replace("{" + "From" + "}", this.from.encode("utf-8")); + path = path.replace("{" + "To" + "}", this.to.toString()); + path = path.replace("{" + "From" + "}", this.from.toString()); Request request = new Request( HttpMethod.POST, @@ -120,7 +116,10 @@ private void addPostParams(final Request request) { request.addPostParam("From", from.toString()); } if (parameters != null) { - request.addPostParam("Parameters", Converter.mapToJson(parameters)); + request.addPostParam( + "Parameters", + Converter.objectToJson(parameters) + ); } } } diff --git a/src/main/java/com/twilio/rest/studio/v1/flow/Execution.java b/src/main/java/com/twilio/rest/studio/v1/flow/Execution.java index 7806f0e36d..a79863d930 100644 --- a/src/main/java/com/twilio/rest/studio/v1/flow/Execution.java +++ b/src/main/java/com/twilio/rest/studio/v1/flow/Execution.java @@ -70,7 +70,7 @@ public static ExecutionReader reader(final String pathFlowSid) { public static ExecutionUpdater updater( final String pathFlowSid, final String pathSid, - final Execution.Status status + final Status status ) { return new ExecutionUpdater(pathFlowSid, pathSid, status); } @@ -124,7 +124,7 @@ public static Execution fromJson( private final String contactSid; private final String contactChannelAddress; private final Map context; - private final Execution.Status status; + private final Status status; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -140,7 +140,7 @@ private Execution( "contact_channel_address" ) final String contactChannelAddress, @JsonProperty("context") final Map context, - @JsonProperty("status") final Execution.Status status, + @JsonProperty("status") final Status status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url, @@ -183,7 +183,7 @@ public final Map getContext() { return this.context; } - public final Execution.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/studio/v1/flow/ExecutionCreator.java b/src/main/java/com/twilio/rest/studio/v1/flow/ExecutionCreator.java index 89c8f288e0..bdc96dd0a3 100644 --- a/src/main/java/com/twilio/rest/studio/v1/flow/ExecutionCreator.java +++ b/src/main/java/com/twilio/rest/studio/v1/flow/ExecutionCreator.java @@ -27,15 +27,13 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class ExecutionCreator extends Creator { private String pathFlowSid; private com.twilio.type.PhoneNumber to; private com.twilio.type.PhoneNumber from; - private Map parameters; + private Object parameters; public ExecutionCreator( final String pathFlowSid, @@ -65,9 +63,7 @@ public ExecutionCreator setFrom(final String from) { return setFrom(Promoter.phoneNumberFromString(from)); } - public ExecutionCreator setParameters( - final Map parameters - ) { + public ExecutionCreator setParameters(final Object parameters) { this.parameters = parameters; return this; } @@ -77,8 +73,8 @@ public Execution create(final TwilioRestClient client) { String path = "/v1/Flows/{FlowSid}/Executions"; path = path.replace("{" + "FlowSid" + "}", this.pathFlowSid.toString()); - path = path.replace("{" + "To" + "}", this.to.encode("utf-8")); - path = path.replace("{" + "From" + "}", this.from.encode("utf-8")); + path = path.replace("{" + "To" + "}", this.to.toString()); + path = path.replace("{" + "From" + "}", this.from.toString()); Request request = new Request( HttpMethod.POST, @@ -120,7 +116,10 @@ private void addPostParams(final Request request) { request.addPostParam("From", from.toString()); } if (parameters != null) { - request.addPostParam("Parameters", Converter.mapToJson(parameters)); + request.addPostParam( + "Parameters", + Converter.objectToJson(parameters) + ); } } } diff --git a/src/main/java/com/twilio/rest/studio/v2/Flow.java b/src/main/java/com/twilio/rest/studio/v2/Flow.java index f4f9f13fbf..7677d433dd 100644 --- a/src/main/java/com/twilio/rest/studio/v2/Flow.java +++ b/src/main/java/com/twilio/rest/studio/v2/Flow.java @@ -44,8 +44,8 @@ public class Flow extends Resource { public static FlowCreator creator( final String friendlyName, - final Flow.Status status, - final Map definition + final Status status, + final Object definition ) { return new FlowCreator(friendlyName, status, definition); } @@ -64,7 +64,7 @@ public static FlowReader reader() { public static FlowUpdater updater( final String pathSid, - final Flow.Status status + final Status status ) { return new FlowUpdater(pathSid, status); } @@ -116,7 +116,7 @@ public static Flow fromJson( private final String accountSid; private final String friendlyName; private final Map definition; - private final Flow.Status status; + private final Status status; private final Integer revision; private final String commitMessage; private final Boolean valid; @@ -134,7 +134,7 @@ private Flow( @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("definition") final Map definition, - @JsonProperty("status") final Flow.Status status, + @JsonProperty("status") final Status status, @JsonProperty("revision") final Integer revision, @JsonProperty("commit_message") final String commitMessage, @JsonProperty("valid") final Boolean valid, @@ -179,7 +179,7 @@ public final Map getDefinition() { return this.definition; } - public final Flow.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/studio/v2/FlowCreator.java b/src/main/java/com/twilio/rest/studio/v2/FlowCreator.java index 3834351da1..9ae445c987 100644 --- a/src/main/java/com/twilio/rest/studio/v2/FlowCreator.java +++ b/src/main/java/com/twilio/rest/studio/v2/FlowCreator.java @@ -26,20 +26,18 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class FlowCreator extends Creator { private String friendlyName; private Flow.Status status; - private Map definition; + private Object definition; private String commitMessage; public FlowCreator( final String friendlyName, final Flow.Status status, - final Map definition + final Object definition ) { this.friendlyName = friendlyName; this.status = status; @@ -56,7 +54,7 @@ public FlowCreator setStatus(final Flow.Status status) { return this; } - public FlowCreator setDefinition(final Map definition) { + public FlowCreator setDefinition(final Object definition) { this.definition = definition; return this; } @@ -116,7 +114,10 @@ private void addPostParams(final Request request) { request.addPostParam("Status", status.toString()); } if (definition != null) { - request.addPostParam("Definition", Converter.mapToJson(definition)); + request.addPostParam( + "Definition", + Converter.objectToJson(definition) + ); } if (commitMessage != null) { request.addPostParam("CommitMessage", commitMessage); diff --git a/src/main/java/com/twilio/rest/studio/v2/FlowUpdater.java b/src/main/java/com/twilio/rest/studio/v2/FlowUpdater.java index 981e21f24e..6d625f2a21 100644 --- a/src/main/java/com/twilio/rest/studio/v2/FlowUpdater.java +++ b/src/main/java/com/twilio/rest/studio/v2/FlowUpdater.java @@ -25,14 +25,13 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class FlowUpdater extends Updater { private String pathSid; private Flow.Status status; private String friendlyName; - private Map definition; + private Object definition; private String commitMessage; public FlowUpdater(final String pathSid, final Flow.Status status) { @@ -50,7 +49,7 @@ public FlowUpdater setFriendlyName(final String friendlyName) { return this; } - public FlowUpdater setDefinition(final Map definition) { + public FlowUpdater setDefinition(final Object definition) { this.definition = definition; return this; } @@ -104,7 +103,10 @@ private void addPostParams(final Request request) { request.addPostParam("FriendlyName", friendlyName); } if (definition != null) { - request.addPostParam("Definition", Converter.mapToJson(definition)); + request.addPostParam( + "Definition", + Converter.objectToJson(definition) + ); } if (commitMessage != null) { request.addPostParam("CommitMessage", commitMessage); diff --git a/src/main/java/com/twilio/rest/studio/v2/FlowValidate.java b/src/main/java/com/twilio/rest/studio/v2/FlowValidate.java index f3a156394a..1024e89519 100644 --- a/src/main/java/com/twilio/rest/studio/v2/FlowValidate.java +++ b/src/main/java/com/twilio/rest/studio/v2/FlowValidate.java @@ -26,8 +26,6 @@ import com.twilio.exception.ApiException; import java.io.IOException; import java.io.InputStream; -import java.util.Map; -import java.util.Map; import java.util.Objects; import lombok.ToString; import lombok.ToString; @@ -40,8 +38,8 @@ public class FlowValidate extends Resource { public static FlowValidateUpdater updater( final String friendlyName, - final FlowValidate.Status status, - final Map definition + final Status status, + final Object definition ) { return new FlowValidateUpdater(friendlyName, status, definition); } diff --git a/src/main/java/com/twilio/rest/studio/v2/FlowValidateUpdater.java b/src/main/java/com/twilio/rest/studio/v2/FlowValidateUpdater.java index 7c97916960..954245fd2a 100644 --- a/src/main/java/com/twilio/rest/studio/v2/FlowValidateUpdater.java +++ b/src/main/java/com/twilio/rest/studio/v2/FlowValidateUpdater.java @@ -25,19 +25,18 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class FlowValidateUpdater extends Updater { private String friendlyName; private FlowValidate.Status status; - private Map definition; + private Object definition; private String commitMessage; public FlowValidateUpdater( final String friendlyName, final FlowValidate.Status status, - final Map definition + final Object definition ) { this.friendlyName = friendlyName; this.status = status; @@ -54,9 +53,7 @@ public FlowValidateUpdater setStatus(final FlowValidate.Status status) { return this; } - public FlowValidateUpdater setDefinition( - final Map definition - ) { + public FlowValidateUpdater setDefinition(final Object definition) { this.definition = definition; return this; } @@ -119,7 +116,10 @@ private void addPostParams(final Request request) { request.addPostParam("Status", status.toString()); } if (definition != null) { - request.addPostParam("Definition", Converter.mapToJson(definition)); + request.addPostParam( + "Definition", + Converter.objectToJson(definition) + ); } if (commitMessage != null) { request.addPostParam("CommitMessage", commitMessage); diff --git a/src/main/java/com/twilio/rest/studio/v2/flow/Execution.java b/src/main/java/com/twilio/rest/studio/v2/flow/Execution.java index a39e679402..be8fa736c7 100644 --- a/src/main/java/com/twilio/rest/studio/v2/flow/Execution.java +++ b/src/main/java/com/twilio/rest/studio/v2/flow/Execution.java @@ -70,7 +70,7 @@ public static ExecutionReader reader(final String pathFlowSid) { public static ExecutionUpdater updater( final String pathFlowSid, final String pathSid, - final Execution.Status status + final Status status ) { return new ExecutionUpdater(pathFlowSid, pathSid, status); } @@ -123,7 +123,7 @@ public static Execution fromJson( private final String flowSid; private final String contactChannelAddress; private final Map context; - private final Execution.Status status; + private final Status status; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -138,7 +138,7 @@ private Execution( "contact_channel_address" ) final String contactChannelAddress, @JsonProperty("context") final Map context, - @JsonProperty("status") final Execution.Status status, + @JsonProperty("status") final Status status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url, @@ -176,7 +176,7 @@ public final Map getContext() { return this.context; } - public final Execution.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/studio/v2/flow/ExecutionCreator.java b/src/main/java/com/twilio/rest/studio/v2/flow/ExecutionCreator.java index df3d5c1245..df95407644 100644 --- a/src/main/java/com/twilio/rest/studio/v2/flow/ExecutionCreator.java +++ b/src/main/java/com/twilio/rest/studio/v2/flow/ExecutionCreator.java @@ -27,15 +27,13 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class ExecutionCreator extends Creator { private String pathFlowSid; private com.twilio.type.PhoneNumber to; private com.twilio.type.PhoneNumber from; - private Map parameters; + private Object parameters; public ExecutionCreator( final String pathFlowSid, @@ -65,9 +63,7 @@ public ExecutionCreator setFrom(final String from) { return setFrom(Promoter.phoneNumberFromString(from)); } - public ExecutionCreator setParameters( - final Map parameters - ) { + public ExecutionCreator setParameters(final Object parameters) { this.parameters = parameters; return this; } @@ -77,8 +73,8 @@ public Execution create(final TwilioRestClient client) { String path = "/v2/Flows/{FlowSid}/Executions"; path = path.replace("{" + "FlowSid" + "}", this.pathFlowSid.toString()); - path = path.replace("{" + "To" + "}", this.to.encode("utf-8")); - path = path.replace("{" + "From" + "}", this.from.encode("utf-8")); + path = path.replace("{" + "To" + "}", this.to.toString()); + path = path.replace("{" + "From" + "}", this.from.toString()); Request request = new Request( HttpMethod.POST, @@ -120,7 +116,10 @@ private void addPostParams(final Request request) { request.addPostParam("From", from.toString()); } if (parameters != null) { - request.addPostParam("Parameters", Converter.mapToJson(parameters)); + request.addPostParam( + "Parameters", + Converter.objectToJson(parameters) + ); } } } diff --git a/src/main/java/com/twilio/rest/studio/v2/flow/FlowRevision.java b/src/main/java/com/twilio/rest/studio/v2/flow/FlowRevision.java index c92a4d7238..852a110e87 100644 --- a/src/main/java/com/twilio/rest/studio/v2/flow/FlowRevision.java +++ b/src/main/java/com/twilio/rest/studio/v2/flow/FlowRevision.java @@ -100,7 +100,7 @@ public static FlowRevision fromJson( private final String accountSid; private final String friendlyName; private final Map definition; - private final FlowRevision.Status status; + private final Status status; private final Integer revision; private final String commitMessage; private final Boolean valid; @@ -115,7 +115,7 @@ private FlowRevision( @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("definition") final Map definition, - @JsonProperty("status") final FlowRevision.Status status, + @JsonProperty("status") final Status status, @JsonProperty("revision") final Integer revision, @JsonProperty("commit_message") final String commitMessage, @JsonProperty("valid") final Boolean valid, @@ -154,7 +154,7 @@ public final Map getDefinition() { return this.definition; } - public final FlowRevision.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/EsimProfile.java b/src/main/java/com/twilio/rest/supersim/v1/EsimProfile.java index 5d3e1b08eb..311216484a 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/EsimProfile.java +++ b/src/main/java/com/twilio/rest/supersim/v1/EsimProfile.java @@ -98,7 +98,7 @@ public static EsimProfile fromJson( private final String accountSid; private final String iccid; private final String simSid; - private final EsimProfile.Status status; + private final Status status; private final String eid; private final URI smdpPlusAddress; private final String matchingId; @@ -115,7 +115,7 @@ private EsimProfile( @JsonProperty("account_sid") final String accountSid, @JsonProperty("iccid") final String iccid, @JsonProperty("sim_sid") final String simSid, - @JsonProperty("status") final EsimProfile.Status status, + @JsonProperty("status") final Status status, @JsonProperty("eid") final String eid, @JsonProperty("smdp_plus_address") final URI smdpPlusAddress, @JsonProperty("matching_id") final String matchingId, @@ -158,7 +158,7 @@ public final String getSimSid() { return this.simSid; } - public final EsimProfile.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/Fleet.java b/src/main/java/com/twilio/rest/supersim/v1/Fleet.java index 19c54502b2..2b9adfe683 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/Fleet.java +++ b/src/main/java/com/twilio/rest/supersim/v1/Fleet.java @@ -107,7 +107,7 @@ public static Fleet fromJson( private final URI url; private final Boolean dataEnabled; private final Integer dataLimit; - private final Fleet.DataMetering dataMetering; + private final DataMetering dataMetering; private final Boolean smsCommandsEnabled; private final URI smsCommandsUrl; private final HttpMethod smsCommandsMethod; @@ -125,7 +125,7 @@ private Fleet( @JsonProperty("url") final URI url, @JsonProperty("data_enabled") final Boolean dataEnabled, @JsonProperty("data_limit") final Integer dataLimit, - @JsonProperty("data_metering") final Fleet.DataMetering dataMetering, + @JsonProperty("data_metering") final DataMetering dataMetering, @JsonProperty("sms_commands_enabled") final Boolean smsCommandsEnabled, @JsonProperty("sms_commands_url") final URI smsCommandsUrl, @JsonProperty("sms_commands_method") final HttpMethod smsCommandsMethod, @@ -184,7 +184,7 @@ public final Integer getDataLimit() { return this.dataLimit; } - public final Fleet.DataMetering getDataMetering() { + public final DataMetering getDataMetering() { return this.dataMetering; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/IpCommand.java b/src/main/java/com/twilio/rest/supersim/v1/IpCommand.java index da34f019a3..aedeae6f5e 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/IpCommand.java +++ b/src/main/java/com/twilio/rest/supersim/v1/IpCommand.java @@ -102,11 +102,11 @@ public static IpCommand fromJson( private final String accountSid; private final String simSid; private final String simIccid; - private final IpCommand.Status status; - private final IpCommand.Direction direction; + private final Status status; + private final Direction direction; private final String deviceIp; private final Integer devicePort; - private final IpCommand.PayloadType payloadType; + private final PayloadType payloadType; private final String payload; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -118,11 +118,11 @@ private IpCommand( @JsonProperty("account_sid") final String accountSid, @JsonProperty("sim_sid") final String simSid, @JsonProperty("sim_iccid") final String simIccid, - @JsonProperty("status") final IpCommand.Status status, - @JsonProperty("direction") final IpCommand.Direction direction, + @JsonProperty("status") final Status status, + @JsonProperty("direction") final Direction direction, @JsonProperty("device_ip") final String deviceIp, @JsonProperty("device_port") final Integer devicePort, - @JsonProperty("payload_type") final IpCommand.PayloadType payloadType, + @JsonProperty("payload_type") final PayloadType payloadType, @JsonProperty("payload") final String payload, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -159,11 +159,11 @@ public final String getSimIccid() { return this.simIccid; } - public final IpCommand.Status getStatus() { + public final Status getStatus() { return this.status; } - public final IpCommand.Direction getDirection() { + public final Direction getDirection() { return this.direction; } @@ -175,7 +175,7 @@ public final Integer getDevicePort() { return this.devicePort; } - public final IpCommand.PayloadType getPayloadType() { + public final PayloadType getPayloadType() { return this.payloadType; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/SettingsUpdate.java b/src/main/java/com/twilio/rest/supersim/v1/SettingsUpdate.java index 4d3dbc2f17..05a18f96f5 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/SettingsUpdate.java +++ b/src/main/java/com/twilio/rest/supersim/v1/SettingsUpdate.java @@ -91,7 +91,7 @@ public static SettingsUpdate fromJson( private final String sid; private final String iccid; private final String simSid; - private final SettingsUpdate.Status status; + private final Status status; private final List> packages; private final ZonedDateTime dateCompleted; private final ZonedDateTime dateCreated; @@ -102,7 +102,7 @@ private SettingsUpdate( @JsonProperty("sid") final String sid, @JsonProperty("iccid") final String iccid, @JsonProperty("sim_sid") final String simSid, - @JsonProperty("status") final SettingsUpdate.Status status, + @JsonProperty("status") final Status status, @JsonProperty("packages") final List> packages, @JsonProperty("date_completed") final String dateCompleted, @JsonProperty("date_created") final String dateCreated, @@ -131,7 +131,7 @@ public final String getSimSid() { return this.simSid; } - public final SettingsUpdate.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/Sim.java b/src/main/java/com/twilio/rest/supersim/v1/Sim.java index 072e1815fb..2829cf05ba 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/Sim.java +++ b/src/main/java/com/twilio/rest/supersim/v1/Sim.java @@ -107,7 +107,7 @@ public static Sim fromJson( private final String uniqueName; private final String accountSid; private final String iccid; - private final Sim.Status status; + private final Status status; private final String fleetSid; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -120,7 +120,7 @@ private Sim( @JsonProperty("unique_name") final String uniqueName, @JsonProperty("account_sid") final String accountSid, @JsonProperty("iccid") final String iccid, - @JsonProperty("status") final Sim.Status status, + @JsonProperty("status") final Status status, @JsonProperty("fleet_sid") final String fleetSid, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -155,7 +155,7 @@ public final String getIccid() { return this.iccid; } - public final Sim.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/SmsCommand.java b/src/main/java/com/twilio/rest/supersim/v1/SmsCommand.java index ab1c698aa7..6e22dd0e57 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/SmsCommand.java +++ b/src/main/java/com/twilio/rest/supersim/v1/SmsCommand.java @@ -101,8 +101,8 @@ public static SmsCommand fromJson( private final String accountSid; private final String simSid; private final String payload; - private final SmsCommand.Status status; - private final SmsCommand.Direction direction; + private final Status status; + private final Direction direction; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -113,8 +113,8 @@ private SmsCommand( @JsonProperty("account_sid") final String accountSid, @JsonProperty("sim_sid") final String simSid, @JsonProperty("payload") final String payload, - @JsonProperty("status") final SmsCommand.Status status, - @JsonProperty("direction") final SmsCommand.Direction direction, + @JsonProperty("status") final Status status, + @JsonProperty("direction") final Direction direction, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url @@ -146,11 +146,11 @@ public final String getPayload() { return this.payload; } - public final SmsCommand.Status getStatus() { + public final Status getStatus() { return this.status; } - public final SmsCommand.Direction getDirection() { + public final Direction getDirection() { return this.direction; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/UsageRecord.java b/src/main/java/com/twilio/rest/supersim/v1/UsageRecord.java index 2b7510e170..dd18ce4249 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/UsageRecord.java +++ b/src/main/java/com/twilio/rest/supersim/v1/UsageRecord.java @@ -114,7 +114,7 @@ private UsageRecord( @JsonProperty("data_total") final Long dataTotal, @JsonProperty("data_total_billed") final BigDecimal dataTotalBilled, @JsonProperty("billed_unit") @JsonDeserialize( - using = com.twilio.converter.CurrencyDeserializer.class + using = CurrencyDeserializer.class ) final Currency billedUnit ) { this.accountSid = accountSid; diff --git a/src/main/java/com/twilio/rest/supersim/v1/sim/BillingPeriod.java b/src/main/java/com/twilio/rest/supersim/v1/sim/BillingPeriod.java index d73822c5b7..2cd6b48046 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/sim/BillingPeriod.java +++ b/src/main/java/com/twilio/rest/supersim/v1/sim/BillingPeriod.java @@ -90,7 +90,7 @@ public static BillingPeriod fromJson( private final String simSid; private final ZonedDateTime startTime; private final ZonedDateTime endTime; - private final BillingPeriod.BpType periodType; + private final BpType periodType; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -101,7 +101,7 @@ private BillingPeriod( @JsonProperty("sim_sid") final String simSid, @JsonProperty("start_time") final String startTime, @JsonProperty("end_time") final String endTime, - @JsonProperty("period_type") final BillingPeriod.BpType periodType, + @JsonProperty("period_type") final BpType periodType, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated ) { @@ -135,7 +135,7 @@ public final ZonedDateTime getEndTime() { return this.endTime; } - public final BillingPeriod.BpType getPeriodType() { + public final BpType getPeriodType() { return this.periodType; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/sim/SimIpAddress.java b/src/main/java/com/twilio/rest/supersim/v1/sim/SimIpAddress.java index 2983f71ba4..88f3361ac7 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/sim/SimIpAddress.java +++ b/src/main/java/com/twilio/rest/supersim/v1/sim/SimIpAddress.java @@ -84,14 +84,14 @@ public static SimIpAddress fromJson( } private final String ipAddress; - private final SimIpAddress.IpAddressVersion ipAddressVersion; + private final IpAddressVersion ipAddressVersion; @JsonCreator private SimIpAddress( @JsonProperty("ip_address") final String ipAddress, @JsonProperty( "ip_address_version" - ) final SimIpAddress.IpAddressVersion ipAddressVersion + ) final IpAddressVersion ipAddressVersion ) { this.ipAddress = ipAddress; this.ipAddressVersion = ipAddressVersion; @@ -101,7 +101,7 @@ public final String getIpAddress() { return this.ipAddress; } - public final SimIpAddress.IpAddressVersion getIpAddressVersion() { + public final IpAddressVersion getIpAddressVersion() { return this.ipAddressVersion; } diff --git a/src/main/java/com/twilio/rest/sync/v1/service/DocumentCreator.java b/src/main/java/com/twilio/rest/sync/v1/service/DocumentCreator.java index 9b5eca36b7..3ad46deab0 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/DocumentCreator.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/DocumentCreator.java @@ -26,14 +26,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class DocumentCreator extends Creator { private String pathServiceSid; private String uniqueName; - private Map data; + private Object data; private Integer ttl; public DocumentCreator(final String pathServiceSid) { @@ -45,7 +43,7 @@ public DocumentCreator setUniqueName(final String uniqueName) { return this; } - public DocumentCreator setData(final Map data) { + public DocumentCreator setData(final Object data) { this.data = data; return this; } @@ -102,7 +100,7 @@ private void addPostParams(final Request request) { request.addPostParam("UniqueName", uniqueName); } if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/DocumentUpdater.java b/src/main/java/com/twilio/rest/sync/v1/service/DocumentUpdater.java index 1561d4c8a2..8c4bb058d5 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/DocumentUpdater.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/DocumentUpdater.java @@ -25,14 +25,13 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class DocumentUpdater extends Updater { private String pathServiceSid; private String pathSid; private String ifMatch; - private Map data; + private Object data; private Integer ttl; public DocumentUpdater(final String pathServiceSid, final String pathSid) { @@ -45,7 +44,7 @@ public DocumentUpdater setIfMatch(final String ifMatch) { return this; } - public DocumentUpdater setData(final Map data) { + public DocumentUpdater setData(final Object data) { this.data = data; return this; } @@ -101,7 +100,7 @@ public Document update(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItem.java b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItem.java index c0d70df086..00bbcafebd 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItem.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItem.java @@ -44,7 +44,7 @@ public class SyncListItem extends Resource { public static SyncListItemCreator creator( final String pathServiceSid, final String pathListSid, - final Map data + final Object data ) { return new SyncListItemCreator(pathServiceSid, pathListSid, data); } diff --git a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemCreator.java b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemCreator.java index 2af4101ee6..4d8ac8f192 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemCreator.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemCreator.java @@ -26,14 +26,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class SyncListItemCreator extends Creator { private String pathServiceSid; private String pathListSid; - private Map data; + private Object data; private Integer ttl; private Integer itemTtl; private Integer collectionTtl; @@ -41,14 +39,14 @@ public class SyncListItemCreator extends Creator { public SyncListItemCreator( final String pathServiceSid, final String pathListSid, - final Map data + final Object data ) { this.pathServiceSid = pathServiceSid; this.pathListSid = pathListSid; this.data = data; } - public SyncListItemCreator setData(final Map data) { + public SyncListItemCreator setData(final Object data) { this.data = data; return this; } @@ -114,7 +112,7 @@ public SyncListItem create(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemUpdater.java b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemUpdater.java index df538d9384..24dde562ca 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemUpdater.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemUpdater.java @@ -25,7 +25,6 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class SyncListItemUpdater extends Updater { @@ -33,7 +32,7 @@ public class SyncListItemUpdater extends Updater { private String pathListSid; private Integer pathIndex; private String ifMatch; - private Map data; + private Object data; private Integer ttl; private Integer itemTtl; private Integer collectionTtl; @@ -53,7 +52,7 @@ public SyncListItemUpdater setIfMatch(final String ifMatch) { return this; } - public SyncListItemUpdater setData(final Map data) { + public SyncListItemUpdater setData(final Object data) { this.data = data; return this; } @@ -120,7 +119,7 @@ public SyncListItem update(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItem.java b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItem.java index e2c25935cf..f134d6fb0c 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItem.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItem.java @@ -45,7 +45,7 @@ public static SyncMapItemCreator creator( final String pathServiceSid, final String pathMapSid, final String key, - final Map data + final Object data ) { return new SyncMapItemCreator(pathServiceSid, pathMapSid, key, data); } diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemCreator.java b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemCreator.java index 095e615ca2..c85bdbfeb9 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemCreator.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemCreator.java @@ -26,15 +26,13 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class SyncMapItemCreator extends Creator { private String pathServiceSid; private String pathMapSid; private String key; - private Map data; + private Object data; private Integer ttl; private Integer itemTtl; private Integer collectionTtl; @@ -43,7 +41,7 @@ public SyncMapItemCreator( final String pathServiceSid, final String pathMapSid, final String key, - final Map data + final Object data ) { this.pathServiceSid = pathServiceSid; this.pathMapSid = pathMapSid; @@ -56,7 +54,7 @@ public SyncMapItemCreator setKey(final String key) { return this; } - public SyncMapItemCreator setData(final Map data) { + public SyncMapItemCreator setData(final Object data) { this.data = data; return this; } @@ -126,7 +124,7 @@ private void addPostParams(final Request request) { request.addPostParam("Key", key); } if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemUpdater.java b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemUpdater.java index f9cb5af292..b0b1a151c0 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemUpdater.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemUpdater.java @@ -25,7 +25,6 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class SyncMapItemUpdater extends Updater { @@ -33,7 +32,7 @@ public class SyncMapItemUpdater extends Updater { private String pathMapSid; private String pathKey; private String ifMatch; - private Map data; + private Object data; private Integer ttl; private Integer itemTtl; private Integer collectionTtl; @@ -53,7 +52,7 @@ public SyncMapItemUpdater setIfMatch(final String ifMatch) { return this; } - public SyncMapItemUpdater setData(final Map data) { + public SyncMapItemUpdater setData(final Object data) { this.data = data; return this; } @@ -120,7 +119,7 @@ public SyncMapItem update(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessage.java b/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessage.java index 7191f3acc2..b787e9d5a1 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessage.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessage.java @@ -40,7 +40,7 @@ public class StreamMessage extends Resource { public static StreamMessageCreator creator( final String pathServiceSid, final String pathStreamSid, - final Map data + final Object data ) { return new StreamMessageCreator(pathServiceSid, pathStreamSid, data); } diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessageCreator.java b/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessageCreator.java index 5739a6e69d..015002f303 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessageCreator.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessageCreator.java @@ -26,26 +26,24 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class StreamMessageCreator extends Creator { private String pathServiceSid; private String pathStreamSid; - private Map data; + private Object data; public StreamMessageCreator( final String pathServiceSid, final String pathStreamSid, - final Map data + final Object data ) { this.pathServiceSid = pathServiceSid; this.pathStreamSid = pathStreamSid; this.data = data; } - public StreamMessageCreator setData(final Map data) { + public StreamMessageCreator setData(final Object data) { this.data = data; return this; } @@ -100,7 +98,7 @@ public StreamMessage create(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } } } diff --git a/src/main/java/com/twilio/rest/taskrouter/v1/Workspace.java b/src/main/java/com/twilio/rest/taskrouter/v1/Workspace.java index 4ab41a8013..9d2660f685 100644 --- a/src/main/java/com/twilio/rest/taskrouter/v1/Workspace.java +++ b/src/main/java/com/twilio/rest/taskrouter/v1/Workspace.java @@ -116,7 +116,7 @@ public static Workspace fromJson( private final String sid; private final String timeoutActivityName; private final String timeoutActivitySid; - private final Workspace.QueueOrder prioritizeQueueOrder; + private final QueueOrder prioritizeQueueOrder; private final URI url; private final Map links; @@ -136,7 +136,7 @@ private Workspace( @JsonProperty("timeout_activity_sid") final String timeoutActivitySid, @JsonProperty( "prioritize_queue_order" - ) final Workspace.QueueOrder prioritizeQueueOrder, + ) final QueueOrder prioritizeQueueOrder, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links ) { @@ -205,7 +205,7 @@ public final String getTimeoutActivitySid() { return this.timeoutActivitySid; } - public final Workspace.QueueOrder getPrioritizeQueueOrder() { + public final QueueOrder getPrioritizeQueueOrder() { return this.prioritizeQueueOrder; } diff --git a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/Task.java b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/Task.java index 5179bf0053..09f55e1d04 100644 --- a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/Task.java +++ b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/Task.java @@ -115,7 +115,7 @@ public static Task fromJson( private final String accountSid; private final Integer age; - private final Task.Status assignmentStatus; + private final Status assignmentStatus; private final String attributes; private final String addons; private final ZonedDateTime dateCreated; @@ -142,7 +142,7 @@ public static Task fromJson( private Task( @JsonProperty("account_sid") final String accountSid, @JsonProperty("age") final Integer age, - @JsonProperty("assignment_status") final Task.Status assignmentStatus, + @JsonProperty("assignment_status") final Status assignmentStatus, @JsonProperty("attributes") final String attributes, @JsonProperty("addons") final String addons, @JsonProperty("date_created") final String dateCreated, @@ -209,7 +209,7 @@ public final Integer getAge() { return this.age; } - public final Task.Status getAssignmentStatus() { + public final Status getAssignmentStatus() { return this.assignmentStatus; } diff --git a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/TaskQueue.java b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/TaskQueue.java index 15f1dfabef..28550cc4ce 100644 --- a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/TaskQueue.java +++ b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/TaskQueue.java @@ -127,7 +127,7 @@ public static TaskQueue fromJson( private final String reservationActivityName; private final String sid; private final String targetWorkers; - private final TaskQueue.TaskOrder taskOrder; + private final TaskOrder taskOrder; private final URI url; private final String workspaceSid; private final Map links; @@ -153,7 +153,7 @@ private TaskQueue( ) final String reservationActivityName, @JsonProperty("sid") final String sid, @JsonProperty("target_workers") final String targetWorkers, - @JsonProperty("task_order") final TaskQueue.TaskOrder taskOrder, + @JsonProperty("task_order") final TaskOrder taskOrder, @JsonProperty("url") final URI url, @JsonProperty("workspace_sid") final String workspaceSid, @JsonProperty("links") final Map links @@ -219,7 +219,7 @@ public final String getTargetWorkers() { return this.targetWorkers; } - public final TaskQueue.TaskOrder getTaskOrder() { + public final TaskOrder getTaskOrder() { return this.taskOrder; } diff --git a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/task/Reservation.java b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/task/Reservation.java index e3755218cc..14ae6d69c9 100644 --- a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/task/Reservation.java +++ b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/task/Reservation.java @@ -110,7 +110,7 @@ public static Reservation fromJson( private final String accountSid; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; - private final Reservation.Status reservationStatus; + private final Status reservationStatus; private final String sid; private final String taskSid; private final String workerName; @@ -124,9 +124,7 @@ private Reservation( @JsonProperty("account_sid") final String accountSid, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, - @JsonProperty( - "reservation_status" - ) final Reservation.Status reservationStatus, + @JsonProperty("reservation_status") final Status reservationStatus, @JsonProperty("sid") final String sid, @JsonProperty("task_sid") final String taskSid, @JsonProperty("worker_name") final String workerName, @@ -160,7 +158,7 @@ public final ZonedDateTime getDateUpdated() { return this.dateUpdated; } - public final Reservation.Status getReservationStatus() { + public final Status getReservationStatus() { return this.reservationStatus; } diff --git a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/worker/Reservation.java b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/worker/Reservation.java index 3c6c7d48d6..89c4a7f9d4 100644 --- a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/worker/Reservation.java +++ b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/worker/Reservation.java @@ -110,7 +110,7 @@ public static Reservation fromJson( private final String accountSid; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; - private final Reservation.Status reservationStatus; + private final Status reservationStatus; private final String sid; private final String taskSid; private final String workerName; @@ -124,9 +124,7 @@ private Reservation( @JsonProperty("account_sid") final String accountSid, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, - @JsonProperty( - "reservation_status" - ) final Reservation.Status reservationStatus, + @JsonProperty("reservation_status") final Status reservationStatus, @JsonProperty("sid") final String sid, @JsonProperty("task_sid") final String taskSid, @JsonProperty("worker_name") final String workerName, @@ -160,7 +158,7 @@ public final ZonedDateTime getDateUpdated() { return this.dateUpdated; } - public final Reservation.Status getReservationStatus() { + public final Status getReservationStatus() { return this.reservationStatus; } diff --git a/src/main/java/com/twilio/rest/trunking/v1/Trunk.java b/src/main/java/com/twilio/rest/trunking/v1/Trunk.java index 2d77f12579..48919cb239 100644 --- a/src/main/java/com/twilio/rest/trunking/v1/Trunk.java +++ b/src/main/java/com/twilio/rest/trunking/v1/Trunk.java @@ -113,8 +113,8 @@ public static Trunk fromJson( private final String friendlyName; private final Boolean secure; private final Map recording; - private final Trunk.TransferSetting transferMode; - private final Trunk.TransferCallerId transferCallerId; + private final TransferSetting transferMode; + private final TransferCallerId transferCallerId; private final Boolean cnamLookupEnabled; private final String authType; private final List authTypeSet; @@ -135,10 +135,10 @@ private Trunk( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("secure") final Boolean secure, @JsonProperty("recording") final Map recording, - @JsonProperty("transfer_mode") final Trunk.TransferSetting transferMode, + @JsonProperty("transfer_mode") final TransferSetting transferMode, @JsonProperty( "transfer_caller_id" - ) final Trunk.TransferCallerId transferCallerId, + ) final TransferCallerId transferCallerId, @JsonProperty("cnam_lookup_enabled") final Boolean cnamLookupEnabled, @JsonProperty("auth_type") final String authType, @JsonProperty("auth_type_set") final List authTypeSet, @@ -195,11 +195,11 @@ public final Map getRecording() { return this.recording; } - public final Trunk.TransferSetting getTransferMode() { + public final TransferSetting getTransferMode() { return this.transferMode; } - public final Trunk.TransferCallerId getTransferCallerId() { + public final TransferCallerId getTransferCallerId() { return this.transferCallerId; } diff --git a/src/main/java/com/twilio/rest/trunking/v1/trunk/PhoneNumber.java b/src/main/java/com/twilio/rest/trunking/v1/trunk/PhoneNumber.java index 733b18311c..beef3087ff 100644 --- a/src/main/java/com/twilio/rest/trunking/v1/trunk/PhoneNumber.java +++ b/src/main/java/com/twilio/rest/trunking/v1/trunk/PhoneNumber.java @@ -111,7 +111,7 @@ public static PhoneNumber fromJson( } private final String accountSid; - private final PhoneNumber.AddressRequirement addressRequirements; + private final AddressRequirement addressRequirements; private final String apiVersion; private final Boolean beta; private final Map capabilities; @@ -142,7 +142,7 @@ private PhoneNumber( @JsonProperty("account_sid") final String accountSid, @JsonProperty( "address_requirements" - ) final PhoneNumber.AddressRequirement addressRequirements, + ) final AddressRequirement addressRequirements, @JsonProperty("api_version") final String apiVersion, @JsonProperty("beta") final Boolean beta, @JsonProperty("capabilities") final Map capabilities, @@ -208,7 +208,7 @@ public final String getAccountSid() { return this.accountSid; } - public final PhoneNumber.AddressRequirement getAddressRequirements() { + public final AddressRequirement getAddressRequirements() { return this.addressRequirements; } diff --git a/src/main/java/com/twilio/rest/trunking/v1/trunk/Recording.java b/src/main/java/com/twilio/rest/trunking/v1/trunk/Recording.java index 022e65d0b9..709ccb95c9 100644 --- a/src/main/java/com/twilio/rest/trunking/v1/trunk/Recording.java +++ b/src/main/java/com/twilio/rest/trunking/v1/trunk/Recording.java @@ -87,23 +87,23 @@ public static Recording fromJson( } } - private final Recording.RecordingMode mode; - private final Recording.RecordingTrim trim; + private final RecordingMode mode; + private final RecordingTrim trim; @JsonCreator private Recording( - @JsonProperty("mode") final Recording.RecordingMode mode, - @JsonProperty("trim") final Recording.RecordingTrim trim + @JsonProperty("mode") final RecordingMode mode, + @JsonProperty("trim") final RecordingTrim trim ) { this.mode = mode; this.trim = trim; } - public final Recording.RecordingMode getMode() { + public final RecordingMode getMode() { return this.mode; } - public final Recording.RecordingTrim getTrim() { + public final RecordingTrim getTrim() { return this.trim; } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/ComplianceRegistrationInquiries.java b/src/main/java/com/twilio/rest/trusthub/v1/ComplianceRegistrationInquiries.java index b633de24f7..76a614b6e0 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/ComplianceRegistrationInquiries.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/ComplianceRegistrationInquiries.java @@ -38,8 +38,8 @@ public class ComplianceRegistrationInquiries extends Resource { private static final long serialVersionUID = 153862952025802L; public static ComplianceRegistrationInquiriesCreator creator( - final ComplianceRegistrationInquiries.EndUserType endUserType, - final ComplianceRegistrationInquiries.PhoneNumberType phoneNumberType + final EndUserType endUserType, + final PhoneNumberType phoneNumberType ) { return new ComplianceRegistrationInquiriesCreator( endUserType, diff --git a/src/main/java/com/twilio/rest/trusthub/v1/ComplianceTollfreeInquiriesCreator.java b/src/main/java/com/twilio/rest/trusthub/v1/ComplianceTollfreeInquiriesCreator.java index 35cf959970..a4413dc4c8 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/ComplianceTollfreeInquiriesCreator.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/ComplianceTollfreeInquiriesCreator.java @@ -259,7 +259,7 @@ public ComplianceTollfreeInquiries create(final TwilioRestClient client) { path = path.replace( "{" + "TollfreePhoneNumber" + "}", - this.tollfreePhoneNumber.encode("utf-8") + this.tollfreePhoneNumber.toString() ); path = path.replace( diff --git a/src/main/java/com/twilio/rest/trusthub/v1/CustomerProfiles.java b/src/main/java/com/twilio/rest/trusthub/v1/CustomerProfiles.java index 9217f2067b..7225389bcd 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/CustomerProfiles.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/CustomerProfiles.java @@ -113,7 +113,7 @@ public static CustomerProfiles fromJson( private final String accountSid; private final String policySid; private final String friendlyName; - private final CustomerProfiles.Status status; + private final Status status; private final ZonedDateTime validUntil; private final String email; private final URI statusCallback; @@ -129,7 +129,7 @@ private CustomerProfiles( @JsonProperty("account_sid") final String accountSid, @JsonProperty("policy_sid") final String policySid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final CustomerProfiles.Status status, + @JsonProperty("status") final Status status, @JsonProperty("valid_until") final String validUntil, @JsonProperty("email") final String email, @JsonProperty("status_callback") final URI statusCallback, @@ -170,7 +170,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final CustomerProfiles.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/EndUserCreator.java b/src/main/java/com/twilio/rest/trusthub/v1/EndUserCreator.java index 0be75ae9a4..aaddaa97f9 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/EndUserCreator.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/EndUserCreator.java @@ -26,14 +26,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class EndUserCreator extends Creator { private String friendlyName; private String type; - private Map attributes; + private Object attributes; public EndUserCreator(final String friendlyName, final String type) { this.friendlyName = friendlyName; @@ -50,7 +48,7 @@ public EndUserCreator setType(final String type) { return this; } - public EndUserCreator setAttributes(final Map attributes) { + public EndUserCreator setAttributes(final Object attributes) { this.attributes = attributes; return this; } @@ -103,7 +101,10 @@ private void addPostParams(final Request request) { request.addPostParam("Type", type); } if (attributes != null) { - request.addPostParam("Attributes", Converter.mapToJson(attributes)); + request.addPostParam( + "Attributes", + Converter.objectToJson(attributes) + ); } } } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/EndUserUpdater.java b/src/main/java/com/twilio/rest/trusthub/v1/EndUserUpdater.java index 39e4de9753..479a4a4ed9 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/EndUserUpdater.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/EndUserUpdater.java @@ -25,13 +25,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class EndUserUpdater extends Updater { private String pathSid; private String friendlyName; - private Map attributes; + private Object attributes; public EndUserUpdater(final String pathSid) { this.pathSid = pathSid; @@ -42,7 +41,7 @@ public EndUserUpdater setFriendlyName(final String friendlyName) { return this; } - public EndUserUpdater setAttributes(final Map attributes) { + public EndUserUpdater setAttributes(final Object attributes) { this.attributes = attributes; return this; } @@ -87,7 +86,10 @@ private void addPostParams(final Request request) { request.addPostParam("FriendlyName", friendlyName); } if (attributes != null) { - request.addPostParam("Attributes", Converter.mapToJson(attributes)); + request.addPostParam( + "Attributes", + Converter.objectToJson(attributes) + ); } } } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocument.java b/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocument.java index fcb0e31305..e9c68d404c 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocument.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocument.java @@ -111,7 +111,7 @@ public static SupportingDocument fromJson( private final String accountSid; private final String friendlyName; private final String mimeType; - private final SupportingDocument.Status status; + private final Status status; private final String type; private final Map attributes; private final ZonedDateTime dateCreated; @@ -124,7 +124,7 @@ private SupportingDocument( @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("mime_type") final String mimeType, - @JsonProperty("status") final SupportingDocument.Status status, + @JsonProperty("status") final Status status, @JsonProperty("type") final String type, @JsonProperty("attributes") final Map attributes, @JsonProperty("date_created") final String dateCreated, @@ -159,7 +159,7 @@ public final String getMimeType() { return this.mimeType; } - public final SupportingDocument.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocumentCreator.java b/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocumentCreator.java index 6b509fe88f..53f68a08d7 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocumentCreator.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocumentCreator.java @@ -26,14 +26,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class SupportingDocumentCreator extends Creator { private String friendlyName; private String type; - private Map attributes; + private Object attributes; public SupportingDocumentCreator( final String friendlyName, @@ -55,9 +53,7 @@ public SupportingDocumentCreator setType(final String type) { return this; } - public SupportingDocumentCreator setAttributes( - final Map attributes - ) { + public SupportingDocumentCreator setAttributes(final Object attributes) { this.attributes = attributes; return this; } @@ -113,7 +109,10 @@ private void addPostParams(final Request request) { request.addPostParam("Type", type); } if (attributes != null) { - request.addPostParam("Attributes", Converter.mapToJson(attributes)); + request.addPostParam( + "Attributes", + Converter.objectToJson(attributes) + ); } } } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocumentUpdater.java b/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocumentUpdater.java index 099d6f7077..ec523a8f85 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocumentUpdater.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocumentUpdater.java @@ -25,13 +25,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class SupportingDocumentUpdater extends Updater { private String pathSid; private String friendlyName; - private Map attributes; + private Object attributes; public SupportingDocumentUpdater(final String pathSid) { this.pathSid = pathSid; @@ -44,9 +43,7 @@ public SupportingDocumentUpdater setFriendlyName( return this; } - public SupportingDocumentUpdater setAttributes( - final Map attributes - ) { + public SupportingDocumentUpdater setAttributes(final Object attributes) { this.attributes = attributes; return this; } @@ -94,7 +91,10 @@ private void addPostParams(final Request request) { request.addPostParam("FriendlyName", friendlyName); } if (attributes != null) { - request.addPostParam("Attributes", Converter.mapToJson(attributes)); + request.addPostParam( + "Attributes", + Converter.objectToJson(attributes) + ); } } } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/TrustProducts.java b/src/main/java/com/twilio/rest/trusthub/v1/TrustProducts.java index a1be16ed7e..97afa46975 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/TrustProducts.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/TrustProducts.java @@ -113,7 +113,7 @@ public static TrustProducts fromJson( private final String accountSid; private final String policySid; private final String friendlyName; - private final TrustProducts.Status status; + private final Status status; private final ZonedDateTime validUntil; private final String email; private final URI statusCallback; @@ -129,7 +129,7 @@ private TrustProducts( @JsonProperty("account_sid") final String accountSid, @JsonProperty("policy_sid") final String policySid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final TrustProducts.Status status, + @JsonProperty("status") final Status status, @JsonProperty("valid_until") final String validUntil, @JsonProperty("email") final String email, @JsonProperty("status_callback") final URI statusCallback, @@ -170,7 +170,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final TrustProducts.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/customerprofiles/CustomerProfilesEvaluations.java b/src/main/java/com/twilio/rest/trusthub/v1/customerprofiles/CustomerProfilesEvaluations.java index 27d0116ac0..04af325a8b 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/customerprofiles/CustomerProfilesEvaluations.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/customerprofiles/CustomerProfilesEvaluations.java @@ -121,7 +121,7 @@ public static CustomerProfilesEvaluations fromJson( private final String accountSid; private final String policySid; private final String customerProfileSid; - private final CustomerProfilesEvaluations.Status status; + private final Status status; private final List> results; private final ZonedDateTime dateCreated; private final URI url; @@ -132,7 +132,7 @@ private CustomerProfilesEvaluations( @JsonProperty("account_sid") final String accountSid, @JsonProperty("policy_sid") final String policySid, @JsonProperty("customer_profile_sid") final String customerProfileSid, - @JsonProperty("status") final CustomerProfilesEvaluations.Status status, + @JsonProperty("status") final Status status, @JsonProperty("results") final List> results, @JsonProperty("date_created") final String dateCreated, @JsonProperty("url") final URI url @@ -163,7 +163,7 @@ public final String getCustomerProfileSid() { return this.customerProfileSid; } - public final CustomerProfilesEvaluations.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/trustproducts/TrustProductsEvaluations.java b/src/main/java/com/twilio/rest/trusthub/v1/trustproducts/TrustProductsEvaluations.java index c2aee8cf6b..9c10b40232 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/trustproducts/TrustProductsEvaluations.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/trustproducts/TrustProductsEvaluations.java @@ -115,7 +115,7 @@ public static TrustProductsEvaluations fromJson( private final String accountSid; private final String policySid; private final String trustProductSid; - private final TrustProductsEvaluations.Status status; + private final Status status; private final List> results; private final ZonedDateTime dateCreated; private final URI url; @@ -126,7 +126,7 @@ private TrustProductsEvaluations( @JsonProperty("account_sid") final String accountSid, @JsonProperty("policy_sid") final String policySid, @JsonProperty("trust_product_sid") final String trustProductSid, - @JsonProperty("status") final TrustProductsEvaluations.Status status, + @JsonProperty("status") final Status status, @JsonProperty("results") final List> results, @JsonProperty("date_created") final String dateCreated, @JsonProperty("url") final URI url @@ -157,7 +157,7 @@ public final String getTrustProductSid() { return this.trustProductSid; } - public final TrustProductsEvaluations.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/verify/v2/Form.java b/src/main/java/com/twilio/rest/verify/v2/Form.java index c6f82158f9..0511a234b7 100644 --- a/src/main/java/com/twilio/rest/verify/v2/Form.java +++ b/src/main/java/com/twilio/rest/verify/v2/Form.java @@ -39,7 +39,7 @@ public class Form extends Resource { private static final long serialVersionUID = 202517967097226L; - public static FormFetcher fetcher(final Form.FormTypes formType) { + public static FormFetcher fetcher(final FormTypes formType) { return new FormFetcher(formType); } @@ -86,14 +86,14 @@ public static Form fromJson( } } - private final Form.FormTypes formType; + private final FormTypes formType; private final Map forms; private final Map formMeta; private final URI url; @JsonCreator private Form( - @JsonProperty("form_type") final Form.FormTypes formType, + @JsonProperty("form_type") final FormTypes formType, @JsonProperty("forms") final Map forms, @JsonProperty("form_meta") final Map formMeta, @JsonProperty("url") final URI url @@ -104,7 +104,7 @@ private Form( this.url = url; } - public final Form.FormTypes getFormType() { + public final FormTypes getFormType() { return this.formType; } diff --git a/src/main/java/com/twilio/rest/verify/v2/VerificationAttempt.java b/src/main/java/com/twilio/rest/verify/v2/VerificationAttempt.java index 9058afe690..de89169b16 100644 --- a/src/main/java/com/twilio/rest/verify/v2/VerificationAttempt.java +++ b/src/main/java/com/twilio/rest/verify/v2/VerificationAttempt.java @@ -98,8 +98,8 @@ public static VerificationAttempt fromJson( private final String verificationSid; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; - private final VerificationAttempt.ConversionStatus conversionStatus; - private final VerificationAttempt.Channels channel; + private final ConversionStatus conversionStatus; + private final Channels channel; private final Map price; private final Map channelData; private final URI url; @@ -114,8 +114,8 @@ private VerificationAttempt( @JsonProperty("date_updated") final String dateUpdated, @JsonProperty( "conversion_status" - ) final VerificationAttempt.ConversionStatus conversionStatus, - @JsonProperty("channel") final VerificationAttempt.Channels channel, + ) final ConversionStatus conversionStatus, + @JsonProperty("channel") final Channels channel, @JsonProperty("price") final Map price, @JsonProperty("channel_data") final Map channelData, @JsonProperty("url") final URI url @@ -157,11 +157,11 @@ public final ZonedDateTime getDateUpdated() { return this.dateUpdated; } - public final VerificationAttempt.ConversionStatus getConversionStatus() { + public final ConversionStatus getConversionStatus() { return this.conversionStatus; } - public final VerificationAttempt.Channels getChannel() { + public final Channels getChannel() { return this.channel; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/AccessToken.java b/src/main/java/com/twilio/rest/verify/v2/service/AccessToken.java index e8ed33b57d..64f406878e 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/AccessToken.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/AccessToken.java @@ -42,7 +42,7 @@ public class AccessToken extends Resource { public static AccessTokenCreator creator( final String pathServiceSid, final String identity, - final AccessToken.FactorTypes factorType + final FactorTypes factorType ) { return new AccessTokenCreator(pathServiceSid, identity, factorType); } @@ -101,7 +101,7 @@ public static AccessToken fromJson( private final String accountSid; private final String serviceSid; private final String entityIdentity; - private final AccessToken.FactorTypes factorType; + private final FactorTypes factorType; private final String factorFriendlyName; private final String token; private final URI url; @@ -114,7 +114,7 @@ private AccessToken( @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, @JsonProperty("entity_identity") final String entityIdentity, - @JsonProperty("factor_type") final AccessToken.FactorTypes factorType, + @JsonProperty("factor_type") final FactorTypes factorType, @JsonProperty("factor_friendly_name") final String factorFriendlyName, @JsonProperty("token") final String token, @JsonProperty("url") final URI url, @@ -149,7 +149,7 @@ public final String getEntityIdentity() { return this.entityIdentity; } - public final AccessToken.FactorTypes getFactorType() { + public final FactorTypes getFactorType() { return this.factorType; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/Verification.java b/src/main/java/com/twilio/rest/verify/v2/service/Verification.java index 913b0b4db9..c46be724eb 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/Verification.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/Verification.java @@ -60,7 +60,7 @@ public static VerificationFetcher fetcher( public static VerificationUpdater updater( final String pathServiceSid, final String pathSid, - final Verification.Status status + final Status status ) { return new VerificationUpdater(pathServiceSid, pathSid, status); } @@ -112,7 +112,7 @@ public static Verification fromJson( private final String serviceSid; private final String accountSid; private final String to; - private final Verification.Channel channel; + private final Channel channel; private final String status; private final Boolean valid; private final Map lookup; @@ -130,7 +130,7 @@ private Verification( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("to") final String to, - @JsonProperty("channel") final Verification.Channel channel, + @JsonProperty("channel") final Channel channel, @JsonProperty("status") final String status, @JsonProperty("valid") final Boolean valid, @JsonProperty("lookup") final Map lookup, @@ -177,7 +177,7 @@ public final String getTo() { return this.to; } - public final Verification.Channel getChannel() { + public final Channel getChannel() { return this.channel; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/VerificationCheck.java b/src/main/java/com/twilio/rest/verify/v2/service/VerificationCheck.java index 303b066dae..938c708c7e 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/VerificationCheck.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/VerificationCheck.java @@ -94,7 +94,7 @@ public static VerificationCheck fromJson( private final String serviceSid; private final String accountSid; private final String to; - private final VerificationCheck.Channel channel; + private final Channel channel; private final String status; private final Boolean valid; private final String amount; @@ -109,7 +109,7 @@ private VerificationCheck( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("to") final String to, - @JsonProperty("channel") final VerificationCheck.Channel channel, + @JsonProperty("channel") final Channel channel, @JsonProperty("status") final String status, @JsonProperty("valid") final Boolean valid, @JsonProperty("amount") final String amount, @@ -150,7 +150,7 @@ public final String getTo() { return this.to; } - public final VerificationCheck.Channel getChannel() { + public final Channel getChannel() { return this.channel; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/VerificationCreator.java b/src/main/java/com/twilio/rest/verify/v2/service/VerificationCreator.java index d6f592d7db..2e88faa3f9 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/VerificationCreator.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/VerificationCreator.java @@ -26,8 +26,6 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class VerificationCreator extends Creator { @@ -41,8 +39,8 @@ public class VerificationCreator extends Creator { private String customCode; private String amount; private String payee; - private Map rateLimits; - private Map channelConfiguration; + private Object rateLimits; + private Object channelConfiguration; private String appHash; private String templateSid; private String templateCustomSubstitutions; @@ -108,15 +106,13 @@ public VerificationCreator setPayee(final String payee) { return this; } - public VerificationCreator setRateLimits( - final Map rateLimits - ) { + public VerificationCreator setRateLimits(final Object rateLimits) { this.rateLimits = rateLimits; return this; } public VerificationCreator setChannelConfiguration( - final Map channelConfiguration + final Object channelConfiguration ) { this.channelConfiguration = channelConfiguration; return this; @@ -236,12 +232,15 @@ private void addPostParams(final Request request) { request.addPostParam("Payee", payee); } if (rateLimits != null) { - request.addPostParam("RateLimits", Converter.mapToJson(rateLimits)); + request.addPostParam( + "RateLimits", + Converter.objectToJson(rateLimits) + ); } if (channelConfiguration != null) { request.addPostParam( "ChannelConfiguration", - Converter.mapToJson(channelConfiguration) + Converter.objectToJson(channelConfiguration) ); } if (appHash != null) { diff --git a/src/main/java/com/twilio/rest/verify/v2/service/Webhook.java b/src/main/java/com/twilio/rest/verify/v2/service/Webhook.java index 16a7742d11..1ac1c6672d 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/Webhook.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/Webhook.java @@ -127,10 +127,10 @@ public static Webhook fromJson( private final String accountSid; private final String friendlyName; private final List eventTypes; - private final Webhook.Status status; - private final Webhook.Version version; + private final Status status; + private final Version version; private final URI webhookUrl; - private final Webhook.Methods webhookMethod; + private final Methods webhookMethod; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -142,10 +142,10 @@ private Webhook( @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("event_types") final List eventTypes, - @JsonProperty("status") final Webhook.Status status, - @JsonProperty("version") final Webhook.Version version, + @JsonProperty("status") final Status status, + @JsonProperty("version") final Version version, @JsonProperty("webhook_url") final URI webhookUrl, - @JsonProperty("webhook_method") final Webhook.Methods webhookMethod, + @JsonProperty("webhook_method") final Methods webhookMethod, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url @@ -184,11 +184,11 @@ public final List getEventTypes() { return this.eventTypes; } - public final Webhook.Status getStatus() { + public final Status getStatus() { return this.status; } - public final Webhook.Version getVersion() { + public final Version getVersion() { return this.version; } @@ -196,7 +196,7 @@ public final URI getWebhookUrl() { return this.webhookUrl; } - public final Webhook.Methods getWebhookMethod() { + public final Methods getWebhookMethod() { return this.webhookMethod; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/entity/Challenge.java b/src/main/java/com/twilio/rest/verify/v2/service/entity/Challenge.java index 0d62df7622..448f620207 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/entity/Challenge.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/entity/Challenge.java @@ -125,12 +125,12 @@ public static Challenge fromJson( private final ZonedDateTime dateUpdated; private final ZonedDateTime dateResponded; private final ZonedDateTime expirationDate; - private final Challenge.ChallengeStatuses status; - private final Challenge.ChallengeReasons respondedReason; + private final ChallengeStatuses status; + private final ChallengeReasons respondedReason; private final Map details; private final Map hiddenDetails; private final Map metadata; - private final Challenge.FactorTypes factorType; + private final FactorTypes factorType; private final URI url; private final Map links; @@ -146,14 +146,14 @@ private Challenge( @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("date_responded") final String dateResponded, @JsonProperty("expiration_date") final String expirationDate, - @JsonProperty("status") final Challenge.ChallengeStatuses status, + @JsonProperty("status") final ChallengeStatuses status, @JsonProperty( "responded_reason" - ) final Challenge.ChallengeReasons respondedReason, + ) final ChallengeReasons respondedReason, @JsonProperty("details") final Map details, @JsonProperty("hidden_details") final Map hiddenDetails, @JsonProperty("metadata") final Map metadata, - @JsonProperty("factor_type") final Challenge.FactorTypes factorType, + @JsonProperty("factor_type") final FactorTypes factorType, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links ) { @@ -219,11 +219,11 @@ public final ZonedDateTime getExpirationDate() { return this.expirationDate; } - public final Challenge.ChallengeStatuses getStatus() { + public final ChallengeStatuses getStatus() { return this.status; } - public final Challenge.ChallengeReasons getRespondedReason() { + public final ChallengeReasons getRespondedReason() { return this.respondedReason; } @@ -239,7 +239,7 @@ public final Map getMetadata() { return this.metadata; } - public final Challenge.FactorTypes getFactorType() { + public final FactorTypes getFactorType() { return this.factorType; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/entity/ChallengeCreator.java b/src/main/java/com/twilio/rest/verify/v2/service/entity/ChallengeCreator.java index 5f014a389f..7db4865e5c 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/entity/ChallengeCreator.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/entity/ChallengeCreator.java @@ -30,8 +30,6 @@ import java.time.ZonedDateTime; import java.util.List; import java.util.List; -import java.util.Map; -import java.util.Map; public class ChallengeCreator extends Creator { @@ -40,8 +38,8 @@ public class ChallengeCreator extends Creator { private String factorSid; private ZonedDateTime expirationDate; private String detailsMessage; - private List> detailsFields; - private Map hiddenDetails; + private List detailsFields; + private Object hiddenDetails; private String authPayload; public ChallengeCreator( @@ -71,22 +69,16 @@ public ChallengeCreator setDetailsMessage(final String detailsMessage) { return this; } - public ChallengeCreator setDetailsFields( - final List> detailsFields - ) { + public ChallengeCreator setDetailsFields(final List detailsFields) { this.detailsFields = detailsFields; return this; } - public ChallengeCreator setDetailsFields( - final Map detailsFields - ) { + public ChallengeCreator setDetailsFields(final Object detailsFields) { return setDetailsFields(Promoter.listOfOne(detailsFields)); } - public ChallengeCreator setHiddenDetails( - final Map hiddenDetails - ) { + public ChallengeCreator setHiddenDetails(final Object hiddenDetails) { this.hiddenDetails = hiddenDetails; return this; } @@ -156,17 +148,14 @@ private void addPostParams(final Request request) { request.addPostParam("Details.Message", detailsMessage); } if (detailsFields != null) { - for (Map prop : detailsFields) { - request.addPostParam( - "Details.Fields", - Converter.mapToJson(prop) - ); + for (Object prop : detailsFields) { + request.addPostParam("Details.Fields", prop.toString()); } } if (hiddenDetails != null) { request.addPostParam( "HiddenDetails", - Converter.mapToJson(hiddenDetails) + Converter.objectToJson(hiddenDetails) ); } if (authPayload != null) { diff --git a/src/main/java/com/twilio/rest/verify/v2/service/entity/ChallengeUpdater.java b/src/main/java/com/twilio/rest/verify/v2/service/entity/ChallengeUpdater.java index 3b7fda6ef9..9870c326cc 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/entity/ChallengeUpdater.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/entity/ChallengeUpdater.java @@ -25,7 +25,6 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class ChallengeUpdater extends Updater { @@ -33,7 +32,7 @@ public class ChallengeUpdater extends Updater { private String pathIdentity; private String pathSid; private String authPayload; - private Map metadata; + private Object metadata; public ChallengeUpdater( final String pathServiceSid, @@ -50,7 +49,7 @@ public ChallengeUpdater setAuthPayload(final String authPayload) { return this; } - public ChallengeUpdater setMetadata(final Map metadata) { + public ChallengeUpdater setMetadata(final Object metadata) { this.metadata = metadata; return this; } @@ -106,7 +105,7 @@ private void addPostParams(final Request request) { request.addPostParam("AuthPayload", authPayload); } if (metadata != null) { - request.addPostParam("Metadata", Converter.mapToJson(metadata)); + request.addPostParam("Metadata", Converter.objectToJson(metadata)); } } } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/entity/Factor.java b/src/main/java/com/twilio/rest/verify/v2/service/entity/Factor.java index edeafe8f4e..ba24c6e972 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/entity/Factor.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/entity/Factor.java @@ -123,8 +123,8 @@ public static Factor fromJson( private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String friendlyName; - private final Factor.FactorStatuses status; - private final Factor.FactorTypes factorType; + private final FactorStatuses status; + private final FactorTypes factorType; private final Map config; private final Map metadata; private final URI url; @@ -139,8 +139,8 @@ private Factor( @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final Factor.FactorStatuses status, - @JsonProperty("factor_type") final Factor.FactorTypes factorType, + @JsonProperty("status") final FactorStatuses status, + @JsonProperty("factor_type") final FactorTypes factorType, @JsonProperty("config") final Map config, @JsonProperty("metadata") final Map metadata, @JsonProperty("url") final URI url @@ -192,11 +192,11 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Factor.FactorStatuses getStatus() { + public final FactorStatuses getStatus() { return this.status; } - public final Factor.FactorTypes getFactorType() { + public final FactorTypes getFactorType() { return this.factorType; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/entity/NewFactor.java b/src/main/java/com/twilio/rest/verify/v2/service/entity/NewFactor.java index 308d23c721..b5b249668f 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/entity/NewFactor.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/entity/NewFactor.java @@ -45,7 +45,7 @@ public static NewFactorCreator creator( final String pathServiceSid, final String pathIdentity, final String friendlyName, - final NewFactor.FactorTypes factorType + final FactorTypes factorType ) { return new NewFactorCreator( pathServiceSid, @@ -107,8 +107,8 @@ public static NewFactor fromJson( private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String friendlyName; - private final NewFactor.FactorStatuses status; - private final NewFactor.FactorTypes factorType; + private final FactorStatuses status; + private final FactorTypes factorType; private final Map config; private final Map metadata; private final URI url; @@ -124,8 +124,8 @@ private NewFactor( @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final NewFactor.FactorStatuses status, - @JsonProperty("factor_type") final NewFactor.FactorTypes factorType, + @JsonProperty("status") final FactorStatuses status, + @JsonProperty("factor_type") final FactorTypes factorType, @JsonProperty("config") final Map config, @JsonProperty("metadata") final Map metadata, @JsonProperty("url") final URI url @@ -182,11 +182,11 @@ public final String getFriendlyName() { return this.friendlyName; } - public final NewFactor.FactorStatuses getStatus() { + public final FactorStatuses getStatus() { return this.status; } - public final NewFactor.FactorTypes getFactorType() { + public final FactorTypes getFactorType() { return this.factorType; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/entity/NewFactorCreator.java b/src/main/java/com/twilio/rest/verify/v2/service/entity/NewFactorCreator.java index 3221e50770..6f4e2f5409 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/entity/NewFactorCreator.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/entity/NewFactorCreator.java @@ -26,8 +26,6 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class NewFactorCreator extends Creator { @@ -46,7 +44,7 @@ public class NewFactorCreator extends Creator { private Integer configSkew; private Integer configCodeLength; private NewFactor.TotpAlgorithms configAlg; - private Map metadata; + private Object metadata; public NewFactorCreator( final String pathServiceSid, @@ -135,7 +133,7 @@ public NewFactorCreator setConfigAlg( return this; } - public NewFactorCreator setMetadata(final Map metadata) { + public NewFactorCreator setMetadata(final Object metadata) { this.metadata = metadata; return this; } @@ -241,7 +239,7 @@ private void addPostParams(final Request request) { request.addPostParam("Config.Alg", configAlg.toString()); } if (metadata != null) { - request.addPostParam("Metadata", Converter.mapToJson(metadata)); + request.addPostParam("Metadata", Converter.objectToJson(metadata)); } } } diff --git a/src/main/java/com/twilio/rest/video/v1/Composition.java b/src/main/java/com/twilio/rest/video/v1/Composition.java index c58d12e102..cdb8c529ea 100644 --- a/src/main/java/com/twilio/rest/video/v1/Composition.java +++ b/src/main/java/com/twilio/rest/video/v1/Composition.java @@ -103,7 +103,7 @@ public static Composition fromJson( } private final String accountSid; - private final Composition.Status status; + private final Status status; private final ZonedDateTime dateCreated; private final ZonedDateTime dateCompleted; private final ZonedDateTime dateDeleted; @@ -114,7 +114,7 @@ public static Composition fromJson( private final Map videoLayout; private final String resolution; private final Boolean trim; - private final Composition.Format format; + private final Format format; private final Integer bitrate; private final Long size; private final Integer duration; @@ -127,7 +127,7 @@ public static Composition fromJson( @JsonCreator private Composition( @JsonProperty("account_sid") final String accountSid, - @JsonProperty("status") final Composition.Status status, + @JsonProperty("status") final Status status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_completed") final String dateCompleted, @JsonProperty("date_deleted") final String dateDeleted, @@ -140,7 +140,7 @@ private Composition( @JsonProperty("video_layout") final Map videoLayout, @JsonProperty("resolution") final String resolution, @JsonProperty("trim") final Boolean trim, - @JsonProperty("format") final Composition.Format format, + @JsonProperty("format") final Format format, @JsonProperty("bitrate") final Integer bitrate, @JsonProperty("size") final Long size, @JsonProperty("duration") final Integer duration, @@ -182,7 +182,7 @@ public final String getAccountSid() { return this.accountSid; } - public final Composition.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -226,7 +226,7 @@ public final Boolean getTrim() { return this.trim; } - public final Composition.Format getFormat() { + public final Format getFormat() { return this.format; } diff --git a/src/main/java/com/twilio/rest/video/v1/CompositionHook.java b/src/main/java/com/twilio/rest/video/v1/CompositionHook.java index 4c28fa2a64..c311f937ea 100644 --- a/src/main/java/com/twilio/rest/video/v1/CompositionHook.java +++ b/src/main/java/com/twilio/rest/video/v1/CompositionHook.java @@ -120,7 +120,7 @@ public static CompositionHook fromJson( private final Map videoLayout; private final String resolution; private final Boolean trim; - private final CompositionHook.Format format; + private final Format format; private final URI statusCallback; private final HttpMethod statusCallbackMethod; private final URI url; @@ -140,7 +140,7 @@ private CompositionHook( @JsonProperty("video_layout") final Map videoLayout, @JsonProperty("resolution") final String resolution, @JsonProperty("trim") final Boolean trim, - @JsonProperty("format") final CompositionHook.Format format, + @JsonProperty("format") final Format format, @JsonProperty("status_callback") final URI statusCallback, @JsonProperty( "status_callback_method" @@ -208,7 +208,7 @@ public final Boolean getTrim() { return this.trim; } - public final CompositionHook.Format getFormat() { + public final Format getFormat() { return this.format; } diff --git a/src/main/java/com/twilio/rest/video/v1/Recording.java b/src/main/java/com/twilio/rest/video/v1/Recording.java index 4f21119419..8c7e6debb8 100644 --- a/src/main/java/com/twilio/rest/video/v1/Recording.java +++ b/src/main/java/com/twilio/rest/video/v1/Recording.java @@ -98,16 +98,16 @@ public static Recording fromJson( } private final String accountSid; - private final Recording.Status status; + private final Status status; private final ZonedDateTime dateCreated; private final String sid; private final String sourceSid; private final Long size; private final URI url; - private final Recording.Type type; + private final Type type; private final Integer duration; - private final Recording.Format containerFormat; - private final Recording.Codec codec; + private final Format containerFormat; + private final Codec codec; private final Map groupingSids; private final String trackName; private final Long offset; @@ -119,18 +119,16 @@ public static Recording fromJson( @JsonCreator private Recording( @JsonProperty("account_sid") final String accountSid, - @JsonProperty("status") final Recording.Status status, + @JsonProperty("status") final Status status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("sid") final String sid, @JsonProperty("source_sid") final String sourceSid, @JsonProperty("size") final Long size, @JsonProperty("url") final URI url, - @JsonProperty("type") final Recording.Type type, + @JsonProperty("type") final Type type, @JsonProperty("duration") final Integer duration, - @JsonProperty( - "container_format" - ) final Recording.Format containerFormat, - @JsonProperty("codec") final Recording.Codec codec, + @JsonProperty("container_format") final Format containerFormat, + @JsonProperty("codec") final Codec codec, @JsonProperty("grouping_sids") final Map groupingSids, @JsonProperty("track_name") final String trackName, @JsonProperty("offset") final Long offset, @@ -167,7 +165,7 @@ public final String getAccountSid() { return this.accountSid; } - public final Recording.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -191,7 +189,7 @@ public final URI getUrl() { return this.url; } - public final Recording.Type getType() { + public final Type getType() { return this.type; } @@ -199,11 +197,11 @@ public final Integer getDuration() { return this.duration; } - public final Recording.Format getContainerFormat() { + public final Format getContainerFormat() { return this.containerFormat; } - public final Recording.Codec getCodec() { + public final Codec getCodec() { return this.codec; } diff --git a/src/main/java/com/twilio/rest/video/v1/Room.java b/src/main/java/com/twilio/rest/video/v1/Room.java index 77a513b610..3ed9520d58 100644 --- a/src/main/java/com/twilio/rest/video/v1/Room.java +++ b/src/main/java/com/twilio/rest/video/v1/Room.java @@ -57,7 +57,7 @@ public static RoomReader reader() { public static RoomUpdater updater( final String pathSid, - final Room.RoomStatus status + final RoomStatus status ) { return new RoomUpdater(pathSid, status); } @@ -106,7 +106,7 @@ public static Room fromJson( } private final String sid; - private final Room.RoomStatus status; + private final RoomStatus status; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String accountSid; @@ -116,12 +116,12 @@ public static Room fromJson( private final HttpMethod statusCallbackMethod; private final ZonedDateTime endTime; private final Integer duration; - private final Room.RoomType type; + private final RoomType type; private final Integer maxParticipants; private final Integer maxParticipantDuration; private final Integer maxConcurrentPublishedTracks; private final Boolean recordParticipantsOnConnect; - private final List videoCodecs; + private final List videoCodecs; private final String mediaRegion; private final Boolean audioOnly; private final Integer emptyRoomTimeout; @@ -133,7 +133,7 @@ public static Room fromJson( @JsonCreator private Room( @JsonProperty("sid") final String sid, - @JsonProperty("status") final Room.RoomStatus status, + @JsonProperty("status") final RoomStatus status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("account_sid") final String accountSid, @@ -145,7 +145,7 @@ private Room( ) final HttpMethod statusCallbackMethod, @JsonProperty("end_time") final String endTime, @JsonProperty("duration") final Integer duration, - @JsonProperty("type") final Room.RoomType type, + @JsonProperty("type") final RoomType type, @JsonProperty("max_participants") final Integer maxParticipants, @JsonProperty( "max_participant_duration" @@ -156,7 +156,7 @@ private Room( @JsonProperty( "record_participants_on_connect" ) final Boolean recordParticipantsOnConnect, - @JsonProperty("video_codecs") final List videoCodecs, + @JsonProperty("video_codecs") final List videoCodecs, @JsonProperty("media_region") final String mediaRegion, @JsonProperty("audio_only") final Boolean audioOnly, @JsonProperty("empty_room_timeout") final Integer emptyRoomTimeout, @@ -195,7 +195,7 @@ public final String getSid() { return this.sid; } - public final Room.RoomStatus getStatus() { + public final RoomStatus getStatus() { return this.status; } @@ -235,7 +235,7 @@ public final Integer getDuration() { return this.duration; } - public final Room.RoomType getType() { + public final RoomType getType() { return this.type; } @@ -255,7 +255,7 @@ public final Boolean getRecordParticipantsOnConnect() { return this.recordParticipantsOnConnect; } - public final List getVideoCodecs() { + public final List getVideoCodecs() { return this.videoCodecs; } diff --git a/src/main/java/com/twilio/rest/video/v1/room/Participant.java b/src/main/java/com/twilio/rest/video/v1/room/Participant.java index e424615a76..83a9ab8d84 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/Participant.java +++ b/src/main/java/com/twilio/rest/video/v1/room/Participant.java @@ -105,7 +105,7 @@ public static Participant fromJson( private final String sid; private final String roomSid; private final String accountSid; - private final Participant.Status status; + private final Status status; private final String identity; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -120,7 +120,7 @@ private Participant( @JsonProperty("sid") final String sid, @JsonProperty("room_sid") final String roomSid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty("status") final Participant.Status status, + @JsonProperty("status") final Status status, @JsonProperty("identity") final String identity, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -156,7 +156,7 @@ public final String getAccountSid() { return this.accountSid; } - public final Participant.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/video/v1/room/RoomRecording.java b/src/main/java/com/twilio/rest/video/v1/room/RoomRecording.java index 7a37f4e2ad..506eaea365 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/RoomRecording.java +++ b/src/main/java/com/twilio/rest/video/v1/room/RoomRecording.java @@ -103,16 +103,16 @@ public static RoomRecording fromJson( } private final String accountSid; - private final RoomRecording.Status status; + private final Status status; private final ZonedDateTime dateCreated; private final String sid; private final String sourceSid; private final Long size; private final URI url; - private final RoomRecording.Type type; + private final Type type; private final Integer duration; - private final RoomRecording.Format containerFormat; - private final RoomRecording.Codec codec; + private final Format containerFormat; + private final Codec codec; private final Map groupingSids; private final String trackName; private final Long offset; @@ -123,18 +123,16 @@ public static RoomRecording fromJson( @JsonCreator private RoomRecording( @JsonProperty("account_sid") final String accountSid, - @JsonProperty("status") final RoomRecording.Status status, + @JsonProperty("status") final Status status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("sid") final String sid, @JsonProperty("source_sid") final String sourceSid, @JsonProperty("size") final Long size, @JsonProperty("url") final URI url, - @JsonProperty("type") final RoomRecording.Type type, + @JsonProperty("type") final Type type, @JsonProperty("duration") final Integer duration, - @JsonProperty( - "container_format" - ) final RoomRecording.Format containerFormat, - @JsonProperty("codec") final RoomRecording.Codec codec, + @JsonProperty("container_format") final Format containerFormat, + @JsonProperty("codec") final Codec codec, @JsonProperty("grouping_sids") final Map groupingSids, @JsonProperty("track_name") final String trackName, @JsonProperty("offset") final Long offset, @@ -167,7 +165,7 @@ public final String getAccountSid() { return this.accountSid; } - public final RoomRecording.Status getStatus() { + public final Status getStatus() { return this.status; } @@ -191,7 +189,7 @@ public final URI getUrl() { return this.url; } - public final RoomRecording.Type getType() { + public final Type getType() { return this.type; } @@ -199,11 +197,11 @@ public final Integer getDuration() { return this.duration; } - public final RoomRecording.Format getContainerFormat() { + public final Format getContainerFormat() { return this.containerFormat; } - public final RoomRecording.Codec getCodec() { + public final Codec getCodec() { return this.codec; } diff --git a/src/main/java/com/twilio/rest/video/v1/room/participant/Anonymize.java b/src/main/java/com/twilio/rest/video/v1/room/participant/Anonymize.java index 13cd56e05e..898d66175f 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/participant/Anonymize.java +++ b/src/main/java/com/twilio/rest/video/v1/room/participant/Anonymize.java @@ -92,7 +92,7 @@ public static Anonymize fromJson( private final String sid; private final String roomSid; private final String accountSid; - private final Anonymize.Status status; + private final Status status; private final String identity; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -106,7 +106,7 @@ private Anonymize( @JsonProperty("sid") final String sid, @JsonProperty("room_sid") final String roomSid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty("status") final Anonymize.Status status, + @JsonProperty("status") final Status status, @JsonProperty("identity") final String identity, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -140,7 +140,7 @@ public final String getAccountSid() { return this.accountSid; } - public final Anonymize.Status getStatus() { + public final Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/video/v1/room/participant/PublishedTrack.java b/src/main/java/com/twilio/rest/video/v1/room/participant/PublishedTrack.java index 38798ef161..d48e5ad022 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/participant/PublishedTrack.java +++ b/src/main/java/com/twilio/rest/video/v1/room/participant/PublishedTrack.java @@ -108,7 +108,7 @@ public static PublishedTrack fromJson( private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Boolean enabled; - private final PublishedTrack.Kind kind; + private final Kind kind; private final URI url; @JsonCreator @@ -120,7 +120,7 @@ private PublishedTrack( @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("enabled") final Boolean enabled, - @JsonProperty("kind") final PublishedTrack.Kind kind, + @JsonProperty("kind") final Kind kind, @JsonProperty("url") final URI url ) { this.sid = sid; @@ -162,7 +162,7 @@ public final Boolean getEnabled() { return this.enabled; } - public final PublishedTrack.Kind getKind() { + public final Kind getKind() { return this.kind; } diff --git a/src/main/java/com/twilio/rest/video/v1/room/participant/SubscribedTrack.java b/src/main/java/com/twilio/rest/video/v1/room/participant/SubscribedTrack.java index d31de8e3c5..23c88fbcc7 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/participant/SubscribedTrack.java +++ b/src/main/java/com/twilio/rest/video/v1/room/participant/SubscribedTrack.java @@ -109,7 +109,7 @@ public static SubscribedTrack fromJson( private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Boolean enabled; - private final SubscribedTrack.Kind kind; + private final Kind kind; private final URI url; @JsonCreator @@ -122,7 +122,7 @@ private SubscribedTrack( @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("enabled") final Boolean enabled, - @JsonProperty("kind") final SubscribedTrack.Kind kind, + @JsonProperty("kind") final Kind kind, @JsonProperty("url") final URI url ) { this.sid = sid; @@ -169,7 +169,7 @@ public final Boolean getEnabled() { return this.enabled; } - public final SubscribedTrack.Kind getKind() { + public final Kind getKind() { return this.kind; } diff --git a/src/main/java/com/twilio/rest/wireless/v1/Command.java b/src/main/java/com/twilio/rest/wireless/v1/Command.java index e1c79cb63b..bd545d7403 100644 --- a/src/main/java/com/twilio/rest/wireless/v1/Command.java +++ b/src/main/java/com/twilio/rest/wireless/v1/Command.java @@ -102,11 +102,11 @@ public static Command fromJson( private final String accountSid; private final String simSid; private final String command; - private final Command.CommandMode commandMode; - private final Command.Transport transport; + private final CommandMode commandMode; + private final Transport transport; private final Boolean deliveryReceiptRequested; - private final Command.Status status; - private final Command.Direction direction; + private final Status status; + private final Direction direction; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -117,13 +117,13 @@ private Command( @JsonProperty("account_sid") final String accountSid, @JsonProperty("sim_sid") final String simSid, @JsonProperty("command") final String command, - @JsonProperty("command_mode") final Command.CommandMode commandMode, - @JsonProperty("transport") final Command.Transport transport, + @JsonProperty("command_mode") final CommandMode commandMode, + @JsonProperty("transport") final Transport transport, @JsonProperty( "delivery_receipt_requested" ) final Boolean deliveryReceiptRequested, - @JsonProperty("status") final Command.Status status, - @JsonProperty("direction") final Command.Direction direction, + @JsonProperty("status") final Status status, + @JsonProperty("direction") final Direction direction, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url @@ -158,11 +158,11 @@ public final String getCommand() { return this.command; } - public final Command.CommandMode getCommandMode() { + public final CommandMode getCommandMode() { return this.commandMode; } - public final Command.Transport getTransport() { + public final Transport getTransport() { return this.transport; } @@ -170,11 +170,11 @@ public final Boolean getDeliveryReceiptRequested() { return this.deliveryReceiptRequested; } - public final Command.Status getStatus() { + public final Status getStatus() { return this.status; } - public final Command.Direction getDirection() { + public final Direction getDirection() { return this.direction; } diff --git a/src/main/java/com/twilio/rest/wireless/v1/Sim.java b/src/main/java/com/twilio/rest/wireless/v1/Sim.java index ccfd84da74..6410f6d200 100644 --- a/src/main/java/com/twilio/rest/wireless/v1/Sim.java +++ b/src/main/java/com/twilio/rest/wireless/v1/Sim.java @@ -108,8 +108,8 @@ public static Sim fromJson( private final String friendlyName; private final String iccid; private final String eId; - private final Sim.Status status; - private final Sim.ResetStatus resetStatus; + private final Status status; + private final ResetStatus resetStatus; private final URI commandsCallbackUrl; private final HttpMethod commandsCallbackMethod; private final HttpMethod smsFallbackMethod; @@ -135,8 +135,8 @@ private Sim( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("iccid") final String iccid, @JsonProperty("e_id") final String eId, - @JsonProperty("status") final Sim.Status status, - @JsonProperty("reset_status") final Sim.ResetStatus resetStatus, + @JsonProperty("status") final Status status, + @JsonProperty("reset_status") final ResetStatus resetStatus, @JsonProperty("commands_callback_url") final URI commandsCallbackUrl, @JsonProperty( "commands_callback_method" @@ -211,11 +211,11 @@ public final String getEId() { return this.eId; } - public final Sim.Status getStatus() { + public final Status getStatus() { return this.status; } - public final Sim.ResetStatus getResetStatus() { + public final ResetStatus getResetStatus() { return this.resetStatus; } diff --git a/src/test/java/com/twilio/ClusterTest.java b/src/test/java/com/twilio/ClusterTest.java index 328609a1c5..48e0fc3f39 100644 --- a/src/test/java/com/twilio/ClusterTest.java +++ b/src/test/java/com/twilio/ClusterTest.java @@ -38,7 +38,7 @@ public class ClusterTest { String clientSecret; String messageSid; TwilioRestClient customRestClient; - + String accountSid; @Before @@ -57,11 +57,11 @@ public void setUp() { orgsClientSecret = System.getenv("TWILIO_ORGS_CLIENT_SECRET"); organisationSid = System.getenv("TWILIO_ORG_SID"); TwilioOrgsTokenAuth.init(grantType, orgsClientId, orgsClientSecret); - + clientId = System.getenv("TWILIO_CLIENT_ID"); clientSecret = System.getenv("TWILIO_CLIENT_SECRET"); messageSid = System.getenv("TWILIO_MESSAGE_SID"); - + // CustomHttpClient customRestClient = new TwilioRestClient.Builder(apiKey, secret).accountSid(accountSid).httpClient(new CustomHttpClient()).build(); } @@ -117,7 +117,7 @@ public void testListParams() { sinkConfiguration.put("destination", "http://example.org/webhook"); sinkConfiguration.put("method", "post"); sinkConfiguration.put("batch_events",false); - List> types = new ArrayList<>(); + List types = new ArrayList<>(); Map types1 = new HashMap<>(); Map types2 = new HashMap<>(); types1.put("type", "com.twilio.messaging.message.delivered"); @@ -175,7 +175,7 @@ public void testMultiPartFormData() { // @Test // public void testPublicOAuthFetchMessage() { // Twilio.init(new ClientCredentialProvider(clientId, clientSecret), accountSid); -// // Fetching an existing message; if this test fails, the SID might be deleted, +// // Fetching an existing message; if this test fails, the SID might be deleted, // // in that case, change TWILIO_MESSAGE_SID in twilio-java repo env variables // Message message = Message.fetcher(messageSid).fetch(); // assertNotNull(message); From e3483556029cf4ee206b48d7e4127b3b750a24de Mon Sep 17 00:00:00 2001 From: Shubham Date: Wed, 2 Jul 2025 20:54:35 +0530 Subject: [PATCH 02/12] chore: Handle List serialization (#874) * fix: use Object for types instead of Map * fix: use Object for anyType * fix: use Object for anyType * fix: handle array of objects correctly * fix: add converter import statement --- .../com/twilio/rest/accounts/v1/BulkConsentsCreator.java | 3 ++- .../com/twilio/rest/accounts/v1/BulkContactsCreator.java | 3 ++- .../java/com/twilio/rest/events/v1/SubscriptionCreator.java | 3 ++- .../twilio/rest/flexapi/v1/PluginConfigurationCreator.java | 3 ++- .../com/twilio/rest/proxy/v1/service/SessionCreator.java | 6 +++++- .../rest/verify/v2/service/entity/ChallengeCreator.java | 5 ++++- 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/twilio/rest/accounts/v1/BulkConsentsCreator.java b/src/main/java/com/twilio/rest/accounts/v1/BulkConsentsCreator.java index ad5acc7da5..b472c75f67 100644 --- a/src/main/java/com/twilio/rest/accounts/v1/BulkConsentsCreator.java +++ b/src/main/java/com/twilio/rest/accounts/v1/BulkConsentsCreator.java @@ -15,6 +15,7 @@ package com.twilio.rest.accounts.v1; import com.twilio.base.Creator; +import com.twilio.converter.Converter; import com.twilio.constant.EnumConstants; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; @@ -86,7 +87,7 @@ public BulkConsents create(final TwilioRestClient client) { private void addPostParams(final Request request) { if (items != null) { for (Object prop : items) { - request.addPostParam("Items", prop.toString()); + request.addPostParam("Items", Converter.objectToJson(prop)); } } } diff --git a/src/main/java/com/twilio/rest/accounts/v1/BulkContactsCreator.java b/src/main/java/com/twilio/rest/accounts/v1/BulkContactsCreator.java index 2939c5c60d..abbd29d480 100644 --- a/src/main/java/com/twilio/rest/accounts/v1/BulkContactsCreator.java +++ b/src/main/java/com/twilio/rest/accounts/v1/BulkContactsCreator.java @@ -16,6 +16,7 @@ import com.twilio.base.Creator; import com.twilio.constant.EnumConstants; +import com.twilio.converter.Converter; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; @@ -86,7 +87,7 @@ public BulkContacts create(final TwilioRestClient client) { private void addPostParams(final Request request) { if (items != null) { for (Object prop : items) { - request.addPostParam("Items", prop.toString()); + request.addPostParam("Items", Converter.objectToJson(prop)); } } } diff --git a/src/main/java/com/twilio/rest/events/v1/SubscriptionCreator.java b/src/main/java/com/twilio/rest/events/v1/SubscriptionCreator.java index e82e798efa..fd9b3c97e5 100644 --- a/src/main/java/com/twilio/rest/events/v1/SubscriptionCreator.java +++ b/src/main/java/com/twilio/rest/events/v1/SubscriptionCreator.java @@ -15,6 +15,7 @@ package com.twilio.rest.events.v1; import com.twilio.base.Creator; +import com.twilio.converter.Converter; import com.twilio.constant.EnumConstants; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; @@ -116,7 +117,7 @@ private void addPostParams(final Request request) { } if (types != null) { for (Object prop : types) { - request.addPostParam("Types", prop.toString()); + request.addPostParam("Types", Converter.objectToJson(prop)); } } } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/PluginConfigurationCreator.java b/src/main/java/com/twilio/rest/flexapi/v1/PluginConfigurationCreator.java index d55ca90f44..19dbfd4fee 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/PluginConfigurationCreator.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/PluginConfigurationCreator.java @@ -16,6 +16,7 @@ import com.twilio.base.Creator; import com.twilio.constant.EnumConstants; +import com.twilio.converter.Converter; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; @@ -110,7 +111,7 @@ private void addPostParams(final Request request) { } if (plugins != null) { for (Object prop : plugins) { - request.addPostParam("Plugins", prop.toString()); + request.addPostParam("Plugins", Converter.objectToJson(prop)); } } if (description != null) { diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/SessionCreator.java b/src/main/java/com/twilio/rest/proxy/v1/service/SessionCreator.java index 7cabf721a5..8a936a5902 100644 --- a/src/main/java/com/twilio/rest/proxy/v1/service/SessionCreator.java +++ b/src/main/java/com/twilio/rest/proxy/v1/service/SessionCreator.java @@ -15,6 +15,7 @@ package com.twilio.rest.proxy.v1.service; import com.twilio.base.Creator; +import com.twilio.converter.Converter; import com.twilio.constant.EnumConstants; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; @@ -137,7 +138,10 @@ private void addPostParams(final Request request) { } if (participants != null) { for (Object prop : participants) { - request.addPostParam("Participants", prop.toString()); + request.addPostParam( + "Participants", + Converter.objectToJson(prop) + ); } } } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/entity/ChallengeCreator.java b/src/main/java/com/twilio/rest/verify/v2/service/entity/ChallengeCreator.java index 7db4865e5c..366f518740 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/entity/ChallengeCreator.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/entity/ChallengeCreator.java @@ -149,7 +149,10 @@ private void addPostParams(final Request request) { } if (detailsFields != null) { for (Object prop : detailsFields) { - request.addPostParam("Details.Fields", prop.toString()); + request.addPostParam( + "Details.Fields", + Converter.objectToJson(prop) + ); } } if (hiddenDetails != null) { From b7375942080fa06d00e905ddf5b1d7b08057b924 Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 3 Jul 2025 12:23:09 +0530 Subject: [PATCH 03/12] chore: prepare for RC release (#875) --- CHANGES.md | 4 ++++ README.md | 4 ++-- pom.xml | 4 ++-- src/main/java/com/twilio/Twilio.java | 8 ++++---- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2a4a510039..22a5fd150c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,10 @@ twilio-java changelog ===================== +[2025-07-03] Version 11.0.0-rc.0 +-------------------------------- +- Release Candidate prep + [2025-06-12] Version 10.9.2 --------------------------- **Library - Chore** diff --git a/README.md b/README.md index dbd9f1c804..e498ca964c 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Use the following dependency in your project to grab via Maven: com.twilio.sdk twilio - 10.X.X + 11.X.X-rc.x compile ``` @@ -70,7 +70,7 @@ Use the following dependency in your project to grab via Maven: or Gradle: ```groovy -implementation "com.twilio.sdk:twilio:10.X.X" +implementation "com.twilio.sdk:twilio:11.X.X-rc.x" ``` If you want to compile it yourself, here's how: diff --git a/pom.xml b/pom.xml index 69033e805e..ccd11db341 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ twilio jar twilio - 10.9.2 + 11.0.0-rc.0 Twilio Java Helper Library https://www.twilio.com @@ -490,4 +490,4 @@ - \ No newline at end of file + diff --git a/src/main/java/com/twilio/Twilio.java b/src/main/java/com/twilio/Twilio.java index 7ed3da168a..b2827de8f3 100644 --- a/src/main/java/com/twilio/Twilio.java +++ b/src/main/java/com/twilio/Twilio.java @@ -24,7 +24,7 @@ */ public class Twilio { - public static final String VERSION = "10.9.2"; + public static final String VERSION = "11.0.0-rc.0"; public static final String JAVA_VERSION = System.getProperty("java.version"); public static final String OS_NAME = System.getProperty("os.name"); public static final String OS_ARCH = System.getProperty("os.arch"); @@ -37,7 +37,7 @@ public class Twilio { private static String edge = System.getenv("TWILIO_EDGE"); private static volatile TwilioRestClient restClient; private static volatile ExecutorService executorService; - + private static CredentialProvider credentialProvider; private Twilio() { @@ -85,7 +85,7 @@ private static void setCredentialProvider(final CredentialProvider credentialPro if (credentialProvider == null) { throw new AuthenticationException("Credential Provider can not be null"); } - + if (!credentialProvider.equals(Twilio.credentialProvider)) { Twilio.invalidate(); } @@ -315,7 +315,7 @@ private static void invalidate() { private static void invalidateOAuthCreds() { Twilio.credentialProvider = null; } - + private static void invalidateBasicCreds() { Twilio.username = null; Twilio.password = null; From 953e73e599fdcf5d197fb95e873c0929d1fe2bd0 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 3 Jul 2025 09:38:52 +0000 Subject: [PATCH 04/12] [Librarian] Regenerated @ d122b05026327019e18cb5763c557a68138cc2c8 0e8634d10afc0145e18ccb8d90598b642b67ad87 --- CHANGES.md | 29 + src/main/java/com/twilio/Domains.java | 2 - .../rest/accounts/v1/BulkConsentsCreator.java | 3 +- .../rest/accounts/v1/BulkContactsCreator.java | 1 + .../com/twilio/rest/api/v2010/Account.java | 12 +- .../v2010/account/AuthorizedConnectApp.java | 8 +- .../twilio/rest/api/v2010/account/Call.java | 8 +- .../rest/api/v2010/account/Conference.java | 12 +- .../rest/api/v2010/account/ConnectApp.java | 8 +- .../v2010/account/IncomingPhoneNumber.java | 26 +- .../rest/api/v2010/account/Message.java | 14 +- .../rest/api/v2010/account/Recording.java | 12 +- .../rest/api/v2010/account/Transcription.java | 8 +- .../account/address/DependentPhoneNumber.java | 14 +- .../api/v2010/account/call/Recording.java | 18 +- .../rest/api/v2010/account/call/Siprec.java | 10 +- .../rest/api/v2010/account/call/Stream.java | 10 +- .../api/v2010/account/call/Transcription.java | 10 +- .../v2010/account/conference/Participant.java | 6 +- .../v2010/account/conference/Recording.java | 18 +- .../account/incomingphonenumber/Local.java | 26 +- .../account/incomingphonenumber/Mobile.java | 26 +- .../account/incomingphonenumber/TollFree.java | 26 +- .../api/v2010/account/message/Feedback.java | 6 +- .../v2010/account/recording/AddOnResult.java | 6 +- .../account/recording/Transcription.java | 8 +- .../rest/api/v2010/account/usage/Record.java | 8 +- .../rest/api/v2010/account/usage/Trigger.java | 24 +- .../v2010/account/usage/record/AllTime.java | 8 +- .../api/v2010/account/usage/record/Daily.java | 8 +- .../v2010/account/usage/record/LastMonth.java | 8 +- .../v2010/account/usage/record/Monthly.java | 8 +- .../v2010/account/usage/record/ThisMonth.java | 8 +- .../api/v2010/account/usage/record/Today.java | 8 +- .../v2010/account/usage/record/Yearly.java | 8 +- .../v2010/account/usage/record/Yesterday.java | 8 +- .../twilio/rest/assistants/v1/Assistant.java | 2 +- .../twilio/rest/assistants/v1/Knowledge.java | 2 +- .../com/twilio/rest/assistants/v1/Tool.java | 2 +- .../assistants/v1/assistant/Feedback.java | 2 +- .../rest/assistants/v1/assistant/Message.java | 2 +- .../com/twilio/rest/chat/v1/Credential.java | 8 +- .../twilio/rest/chat/v1/service/Channel.java | 6 +- .../com/twilio/rest/chat/v1/service/Role.java | 8 +- .../chat/v1/service/user/UserChannel.java | 6 +- .../com/twilio/rest/chat/v2/Credential.java | 8 +- .../twilio/rest/chat/v2/service/Binding.java | 6 +- .../twilio/rest/chat/v2/service/Channel.java | 6 +- .../com/twilio/rest/chat/v2/service/Role.java | 8 +- .../rest/chat/v2/service/channel/Webhook.java | 2 +- .../chat/v2/service/user/UserBinding.java | 6 +- .../chat/v2/service/user/UserChannel.java | 12 +- .../java/com/twilio/rest/chat/v3/Channel.java | 6 +- .../com/twilio/rest/content/v1/Content.java | 2 +- .../content/v1/content/ApprovalCreate.java | 2 +- .../v1/AddressConfiguration.java | 2 +- .../rest/conversations/v1/Conversation.java | 6 +- .../v1/ConversationWithParticipants.java | 6 +- .../rest/conversations/v1/Credential.java | 8 +- .../v1/ParticipantConversation.java | 8 +- .../twilio/rest/conversations/v1/Role.java | 8 +- .../v1/configuration/Webhook.java | 12 +- .../v1/conversation/Webhook.java | 2 +- .../conversation/message/DeliveryReceipt.java | 6 +- .../conversations/v1/service/Binding.java | 6 +- .../v1/service/Conversation.java | 6 +- .../service/ConversationWithParticipants.java | 6 +- .../v1/service/ParticipantConversation.java | 8 +- .../rest/conversations/v1/service/Role.java | 8 +- .../v1/service/configuration/Webhook.java | 6 +- .../v1/service/conversation/Webhook.java | 2 +- .../conversation/message/DeliveryReceipt.java | 6 +- .../v1/service/user/UserConversation.java | 14 +- .../v1/user/UserConversation.java | 14 +- .../java/com/twilio/rest/events/v1/Sink.java | 14 +- .../rest/events/v1/SubscriptionCreator.java | 3 +- .../twilio/rest/flexapi/v1/Configuration.java | 6 +- .../com/twilio/rest/flexapi/v1/FlexFlow.java | 16 +- .../v1/PluginConfigurationCreator.java | 1 + .../rest/flexapi/v1/ProvisioningStatus.java | 6 +- .../v1/interaction/InteractionChannel.java | 14 +- .../InteractionChannelParticipant.java | 10 +- .../InteractionTransfer.java | 12 +- .../com/twilio/rest/frontlineapi/v1/User.java | 6 +- .../rest/insights/v1/CallSummaries.java | 26 +- .../twilio/rest/insights/v1/Conference.java | 40 +- .../com/twilio/rest/insights/v1/Room.java | 50 +- .../rest/insights/v1/call/Annotation.java | 12 +- .../rest/insights/v1/call/CallSummary.java | 26 +- .../twilio/rest/insights/v1/call/Event.java | 12 +- .../twilio/rest/insights/v1/call/Metric.java | 12 +- .../v1/conference/ConferenceParticipant.java | 54 +- .../rest/insights/v1/room/Participant.java | 26 +- .../rest/intelligence/v2/CustomOperator.java | 8 +- .../twilio/rest/intelligence/v2/Operator.java | 6 +- .../rest/intelligence/v2/OperatorType.java | 20 +- .../intelligence/v2/PrebuiltOperator.java | 8 +- .../twilio/rest/intelligence/v2/Service.java | 8 +- .../rest/intelligence/v2/Transcript.java | 6 +- .../v2/transcript/OperatorResult.java | 8 +- .../rest/ipmessaging/v1/Credential.java | 8 +- .../rest/ipmessaging/v1/service/Channel.java | 6 +- .../rest/ipmessaging/v1/service/Role.java | 8 +- .../v1/service/user/UserChannel.java | 6 +- .../rest/ipmessaging/v2/Credential.java | 8 +- .../rest/ipmessaging/v2/service/Binding.java | 6 +- .../rest/ipmessaging/v2/service/Channel.java | 6 +- .../rest/ipmessaging/v2/service/Role.java | 8 +- .../v2/service/channel/Webhook.java | 2 +- .../v2/service/user/UserBinding.java | 6 +- .../v2/service/user/UserChannel.java | 12 +- .../twilio/rest/knowledge/v1/Knowledge.java | 409 --------- .../rest/knowledge/v1/KnowledgeDeleter.java | 69 -- .../rest/knowledge/v1/KnowledgeFetcher.java | 73 -- .../rest/knowledge/v1/KnowledgeReader.java | 144 ---- .../rest/knowledge/v1/knowledge/Chunk.java | 161 ---- .../knowledge/v1/knowledge/ChunkReader.java | 139 --- .../v1/knowledge/KnowledgeStatus.java | 145 ---- .../v1/knowledge/KnowledgeStatusFetcher.java | 73 -- .../com/twilio/rest/lookups/v2/Bucket.java | 209 +++++ .../v2/BucketDeleter.java} | 23 +- .../v2/BucketFetcher.java} | 27 +- .../v2/BucketUpdater.java} | 54 +- .../rest/lookups/v2/LookupOverride.java | 337 ++++++++ .../v2/LookupOverrideCreator.java} | 48 +- .../v2/LookupOverrideDeleter.java} | 32 +- .../v2/LookupOverrideFetcher.java} | 36 +- .../v2/LookupOverrideUpdater.java} | 50 +- .../twilio/rest/lookups/v2/PhoneNumber.java | 6 +- .../com/twilio/rest/lookups/v2/Query.java | 799 ++++++++++++++++++ .../v2/QueryCreator.java} | 54 +- .../v2/RateLimit.java} | 120 +-- .../v2/RateLimitFetcher.java} | 49 +- .../marketplace/v1/ReferralConversion.java | 2 +- .../installedaddon/InstalledAddOnUsage.java | 2 +- .../rest/messaging/v1/BrandRegistration.java | 22 +- .../com/twilio/rest/messaging/v1/Service.java | 6 +- .../messaging/v1/TollfreeVerification.java | 16 +- .../v1/brandregistration/BrandVetting.java | 10 +- .../rest/messaging/v2/ChannelsSender.java | 8 +- .../rest/microvisor/v1/AccountConfig.java | 168 ---- .../microvisor/v1/AccountConfigCreator.java | 95 --- .../microvisor/v1/AccountConfigFetcher.java | 73 -- .../microvisor/v1/AccountConfigReader.java | 135 --- .../rest/microvisor/v1/AccountSecret.java | 160 ---- .../microvisor/v1/AccountSecretCreator.java | 95 --- .../microvisor/v1/AccountSecretDeleter.java | 69 -- .../microvisor/v1/AccountSecretReader.java | 135 --- .../com/twilio/rest/microvisor/v1/App.java | 197 ----- .../twilio/rest/microvisor/v1/AppDeleter.java | 69 -- .../twilio/rest/microvisor/v1/AppFetcher.java | 70 -- .../twilio/rest/microvisor/v1/AppReader.java | 135 --- .../com/twilio/rest/microvisor/v1/Device.java | 206 ----- .../rest/microvisor/v1/DeviceUpdater.java | 109 --- .../microvisor/v1/app/AppManifestFetcher.java | 73 -- .../microvisor/v1/device/DeviceConfig.java | 184 ---- .../v1/device/DeviceConfigCreator.java | 106 --- .../v1/device/DeviceConfigReader.java | 143 ---- .../v1/device/DeviceConfigUpdater.java | 98 --- .../microvisor/v1/device/DeviceSecret.java | 176 ---- .../v1/device/DeviceSecretCreator.java | 106 --- .../v1/device/DeviceSecretFetcher.java | 83 -- .../v1/device/DeviceSecretReader.java | 143 ---- .../v1/device/DeviceSecretUpdater.java | 98 --- .../com/twilio/rest/notify/v1/Credential.java | 8 +- .../rest/notify/v1/service/Binding.java | 2 +- .../rest/notify/v1/service/Notification.java | 6 +- .../rest/numbers/v1/PortingPortability.java | 8 +- .../v1/PortingWebhookConfigurationDelete.java | 2 +- ...okConfigurationFetch.java => Webhook.java} | 33 +- ...nFetchFetcher.java => WebhookFetcher.java} | 16 +- .../numbers/v2/AuthorizationDocument.java | 6 +- .../numbers/v2/BulkHostedNumberOrder.java | 8 +- .../twilio/rest/numbers/v2/BundleClone.java | 6 +- .../rest/numbers/v2/HostedNumberOrder.java | 14 +- .../DependentHostedNumberOrder.java | 6 +- .../v2/regulatorycompliance/Bundle.java | 6 +- .../v2/regulatorycompliance/EndUser.java | 8 +- .../v2/regulatorycompliance/Regulation.java | 6 +- .../SupportingDocument.java | 6 +- .../bundle/BundleCopy.java | 6 +- .../bundle/Evaluation.java | 6 +- .../bundle/ReplaceItems.java | 6 +- .../hostedNumbers/AuthorizationDocument.java | 6 +- .../hostedNumbers/HostedNumberOrder.java | 12 +- .../DependentHostedNumberOrder.java | 12 +- .../previewiam/organizations/Account.java | 6 +- .../organizations/RoleAssignment.java | 2 +- .../rest/previewiam/organizations/User.java | 4 +- .../rest/pricing/v1/messaging/Country.java | 2 +- .../rest/pricing/v1/phonenumber/Country.java | 2 +- .../twilio/rest/pricing/v1/voice/Country.java | 2 +- .../twilio/rest/pricing/v1/voice/Number.java | 2 +- .../com/twilio/rest/pricing/v2/Country.java | 2 +- .../com/twilio/rest/pricing/v2/Number.java | 2 +- .../twilio/rest/pricing/v2/voice/Country.java | 2 +- .../twilio/rest/pricing/v2/voice/Number.java | 2 +- .../com/twilio/rest/proxy/v1/Service.java | 14 +- .../twilio/rest/proxy/v1/service/Session.java | 12 +- .../rest/proxy/v1/service/SessionCreator.java | 3 +- .../rest/proxy/v1/service/ShortCode.java | 236 ------ .../proxy/v1/service/ShortCodeDeleter.java | 76 -- .../proxy/v1/service/ShortCodeReader.java | 143 ---- .../proxy/v1/service/ShortCodeUpdater.java | 92 -- .../proxy/v1/service/session/Interaction.java | 18 +- .../participant/MessageInteraction.java | 18 +- .../rest/serverless/v1/service/Build.java | 12 +- .../v1/service/asset/AssetVersion.java | 6 +- .../v1/service/build/BuildStatus.java | 6 +- .../v1/service/function/FunctionVersion.java | 6 +- .../java/com/twilio/rest/studio/v1/Flow.java | 6 +- .../rest/studio/v1/flow/Engagement.java | 6 +- .../twilio/rest/studio/v1/flow/Execution.java | 8 +- .../java/com/twilio/rest/studio/v2/Flow.java | 10 +- .../twilio/rest/studio/v2/FlowValidate.java | 2 +- .../twilio/rest/studio/v2/flow/Execution.java | 8 +- .../rest/studio/v2/flow/FlowRevision.java | 6 +- .../twilio/rest/supersim/v1/EsimProfile.java | 6 +- .../com/twilio/rest/supersim/v1/Fleet.java | 6 +- .../twilio/rest/supersim/v1/IpCommand.java | 18 +- .../rest/supersim/v1/SettingsUpdate.java | 6 +- .../java/com/twilio/rest/supersim/v1/Sim.java | 6 +- .../twilio/rest/supersim/v1/SmsCommand.java | 12 +- .../twilio/rest/supersim/v1/UsageRecord.java | 2 +- .../rest/supersim/v1/sim/BillingPeriod.java | 6 +- .../rest/supersim/v1/sim/SimIpAddress.java | 6 +- .../rest/sync/v1/service/DocumentCreator.java | 8 +- .../rest/sync/v1/service/DocumentUpdater.java | 7 +- .../v1/service/synclist/SyncListItem.java | 2 +- .../service/synclist/SyncListItemCreator.java | 10 +- .../service/synclist/SyncListItemUpdater.java | 7 +- .../sync/v1/service/syncmap/SyncMapItem.java | 2 +- .../service/syncmap/SyncMapItemCreator.java | 10 +- .../service/syncmap/SyncMapItemUpdater.java | 7 +- .../v1/service/syncstream/StreamMessage.java | 2 +- .../syncstream/StreamMessageCreator.java | 10 +- .../twilio/rest/taskrouter/v1/Workspace.java | 6 +- .../rest/taskrouter/v1/workspace/Task.java | 6 +- .../taskrouter/v1/workspace/TaskQueue.java | 6 +- .../v1/workspace/task/Reservation.java | 8 +- .../v1/workspace/worker/Reservation.java | 8 +- .../com/twilio/rest/trunking/v1/Trunk.java | 25 +- .../rest/trunking/v1/trunk/PhoneNumber.java | 6 +- .../rest/trunking/v1/trunk/Recording.java | 12 +- .../v1/ComplianceRegistrationInquiries.java | 4 +- .../rest/trusthub/v1/CustomerProfiles.java | 6 +- .../rest/trusthub/v1/SupportingDocument.java | 6 +- .../rest/trusthub/v1/TrustProducts.java | 6 +- .../CustomerProfilesEvaluations.java | 6 +- .../TrustProductsEvaluations.java | 6 +- .../java/com/twilio/rest/verify/v2/Form.java | 8 +- .../rest/verify/v2/VerificationAttempt.java | 15 +- .../v2/VerificationAttemptsSummary.java | 3 +- .../rest/verify/v2/service/AccessToken.java | 8 +- .../rest/verify/v2/service/Verification.java | 8 +- .../verify/v2/service/VerificationCheck.java | 6 +- .../rest/verify/v2/service/Webhook.java | 18 +- .../verify/v2/service/entity/Challenge.java | 18 +- .../rest/verify/v2/service/entity/Factor.java | 12 +- .../verify/v2/service/entity/NewFactor.java | 14 +- .../com/twilio/rest/video/v1/Composition.java | 12 +- .../twilio/rest/video/v1/CompositionHook.java | 6 +- .../com/twilio/rest/video/v1/Recording.java | 26 +- .../java/com/twilio/rest/video/v1/Room.java | 20 +- .../rest/video/v1/room/Participant.java | 6 +- .../rest/video/v1/room/RoomRecording.java | 26 +- .../rest/video/v1/room/Transcriptions.java | 255 ++++++ .../v1/room/TranscriptionsCreator.java} | 49 +- .../v1/room/TranscriptionsFetcher.java} | 30 +- .../v1/room/TranscriptionsReader.java} | 44 +- .../v1/room/TranscriptionsUpdater.java} | 42 +- .../video/v1/room/participant/Anonymize.java | 6 +- .../v1/room/participant/PublishedTrack.java | 6 +- .../v1/room/participant/SubscribedTrack.java | 6 +- .../com/twilio/rest/wireless/v1/Command.java | 24 +- .../java/com/twilio/rest/wireless/v1/Sim.java | 12 +- .../java/com/twilio/twiml/voice/Dial.java | 9 + .../java/com/twilio/twiml/voice/WhatsApp.java | 299 +++++++ .../java/com/twilio/twiml/voice/DialTest.java | 18 + .../com/twilio/twiml/voice/WhatsAppTest.java | 54 ++ 280 files changed, 3437 insertions(+), 5960 deletions(-) delete mode 100644 src/main/java/com/twilio/rest/knowledge/v1/Knowledge.java delete mode 100644 src/main/java/com/twilio/rest/knowledge/v1/KnowledgeDeleter.java delete mode 100644 src/main/java/com/twilio/rest/knowledge/v1/KnowledgeFetcher.java delete mode 100644 src/main/java/com/twilio/rest/knowledge/v1/KnowledgeReader.java delete mode 100644 src/main/java/com/twilio/rest/knowledge/v1/knowledge/Chunk.java delete mode 100644 src/main/java/com/twilio/rest/knowledge/v1/knowledge/ChunkReader.java delete mode 100644 src/main/java/com/twilio/rest/knowledge/v1/knowledge/KnowledgeStatus.java delete mode 100644 src/main/java/com/twilio/rest/knowledge/v1/knowledge/KnowledgeStatusFetcher.java create mode 100644 src/main/java/com/twilio/rest/lookups/v2/Bucket.java rename src/main/java/com/twilio/rest/{microvisor/v1/AccountConfigDeleter.java => lookups/v2/BucketDeleter.java} (73%) rename src/main/java/com/twilio/rest/{microvisor/v1/DeviceFetcher.java => lookups/v2/BucketFetcher.java} (69%) rename src/main/java/com/twilio/rest/{microvisor/v1/AccountConfigUpdater.java => lookups/v2/BucketUpdater.java} (53%) create mode 100644 src/main/java/com/twilio/rest/lookups/v2/LookupOverride.java rename src/main/java/com/twilio/rest/{knowledge/v1/KnowledgeCreator.java => lookups/v2/LookupOverrideCreator.java} (61%) rename src/main/java/com/twilio/rest/{microvisor/v1/device/DeviceConfigDeleter.java => lookups/v2/LookupOverrideDeleter.java} (71%) rename src/main/java/com/twilio/rest/{microvisor/v1/device/DeviceConfigFetcher.java => lookups/v2/LookupOverrideFetcher.java} (68%) rename src/main/java/com/twilio/rest/{knowledge/v1/KnowledgeUpdater.java => lookups/v2/LookupOverrideUpdater.java} (63%) create mode 100644 src/main/java/com/twilio/rest/lookups/v2/Query.java rename src/main/java/com/twilio/rest/{microvisor/v1/device/DeviceSecretDeleter.java => lookups/v2/QueryCreator.java} (58%) rename src/main/java/com/twilio/rest/{microvisor/v1/app/AppManifest.java => lookups/v2/RateLimit.java} (52%) rename src/main/java/com/twilio/rest/{proxy/v1/service/ShortCodeFetcher.java => lookups/v2/RateLimitFetcher.java} (65%) delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/AccountConfig.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/AccountConfigCreator.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/AccountConfigFetcher.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/AccountConfigReader.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/AccountSecret.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/AccountSecretCreator.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/AccountSecretDeleter.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/AccountSecretReader.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/App.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/AppDeleter.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/AppFetcher.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/AppReader.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/Device.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/DeviceUpdater.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/app/AppManifestFetcher.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfig.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigCreator.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigReader.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigUpdater.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecret.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretCreator.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretFetcher.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretReader.java delete mode 100644 src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretUpdater.java rename src/main/java/com/twilio/rest/numbers/v1/{PortingWebhookConfigurationFetch.java => Webhook.java} (82%) rename src/main/java/com/twilio/rest/numbers/v1/{PortingWebhookConfigurationFetchFetcher.java => WebhookFetcher.java} (79%) delete mode 100644 src/main/java/com/twilio/rest/proxy/v1/service/ShortCode.java delete mode 100644 src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeDeleter.java delete mode 100644 src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeReader.java delete mode 100644 src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeUpdater.java create mode 100644 src/main/java/com/twilio/rest/video/v1/room/Transcriptions.java rename src/main/java/com/twilio/rest/{proxy/v1/service/ShortCodeCreator.java => video/v1/room/TranscriptionsCreator.java} (63%) rename src/main/java/com/twilio/rest/{microvisor/v1/AccountSecretFetcher.java => video/v1/room/TranscriptionsFetcher.java} (69%) rename src/main/java/com/twilio/rest/{microvisor/v1/DeviceReader.java => video/v1/room/TranscriptionsReader.java} (72%) rename src/main/java/com/twilio/rest/{microvisor/v1/AccountSecretUpdater.java => video/v1/room/TranscriptionsUpdater.java} (64%) create mode 100644 src/main/java/com/twilio/twiml/voice/WhatsApp.java create mode 100644 src/test/java/com/twilio/twiml/voice/WhatsAppTest.java diff --git a/CHANGES.md b/CHANGES.md index 22a5fd150c..9ef65ffab7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,35 @@ twilio-java changelog ===================== +[2025-07-03] Version 11.0.0-rc.1 +-------------------------------- +**Library - Chore** +- [PR #875](https://github.com/twilio/twilio-java/pull/875): prepare for RC release. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! +- [PR #874](https://github.com/twilio/twilio-java/pull/874): Handle List serialization. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! +- [PR #873](https://github.com/twilio/twilio-java/pull/873): use Object for anyType. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Bulkexports** +- Changed the type of 'details' field to be a list of objects instead of a single object + +**Conversations** +- Updates to `method` casing for ConfgurationAddress, ConversationScopedWebhook, and ServiceConversationScopedWebhook for RestProxy compatibility + +**Proxy** +- remove shortcodes resource as its no longer used + +**Serverless** +- Change log field level from type `ienum` to `string` in Logs api + +**Taskrouter** +- Remove `URL-encoded` from attributes param definition in tasks + +**Trunking** +- Added `symmetric_rtp_enabled` property on Trunks. + +**Twiml** +- Add support for `` noun under `` verb + + [2025-07-03] Version 11.0.0-rc.0 -------------------------------- - Release Candidate prep diff --git a/src/main/java/com/twilio/Domains.java b/src/main/java/com/twilio/Domains.java index 956b8080b9..2baa605f57 100644 --- a/src/main/java/com/twilio/Domains.java +++ b/src/main/java/com/twilio/Domains.java @@ -26,11 +26,9 @@ public enum Domains { INSIGHTS("insights"), INTELLIGENCE("intelligence"), IPMESSAGING("ip-messaging"), - KNOWLEDGE("knowledge"), LOOKUPS("lookups"), MARKETPLACE("marketplace"), MESSAGING("messaging"), - MICROVISOR("microvisor"), MONITOR("monitor"), NOTIFY("notify"), NUMBERS("numbers"), diff --git a/src/main/java/com/twilio/rest/accounts/v1/BulkConsentsCreator.java b/src/main/java/com/twilio/rest/accounts/v1/BulkConsentsCreator.java index b472c75f67..1155c9fd32 100644 --- a/src/main/java/com/twilio/rest/accounts/v1/BulkConsentsCreator.java +++ b/src/main/java/com/twilio/rest/accounts/v1/BulkConsentsCreator.java @@ -15,8 +15,9 @@ package com.twilio.rest.accounts.v1; import com.twilio.base.Creator; -import com.twilio.converter.Converter; import com.twilio.constant.EnumConstants; +import com.twilio.converter.Converter; +import com.twilio.converter.Converter; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; diff --git a/src/main/java/com/twilio/rest/accounts/v1/BulkContactsCreator.java b/src/main/java/com/twilio/rest/accounts/v1/BulkContactsCreator.java index abbd29d480..7dc970c184 100644 --- a/src/main/java/com/twilio/rest/accounts/v1/BulkContactsCreator.java +++ b/src/main/java/com/twilio/rest/accounts/v1/BulkContactsCreator.java @@ -17,6 +17,7 @@ import com.twilio.base.Creator; import com.twilio.constant.EnumConstants; import com.twilio.converter.Converter; +import com.twilio.converter.Converter; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; diff --git a/src/main/java/com/twilio/rest/api/v2010/Account.java b/src/main/java/com/twilio/rest/api/v2010/Account.java index 814acb9477..7ab47a5b18 100644 --- a/src/main/java/com/twilio/rest/api/v2010/Account.java +++ b/src/main/java/com/twilio/rest/api/v2010/Account.java @@ -113,9 +113,9 @@ public static Account fromJson( private final String friendlyName; private final String ownerAccountSid; private final String sid; - private final Status status; + private final Account.Status status; private final Map subresourceUris; - private final Type type; + private final Account.Type type; private final String uri; @JsonCreator @@ -126,12 +126,12 @@ private Account( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("owner_account_sid") final String ownerAccountSid, @JsonProperty("sid") final String sid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Account.Status status, @JsonProperty("subresource_uris") final Map< String, String > subresourceUris, - @JsonProperty("type") final Type type, + @JsonProperty("type") final Account.Type type, @JsonProperty("uri") final String uri ) { this.authToken = authToken; @@ -170,7 +170,7 @@ public final String getSid() { return this.sid; } - public final Status getStatus() { + public final Account.Status getStatus() { return this.status; } @@ -178,7 +178,7 @@ public final Map getSubresourceUris() { return this.subresourceUris; } - public final Type getType() { + public final Account.Type getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/AuthorizedConnectApp.java b/src/main/java/com/twilio/rest/api/v2010/account/AuthorizedConnectApp.java index a58a35511e..f7e1d9f67f 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/AuthorizedConnectApp.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/AuthorizedConnectApp.java @@ -113,7 +113,7 @@ public static AuthorizedConnectApp fromJson( private final String connectAppFriendlyName; private final URI connectAppHomepageUrl; private final String connectAppSid; - private final List permissions; + private final List permissions; private final String uri; @JsonCreator @@ -132,7 +132,9 @@ private AuthorizedConnectApp( "connect_app_homepage_url" ) final URI connectAppHomepageUrl, @JsonProperty("connect_app_sid") final String connectAppSid, - @JsonProperty("permissions") final List permissions, + @JsonProperty("permissions") final List< + AuthorizedConnectApp.Permission + > permissions, @JsonProperty("uri") final String uri ) { this.accountSid = accountSid; @@ -169,7 +171,7 @@ public final String getConnectAppSid() { return this.connectAppSid; } - public final List getPermissions() { + public final List getPermissions() { return this.permissions; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/Call.java b/src/main/java/com/twilio/rest/api/v2010/account/Call.java index 59e9b2a099..8eaf7c203d 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/Call.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/Call.java @@ -189,7 +189,7 @@ public static Call fromJson( private final String from; private final String fromFormatted; private final String phoneNumberSid; - private final Status status; + private final Call.Status status; private final ZonedDateTime startTime; private final ZonedDateTime endTime; private final String duration; @@ -218,13 +218,13 @@ private Call( @JsonProperty("from") final String from, @JsonProperty("from_formatted") final String fromFormatted, @JsonProperty("phone_number_sid") final String phoneNumberSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Call.Status status, @JsonProperty("start_time") final String startTime, @JsonProperty("end_time") final String endTime, @JsonProperty("duration") final String duration, @JsonProperty("price") final String price, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("direction") final String direction, @JsonProperty("answered_by") final String answeredBy, @@ -308,7 +308,7 @@ public final String getPhoneNumberSid() { return this.phoneNumberSid; } - public final Status getStatus() { + public final Call.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/Conference.java b/src/main/java/com/twilio/rest/api/v2010/account/Conference.java index a35e39b51c..bcb13ce3df 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/Conference.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/Conference.java @@ -120,10 +120,10 @@ public static Conference fromJson( private final String friendlyName; private final String region; private final String sid; - private final Status status; + private final Conference.Status status; private final String uri; private final Map subresourceUris; - private final ReasonConferenceEnded reasonConferenceEnded; + private final Conference.ReasonConferenceEnded reasonConferenceEnded; private final String callSidEndingConference; @JsonCreator @@ -135,7 +135,7 @@ private Conference( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("region") final String region, @JsonProperty("sid") final String sid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Conference.Status status, @JsonProperty("uri") final String uri, @JsonProperty("subresource_uris") final Map< String, @@ -143,7 +143,7 @@ private Conference( > subresourceUris, @JsonProperty( "reason_conference_ended" - ) final ReasonConferenceEnded reasonConferenceEnded, + ) final Conference.ReasonConferenceEnded reasonConferenceEnded, @JsonProperty( "call_sid_ending_conference" ) final String callSidEndingConference @@ -190,7 +190,7 @@ public final String getSid() { return this.sid; } - public final Status getStatus() { + public final Conference.Status getStatus() { return this.status; } @@ -202,7 +202,7 @@ public final Map getSubresourceUris() { return this.subresourceUris; } - public final ReasonConferenceEnded getReasonConferenceEnded() { + public final Conference.ReasonConferenceEnded getReasonConferenceEnded() { return this.reasonConferenceEnded; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/ConnectApp.java b/src/main/java/com/twilio/rest/api/v2010/account/ConnectApp.java index da84d010e6..64e5e6198c 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/ConnectApp.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/ConnectApp.java @@ -131,7 +131,7 @@ public static ConnectApp fromJson( private final String description; private final String friendlyName; private final URI homepageUrl; - private final List permissions; + private final List permissions; private final String sid; private final String uri; @@ -149,7 +149,9 @@ private ConnectApp( @JsonProperty("description") final String description, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("homepage_url") final URI homepageUrl, - @JsonProperty("permissions") final List permissions, + @JsonProperty("permissions") final List< + ConnectApp.Permission + > permissions, @JsonProperty("sid") final String sid, @JsonProperty("uri") final String uri ) { @@ -198,7 +200,7 @@ public final URI getHomepageUrl() { return this.homepageUrl; } - public final List getPermissions() { + public final List getPermissions() { return this.permissions; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/IncomingPhoneNumber.java b/src/main/java/com/twilio/rest/api/v2010/account/IncomingPhoneNumber.java index f59bdac73f..6c202374e5 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/IncomingPhoneNumber.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/IncomingPhoneNumber.java @@ -153,7 +153,7 @@ public static IncomingPhoneNumber fromJson( private final String accountSid; private final String addressSid; - private final AddressRequirement addressRequirements; + private final IncomingPhoneNumber.AddressRequirement addressRequirements; private final String apiVersion; private final Boolean beta; private final PhoneNumberCapabilities capabilities; @@ -173,16 +173,16 @@ public static IncomingPhoneNumber fromJson( private final HttpMethod statusCallbackMethod; private final String trunkSid; private final String uri; - private final VoiceReceiveMode voiceReceiveMode; + private final IncomingPhoneNumber.VoiceReceiveMode voiceReceiveMode; private final String voiceApplicationSid; private final Boolean voiceCallerIdLookup; private final HttpMethod voiceFallbackMethod; private final URI voiceFallbackUrl; private final HttpMethod voiceMethod; private final URI voiceUrl; - private final EmergencyStatus emergencyStatus; + private final IncomingPhoneNumber.EmergencyStatus emergencyStatus; private final String emergencyAddressSid; - private final EmergencyAddressStatus emergencyAddressStatus; + private final IncomingPhoneNumber.EmergencyAddressStatus emergencyAddressStatus; private final String bundleSid; private final String status; @@ -192,7 +192,7 @@ private IncomingPhoneNumber( @JsonProperty("address_sid") final String addressSid, @JsonProperty( "address_requirements" - ) final AddressRequirement addressRequirements, + ) final IncomingPhoneNumber.AddressRequirement addressRequirements, @JsonProperty("api_version") final String apiVersion, @JsonProperty("beta") final Boolean beta, @JsonProperty( @@ -220,7 +220,7 @@ private IncomingPhoneNumber( @JsonProperty("uri") final String uri, @JsonProperty( "voice_receive_mode" - ) final VoiceReceiveMode voiceReceiveMode, + ) final IncomingPhoneNumber.VoiceReceiveMode voiceReceiveMode, @JsonProperty("voice_application_sid") final String voiceApplicationSid, @JsonProperty( "voice_caller_id_lookup" @@ -231,11 +231,13 @@ private IncomingPhoneNumber( @JsonProperty("voice_fallback_url") final URI voiceFallbackUrl, @JsonProperty("voice_method") final HttpMethod voiceMethod, @JsonProperty("voice_url") final URI voiceUrl, - @JsonProperty("emergency_status") final EmergencyStatus emergencyStatus, + @JsonProperty( + "emergency_status" + ) final IncomingPhoneNumber.EmergencyStatus emergencyStatus, @JsonProperty("emergency_address_sid") final String emergencyAddressSid, @JsonProperty( "emergency_address_status" - ) final EmergencyAddressStatus emergencyAddressStatus, + ) final IncomingPhoneNumber.EmergencyAddressStatus emergencyAddressStatus, @JsonProperty("bundle_sid") final String bundleSid, @JsonProperty("status") final String status ) { @@ -283,7 +285,7 @@ public final String getAddressSid() { return this.addressSid; } - public final AddressRequirement getAddressRequirements() { + public final IncomingPhoneNumber.AddressRequirement getAddressRequirements() { return this.addressRequirements; } @@ -363,7 +365,7 @@ public final String getUri() { return this.uri; } - public final VoiceReceiveMode getVoiceReceiveMode() { + public final IncomingPhoneNumber.VoiceReceiveMode getVoiceReceiveMode() { return this.voiceReceiveMode; } @@ -391,7 +393,7 @@ public final URI getVoiceUrl() { return this.voiceUrl; } - public final EmergencyStatus getEmergencyStatus() { + public final IncomingPhoneNumber.EmergencyStatus getEmergencyStatus() { return this.emergencyStatus; } @@ -399,7 +401,7 @@ public final String getEmergencyAddressSid() { return this.emergencyAddressSid; } - public final EmergencyAddressStatus getEmergencyAddressStatus() { + public final IncomingPhoneNumber.EmergencyAddressStatus getEmergencyAddressStatus() { return this.emergencyAddressStatus; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/Message.java b/src/main/java/com/twilio/rest/api/v2010/account/Message.java index dce011b3df..548b52b068 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/Message.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/Message.java @@ -209,7 +209,7 @@ public static Message fromJson( private final String body; private final String numSegments; - private final Direction direction; + private final Message.Direction direction; private final com.twilio.type.PhoneNumber from; private final String to; private final ZonedDateTime dateUpdated; @@ -218,7 +218,7 @@ public static Message fromJson( private final String uri; private final String accountSid; private final String numMedia; - private final Status status; + private final Message.Status status; private final String messagingServiceSid; private final String sid; private final ZonedDateTime dateSent; @@ -232,7 +232,7 @@ public static Message fromJson( private Message( @JsonProperty("body") final String body, @JsonProperty("num_segments") final String numSegments, - @JsonProperty("direction") final Direction direction, + @JsonProperty("direction") final Message.Direction direction, @JsonProperty("from") final com.twilio.type.PhoneNumber from, @JsonProperty("to") final String to, @JsonProperty("date_updated") final String dateUpdated, @@ -241,14 +241,14 @@ private Message( @JsonProperty("uri") final String uri, @JsonProperty("account_sid") final String accountSid, @JsonProperty("num_media") final String numMedia, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Message.Status status, @JsonProperty("messaging_service_sid") final String messagingServiceSid, @JsonProperty("sid") final String sid, @JsonProperty("date_sent") final String dateSent, @JsonProperty("date_created") final String dateCreated, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("api_version") final String apiVersion, @JsonProperty("subresource_uris") final Map< @@ -286,7 +286,7 @@ public final String getNumSegments() { return this.numSegments; } - public final Direction getDirection() { + public final Message.Direction getDirection() { return this.direction; } @@ -322,7 +322,7 @@ public final String getNumMedia() { return this.numMedia; } - public final Status getStatus() { + public final Message.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/Recording.java b/src/main/java/com/twilio/rest/api/v2010/account/Recording.java index e36eee0d13..88e79667f7 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/Recording.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/Recording.java @@ -125,9 +125,9 @@ public static Recording fromJson( private final String sid; private final String price; private final String priceUnit; - private final Status status; + private final Recording.Status status; private final Integer channels; - private final Source source; + private final Recording.Source source; private final Integer errorCode; private final String uri; private final Map encryptionDetails; @@ -147,9 +147,9 @@ private Recording( @JsonProperty("sid") final String sid, @JsonProperty("price") final String price, @JsonProperty("price_unit") final String priceUnit, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Recording.Status status, @JsonProperty("channels") final Integer channels, - @JsonProperty("source") final Source source, + @JsonProperty("source") final Recording.Source source, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("uri") final String uri, @JsonProperty("encryption_details") final Map< @@ -227,7 +227,7 @@ public final String getPriceUnit() { return this.priceUnit; } - public final Status getStatus() { + public final Recording.Status getStatus() { return this.status; } @@ -235,7 +235,7 @@ public final Integer getChannels() { return this.channels; } - public final Source getSource() { + public final Recording.Source getSource() { return this.source; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/Transcription.java b/src/main/java/com/twilio/rest/api/v2010/account/Transcription.java index e801e42350..a9525ed472 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/Transcription.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/Transcription.java @@ -124,7 +124,7 @@ public static Transcription fromJson( private final Currency priceUnit; private final String recordingSid; private final String sid; - private final Status status; + private final Transcription.Status status; private final String transcriptionText; private final String type; private final String uri; @@ -138,11 +138,11 @@ private Transcription( @JsonProperty("duration") final String duration, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("recording_sid") final String recordingSid, @JsonProperty("sid") final String sid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Transcription.Status status, @JsonProperty("transcription_text") final String transcriptionText, @JsonProperty("type") final String type, @JsonProperty("uri") final String uri @@ -198,7 +198,7 @@ public final String getSid() { return this.sid; } - public final Status getStatus() { + public final Transcription.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/address/DependentPhoneNumber.java b/src/main/java/com/twilio/rest/api/v2010/account/address/DependentPhoneNumber.java index ff8e7f4f78..3c65422d55 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/address/DependentPhoneNumber.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/address/DependentPhoneNumber.java @@ -113,7 +113,7 @@ public static DependentPhoneNumber fromJson( private final URI smsFallbackUrl; private final HttpMethod smsMethod; private final URI smsUrl; - private final AddressRequirement addressRequirements; + private final DependentPhoneNumber.AddressRequirement addressRequirements; private final Map capabilities; private final URI statusCallback; private final HttpMethod statusCallbackMethod; @@ -121,7 +121,7 @@ public static DependentPhoneNumber fromJson( private final String smsApplicationSid; private final String voiceApplicationSid; private final String trunkSid; - private final EmergencyStatus emergencyStatus; + private final DependentPhoneNumber.EmergencyStatus emergencyStatus; private final String emergencyAddressSid; private final String uri; @@ -150,7 +150,7 @@ private DependentPhoneNumber( @JsonProperty("sms_url") final URI smsUrl, @JsonProperty( "address_requirements" - ) final AddressRequirement addressRequirements, + ) final DependentPhoneNumber.AddressRequirement addressRequirements, @JsonProperty("capabilities") final Map capabilities, @JsonProperty("status_callback") final URI statusCallback, @JsonProperty( @@ -160,7 +160,9 @@ private DependentPhoneNumber( @JsonProperty("sms_application_sid") final String smsApplicationSid, @JsonProperty("voice_application_sid") final String voiceApplicationSid, @JsonProperty("trunk_sid") final String trunkSid, - @JsonProperty("emergency_status") final EmergencyStatus emergencyStatus, + @JsonProperty( + "emergency_status" + ) final DependentPhoneNumber.EmergencyStatus emergencyStatus, @JsonProperty("emergency_address_sid") final String emergencyAddressSid, @JsonProperty("uri") final String uri ) { @@ -252,7 +254,7 @@ public final URI getSmsUrl() { return this.smsUrl; } - public final AddressRequirement getAddressRequirements() { + public final DependentPhoneNumber.AddressRequirement getAddressRequirements() { return this.addressRequirements; } @@ -284,7 +286,7 @@ public final String getTrunkSid() { return this.trunkSid; } - public final EmergencyStatus getEmergencyStatus() { + public final DependentPhoneNumber.EmergencyStatus getEmergencyStatus() { return this.emergencyStatus; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/call/Recording.java b/src/main/java/com/twilio/rest/api/v2010/account/call/Recording.java index 23d275246f..12054b2b44 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/call/Recording.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/call/Recording.java @@ -99,7 +99,7 @@ public static RecordingReader reader( public static RecordingUpdater updater( final String pathCallSid, final String pathSid, - final Status status + final Recording.Status status ) { return new RecordingUpdater(pathCallSid, pathSid, status); } @@ -108,7 +108,7 @@ public static RecordingUpdater updater( final String pathAccountSid, final String pathCallSid, final String pathSid, - final Status status + final Recording.Status status ) { return new RecordingUpdater( pathAccountSid, @@ -174,9 +174,9 @@ public static Recording fromJson( private final String uri; private final Map encryptionDetails; private final Currency priceUnit; - private final Status status; + private final Recording.Status status; private final Integer channels; - private final Source source; + private final Recording.Source source; private final Integer errorCode; private final String track; @@ -198,11 +198,11 @@ private Recording( Object > encryptionDetails, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Recording.Status status, @JsonProperty("channels") final Integer channels, - @JsonProperty("source") final Source source, + @JsonProperty("source") final Recording.Source source, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("track") final String track ) { @@ -278,7 +278,7 @@ public final Currency getPriceUnit() { return this.priceUnit; } - public final Status getStatus() { + public final Recording.Status getStatus() { return this.status; } @@ -286,7 +286,7 @@ public final Integer getChannels() { return this.channels; } - public final Source getSource() { + public final Recording.Source getSource() { return this.source; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/call/Siprec.java b/src/main/java/com/twilio/rest/api/v2010/account/call/Siprec.java index 87912457a3..376b870d65 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/call/Siprec.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/call/Siprec.java @@ -52,7 +52,7 @@ public static SiprecCreator creator( public static SiprecUpdater updater( final String pathCallSid, final String pathSid, - final UpdateStatus status + final Siprec.UpdateStatus status ) { return new SiprecUpdater(pathCallSid, pathSid, status); } @@ -61,7 +61,7 @@ public static SiprecUpdater updater( final String pathAccountSid, final String pathCallSid, final String pathSid, - final UpdateStatus status + final Siprec.UpdateStatus status ) { return new SiprecUpdater(pathAccountSid, pathCallSid, pathSid, status); } @@ -113,7 +113,7 @@ public static Siprec fromJson( private final String accountSid; private final String callSid; private final String name; - private final Status status; + private final Siprec.Status status; private final ZonedDateTime dateUpdated; private final String uri; @@ -123,7 +123,7 @@ private Siprec( @JsonProperty("account_sid") final String accountSid, @JsonProperty("call_sid") final String callSid, @JsonProperty("name") final String name, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Siprec.Status status, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("uri") final String uri ) { @@ -152,7 +152,7 @@ public final String getName() { return this.name; } - public final Status getStatus() { + public final Siprec.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/call/Stream.java b/src/main/java/com/twilio/rest/api/v2010/account/call/Stream.java index 6fcf583011..c646360c75 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/call/Stream.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/call/Stream.java @@ -57,7 +57,7 @@ public static StreamCreator creator( public static StreamUpdater updater( final String pathCallSid, final String pathSid, - final UpdateStatus status + final Stream.UpdateStatus status ) { return new StreamUpdater(pathCallSid, pathSid, status); } @@ -66,7 +66,7 @@ public static StreamUpdater updater( final String pathAccountSid, final String pathCallSid, final String pathSid, - final UpdateStatus status + final Stream.UpdateStatus status ) { return new StreamUpdater(pathAccountSid, pathCallSid, pathSid, status); } @@ -118,7 +118,7 @@ public static Stream fromJson( private final String accountSid; private final String callSid; private final String name; - private final Status status; + private final Stream.Status status; private final ZonedDateTime dateUpdated; private final String uri; @@ -128,7 +128,7 @@ private Stream( @JsonProperty("account_sid") final String accountSid, @JsonProperty("call_sid") final String callSid, @JsonProperty("name") final String name, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Stream.Status status, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("uri") final String uri ) { @@ -157,7 +157,7 @@ public final String getName() { return this.name; } - public final Status getStatus() { + public final Stream.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/call/Transcription.java b/src/main/java/com/twilio/rest/api/v2010/account/call/Transcription.java index e7aec1241e..1f1083335a 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/call/Transcription.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/call/Transcription.java @@ -52,7 +52,7 @@ public static TranscriptionCreator creator( public static TranscriptionUpdater updater( final String pathCallSid, final String pathSid, - final UpdateStatus status + final Transcription.UpdateStatus status ) { return new TranscriptionUpdater(pathCallSid, pathSid, status); } @@ -61,7 +61,7 @@ public static TranscriptionUpdater updater( final String pathAccountSid, final String pathCallSid, final String pathSid, - final UpdateStatus status + final Transcription.UpdateStatus status ) { return new TranscriptionUpdater( pathAccountSid, @@ -118,7 +118,7 @@ public static Transcription fromJson( private final String accountSid; private final String callSid; private final String name; - private final Status status; + private final Transcription.Status status; private final ZonedDateTime dateUpdated; private final String uri; @@ -128,7 +128,7 @@ private Transcription( @JsonProperty("account_sid") final String accountSid, @JsonProperty("call_sid") final String callSid, @JsonProperty("name") final String name, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Transcription.Status status, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("uri") final String uri ) { @@ -157,7 +157,7 @@ public final String getName() { return this.name; } - public final Status getStatus() { + public final Transcription.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/conference/Participant.java b/src/main/java/com/twilio/rest/api/v2010/account/conference/Participant.java index f386803124..1eb8a9218a 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/conference/Participant.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/conference/Participant.java @@ -183,7 +183,7 @@ public static Participant fromJson( private final Boolean muted; private final Boolean hold; private final Boolean startConferenceOnEnter; - private final Status status; + private final Participant.Status status; private final String queueTime; private final String uri; @@ -205,7 +205,7 @@ private Participant( @JsonProperty( "start_conference_on_enter" ) final Boolean startConferenceOnEnter, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Participant.Status status, @JsonProperty("queue_time") final String queueTime, @JsonProperty("uri") final String uri ) { @@ -274,7 +274,7 @@ public final Boolean getStartConferenceOnEnter() { return this.startConferenceOnEnter; } - public final Status getStatus() { + public final Participant.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/conference/Recording.java b/src/main/java/com/twilio/rest/api/v2010/account/conference/Recording.java index cb19e56da8..0a4e1b2876 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/conference/Recording.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/conference/Recording.java @@ -87,7 +87,7 @@ public static RecordingReader reader( public static RecordingUpdater updater( final String pathConferenceSid, final String pathSid, - final Status status + final Recording.Status status ) { return new RecordingUpdater(pathConferenceSid, pathSid, status); } @@ -96,7 +96,7 @@ public static RecordingUpdater updater( final String pathAccountSid, final String pathConferenceSid, final String pathSid, - final Status status + final Recording.Status status ) { return new RecordingUpdater( pathAccountSid, @@ -160,9 +160,9 @@ public static Recording fromJson( private final String sid; private final String price; private final Currency priceUnit; - private final Status status; + private final Recording.Status status; private final Integer channels; - private final Source source; + private final Recording.Source source; private final Integer errorCode; private final Map encryptionDetails; private final String uri; @@ -180,11 +180,11 @@ private Recording( @JsonProperty("sid") final String sid, @JsonProperty("price") final String price, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Recording.Status status, @JsonProperty("channels") final Integer channels, - @JsonProperty("source") final Source source, + @JsonProperty("source") final Recording.Source source, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("encryption_details") final Map< String, @@ -255,7 +255,7 @@ public final Currency getPriceUnit() { return this.priceUnit; } - public final Status getStatus() { + public final Recording.Status getStatus() { return this.status; } @@ -263,7 +263,7 @@ public final Integer getChannels() { return this.channels; } - public final Source getSource() { + public final Recording.Source getSource() { return this.source; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Local.java b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Local.java index cb3531a74c..801ff7fc75 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Local.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Local.java @@ -107,7 +107,7 @@ public static Local fromJson( private final String accountSid; private final String addressSid; - private final AddressRequirement addressRequirements; + private final Local.AddressRequirement addressRequirements; private final String apiVersion; private final Boolean beta; private final PhoneNumberCapabilities capabilities; @@ -127,16 +127,16 @@ public static Local fromJson( private final HttpMethod statusCallbackMethod; private final String trunkSid; private final String uri; - private final VoiceReceiveMode voiceReceiveMode; + private final Local.VoiceReceiveMode voiceReceiveMode; private final String voiceApplicationSid; private final Boolean voiceCallerIdLookup; private final HttpMethod voiceFallbackMethod; private final URI voiceFallbackUrl; private final HttpMethod voiceMethod; private final URI voiceUrl; - private final EmergencyStatus emergencyStatus; + private final Local.EmergencyStatus emergencyStatus; private final String emergencyAddressSid; - private final EmergencyAddressStatus emergencyAddressStatus; + private final Local.EmergencyAddressStatus emergencyAddressStatus; private final String bundleSid; private final String status; @@ -146,7 +146,7 @@ private Local( @JsonProperty("address_sid") final String addressSid, @JsonProperty( "address_requirements" - ) final AddressRequirement addressRequirements, + ) final Local.AddressRequirement addressRequirements, @JsonProperty("api_version") final String apiVersion, @JsonProperty("beta") final Boolean beta, @JsonProperty( @@ -174,7 +174,7 @@ private Local( @JsonProperty("uri") final String uri, @JsonProperty( "voice_receive_mode" - ) final VoiceReceiveMode voiceReceiveMode, + ) final Local.VoiceReceiveMode voiceReceiveMode, @JsonProperty("voice_application_sid") final String voiceApplicationSid, @JsonProperty( "voice_caller_id_lookup" @@ -185,11 +185,13 @@ private Local( @JsonProperty("voice_fallback_url") final URI voiceFallbackUrl, @JsonProperty("voice_method") final HttpMethod voiceMethod, @JsonProperty("voice_url") final URI voiceUrl, - @JsonProperty("emergency_status") final EmergencyStatus emergencyStatus, + @JsonProperty( + "emergency_status" + ) final Local.EmergencyStatus emergencyStatus, @JsonProperty("emergency_address_sid") final String emergencyAddressSid, @JsonProperty( "emergency_address_status" - ) final EmergencyAddressStatus emergencyAddressStatus, + ) final Local.EmergencyAddressStatus emergencyAddressStatus, @JsonProperty("bundle_sid") final String bundleSid, @JsonProperty("status") final String status ) { @@ -237,7 +239,7 @@ public final String getAddressSid() { return this.addressSid; } - public final AddressRequirement getAddressRequirements() { + public final Local.AddressRequirement getAddressRequirements() { return this.addressRequirements; } @@ -317,7 +319,7 @@ public final String getUri() { return this.uri; } - public final VoiceReceiveMode getVoiceReceiveMode() { + public final Local.VoiceReceiveMode getVoiceReceiveMode() { return this.voiceReceiveMode; } @@ -345,7 +347,7 @@ public final URI getVoiceUrl() { return this.voiceUrl; } - public final EmergencyStatus getEmergencyStatus() { + public final Local.EmergencyStatus getEmergencyStatus() { return this.emergencyStatus; } @@ -353,7 +355,7 @@ public final String getEmergencyAddressSid() { return this.emergencyAddressSid; } - public final EmergencyAddressStatus getEmergencyAddressStatus() { + public final Local.EmergencyAddressStatus getEmergencyAddressStatus() { return this.emergencyAddressStatus; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Mobile.java b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Mobile.java index 78bdb0710f..62c6156f9e 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Mobile.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/Mobile.java @@ -107,7 +107,7 @@ public static Mobile fromJson( private final String accountSid; private final String addressSid; - private final AddressRequirement addressRequirements; + private final Mobile.AddressRequirement addressRequirements; private final String apiVersion; private final Boolean beta; private final PhoneNumberCapabilities capabilities; @@ -127,16 +127,16 @@ public static Mobile fromJson( private final HttpMethod statusCallbackMethod; private final String trunkSid; private final String uri; - private final VoiceReceiveMode voiceReceiveMode; + private final Mobile.VoiceReceiveMode voiceReceiveMode; private final String voiceApplicationSid; private final Boolean voiceCallerIdLookup; private final HttpMethod voiceFallbackMethod; private final URI voiceFallbackUrl; private final HttpMethod voiceMethod; private final URI voiceUrl; - private final EmergencyStatus emergencyStatus; + private final Mobile.EmergencyStatus emergencyStatus; private final String emergencyAddressSid; - private final EmergencyAddressStatus emergencyAddressStatus; + private final Mobile.EmergencyAddressStatus emergencyAddressStatus; private final String bundleSid; private final String status; @@ -146,7 +146,7 @@ private Mobile( @JsonProperty("address_sid") final String addressSid, @JsonProperty( "address_requirements" - ) final AddressRequirement addressRequirements, + ) final Mobile.AddressRequirement addressRequirements, @JsonProperty("api_version") final String apiVersion, @JsonProperty("beta") final Boolean beta, @JsonProperty( @@ -174,7 +174,7 @@ private Mobile( @JsonProperty("uri") final String uri, @JsonProperty( "voice_receive_mode" - ) final VoiceReceiveMode voiceReceiveMode, + ) final Mobile.VoiceReceiveMode voiceReceiveMode, @JsonProperty("voice_application_sid") final String voiceApplicationSid, @JsonProperty( "voice_caller_id_lookup" @@ -185,11 +185,13 @@ private Mobile( @JsonProperty("voice_fallback_url") final URI voiceFallbackUrl, @JsonProperty("voice_method") final HttpMethod voiceMethod, @JsonProperty("voice_url") final URI voiceUrl, - @JsonProperty("emergency_status") final EmergencyStatus emergencyStatus, + @JsonProperty( + "emergency_status" + ) final Mobile.EmergencyStatus emergencyStatus, @JsonProperty("emergency_address_sid") final String emergencyAddressSid, @JsonProperty( "emergency_address_status" - ) final EmergencyAddressStatus emergencyAddressStatus, + ) final Mobile.EmergencyAddressStatus emergencyAddressStatus, @JsonProperty("bundle_sid") final String bundleSid, @JsonProperty("status") final String status ) { @@ -237,7 +239,7 @@ public final String getAddressSid() { return this.addressSid; } - public final AddressRequirement getAddressRequirements() { + public final Mobile.AddressRequirement getAddressRequirements() { return this.addressRequirements; } @@ -317,7 +319,7 @@ public final String getUri() { return this.uri; } - public final VoiceReceiveMode getVoiceReceiveMode() { + public final Mobile.VoiceReceiveMode getVoiceReceiveMode() { return this.voiceReceiveMode; } @@ -345,7 +347,7 @@ public final URI getVoiceUrl() { return this.voiceUrl; } - public final EmergencyStatus getEmergencyStatus() { + public final Mobile.EmergencyStatus getEmergencyStatus() { return this.emergencyStatus; } @@ -353,7 +355,7 @@ public final String getEmergencyAddressSid() { return this.emergencyAddressSid; } - public final EmergencyAddressStatus getEmergencyAddressStatus() { + public final Mobile.EmergencyAddressStatus getEmergencyAddressStatus() { return this.emergencyAddressStatus; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/TollFree.java b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/TollFree.java index af9f39055a..4e1e3cf74c 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/TollFree.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/incomingphonenumber/TollFree.java @@ -107,7 +107,7 @@ public static TollFree fromJson( private final String accountSid; private final String addressSid; - private final AddressRequirement addressRequirements; + private final TollFree.AddressRequirement addressRequirements; private final String apiVersion; private final Boolean beta; private final PhoneNumberCapabilities capabilities; @@ -127,16 +127,16 @@ public static TollFree fromJson( private final HttpMethod statusCallbackMethod; private final String trunkSid; private final String uri; - private final VoiceReceiveMode voiceReceiveMode; + private final TollFree.VoiceReceiveMode voiceReceiveMode; private final String voiceApplicationSid; private final Boolean voiceCallerIdLookup; private final HttpMethod voiceFallbackMethod; private final URI voiceFallbackUrl; private final HttpMethod voiceMethod; private final URI voiceUrl; - private final EmergencyStatus emergencyStatus; + private final TollFree.EmergencyStatus emergencyStatus; private final String emergencyAddressSid; - private final EmergencyAddressStatus emergencyAddressStatus; + private final TollFree.EmergencyAddressStatus emergencyAddressStatus; private final String bundleSid; private final String status; @@ -146,7 +146,7 @@ private TollFree( @JsonProperty("address_sid") final String addressSid, @JsonProperty( "address_requirements" - ) final AddressRequirement addressRequirements, + ) final TollFree.AddressRequirement addressRequirements, @JsonProperty("api_version") final String apiVersion, @JsonProperty("beta") final Boolean beta, @JsonProperty( @@ -174,7 +174,7 @@ private TollFree( @JsonProperty("uri") final String uri, @JsonProperty( "voice_receive_mode" - ) final VoiceReceiveMode voiceReceiveMode, + ) final TollFree.VoiceReceiveMode voiceReceiveMode, @JsonProperty("voice_application_sid") final String voiceApplicationSid, @JsonProperty( "voice_caller_id_lookup" @@ -185,11 +185,13 @@ private TollFree( @JsonProperty("voice_fallback_url") final URI voiceFallbackUrl, @JsonProperty("voice_method") final HttpMethod voiceMethod, @JsonProperty("voice_url") final URI voiceUrl, - @JsonProperty("emergency_status") final EmergencyStatus emergencyStatus, + @JsonProperty( + "emergency_status" + ) final TollFree.EmergencyStatus emergencyStatus, @JsonProperty("emergency_address_sid") final String emergencyAddressSid, @JsonProperty( "emergency_address_status" - ) final EmergencyAddressStatus emergencyAddressStatus, + ) final TollFree.EmergencyAddressStatus emergencyAddressStatus, @JsonProperty("bundle_sid") final String bundleSid, @JsonProperty("status") final String status ) { @@ -237,7 +239,7 @@ public final String getAddressSid() { return this.addressSid; } - public final AddressRequirement getAddressRequirements() { + public final TollFree.AddressRequirement getAddressRequirements() { return this.addressRequirements; } @@ -317,7 +319,7 @@ public final String getUri() { return this.uri; } - public final VoiceReceiveMode getVoiceReceiveMode() { + public final TollFree.VoiceReceiveMode getVoiceReceiveMode() { return this.voiceReceiveMode; } @@ -345,7 +347,7 @@ public final URI getVoiceUrl() { return this.voiceUrl; } - public final EmergencyStatus getEmergencyStatus() { + public final TollFree.EmergencyStatus getEmergencyStatus() { return this.emergencyStatus; } @@ -353,7 +355,7 @@ public final String getEmergencyAddressSid() { return this.emergencyAddressSid; } - public final EmergencyAddressStatus getEmergencyAddressStatus() { + public final TollFree.EmergencyAddressStatus getEmergencyAddressStatus() { return this.emergencyAddressStatus; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/message/Feedback.java b/src/main/java/com/twilio/rest/api/v2010/account/message/Feedback.java index 86601603c3..66db8761d3 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/message/Feedback.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/message/Feedback.java @@ -94,7 +94,7 @@ public static Feedback fromJson( private final String accountSid; private final String messageSid; - private final Outcome outcome; + private final Feedback.Outcome outcome; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String uri; @@ -103,7 +103,7 @@ public static Feedback fromJson( private Feedback( @JsonProperty("account_sid") final String accountSid, @JsonProperty("message_sid") final String messageSid, - @JsonProperty("outcome") final Outcome outcome, + @JsonProperty("outcome") final Feedback.Outcome outcome, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("uri") final String uri @@ -124,7 +124,7 @@ public final String getMessageSid() { return this.messageSid; } - public final Outcome getOutcome() { + public final Feedback.Outcome getOutcome() { return this.outcome; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/recording/AddOnResult.java b/src/main/java/com/twilio/rest/api/v2010/account/recording/AddOnResult.java index 42b02433c7..c20e30dcb0 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/recording/AddOnResult.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/recording/AddOnResult.java @@ -134,7 +134,7 @@ public static AddOnResult fromJson( private final String sid; private final String accountSid; - private final Status status; + private final AddOnResult.Status status; private final String addOnSid; private final String addOnConfigurationSid; private final ZonedDateTime dateCreated; @@ -147,7 +147,7 @@ public static AddOnResult fromJson( private AddOnResult( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final AddOnResult.Status status, @JsonProperty("add_on_sid") final String addOnSid, @JsonProperty( "add_on_configuration_sid" @@ -182,7 +182,7 @@ public final String getAccountSid() { return this.accountSid; } - public final Status getStatus() { + public final AddOnResult.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/recording/Transcription.java b/src/main/java/com/twilio/rest/api/v2010/account/recording/Transcription.java index ba9df4ae95..c265b98c28 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/recording/Transcription.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/recording/Transcription.java @@ -143,7 +143,7 @@ public static Transcription fromJson( private final Currency priceUnit; private final String recordingSid; private final String sid; - private final Status status; + private final Transcription.Status status; private final String transcriptionText; private final String type; private final String uri; @@ -157,11 +157,11 @@ private Transcription( @JsonProperty("duration") final String duration, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("recording_sid") final String recordingSid, @JsonProperty("sid") final String sid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Transcription.Status status, @JsonProperty("transcription_text") final String transcriptionText, @JsonProperty("type") final String type, @JsonProperty("uri") final String uri @@ -217,7 +217,7 @@ public final String getSid() { return this.sid; } - public final Status getStatus() { + public final Transcription.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/Record.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/Record.java index de6b0f6a44..5c05e36626 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/Record.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/Record.java @@ -98,7 +98,7 @@ public static Record fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Category category; + private final Record.Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private Record( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Category category, + @JsonProperty("category") final Record.Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Category getCategory() { + public final Record.Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/Trigger.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/Trigger.java index 287dcf8236..e18017d6e6 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/Trigger.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/Trigger.java @@ -43,7 +43,7 @@ public class Trigger extends Resource { public static TriggerCreator creator( final URI callbackUrl, final String triggerValue, - final UsageCategory usageCategory + final Trigger.UsageCategory usageCategory ) { return new TriggerCreator(callbackUrl, triggerValue, usageCategory); } @@ -52,7 +52,7 @@ public static TriggerCreator creator( final String pathAccountSid, final URI callbackUrl, final String triggerValue, - final UsageCategory usageCategory + final Trigger.UsageCategory usageCategory ) { return new TriggerCreator( pathAccountSid, @@ -155,12 +155,12 @@ public static Trigger fromJson( private final ZonedDateTime dateFired; private final ZonedDateTime dateUpdated; private final String friendlyName; - private final Recurring recurring; + private final Trigger.Recurring recurring; private final String sid; - private final TriggerField triggerBy; + private final Trigger.TriggerField triggerBy; private final String triggerValue; private final String uri; - private final UsageCategory usageCategory; + private final Trigger.UsageCategory usageCategory; private final String usageRecordUri; @JsonCreator @@ -174,12 +174,14 @@ private Trigger( @JsonProperty("date_fired") final String dateFired, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("recurring") final Recurring recurring, + @JsonProperty("recurring") final Trigger.Recurring recurring, @JsonProperty("sid") final String sid, - @JsonProperty("trigger_by") final TriggerField triggerBy, + @JsonProperty("trigger_by") final Trigger.TriggerField triggerBy, @JsonProperty("trigger_value") final String triggerValue, @JsonProperty("uri") final String uri, - @JsonProperty("usage_category") final UsageCategory usageCategory, + @JsonProperty( + "usage_category" + ) final Trigger.UsageCategory usageCategory, @JsonProperty("usage_record_uri") final String usageRecordUri ) { this.accountSid = accountSid; @@ -236,7 +238,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Recurring getRecurring() { + public final Trigger.Recurring getRecurring() { return this.recurring; } @@ -244,7 +246,7 @@ public final String getSid() { return this.sid; } - public final TriggerField getTriggerBy() { + public final Trigger.TriggerField getTriggerBy() { return this.triggerBy; } @@ -256,7 +258,7 @@ public final String getUri() { return this.uri; } - public final UsageCategory getUsageCategory() { + public final Trigger.UsageCategory getUsageCategory() { return this.usageCategory; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/AllTime.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/AllTime.java index 576f6ddd09..2e5e8e1938 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/AllTime.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/AllTime.java @@ -98,7 +98,7 @@ public static AllTime fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Category category; + private final AllTime.Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private AllTime( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Category category, + @JsonProperty("category") final AllTime.Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Category getCategory() { + public final AllTime.Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Daily.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Daily.java index 22c683d023..c562e8b219 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Daily.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Daily.java @@ -98,7 +98,7 @@ public static Daily fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Category category; + private final Daily.Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private Daily( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Category category, + @JsonProperty("category") final Daily.Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Category getCategory() { + public final Daily.Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/LastMonth.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/LastMonth.java index fcbf30024c..471a20a4d8 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/LastMonth.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/LastMonth.java @@ -98,7 +98,7 @@ public static LastMonth fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Category category; + private final LastMonth.Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private LastMonth( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Category category, + @JsonProperty("category") final LastMonth.Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Category getCategory() { + public final LastMonth.Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Monthly.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Monthly.java index 64b1070365..315837e39e 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Monthly.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Monthly.java @@ -98,7 +98,7 @@ public static Monthly fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Category category; + private final Monthly.Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private Monthly( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Category category, + @JsonProperty("category") final Monthly.Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Category getCategory() { + public final Monthly.Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/ThisMonth.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/ThisMonth.java index f545f03970..f0799a55f9 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/ThisMonth.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/ThisMonth.java @@ -98,7 +98,7 @@ public static ThisMonth fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Category category; + private final ThisMonth.Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private ThisMonth( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Category category, + @JsonProperty("category") final ThisMonth.Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Category getCategory() { + public final ThisMonth.Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Today.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Today.java index 09fced5595..38c0f84024 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Today.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Today.java @@ -98,7 +98,7 @@ public static Today fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Category category; + private final Today.Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private Today( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Category category, + @JsonProperty("category") final Today.Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Category getCategory() { + public final Today.Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yearly.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yearly.java index c55164426b..bc447957ac 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yearly.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yearly.java @@ -98,7 +98,7 @@ public static Yearly fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Category category; + private final Yearly.Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private Yearly( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Category category, + @JsonProperty("category") final Yearly.Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Category getCategory() { + public final Yearly.Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yesterday.java b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yesterday.java index d908600933..f271504c4b 100644 --- a/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yesterday.java +++ b/src/main/java/com/twilio/rest/api/v2010/account/usage/record/Yesterday.java @@ -98,7 +98,7 @@ public static Yesterday fromJson( private final String accountSid; private final String apiVersion; private final String asOf; - private final Category category; + private final Yesterday.Category category; private final String count; private final String countUnit; private final String description; @@ -116,14 +116,14 @@ private Yesterday( @JsonProperty("account_sid") final String accountSid, @JsonProperty("api_version") final String apiVersion, @JsonProperty("as_of") final String asOf, - @JsonProperty("category") final Category category, + @JsonProperty("category") final Yesterday.Category category, @JsonProperty("count") final String count, @JsonProperty("count_unit") final String countUnit, @JsonProperty("description") final String description, @JsonProperty("end_date") final String endDate, @JsonProperty("price") final BigDecimal price, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("start_date") final String startDate, @JsonProperty("subresource_uris") final Map< @@ -163,7 +163,7 @@ public final String getAsOf() { return this.asOf; } - public final Category getCategory() { + public final Yesterday.Category getCategory() { return this.category; } diff --git a/src/main/java/com/twilio/rest/assistants/v1/Assistant.java b/src/main/java/com/twilio/rest/assistants/v1/Assistant.java index ac3ca71dda..0c4ed48947 100644 --- a/src/main/java/com/twilio/rest/assistants/v1/Assistant.java +++ b/src/main/java/com/twilio/rest/assistants/v1/Assistant.java @@ -370,7 +370,7 @@ public static AssistantsV1ServiceTool fromJson( } public static AssistantCreator creator( - final AssistantsV1ServiceCreateAssistantRequest assistantsV1ServiceCreateAssistantRequest + final Assistant.AssistantsV1ServiceCreateAssistantRequest assistantsV1ServiceCreateAssistantRequest ) { return new AssistantCreator(assistantsV1ServiceCreateAssistantRequest); } diff --git a/src/main/java/com/twilio/rest/assistants/v1/Knowledge.java b/src/main/java/com/twilio/rest/assistants/v1/Knowledge.java index b412f115bb..a899609713 100644 --- a/src/main/java/com/twilio/rest/assistants/v1/Knowledge.java +++ b/src/main/java/com/twilio/rest/assistants/v1/Knowledge.java @@ -204,7 +204,7 @@ public static AssistantsV1ServiceUpdateKnowledgeRequest fromJson( } public static KnowledgeCreator creator( - final AssistantsV1ServiceCreateKnowledgeRequest assistantsV1ServiceCreateKnowledgeRequest + final Knowledge.AssistantsV1ServiceCreateKnowledgeRequest assistantsV1ServiceCreateKnowledgeRequest ) { return new KnowledgeCreator(assistantsV1ServiceCreateKnowledgeRequest); } diff --git a/src/main/java/com/twilio/rest/assistants/v1/Tool.java b/src/main/java/com/twilio/rest/assistants/v1/Tool.java index 2f9b5aacb0..48770ad6a1 100644 --- a/src/main/java/com/twilio/rest/assistants/v1/Tool.java +++ b/src/main/java/com/twilio/rest/assistants/v1/Tool.java @@ -289,7 +289,7 @@ public static AssistantsV1ServicePolicy fromJson( } public static ToolCreator creator( - final AssistantsV1ServiceCreateToolRequest assistantsV1ServiceCreateToolRequest + final Tool.AssistantsV1ServiceCreateToolRequest assistantsV1ServiceCreateToolRequest ) { return new ToolCreator(assistantsV1ServiceCreateToolRequest); } diff --git a/src/main/java/com/twilio/rest/assistants/v1/assistant/Feedback.java b/src/main/java/com/twilio/rest/assistants/v1/assistant/Feedback.java index 57cb442b4a..c607c9c472 100644 --- a/src/main/java/com/twilio/rest/assistants/v1/assistant/Feedback.java +++ b/src/main/java/com/twilio/rest/assistants/v1/assistant/Feedback.java @@ -87,7 +87,7 @@ public static AssistantsV1ServiceCreateFeedbackRequest fromJson( public static FeedbackCreator creator( final String pathId, - final AssistantsV1ServiceCreateFeedbackRequest assistantsV1ServiceCreateFeedbackRequest + final Feedback.AssistantsV1ServiceCreateFeedbackRequest assistantsV1ServiceCreateFeedbackRequest ) { return new FeedbackCreator( pathId, diff --git a/src/main/java/com/twilio/rest/assistants/v1/assistant/Message.java b/src/main/java/com/twilio/rest/assistants/v1/assistant/Message.java index b2922bd6e9..3891e48b3e 100644 --- a/src/main/java/com/twilio/rest/assistants/v1/assistant/Message.java +++ b/src/main/java/com/twilio/rest/assistants/v1/assistant/Message.java @@ -93,7 +93,7 @@ public static AssistantsV1ServiceAssistantSendMessageRequest fromJson( public static MessageCreator creator( final String pathId, - final AssistantsV1ServiceAssistantSendMessageRequest assistantsV1ServiceAssistantSendMessageRequest + final Message.AssistantsV1ServiceAssistantSendMessageRequest assistantsV1ServiceAssistantSendMessageRequest ) { return new MessageCreator( pathId, diff --git a/src/main/java/com/twilio/rest/chat/v1/Credential.java b/src/main/java/com/twilio/rest/chat/v1/Credential.java index 8b91dfa3ef..270e61e3fe 100644 --- a/src/main/java/com/twilio/rest/chat/v1/Credential.java +++ b/src/main/java/com/twilio/rest/chat/v1/Credential.java @@ -39,7 +39,7 @@ public class Credential extends Resource { private static final long serialVersionUID = 161183169234848L; - public static CredentialCreator creator(final PushService type) { + public static CredentialCreator creator(final Credential.PushService type) { return new CredentialCreator(type); } @@ -105,7 +105,7 @@ public static Credential fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final PushService type; + private final Credential.PushService type; private final String sandbox; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -116,7 +116,7 @@ private Credential( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final PushService type, + @JsonProperty("type") final Credential.PushService type, @JsonProperty("sandbox") final String sandbox, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final PushService getType() { + public final Credential.PushService getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/chat/v1/service/Channel.java b/src/main/java/com/twilio/rest/chat/v1/service/Channel.java index 0b026f0db2..d8f46724b0 100644 --- a/src/main/java/com/twilio/rest/chat/v1/service/Channel.java +++ b/src/main/java/com/twilio/rest/chat/v1/service/Channel.java @@ -119,7 +119,7 @@ public static Channel fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final ChannelType type; + private final Channel.ChannelType type; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; @@ -136,7 +136,7 @@ private Channel( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("type") final ChannelType type, + @JsonProperty("type") final Channel.ChannelType type, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("created_by") final String createdBy, @@ -185,7 +185,7 @@ public final String getAttributes() { return this.attributes; } - public final ChannelType getType() { + public final Channel.ChannelType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/chat/v1/service/Role.java b/src/main/java/com/twilio/rest/chat/v1/service/Role.java index d2a44ff7dc..eaf3e01555 100644 --- a/src/main/java/com/twilio/rest/chat/v1/service/Role.java +++ b/src/main/java/com/twilio/rest/chat/v1/service/Role.java @@ -43,7 +43,7 @@ public class Role extends Resource { public static RoleCreator creator( final String pathServiceSid, final String friendlyName, - final RoleType type, + final Role.RoleType type, final List permission ) { return new RoleCreator(pathServiceSid, friendlyName, type, permission); @@ -122,7 +122,7 @@ public static Role fromJson( private final String accountSid; private final String serviceSid; private final String friendlyName; - private final RoleType type; + private final Role.RoleType type; private final List permissions; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -134,7 +134,7 @@ private Role( @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final RoleType type, + @JsonProperty("type") final Role.RoleType type, @JsonProperty("permissions") final List permissions, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -167,7 +167,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final RoleType getType() { + public final Role.RoleType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/chat/v1/service/user/UserChannel.java b/src/main/java/com/twilio/rest/chat/v1/service/user/UserChannel.java index 667c61e4eb..245f4d1b5d 100644 --- a/src/main/java/com/twilio/rest/chat/v1/service/user/UserChannel.java +++ b/src/main/java/com/twilio/rest/chat/v1/service/user/UserChannel.java @@ -92,7 +92,7 @@ public static UserChannel fromJson( private final String serviceSid; private final String channelSid; private final String memberSid; - private final ChannelStatus status; + private final UserChannel.ChannelStatus status; private final Integer lastConsumedMessageIndex; private final Integer unreadMessagesCount; private final Map links; @@ -103,7 +103,7 @@ private UserChannel( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("channel_sid") final String channelSid, @JsonProperty("member_sid") final String memberSid, - @JsonProperty("status") final ChannelStatus status, + @JsonProperty("status") final UserChannel.ChannelStatus status, @JsonProperty( "last_consumed_message_index" ) final Integer lastConsumedMessageIndex, @@ -138,7 +138,7 @@ public final String getMemberSid() { return this.memberSid; } - public final ChannelStatus getStatus() { + public final UserChannel.ChannelStatus getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/chat/v2/Credential.java b/src/main/java/com/twilio/rest/chat/v2/Credential.java index 8be42a05aa..b02f30cb1e 100644 --- a/src/main/java/com/twilio/rest/chat/v2/Credential.java +++ b/src/main/java/com/twilio/rest/chat/v2/Credential.java @@ -39,7 +39,7 @@ public class Credential extends Resource { private static final long serialVersionUID = 161183169234848L; - public static CredentialCreator creator(final PushService type) { + public static CredentialCreator creator(final Credential.PushService type) { return new CredentialCreator(type); } @@ -105,7 +105,7 @@ public static Credential fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final PushService type; + private final Credential.PushService type; private final String sandbox; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -116,7 +116,7 @@ private Credential( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final PushService type, + @JsonProperty("type") final Credential.PushService type, @JsonProperty("sandbox") final String sandbox, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final PushService getType() { + public final Credential.PushService getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/chat/v2/service/Binding.java b/src/main/java/com/twilio/rest/chat/v2/service/Binding.java index 87b187143a..3ace8bfd8d 100644 --- a/src/main/java/com/twilio/rest/chat/v2/service/Binding.java +++ b/src/main/java/com/twilio/rest/chat/v2/service/Binding.java @@ -111,7 +111,7 @@ public static Binding fromJson( private final String endpoint; private final String identity; private final String credentialSid; - private final BindingType bindingType; + private final Binding.BindingType bindingType; private final List messageTypes; private final URI url; private final Map links; @@ -126,7 +126,7 @@ private Binding( @JsonProperty("endpoint") final String endpoint, @JsonProperty("identity") final String identity, @JsonProperty("credential_sid") final String credentialSid, - @JsonProperty("binding_type") final BindingType bindingType, + @JsonProperty("binding_type") final Binding.BindingType bindingType, @JsonProperty("message_types") final List messageTypes, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links @@ -177,7 +177,7 @@ public final String getCredentialSid() { return this.credentialSid; } - public final BindingType getBindingType() { + public final Binding.BindingType getBindingType() { return this.bindingType; } diff --git a/src/main/java/com/twilio/rest/chat/v2/service/Channel.java b/src/main/java/com/twilio/rest/chat/v2/service/Channel.java index b4a9182d10..d950169893 100644 --- a/src/main/java/com/twilio/rest/chat/v2/service/Channel.java +++ b/src/main/java/com/twilio/rest/chat/v2/service/Channel.java @@ -119,7 +119,7 @@ public static Channel fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final ChannelType type; + private final Channel.ChannelType type; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; @@ -136,7 +136,7 @@ private Channel( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("type") final ChannelType type, + @JsonProperty("type") final Channel.ChannelType type, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("created_by") final String createdBy, @@ -185,7 +185,7 @@ public final String getAttributes() { return this.attributes; } - public final ChannelType getType() { + public final Channel.ChannelType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/chat/v2/service/Role.java b/src/main/java/com/twilio/rest/chat/v2/service/Role.java index b6dd5785ac..83550db69d 100644 --- a/src/main/java/com/twilio/rest/chat/v2/service/Role.java +++ b/src/main/java/com/twilio/rest/chat/v2/service/Role.java @@ -43,7 +43,7 @@ public class Role extends Resource { public static RoleCreator creator( final String pathServiceSid, final String friendlyName, - final RoleType type, + final Role.RoleType type, final List permission ) { return new RoleCreator(pathServiceSid, friendlyName, type, permission); @@ -122,7 +122,7 @@ public static Role fromJson( private final String accountSid; private final String serviceSid; private final String friendlyName; - private final RoleType type; + private final Role.RoleType type; private final List permissions; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -134,7 +134,7 @@ private Role( @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final RoleType type, + @JsonProperty("type") final Role.RoleType type, @JsonProperty("permissions") final List permissions, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -167,7 +167,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final RoleType getType() { + public final Role.RoleType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/chat/v2/service/channel/Webhook.java b/src/main/java/com/twilio/rest/chat/v2/service/channel/Webhook.java index b75b26253e..969a28cc11 100644 --- a/src/main/java/com/twilio/rest/chat/v2/service/channel/Webhook.java +++ b/src/main/java/com/twilio/rest/chat/v2/service/channel/Webhook.java @@ -44,7 +44,7 @@ public class Webhook extends Resource { public static WebhookCreator creator( final String pathServiceSid, final String pathChannelSid, - final Type type + final Webhook.Type type ) { return new WebhookCreator(pathServiceSid, pathChannelSid, type); } diff --git a/src/main/java/com/twilio/rest/chat/v2/service/user/UserBinding.java b/src/main/java/com/twilio/rest/chat/v2/service/user/UserBinding.java index 183db9c103..f95fefa538 100644 --- a/src/main/java/com/twilio/rest/chat/v2/service/user/UserBinding.java +++ b/src/main/java/com/twilio/rest/chat/v2/service/user/UserBinding.java @@ -115,7 +115,7 @@ public static UserBinding fromJson( private final String identity; private final String userSid; private final String credentialSid; - private final BindingType bindingType; + private final UserBinding.BindingType bindingType; private final List messageTypes; private final URI url; @@ -130,7 +130,7 @@ private UserBinding( @JsonProperty("identity") final String identity, @JsonProperty("user_sid") final String userSid, @JsonProperty("credential_sid") final String credentialSid, - @JsonProperty("binding_type") final BindingType bindingType, + @JsonProperty("binding_type") final UserBinding.BindingType bindingType, @JsonProperty("message_types") final List messageTypes, @JsonProperty("url") final URI url ) { @@ -184,7 +184,7 @@ public final String getCredentialSid() { return this.credentialSid; } - public final BindingType getBindingType() { + public final UserBinding.BindingType getBindingType() { return this.bindingType; } diff --git a/src/main/java/com/twilio/rest/chat/v2/service/user/UserChannel.java b/src/main/java/com/twilio/rest/chat/v2/service/user/UserChannel.java index 3dc09e5aa2..ebe37d60ac 100644 --- a/src/main/java/com/twilio/rest/chat/v2/service/user/UserChannel.java +++ b/src/main/java/com/twilio/rest/chat/v2/service/user/UserChannel.java @@ -130,12 +130,12 @@ public static UserChannel fromJson( private final String channelSid; private final String userSid; private final String memberSid; - private final ChannelStatus status; + private final UserChannel.ChannelStatus status; private final Integer lastConsumedMessageIndex; private final Integer unreadMessagesCount; private final Map links; private final URI url; - private final NotificationLevel notificationLevel; + private final UserChannel.NotificationLevel notificationLevel; @JsonCreator private UserChannel( @@ -144,7 +144,7 @@ private UserChannel( @JsonProperty("channel_sid") final String channelSid, @JsonProperty("user_sid") final String userSid, @JsonProperty("member_sid") final String memberSid, - @JsonProperty("status") final ChannelStatus status, + @JsonProperty("status") final UserChannel.ChannelStatus status, @JsonProperty( "last_consumed_message_index" ) final Integer lastConsumedMessageIndex, @@ -155,7 +155,7 @@ private UserChannel( @JsonProperty("url") final URI url, @JsonProperty( "notification_level" - ) final NotificationLevel notificationLevel + ) final UserChannel.NotificationLevel notificationLevel ) { this.accountSid = accountSid; this.serviceSid = serviceSid; @@ -190,7 +190,7 @@ public final String getMemberSid() { return this.memberSid; } - public final ChannelStatus getStatus() { + public final UserChannel.ChannelStatus getStatus() { return this.status; } @@ -210,7 +210,7 @@ public final URI getUrl() { return this.url; } - public final NotificationLevel getNotificationLevel() { + public final UserChannel.NotificationLevel getNotificationLevel() { return this.notificationLevel; } diff --git a/src/main/java/com/twilio/rest/chat/v3/Channel.java b/src/main/java/com/twilio/rest/chat/v3/Channel.java index b606cf5123..a46f618735 100644 --- a/src/main/java/com/twilio/rest/chat/v3/Channel.java +++ b/src/main/java/com/twilio/rest/chat/v3/Channel.java @@ -95,7 +95,7 @@ public static Channel fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final ChannelType type; + private final Channel.ChannelType type; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; @@ -112,7 +112,7 @@ private Channel( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("type") final ChannelType type, + @JsonProperty("type") final Channel.ChannelType type, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("created_by") final String createdBy, @@ -161,7 +161,7 @@ public final String getAttributes() { return this.attributes; } - public final ChannelType getType() { + public final Channel.ChannelType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/content/v1/Content.java b/src/main/java/com/twilio/rest/content/v1/Content.java index 15b9fb92e2..addc44ae73 100644 --- a/src/main/java/com/twilio/rest/content/v1/Content.java +++ b/src/main/java/com/twilio/rest/content/v1/Content.java @@ -942,7 +942,7 @@ public static ContentCreateRequest fromJson( } public static ContentCreator creator( - final ContentCreateRequest contentCreateRequest + final Content.ContentCreateRequest contentCreateRequest ) { return new ContentCreator(contentCreateRequest); } diff --git a/src/main/java/com/twilio/rest/content/v1/content/ApprovalCreate.java b/src/main/java/com/twilio/rest/content/v1/content/ApprovalCreate.java index f8856de11a..aff2efdaf5 100644 --- a/src/main/java/com/twilio/rest/content/v1/content/ApprovalCreate.java +++ b/src/main/java/com/twilio/rest/content/v1/content/ApprovalCreate.java @@ -72,7 +72,7 @@ public static ContentApprovalRequest fromJson( public static ApprovalCreateCreator creator( final String pathContentSid, - final ContentApprovalRequest contentApprovalRequest + final ApprovalCreate.ContentApprovalRequest contentApprovalRequest ) { return new ApprovalCreateCreator( pathContentSid, diff --git a/src/main/java/com/twilio/rest/conversations/v1/AddressConfiguration.java b/src/main/java/com/twilio/rest/conversations/v1/AddressConfiguration.java index 2aac078a95..b0b200cf5f 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/AddressConfiguration.java +++ b/src/main/java/com/twilio/rest/conversations/v1/AddressConfiguration.java @@ -42,7 +42,7 @@ public class AddressConfiguration extends Resource { private static final long serialVersionUID = 162346024858734L; public static AddressConfigurationCreator creator( - final Type type, + final AddressConfiguration.Type type, final String address ) { return new AddressConfigurationCreator(type, address); diff --git a/src/main/java/com/twilio/rest/conversations/v1/Conversation.java b/src/main/java/com/twilio/rest/conversations/v1/Conversation.java index 652dbc936b..dc54e2affc 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/Conversation.java +++ b/src/main/java/com/twilio/rest/conversations/v1/Conversation.java @@ -111,7 +111,7 @@ public static Conversation fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final State state; + private final Conversation.State state; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Map timers; @@ -128,7 +128,7 @@ private Conversation( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("state") final State state, + @JsonProperty("state") final Conversation.State state, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("timers") final Map timers, @@ -180,7 +180,7 @@ public final String getAttributes() { return this.attributes; } - public final State getState() { + public final Conversation.State getState() { return this.state; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/ConversationWithParticipants.java b/src/main/java/com/twilio/rest/conversations/v1/ConversationWithParticipants.java index 26439f0d4f..ac73b9afa2 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/ConversationWithParticipants.java +++ b/src/main/java/com/twilio/rest/conversations/v1/ConversationWithParticipants.java @@ -101,7 +101,7 @@ public static ConversationWithParticipants fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final State state; + private final ConversationWithParticipants.State state; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Map timers; @@ -118,7 +118,7 @@ private ConversationWithParticipants( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("state") final State state, + @JsonProperty("state") final ConversationWithParticipants.State state, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("timers") final Map timers, @@ -170,7 +170,7 @@ public final String getAttributes() { return this.attributes; } - public final State getState() { + public final ConversationWithParticipants.State getState() { return this.state; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/Credential.java b/src/main/java/com/twilio/rest/conversations/v1/Credential.java index 5d22d8174e..9b3cc9b62d 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/Credential.java +++ b/src/main/java/com/twilio/rest/conversations/v1/Credential.java @@ -39,7 +39,7 @@ public class Credential extends Resource { private static final long serialVersionUID = 265726674321801L; - public static CredentialCreator creator(final PushType type) { + public static CredentialCreator creator(final Credential.PushType type) { return new CredentialCreator(type); } @@ -105,7 +105,7 @@ public static Credential fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final PushType type; + private final Credential.PushType type; private final String sandbox; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -116,7 +116,7 @@ private Credential( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final PushType type, + @JsonProperty("type") final Credential.PushType type, @JsonProperty("sandbox") final String sandbox, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final PushType getType() { + public final Credential.PushType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/ParticipantConversation.java b/src/main/java/com/twilio/rest/conversations/v1/ParticipantConversation.java index e6dd3cfc82..49b97fb0c4 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/ParticipantConversation.java +++ b/src/main/java/com/twilio/rest/conversations/v1/ParticipantConversation.java @@ -100,7 +100,7 @@ public static ParticipantConversation fromJson( private final ZonedDateTime conversationDateCreated; private final ZonedDateTime conversationDateUpdated; private final String conversationCreatedBy; - private final State conversationState; + private final ParticipantConversation.State conversationState; private final Map conversationTimers; private final Map links; @@ -134,7 +134,9 @@ private ParticipantConversation( @JsonProperty( "conversation_created_by" ) final String conversationCreatedBy, - @JsonProperty("conversation_state") final State conversationState, + @JsonProperty( + "conversation_state" + ) final ParticipantConversation.State conversationState, @JsonProperty("conversation_timers") final Map< String, Object @@ -213,7 +215,7 @@ public final String getConversationCreatedBy() { return this.conversationCreatedBy; } - public final State getConversationState() { + public final ParticipantConversation.State getConversationState() { return this.conversationState; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/Role.java b/src/main/java/com/twilio/rest/conversations/v1/Role.java index c20cf35b53..96ca04b94e 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/Role.java +++ b/src/main/java/com/twilio/rest/conversations/v1/Role.java @@ -42,7 +42,7 @@ public class Role extends Resource { public static RoleCreator creator( final String friendlyName, - final RoleType type, + final Role.RoleType type, final List permission ) { return new RoleCreator(friendlyName, type, permission); @@ -114,7 +114,7 @@ public static Role fromJson( private final String accountSid; private final String chatServiceSid; private final String friendlyName; - private final RoleType type; + private final Role.RoleType type; private final List permissions; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -126,7 +126,7 @@ private Role( @JsonProperty("account_sid") final String accountSid, @JsonProperty("chat_service_sid") final String chatServiceSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final RoleType type, + @JsonProperty("type") final Role.RoleType type, @JsonProperty("permissions") final List permissions, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -159,7 +159,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final RoleType getType() { + public final Role.RoleType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/configuration/Webhook.java b/src/main/java/com/twilio/rest/conversations/v1/configuration/Webhook.java index 7633382178..485c684771 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/configuration/Webhook.java +++ b/src/main/java/com/twilio/rest/conversations/v1/configuration/Webhook.java @@ -90,21 +90,21 @@ public static Webhook fromJson( } private final String accountSid; - private final Method method; + private final Webhook.Method method; private final List filters; private final String preWebhookUrl; private final String postWebhookUrl; - private final Target target; + private final Webhook.Target target; private final URI url; @JsonCreator private Webhook( @JsonProperty("account_sid") final String accountSid, - @JsonProperty("method") final Method method, + @JsonProperty("method") final Webhook.Method method, @JsonProperty("filters") final List filters, @JsonProperty("pre_webhook_url") final String preWebhookUrl, @JsonProperty("post_webhook_url") final String postWebhookUrl, - @JsonProperty("target") final Target target, + @JsonProperty("target") final Webhook.Target target, @JsonProperty("url") final URI url ) { this.accountSid = accountSid; @@ -120,7 +120,7 @@ public final String getAccountSid() { return this.accountSid; } - public final Method getMethod() { + public final Webhook.Method getMethod() { return this.method; } @@ -136,7 +136,7 @@ public final String getPostWebhookUrl() { return this.postWebhookUrl; } - public final Target getTarget() { + public final Webhook.Target getTarget() { return this.target; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/conversation/Webhook.java b/src/main/java/com/twilio/rest/conversations/v1/conversation/Webhook.java index 25b7ac3b9a..8bfea294d0 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/conversation/Webhook.java +++ b/src/main/java/com/twilio/rest/conversations/v1/conversation/Webhook.java @@ -43,7 +43,7 @@ public class Webhook extends Resource { public static WebhookCreator creator( final String pathConversationSid, - final Target target + final Webhook.Target target ) { return new WebhookCreator(pathConversationSid, target); } diff --git a/src/main/java/com/twilio/rest/conversations/v1/conversation/message/DeliveryReceipt.java b/src/main/java/com/twilio/rest/conversations/v1/conversation/message/DeliveryReceipt.java index b65ea7716d..5e5098d0a9 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/conversation/message/DeliveryReceipt.java +++ b/src/main/java/com/twilio/rest/conversations/v1/conversation/message/DeliveryReceipt.java @@ -107,7 +107,7 @@ public static DeliveryReceipt fromJson( private final String messageSid; private final String channelMessageSid; private final String participantSid; - private final DeliveryStatus status; + private final DeliveryReceipt.DeliveryStatus status; private final Integer errorCode; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -121,7 +121,7 @@ private DeliveryReceipt( @JsonProperty("message_sid") final String messageSid, @JsonProperty("channel_message_sid") final String channelMessageSid, @JsonProperty("participant_sid") final String participantSid, - @JsonProperty("status") final DeliveryStatus status, + @JsonProperty("status") final DeliveryReceipt.DeliveryStatus status, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -164,7 +164,7 @@ public final String getParticipantSid() { return this.participantSid; } - public final DeliveryStatus getStatus() { + public final DeliveryReceipt.DeliveryStatus getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/Binding.java b/src/main/java/com/twilio/rest/conversations/v1/service/Binding.java index dd66e34198..0c10c7165f 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/Binding.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/Binding.java @@ -109,7 +109,7 @@ public static Binding fromJson( private final ZonedDateTime dateUpdated; private final String endpoint; private final String identity; - private final BindingType bindingType; + private final Binding.BindingType bindingType; private final List messageTypes; private final URI url; @@ -123,7 +123,7 @@ private Binding( @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("endpoint") final String endpoint, @JsonProperty("identity") final String identity, - @JsonProperty("binding_type") final BindingType bindingType, + @JsonProperty("binding_type") final Binding.BindingType bindingType, @JsonProperty("message_types") final List messageTypes, @JsonProperty("url") final URI url ) { @@ -172,7 +172,7 @@ public final String getIdentity() { return this.identity; } - public final BindingType getBindingType() { + public final Binding.BindingType getBindingType() { return this.bindingType; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/Conversation.java b/src/main/java/com/twilio/rest/conversations/v1/service/Conversation.java index f4aed3b123..181767e7e6 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/Conversation.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/Conversation.java @@ -120,7 +120,7 @@ public static Conversation fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final State state; + private final Conversation.State state; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Map timers; @@ -137,7 +137,7 @@ private Conversation( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("state") final State state, + @JsonProperty("state") final Conversation.State state, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("timers") final Map timers, @@ -189,7 +189,7 @@ public final String getAttributes() { return this.attributes; } - public final State getState() { + public final Conversation.State getState() { return this.state; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/ConversationWithParticipants.java b/src/main/java/com/twilio/rest/conversations/v1/service/ConversationWithParticipants.java index 50554a0254..939f0389d7 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/ConversationWithParticipants.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/ConversationWithParticipants.java @@ -103,7 +103,7 @@ public static ConversationWithParticipants fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final State state; + private final ConversationWithParticipants.State state; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Map timers; @@ -120,7 +120,7 @@ private ConversationWithParticipants( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("state") final State state, + @JsonProperty("state") final ConversationWithParticipants.State state, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("timers") final Map timers, @@ -172,7 +172,7 @@ public final String getAttributes() { return this.attributes; } - public final State getState() { + public final ConversationWithParticipants.State getState() { return this.state; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/ParticipantConversation.java b/src/main/java/com/twilio/rest/conversations/v1/service/ParticipantConversation.java index 8949265dc2..7ee5b2860d 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/ParticipantConversation.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/ParticipantConversation.java @@ -102,7 +102,7 @@ public static ParticipantConversation fromJson( private final ZonedDateTime conversationDateCreated; private final ZonedDateTime conversationDateUpdated; private final String conversationCreatedBy; - private final State conversationState; + private final ParticipantConversation.State conversationState; private final Map conversationTimers; private final Map links; @@ -136,7 +136,9 @@ private ParticipantConversation( @JsonProperty( "conversation_created_by" ) final String conversationCreatedBy, - @JsonProperty("conversation_state") final State conversationState, + @JsonProperty( + "conversation_state" + ) final ParticipantConversation.State conversationState, @JsonProperty("conversation_timers") final Map< String, Object @@ -215,7 +217,7 @@ public final String getConversationCreatedBy() { return this.conversationCreatedBy; } - public final State getConversationState() { + public final ParticipantConversation.State getConversationState() { return this.conversationState; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/Role.java b/src/main/java/com/twilio/rest/conversations/v1/service/Role.java index 31e0a6501c..43c80476c7 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/Role.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/Role.java @@ -43,7 +43,7 @@ public class Role extends Resource { public static RoleCreator creator( final String pathChatServiceSid, final String friendlyName, - final RoleType type, + final Role.RoleType type, final List permission ) { return new RoleCreator( @@ -127,7 +127,7 @@ public static Role fromJson( private final String accountSid; private final String chatServiceSid; private final String friendlyName; - private final RoleType type; + private final Role.RoleType type; private final List permissions; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -139,7 +139,7 @@ private Role( @JsonProperty("account_sid") final String accountSid, @JsonProperty("chat_service_sid") final String chatServiceSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final RoleType type, + @JsonProperty("type") final Role.RoleType type, @JsonProperty("permissions") final List permissions, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -172,7 +172,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final RoleType getType() { + public final Role.RoleType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/configuration/Webhook.java b/src/main/java/com/twilio/rest/conversations/v1/service/configuration/Webhook.java index a9965ee61f..9947722db0 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/configuration/Webhook.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/configuration/Webhook.java @@ -94,7 +94,7 @@ public static Webhook fromJson( private final URI preWebhookUrl; private final URI postWebhookUrl; private final List filters; - private final Method method; + private final Webhook.Method method; private final URI url; @JsonCreator @@ -104,7 +104,7 @@ private Webhook( @JsonProperty("pre_webhook_url") final URI preWebhookUrl, @JsonProperty("post_webhook_url") final URI postWebhookUrl, @JsonProperty("filters") final List filters, - @JsonProperty("method") final Method method, + @JsonProperty("method") final Webhook.Method method, @JsonProperty("url") final URI url ) { this.accountSid = accountSid; @@ -136,7 +136,7 @@ public final List getFilters() { return this.filters; } - public final Method getMethod() { + public final Webhook.Method getMethod() { return this.method; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/conversation/Webhook.java b/src/main/java/com/twilio/rest/conversations/v1/service/conversation/Webhook.java index f60058cb16..3df7568adc 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/conversation/Webhook.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/conversation/Webhook.java @@ -44,7 +44,7 @@ public class Webhook extends Resource { public static WebhookCreator creator( final String pathChatServiceSid, final String pathConversationSid, - final Target target + final Webhook.Target target ) { return new WebhookCreator( pathChatServiceSid, diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/conversation/message/DeliveryReceipt.java b/src/main/java/com/twilio/rest/conversations/v1/service/conversation/message/DeliveryReceipt.java index da0e2d35ee..f3a9dd829d 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/conversation/message/DeliveryReceipt.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/conversation/message/DeliveryReceipt.java @@ -115,7 +115,7 @@ public static DeliveryReceipt fromJson( private final String sid; private final String channelMessageSid; private final String participantSid; - private final DeliveryStatus status; + private final DeliveryReceipt.DeliveryStatus status; private final Integer errorCode; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -130,7 +130,7 @@ private DeliveryReceipt( @JsonProperty("sid") final String sid, @JsonProperty("channel_message_sid") final String channelMessageSid, @JsonProperty("participant_sid") final String participantSid, - @JsonProperty("status") final DeliveryStatus status, + @JsonProperty("status") final DeliveryReceipt.DeliveryStatus status, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -178,7 +178,7 @@ public final String getParticipantSid() { return this.participantSid; } - public final DeliveryStatus getStatus() { + public final DeliveryReceipt.DeliveryStatus getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/service/user/UserConversation.java b/src/main/java/com/twilio/rest/conversations/v1/service/user/UserConversation.java index 42aecbd226..555ae5a2c6 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/service/user/UserConversation.java +++ b/src/main/java/com/twilio/rest/conversations/v1/service/user/UserConversation.java @@ -135,13 +135,13 @@ public static UserConversation fromJson( private final String participantSid; private final String userSid; private final String friendlyName; - private final State conversationState; + private final UserConversation.State conversationState; private final Map timers; private final String attributes; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; - private final NotificationLevel notificationLevel; + private final UserConversation.NotificationLevel notificationLevel; private final String uniqueName; private final URI url; private final Map links; @@ -160,7 +160,9 @@ private UserConversation( @JsonProperty("participant_sid") final String participantSid, @JsonProperty("user_sid") final String userSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("conversation_state") final State conversationState, + @JsonProperty( + "conversation_state" + ) final UserConversation.State conversationState, @JsonProperty("timers") final Map timers, @JsonProperty("attributes") final String attributes, @JsonProperty("date_created") final String dateCreated, @@ -168,7 +170,7 @@ private UserConversation( @JsonProperty("created_by") final String createdBy, @JsonProperty( "notification_level" - ) final NotificationLevel notificationLevel, + ) final UserConversation.NotificationLevel notificationLevel, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links @@ -225,7 +227,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final State getConversationState() { + public final UserConversation.State getConversationState() { return this.conversationState; } @@ -249,7 +251,7 @@ public final String getCreatedBy() { return this.createdBy; } - public final NotificationLevel getNotificationLevel() { + public final UserConversation.NotificationLevel getNotificationLevel() { return this.notificationLevel; } diff --git a/src/main/java/com/twilio/rest/conversations/v1/user/UserConversation.java b/src/main/java/com/twilio/rest/conversations/v1/user/UserConversation.java index 58fc49a1d0..2b21907430 100644 --- a/src/main/java/com/twilio/rest/conversations/v1/user/UserConversation.java +++ b/src/main/java/com/twilio/rest/conversations/v1/user/UserConversation.java @@ -117,13 +117,13 @@ public static UserConversation fromJson( private final String participantSid; private final String userSid; private final String friendlyName; - private final State conversationState; + private final UserConversation.State conversationState; private final Map timers; private final String attributes; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; - private final NotificationLevel notificationLevel; + private final UserConversation.NotificationLevel notificationLevel; private final String uniqueName; private final URI url; private final Map links; @@ -142,7 +142,9 @@ private UserConversation( @JsonProperty("participant_sid") final String participantSid, @JsonProperty("user_sid") final String userSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("conversation_state") final State conversationState, + @JsonProperty( + "conversation_state" + ) final UserConversation.State conversationState, @JsonProperty("timers") final Map timers, @JsonProperty("attributes") final String attributes, @JsonProperty("date_created") final String dateCreated, @@ -150,7 +152,7 @@ private UserConversation( @JsonProperty("created_by") final String createdBy, @JsonProperty( "notification_level" - ) final NotificationLevel notificationLevel, + ) final UserConversation.NotificationLevel notificationLevel, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links @@ -207,7 +209,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final State getConversationState() { + public final UserConversation.State getConversationState() { return this.conversationState; } @@ -231,7 +233,7 @@ public final String getCreatedBy() { return this.createdBy; } - public final NotificationLevel getNotificationLevel() { + public final UserConversation.NotificationLevel getNotificationLevel() { return this.notificationLevel; } diff --git a/src/main/java/com/twilio/rest/events/v1/Sink.java b/src/main/java/com/twilio/rest/events/v1/Sink.java index 1d8a20eb62..8a5ea31e9c 100644 --- a/src/main/java/com/twilio/rest/events/v1/Sink.java +++ b/src/main/java/com/twilio/rest/events/v1/Sink.java @@ -44,7 +44,7 @@ public class Sink extends Resource { public static SinkCreator creator( final String description, final Object sinkConfiguration, - final SinkType sinkType + final Sink.SinkType sinkType ) { return new SinkCreator(description, sinkConfiguration, sinkType); } @@ -116,8 +116,8 @@ public static Sink fromJson( private final String description; private final String sid; private final Map sinkConfiguration; - private final SinkType sinkType; - private final Status status; + private final Sink.SinkType sinkType; + private final Sink.Status status; private final URI url; private final Map links; @@ -131,8 +131,8 @@ private Sink( String, Object > sinkConfiguration, - @JsonProperty("sink_type") final SinkType sinkType, - @JsonProperty("status") final Status status, + @JsonProperty("sink_type") final Sink.SinkType sinkType, + @JsonProperty("status") final Sink.Status status, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links ) { @@ -167,11 +167,11 @@ public final Map getSinkConfiguration() { return this.sinkConfiguration; } - public final SinkType getSinkType() { + public final Sink.SinkType getSinkType() { return this.sinkType; } - public final Status getStatus() { + public final Sink.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/events/v1/SubscriptionCreator.java b/src/main/java/com/twilio/rest/events/v1/SubscriptionCreator.java index fd9b3c97e5..32e9a37342 100644 --- a/src/main/java/com/twilio/rest/events/v1/SubscriptionCreator.java +++ b/src/main/java/com/twilio/rest/events/v1/SubscriptionCreator.java @@ -15,8 +15,9 @@ package com.twilio.rest.events.v1; import com.twilio.base.Creator; -import com.twilio.converter.Converter; import com.twilio.constant.EnumConstants; +import com.twilio.converter.Converter; +import com.twilio.converter.Converter; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; diff --git a/src/main/java/com/twilio/rest/flexapi/v1/Configuration.java b/src/main/java/com/twilio/rest/flexapi/v1/Configuration.java index 42346f69ce..79e780fa58 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/Configuration.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/Configuration.java @@ -110,7 +110,7 @@ public static String toJson(Object object, ObjectMapper mapper) { private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Map attributes; - private final Status status; + private final Configuration.Status status; private final String taskrouterWorkspaceSid; private final String taskrouterTargetWorkflowSid; private final String taskrouterTargetTaskqueueSid; @@ -162,7 +162,7 @@ private Configuration( @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("attributes") final Map attributes, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Configuration.Status status, @JsonProperty( "taskrouter_workspace_sid" ) final String taskrouterWorkspaceSid, @@ -343,7 +343,7 @@ public final Map getAttributes() { return this.attributes; } - public final Status getStatus() { + public final Configuration.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/FlexFlow.java b/src/main/java/com/twilio/rest/flexapi/v1/FlexFlow.java index ef505f09b5..ecfe3be905 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/FlexFlow.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/FlexFlow.java @@ -44,7 +44,7 @@ public class FlexFlow extends Resource { public static FlexFlowCreator creator( final String friendlyName, final String chatServiceSid, - final ChannelType channelType + final FlexFlow.ChannelType channelType ) { return new FlexFlowCreator(friendlyName, chatServiceSid, channelType); } @@ -114,10 +114,10 @@ public static FlexFlow fromJson( private final String sid; private final String friendlyName; private final String chatServiceSid; - private final ChannelType channelType; + private final FlexFlow.ChannelType channelType; private final String contactIdentity; private final Boolean enabled; - private final IntegrationType integrationType; + private final FlexFlow.IntegrationType integrationType; private final Map integration; private final Boolean longLived; private final Boolean janitorEnabled; @@ -131,10 +131,12 @@ private FlexFlow( @JsonProperty("sid") final String sid, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("chat_service_sid") final String chatServiceSid, - @JsonProperty("channel_type") final ChannelType channelType, + @JsonProperty("channel_type") final FlexFlow.ChannelType channelType, @JsonProperty("contact_identity") final String contactIdentity, @JsonProperty("enabled") final Boolean enabled, - @JsonProperty("integration_type") final IntegrationType integrationType, + @JsonProperty( + "integration_type" + ) final FlexFlow.IntegrationType integrationType, @JsonProperty("integration") final Map integration, @JsonProperty("long_lived") final Boolean longLived, @JsonProperty("janitor_enabled") final Boolean janitorEnabled, @@ -180,7 +182,7 @@ public final String getChatServiceSid() { return this.chatServiceSid; } - public final ChannelType getChannelType() { + public final FlexFlow.ChannelType getChannelType() { return this.channelType; } @@ -192,7 +194,7 @@ public final Boolean getEnabled() { return this.enabled; } - public final IntegrationType getIntegrationType() { + public final FlexFlow.IntegrationType getIntegrationType() { return this.integrationType; } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/PluginConfigurationCreator.java b/src/main/java/com/twilio/rest/flexapi/v1/PluginConfigurationCreator.java index 19dbfd4fee..3fc0e2b9d8 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/PluginConfigurationCreator.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/PluginConfigurationCreator.java @@ -17,6 +17,7 @@ import com.twilio.base.Creator; import com.twilio.constant.EnumConstants; import com.twilio.converter.Converter; +import com.twilio.converter.Converter; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; diff --git a/src/main/java/com/twilio/rest/flexapi/v1/ProvisioningStatus.java b/src/main/java/com/twilio/rest/flexapi/v1/ProvisioningStatus.java index 4d04e64e6a..48fd242415 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/ProvisioningStatus.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/ProvisioningStatus.java @@ -84,19 +84,19 @@ public static ProvisioningStatus fromJson( } } - private final Status status; + private final ProvisioningStatus.Status status; private final URI url; @JsonCreator private ProvisioningStatus( - @JsonProperty("status") final Status status, + @JsonProperty("status") final ProvisioningStatus.Status status, @JsonProperty("url") final URI url ) { this.status = status; this.url = url; } - public final Status getStatus() { + public final ProvisioningStatus.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/interaction/InteractionChannel.java b/src/main/java/com/twilio/rest/flexapi/v1/interaction/InteractionChannel.java index 628600a80e..9c1d778e34 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/interaction/InteractionChannel.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/interaction/InteractionChannel.java @@ -55,7 +55,7 @@ public static InteractionChannelReader reader( public static InteractionChannelUpdater updater( final String pathInteractionSid, final String pathSid, - final UpdateChannelStatus status + final InteractionChannel.UpdateChannelStatus status ) { return new InteractionChannelUpdater( pathInteractionSid, @@ -109,8 +109,8 @@ public static InteractionChannel fromJson( private final String sid; private final String interactionSid; - private final Type type; - private final ChannelStatus status; + private final InteractionChannel.Type type; + private final InteractionChannel.ChannelStatus status; private final Integer errorCode; private final String errorMessage; private final URI url; @@ -120,8 +120,8 @@ public static InteractionChannel fromJson( private InteractionChannel( @JsonProperty("sid") final String sid, @JsonProperty("interaction_sid") final String interactionSid, - @JsonProperty("type") final Type type, - @JsonProperty("status") final ChannelStatus status, + @JsonProperty("type") final InteractionChannel.Type type, + @JsonProperty("status") final InteractionChannel.ChannelStatus status, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("error_message") final String errorMessage, @JsonProperty("url") final URI url, @@ -145,11 +145,11 @@ public final String getInteractionSid() { return this.interactionSid; } - public final Type getType() { + public final InteractionChannel.Type getType() { return this.type; } - public final ChannelStatus getStatus() { + public final InteractionChannel.ChannelStatus getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelParticipant.java b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelParticipant.java index d23c9ae21d..16c65ee470 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelParticipant.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionChannelParticipant.java @@ -42,7 +42,7 @@ public class InteractionChannelParticipant extends Resource { public static InteractionChannelParticipantCreator creator( final String pathInteractionSid, final String pathChannelSid, - final Type type, + final InteractionChannelParticipant.Type type, final Object mediaProperties ) { return new InteractionChannelParticipantCreator( @@ -67,7 +67,7 @@ public static InteractionChannelParticipantUpdater updater( final String pathInteractionSid, final String pathChannelSid, final String pathSid, - final Status status + final InteractionChannelParticipant.Status status ) { return new InteractionChannelParticipantUpdater( pathInteractionSid, @@ -127,7 +127,7 @@ public static InteractionChannelParticipant fromJson( } private final String sid; - private final Type type; + private final InteractionChannelParticipant.Type type; private final String interactionSid; private final String channelSid; private final URI url; @@ -136,7 +136,7 @@ public static InteractionChannelParticipant fromJson( @JsonCreator private InteractionChannelParticipant( @JsonProperty("sid") final String sid, - @JsonProperty("type") final Type type, + @JsonProperty("type") final InteractionChannelParticipant.Type type, @JsonProperty("interaction_sid") final String interactionSid, @JsonProperty("channel_sid") final String channelSid, @JsonProperty("url") final URI url, @@ -157,7 +157,7 @@ public final String getSid() { return this.sid; } - public final Type getType() { + public final InteractionChannelParticipant.Type getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionTransfer.java b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionTransfer.java index 7541c81831..40779ee7de 100644 --- a/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionTransfer.java +++ b/src/main/java/com/twilio/rest/flexapi/v1/interaction/interactionchannel/InteractionTransfer.java @@ -135,8 +135,8 @@ public static String toJson(Object object, ObjectMapper mapper) { private final String interactionSid; private final String channelSid; private final String executionSid; - private final TransferType type; - private final TransferStatus status; + private final InteractionTransfer.TransferType type; + private final InteractionTransfer.TransferStatus status; private final String from; private final String to; private final String noteSid; @@ -153,8 +153,8 @@ private InteractionTransfer( @JsonProperty("interaction_sid") final String interactionSid, @JsonProperty("channel_sid") final String channelSid, @JsonProperty("execution_sid") final String executionSid, - @JsonProperty("type") final TransferType type, - @JsonProperty("status") final TransferStatus status, + @JsonProperty("type") final InteractionTransfer.TransferType type, + @JsonProperty("status") final InteractionTransfer.TransferStatus status, @JsonProperty("from") final String from, @JsonProperty("to") final String to, @JsonProperty("note_sid") final String noteSid, @@ -204,11 +204,11 @@ public final String getExecutionSid() { return this.executionSid; } - public final TransferType getType() { + public final InteractionTransfer.TransferType getType() { return this.type; } - public final TransferStatus getStatus() { + public final InteractionTransfer.TransferStatus getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/frontlineapi/v1/User.java b/src/main/java/com/twilio/rest/frontlineapi/v1/User.java index 6bc81d1212..3534892247 100644 --- a/src/main/java/com/twilio/rest/frontlineapi/v1/User.java +++ b/src/main/java/com/twilio/rest/frontlineapi/v1/User.java @@ -92,7 +92,7 @@ public static User fromJson( private final String identity; private final String friendlyName; private final String avatar; - private final StateType state; + private final User.StateType state; private final Boolean isAvailable; private final URI url; @@ -102,7 +102,7 @@ private User( @JsonProperty("identity") final String identity, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("avatar") final String avatar, - @JsonProperty("state") final StateType state, + @JsonProperty("state") final User.StateType state, @JsonProperty("is_available") final Boolean isAvailable, @JsonProperty("url") final URI url ) { @@ -131,7 +131,7 @@ public final String getAvatar() { return this.avatar; } - public final StateType getState() { + public final User.StateType getState() { return this.state; } diff --git a/src/main/java/com/twilio/rest/insights/v1/CallSummaries.java b/src/main/java/com/twilio/rest/insights/v1/CallSummaries.java index 2c9a77afed..9741233555 100644 --- a/src/main/java/com/twilio/rest/insights/v1/CallSummaries.java +++ b/src/main/java/com/twilio/rest/insights/v1/CallSummaries.java @@ -91,10 +91,10 @@ public static CallSummaries fromJson( private final String accountSid; private final String callSid; - private final AnsweredBy answeredBy; - private final CallType callType; - private final CallState callState; - private final ProcessingState processingState; + private final CallSummaries.AnsweredBy answeredBy; + private final CallSummaries.CallType callType; + private final CallSummaries.CallState callState; + private final CallSummaries.ProcessingState processingState; private final ZonedDateTime createdTime; private final ZonedDateTime startTime; private final ZonedDateTime endTime; @@ -117,10 +117,12 @@ public static CallSummaries fromJson( private CallSummaries( @JsonProperty("account_sid") final String accountSid, @JsonProperty("call_sid") final String callSid, - @JsonProperty("answered_by") final AnsweredBy answeredBy, - @JsonProperty("call_type") final CallType callType, - @JsonProperty("call_state") final CallState callState, - @JsonProperty("processing_state") final ProcessingState processingState, + @JsonProperty("answered_by") final CallSummaries.AnsweredBy answeredBy, + @JsonProperty("call_type") final CallSummaries.CallType callType, + @JsonProperty("call_state") final CallSummaries.CallState callState, + @JsonProperty( + "processing_state" + ) final CallSummaries.ProcessingState processingState, @JsonProperty("created_time") final String createdTime, @JsonProperty("start_time") final String startTime, @JsonProperty("end_time") final String endTime, @@ -172,19 +174,19 @@ public final String getCallSid() { return this.callSid; } - public final AnsweredBy getAnsweredBy() { + public final CallSummaries.AnsweredBy getAnsweredBy() { return this.answeredBy; } - public final CallType getCallType() { + public final CallSummaries.CallType getCallType() { return this.callType; } - public final CallState getCallState() { + public final CallSummaries.CallState getCallState() { return this.callState; } - public final ProcessingState getProcessingState() { + public final CallSummaries.ProcessingState getProcessingState() { return this.processingState; } diff --git a/src/main/java/com/twilio/rest/insights/v1/Conference.java b/src/main/java/com/twilio/rest/insights/v1/Conference.java index 7a3e57b142..c6a41efe28 100644 --- a/src/main/java/com/twilio/rest/insights/v1/Conference.java +++ b/src/main/java/com/twilio/rest/insights/v1/Conference.java @@ -101,19 +101,19 @@ public static Conference fromJson( private final ZonedDateTime endTime; private final Integer durationSeconds; private final Integer connectDurationSeconds; - private final ConferenceStatus status; + private final Conference.ConferenceStatus status; private final Integer maxParticipants; private final Integer maxConcurrentParticipants; private final Integer uniqueParticipants; - private final ConferenceEndReason endReason; + private final Conference.ConferenceEndReason endReason; private final String endedBy; - private final Region mixerRegion; - private final Region mixerRegionRequested; + private final Conference.Region mixerRegion; + private final Conference.Region mixerRegionRequested; private final Boolean recordingEnabled; private final Map detectedIssues; - private final List tags; + private final List tags; private final Map tagInfo; - private final ProcessingState processingState; + private final Conference.ProcessingState processingState; private final URI url; private final Map links; @@ -129,26 +129,30 @@ private Conference( @JsonProperty( "connect_duration_seconds" ) final Integer connectDurationSeconds, - @JsonProperty("status") final ConferenceStatus status, + @JsonProperty("status") final Conference.ConferenceStatus status, @JsonProperty("max_participants") final Integer maxParticipants, @JsonProperty( "max_concurrent_participants" ) final Integer maxConcurrentParticipants, @JsonProperty("unique_participants") final Integer uniqueParticipants, - @JsonProperty("end_reason") final ConferenceEndReason endReason, + @JsonProperty( + "end_reason" + ) final Conference.ConferenceEndReason endReason, @JsonProperty("ended_by") final String endedBy, - @JsonProperty("mixer_region") final Region mixerRegion, + @JsonProperty("mixer_region") final Conference.Region mixerRegion, @JsonProperty( "mixer_region_requested" - ) final Region mixerRegionRequested, + ) final Conference.Region mixerRegionRequested, @JsonProperty("recording_enabled") final Boolean recordingEnabled, @JsonProperty("detected_issues") final Map< String, Object > detectedIssues, - @JsonProperty("tags") final List tags, + @JsonProperty("tags") final List tags, @JsonProperty("tag_info") final Map tagInfo, - @JsonProperty("processing_state") final ProcessingState processingState, + @JsonProperty( + "processing_state" + ) final Conference.ProcessingState processingState, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links ) { @@ -209,7 +213,7 @@ public final Integer getConnectDurationSeconds() { return this.connectDurationSeconds; } - public final ConferenceStatus getStatus() { + public final Conference.ConferenceStatus getStatus() { return this.status; } @@ -225,7 +229,7 @@ public final Integer getUniqueParticipants() { return this.uniqueParticipants; } - public final ConferenceEndReason getEndReason() { + public final Conference.ConferenceEndReason getEndReason() { return this.endReason; } @@ -233,11 +237,11 @@ public final String getEndedBy() { return this.endedBy; } - public final Region getMixerRegion() { + public final Conference.Region getMixerRegion() { return this.mixerRegion; } - public final Region getMixerRegionRequested() { + public final Conference.Region getMixerRegionRequested() { return this.mixerRegionRequested; } @@ -249,7 +253,7 @@ public final Map getDetectedIssues() { return this.detectedIssues; } - public final List getTags() { + public final List getTags() { return this.tags; } @@ -257,7 +261,7 @@ public final Map getTagInfo() { return this.tagInfo; } - public final ProcessingState getProcessingState() { + public final Conference.ProcessingState getProcessingState() { return this.processingState; } diff --git a/src/main/java/com/twilio/rest/insights/v1/Room.java b/src/main/java/com/twilio/rest/insights/v1/Room.java index e3ad533bec..32a1fb2ece 100644 --- a/src/main/java/com/twilio/rest/insights/v1/Room.java +++ b/src/main/java/com/twilio/rest/insights/v1/Room.java @@ -99,25 +99,25 @@ public static Room fromJson( private final String roomName; private final ZonedDateTime createTime; private final ZonedDateTime endTime; - private final RoomType roomType; - private final RoomStatus roomStatus; + private final Room.RoomType roomType; + private final Room.RoomStatus roomStatus; private final URI statusCallback; private final HttpMethod statusCallbackMethod; - private final CreatedMethod createdMethod; - private final EndReason endReason; + private final Room.CreatedMethod createdMethod; + private final Room.EndReason endReason; private final Integer maxParticipants; private final Integer uniqueParticipants; private final Integer uniqueParticipantIdentities; private final Integer concurrentParticipants; private final Integer maxConcurrentParticipants; - private final List codecs; - private final TwilioRealm mediaRegion; + private final List codecs; + private final Room.TwilioRealm mediaRegion; private final Long durationSec; private final Long totalParticipantDurationSec; private final Long totalRecordingDurationSec; - private final ProcessingState processingState; + private final Room.ProcessingState processingState; private final Boolean recordingEnabled; - private final EdgeLocation edgeLocation; + private final Room.EdgeLocation edgeLocation; private final URI url; private final Map links; @@ -128,14 +128,14 @@ private Room( @JsonProperty("room_name") final String roomName, @JsonProperty("create_time") final String createTime, @JsonProperty("end_time") final String endTime, - @JsonProperty("room_type") final RoomType roomType, - @JsonProperty("room_status") final RoomStatus roomStatus, + @JsonProperty("room_type") final Room.RoomType roomType, + @JsonProperty("room_status") final Room.RoomStatus roomStatus, @JsonProperty("status_callback") final URI statusCallback, @JsonProperty( "status_callback_method" ) final HttpMethod statusCallbackMethod, - @JsonProperty("created_method") final CreatedMethod createdMethod, - @JsonProperty("end_reason") final EndReason endReason, + @JsonProperty("created_method") final Room.CreatedMethod createdMethod, + @JsonProperty("end_reason") final Room.EndReason endReason, @JsonProperty("max_participants") final Integer maxParticipants, @JsonProperty("unique_participants") final Integer uniqueParticipants, @JsonProperty( @@ -147,8 +147,8 @@ private Room( @JsonProperty( "max_concurrent_participants" ) final Integer maxConcurrentParticipants, - @JsonProperty("codecs") final List codecs, - @JsonProperty("media_region") final TwilioRealm mediaRegion, + @JsonProperty("codecs") final List codecs, + @JsonProperty("media_region") final Room.TwilioRealm mediaRegion, @JsonProperty("duration_sec") final Long durationSec, @JsonProperty( "total_participant_duration_sec" @@ -156,9 +156,11 @@ private Room( @JsonProperty( "total_recording_duration_sec" ) final Long totalRecordingDurationSec, - @JsonProperty("processing_state") final ProcessingState processingState, + @JsonProperty( + "processing_state" + ) final Room.ProcessingState processingState, @JsonProperty("recording_enabled") final Boolean recordingEnabled, - @JsonProperty("edge_location") final EdgeLocation edgeLocation, + @JsonProperty("edge_location") final Room.EdgeLocation edgeLocation, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links ) { @@ -210,11 +212,11 @@ public final ZonedDateTime getEndTime() { return this.endTime; } - public final RoomType getRoomType() { + public final Room.RoomType getRoomType() { return this.roomType; } - public final RoomStatus getRoomStatus() { + public final Room.RoomStatus getRoomStatus() { return this.roomStatus; } @@ -226,11 +228,11 @@ public final HttpMethod getStatusCallbackMethod() { return this.statusCallbackMethod; } - public final CreatedMethod getCreatedMethod() { + public final Room.CreatedMethod getCreatedMethod() { return this.createdMethod; } - public final EndReason getEndReason() { + public final Room.EndReason getEndReason() { return this.endReason; } @@ -254,11 +256,11 @@ public final Integer getMaxConcurrentParticipants() { return this.maxConcurrentParticipants; } - public final List getCodecs() { + public final List getCodecs() { return this.codecs; } - public final TwilioRealm getMediaRegion() { + public final Room.TwilioRealm getMediaRegion() { return this.mediaRegion; } @@ -274,7 +276,7 @@ public final Long getTotalRecordingDurationSec() { return this.totalRecordingDurationSec; } - public final ProcessingState getProcessingState() { + public final Room.ProcessingState getProcessingState() { return this.processingState; } @@ -282,7 +284,7 @@ public final Boolean getRecordingEnabled() { return this.recordingEnabled; } - public final EdgeLocation getEdgeLocation() { + public final Room.EdgeLocation getEdgeLocation() { return this.edgeLocation; } diff --git a/src/main/java/com/twilio/rest/insights/v1/call/Annotation.java b/src/main/java/com/twilio/rest/insights/v1/call/Annotation.java index 0bb36cd0a0..0821e30210 100644 --- a/src/main/java/com/twilio/rest/insights/v1/call/Annotation.java +++ b/src/main/java/com/twilio/rest/insights/v1/call/Annotation.java @@ -91,8 +91,8 @@ public static Annotation fromJson( private final String callSid; private final String accountSid; - private final AnsweredBy answeredBy; - private final ConnectivityIssue connectivityIssue; + private final Annotation.AnsweredBy answeredBy; + private final Annotation.ConnectivityIssue connectivityIssue; private final List qualityIssues; private final Boolean spam; private final Integer callScore; @@ -104,10 +104,10 @@ public static Annotation fromJson( private Annotation( @JsonProperty("call_sid") final String callSid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty("answered_by") final AnsweredBy answeredBy, + @JsonProperty("answered_by") final Annotation.AnsweredBy answeredBy, @JsonProperty( "connectivity_issue" - ) final ConnectivityIssue connectivityIssue, + ) final Annotation.ConnectivityIssue connectivityIssue, @JsonProperty("quality_issues") final List qualityIssues, @JsonProperty("spam") final Boolean spam, @JsonProperty("call_score") final Integer callScore, @@ -135,11 +135,11 @@ public final String getAccountSid() { return this.accountSid; } - public final AnsweredBy getAnsweredBy() { + public final Annotation.AnsweredBy getAnsweredBy() { return this.answeredBy; } - public final ConnectivityIssue getConnectivityIssue() { + public final Annotation.ConnectivityIssue getConnectivityIssue() { return this.connectivityIssue; } diff --git a/src/main/java/com/twilio/rest/insights/v1/call/CallSummary.java b/src/main/java/com/twilio/rest/insights/v1/call/CallSummary.java index 68ec399227..ae8c1be46a 100644 --- a/src/main/java/com/twilio/rest/insights/v1/call/CallSummary.java +++ b/src/main/java/com/twilio/rest/insights/v1/call/CallSummary.java @@ -91,10 +91,10 @@ public static CallSummary fromJson( private final String accountSid; private final String callSid; - private final CallType callType; - private final CallState callState; - private final AnsweredBy answeredBy; - private final ProcessingState processingState; + private final CallSummary.CallType callType; + private final CallSummary.CallState callState; + private final CallSummary.AnsweredBy answeredBy; + private final CallSummary.ProcessingState processingState; private final ZonedDateTime createdTime; private final ZonedDateTime startTime; private final ZonedDateTime endTime; @@ -117,10 +117,12 @@ public static CallSummary fromJson( private CallSummary( @JsonProperty("account_sid") final String accountSid, @JsonProperty("call_sid") final String callSid, - @JsonProperty("call_type") final CallType callType, - @JsonProperty("call_state") final CallState callState, - @JsonProperty("answered_by") final AnsweredBy answeredBy, - @JsonProperty("processing_state") final ProcessingState processingState, + @JsonProperty("call_type") final CallSummary.CallType callType, + @JsonProperty("call_state") final CallSummary.CallState callState, + @JsonProperty("answered_by") final CallSummary.AnsweredBy answeredBy, + @JsonProperty( + "processing_state" + ) final CallSummary.ProcessingState processingState, @JsonProperty("created_time") final String createdTime, @JsonProperty("start_time") final String startTime, @JsonProperty("end_time") final String endTime, @@ -172,19 +174,19 @@ public final String getCallSid() { return this.callSid; } - public final CallType getCallType() { + public final CallSummary.CallType getCallType() { return this.callType; } - public final CallState getCallState() { + public final CallSummary.CallState getCallState() { return this.callState; } - public final AnsweredBy getAnsweredBy() { + public final CallSummary.AnsweredBy getAnsweredBy() { return this.answeredBy; } - public final ProcessingState getProcessingState() { + public final CallSummary.ProcessingState getProcessingState() { return this.processingState; } diff --git a/src/main/java/com/twilio/rest/insights/v1/call/Event.java b/src/main/java/com/twilio/rest/insights/v1/call/Event.java index 72db3a8646..3d5803e58c 100644 --- a/src/main/java/com/twilio/rest/insights/v1/call/Event.java +++ b/src/main/java/com/twilio/rest/insights/v1/call/Event.java @@ -88,9 +88,9 @@ public static Event fromJson( private final String timestamp; private final String callSid; private final String accountSid; - private final TwilioEdge edge; + private final Event.TwilioEdge edge; private final String group; - private final Level level; + private final Event.Level level; private final String name; private final Map carrierEdge; private final Map sipEdge; @@ -102,9 +102,9 @@ private Event( @JsonProperty("timestamp") final String timestamp, @JsonProperty("call_sid") final String callSid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty("edge") final TwilioEdge edge, + @JsonProperty("edge") final Event.TwilioEdge edge, @JsonProperty("group") final String group, - @JsonProperty("level") final Level level, + @JsonProperty("level") final Event.Level level, @JsonProperty("name") final String name, @JsonProperty("carrier_edge") final Map carrierEdge, @JsonProperty("sip_edge") final Map sipEdge, @@ -136,7 +136,7 @@ public final String getAccountSid() { return this.accountSid; } - public final TwilioEdge getEdge() { + public final Event.TwilioEdge getEdge() { return this.edge; } @@ -144,7 +144,7 @@ public final String getGroup() { return this.group; } - public final Level getLevel() { + public final Event.Level getLevel() { return this.level; } diff --git a/src/main/java/com/twilio/rest/insights/v1/call/Metric.java b/src/main/java/com/twilio/rest/insights/v1/call/Metric.java index e09bf425a6..c5bc8315e8 100644 --- a/src/main/java/com/twilio/rest/insights/v1/call/Metric.java +++ b/src/main/java/com/twilio/rest/insights/v1/call/Metric.java @@ -88,8 +88,8 @@ public static Metric fromJson( private final String timestamp; private final String callSid; private final String accountSid; - private final TwilioEdge edge; - private final StreamDirection direction; + private final Metric.TwilioEdge edge; + private final Metric.StreamDirection direction; private final Map carrierEdge; private final Map sipEdge; private final Map sdkEdge; @@ -100,8 +100,8 @@ private Metric( @JsonProperty("timestamp") final String timestamp, @JsonProperty("call_sid") final String callSid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty("edge") final TwilioEdge edge, - @JsonProperty("direction") final StreamDirection direction, + @JsonProperty("edge") final Metric.TwilioEdge edge, + @JsonProperty("direction") final Metric.StreamDirection direction, @JsonProperty("carrier_edge") final Map carrierEdge, @JsonProperty("sip_edge") final Map sipEdge, @JsonProperty("sdk_edge") final Map sdkEdge, @@ -130,11 +130,11 @@ public final String getAccountSid() { return this.accountSid; } - public final TwilioEdge getEdge() { + public final Metric.TwilioEdge getEdge() { return this.edge; } - public final StreamDirection getDirection() { + public final Metric.StreamDirection getDirection() { return this.direction; } diff --git a/src/main/java/com/twilio/rest/insights/v1/conference/ConferenceParticipant.java b/src/main/java/com/twilio/rest/insights/v1/conference/ConferenceParticipant.java index b5996e37a3..d62a3c56fd 100644 --- a/src/main/java/com/twilio/rest/insights/v1/conference/ConferenceParticipant.java +++ b/src/main/java/com/twilio/rest/insights/v1/conference/ConferenceParticipant.java @@ -106,10 +106,10 @@ public static ConferenceParticipant fromJson( private final String conferenceSid; private final String callSid; private final String accountSid; - private final CallDirection callDirection; + private final ConferenceParticipant.CallDirection callDirection; private final String from; private final String to; - private final CallStatus callStatus; + private final ConferenceParticipant.CallStatus callStatus; private final String countryCode; private final Boolean isModerator; private final ZonedDateTime joinTime; @@ -117,13 +117,13 @@ public static ConferenceParticipant fromJson( private final Integer durationSeconds; private final Integer outboundQueueLength; private final Integer outboundTimeInQueue; - private final JitterBufferSize jitterBufferSize; + private final ConferenceParticipant.JitterBufferSize jitterBufferSize; private final Boolean isCoach; private final List coachedParticipants; - private final Region participantRegion; - private final Region conferenceRegion; - private final CallType callType; - private final ProcessingState processingState; + private final ConferenceParticipant.Region participantRegion; + private final ConferenceParticipant.Region conferenceRegion; + private final ConferenceParticipant.CallType callType; + private final ConferenceParticipant.ProcessingState processingState; private final Map properties; private final Map events; private final Map metrics; @@ -136,10 +136,14 @@ private ConferenceParticipant( @JsonProperty("conference_sid") final String conferenceSid, @JsonProperty("call_sid") final String callSid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty("call_direction") final CallDirection callDirection, + @JsonProperty( + "call_direction" + ) final ConferenceParticipant.CallDirection callDirection, @JsonProperty("from") final String from, @JsonProperty("to") final String to, - @JsonProperty("call_status") final CallStatus callStatus, + @JsonProperty( + "call_status" + ) final ConferenceParticipant.CallStatus callStatus, @JsonProperty("country_code") final String countryCode, @JsonProperty("is_moderator") final Boolean isModerator, @JsonProperty("join_time") final String joinTime, @@ -153,15 +157,23 @@ private ConferenceParticipant( ) final Integer outboundTimeInQueue, @JsonProperty( "jitter_buffer_size" - ) final JitterBufferSize jitterBufferSize, + ) final ConferenceParticipant.JitterBufferSize jitterBufferSize, @JsonProperty("is_coach") final Boolean isCoach, @JsonProperty("coached_participants") final List< String > coachedParticipants, - @JsonProperty("participant_region") final Region participantRegion, - @JsonProperty("conference_region") final Region conferenceRegion, - @JsonProperty("call_type") final CallType callType, - @JsonProperty("processing_state") final ProcessingState processingState, + @JsonProperty( + "participant_region" + ) final ConferenceParticipant.Region participantRegion, + @JsonProperty( + "conference_region" + ) final ConferenceParticipant.Region conferenceRegion, + @JsonProperty( + "call_type" + ) final ConferenceParticipant.CallType callType, + @JsonProperty( + "processing_state" + ) final ConferenceParticipant.ProcessingState processingState, @JsonProperty("properties") final Map properties, @JsonProperty("events") final Map events, @JsonProperty("metrics") final Map metrics, @@ -216,7 +228,7 @@ public final String getAccountSid() { return this.accountSid; } - public final CallDirection getCallDirection() { + public final ConferenceParticipant.CallDirection getCallDirection() { return this.callDirection; } @@ -228,7 +240,7 @@ public final String getTo() { return this.to; } - public final CallStatus getCallStatus() { + public final ConferenceParticipant.CallStatus getCallStatus() { return this.callStatus; } @@ -260,7 +272,7 @@ public final Integer getOutboundTimeInQueue() { return this.outboundTimeInQueue; } - public final JitterBufferSize getJitterBufferSize() { + public final ConferenceParticipant.JitterBufferSize getJitterBufferSize() { return this.jitterBufferSize; } @@ -272,19 +284,19 @@ public final List getCoachedParticipants() { return this.coachedParticipants; } - public final Region getParticipantRegion() { + public final ConferenceParticipant.Region getParticipantRegion() { return this.participantRegion; } - public final Region getConferenceRegion() { + public final ConferenceParticipant.Region getConferenceRegion() { return this.conferenceRegion; } - public final CallType getCallType() { + public final ConferenceParticipant.CallType getCallType() { return this.callType; } - public final ProcessingState getProcessingState() { + public final ConferenceParticipant.ProcessingState getProcessingState() { return this.processingState; } diff --git a/src/main/java/com/twilio/rest/insights/v1/room/Participant.java b/src/main/java/com/twilio/rest/insights/v1/room/Participant.java index bef00bd135..db0b8b2325 100644 --- a/src/main/java/com/twilio/rest/insights/v1/room/Participant.java +++ b/src/main/java/com/twilio/rest/insights/v1/room/Participant.java @@ -103,14 +103,14 @@ public static Participant fromJson( private final Long durationSec; private final String accountSid; private final String roomSid; - private final RoomStatus status; - private final List codecs; + private final Participant.RoomStatus status; + private final List codecs; private final String endReason; private final Integer errorCode; private final String errorCodeUrl; - private final TwilioRealm mediaRegion; + private final Participant.TwilioRealm mediaRegion; private final Map properties; - private final EdgeLocation edgeLocation; + private final Participant.EdgeLocation edgeLocation; private final Map publisherInfo; private final URI url; @@ -123,14 +123,16 @@ private Participant( @JsonProperty("duration_sec") final Long durationSec, @JsonProperty("account_sid") final String accountSid, @JsonProperty("room_sid") final String roomSid, - @JsonProperty("status") final RoomStatus status, - @JsonProperty("codecs") final List codecs, + @JsonProperty("status") final Participant.RoomStatus status, + @JsonProperty("codecs") final List codecs, @JsonProperty("end_reason") final String endReason, @JsonProperty("error_code") final Integer errorCode, @JsonProperty("error_code_url") final String errorCodeUrl, - @JsonProperty("media_region") final TwilioRealm mediaRegion, + @JsonProperty("media_region") final Participant.TwilioRealm mediaRegion, @JsonProperty("properties") final Map properties, - @JsonProperty("edge_location") final EdgeLocation edgeLocation, + @JsonProperty( + "edge_location" + ) final Participant.EdgeLocation edgeLocation, @JsonProperty("publisher_info") final Map publisherInfo, @JsonProperty("url") final URI url ) { @@ -181,11 +183,11 @@ public final String getRoomSid() { return this.roomSid; } - public final RoomStatus getStatus() { + public final Participant.RoomStatus getStatus() { return this.status; } - public final List getCodecs() { + public final List getCodecs() { return this.codecs; } @@ -201,7 +203,7 @@ public final String getErrorCodeUrl() { return this.errorCodeUrl; } - public final TwilioRealm getMediaRegion() { + public final Participant.TwilioRealm getMediaRegion() { return this.mediaRegion; } @@ -209,7 +211,7 @@ public final Map getProperties() { return this.properties; } - public final EdgeLocation getEdgeLocation() { + public final Participant.EdgeLocation getEdgeLocation() { return this.edgeLocation; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/CustomOperator.java b/src/main/java/com/twilio/rest/intelligence/v2/CustomOperator.java index ca2d94f285..577770f332 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/CustomOperator.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/CustomOperator.java @@ -119,7 +119,7 @@ public static CustomOperator fromJson( private final String author; private final String operatorType; private final Integer version; - private final Availability availability; + private final CustomOperator.Availability availability; private final Map config; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -134,7 +134,9 @@ private CustomOperator( @JsonProperty("author") final String author, @JsonProperty("operator_type") final String operatorType, @JsonProperty("version") final Integer version, - @JsonProperty("availability") final Availability availability, + @JsonProperty( + "availability" + ) final CustomOperator.Availability availability, @JsonProperty("config") final Map config, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -182,7 +184,7 @@ public final Integer getVersion() { return this.version; } - public final Availability getAvailability() { + public final CustomOperator.Availability getAvailability() { return this.availability; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/Operator.java b/src/main/java/com/twilio/rest/intelligence/v2/Operator.java index d5d656a4ed..a9c425c153 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/Operator.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/Operator.java @@ -99,7 +99,7 @@ public static Operator fromJson( private final String author; private final String operatorType; private final Integer version; - private final Availability availability; + private final Operator.Availability availability; private final Map config; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -114,7 +114,7 @@ private Operator( @JsonProperty("author") final String author, @JsonProperty("operator_type") final String operatorType, @JsonProperty("version") final Integer version, - @JsonProperty("availability") final Availability availability, + @JsonProperty("availability") final Operator.Availability availability, @JsonProperty("config") final Map config, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -162,7 +162,7 @@ public final Integer getVersion() { return this.version; } - public final Availability getAvailability() { + public final Operator.Availability getAvailability() { return this.availability; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/OperatorType.java b/src/main/java/com/twilio/rest/intelligence/v2/OperatorType.java index 03d6717137..566ab5cb66 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/OperatorType.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/OperatorType.java @@ -98,10 +98,10 @@ public static OperatorType fromJson( private final String friendlyName; private final String description; private final URI docsLink; - private final OutputType outputType; + private final OperatorType.OutputType outputType; private final List supportedLanguages; - private final Provider provider; - private final Availability availability; + private final OperatorType.Provider provider; + private final OperatorType.Availability availability; private final Boolean configurable; private final Map configSchema; private final ZonedDateTime dateCreated; @@ -115,12 +115,14 @@ private OperatorType( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("description") final String description, @JsonProperty("docs_link") final URI docsLink, - @JsonProperty("output_type") final OutputType outputType, + @JsonProperty("output_type") final OperatorType.OutputType outputType, @JsonProperty("supported_languages") final List< String > supportedLanguages, - @JsonProperty("provider") final Provider provider, - @JsonProperty("availability") final Availability availability, + @JsonProperty("provider") final OperatorType.Provider provider, + @JsonProperty( + "availability" + ) final OperatorType.Availability availability, @JsonProperty("configurable") final Boolean configurable, @JsonProperty("config_schema") final Map configSchema, @JsonProperty("date_created") final String dateCreated, @@ -163,7 +165,7 @@ public final URI getDocsLink() { return this.docsLink; } - public final OutputType getOutputType() { + public final OperatorType.OutputType getOutputType() { return this.outputType; } @@ -171,11 +173,11 @@ public final List getSupportedLanguages() { return this.supportedLanguages; } - public final Provider getProvider() { + public final OperatorType.Provider getProvider() { return this.provider; } - public final Availability getAvailability() { + public final OperatorType.Availability getAvailability() { return this.availability; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/PrebuiltOperator.java b/src/main/java/com/twilio/rest/intelligence/v2/PrebuiltOperator.java index 9d2fc4e69c..c9b414a546 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/PrebuiltOperator.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/PrebuiltOperator.java @@ -99,7 +99,7 @@ public static PrebuiltOperator fromJson( private final String author; private final String operatorType; private final Integer version; - private final Availability availability; + private final PrebuiltOperator.Availability availability; private final Map config; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -114,7 +114,9 @@ private PrebuiltOperator( @JsonProperty("author") final String author, @JsonProperty("operator_type") final String operatorType, @JsonProperty("version") final Integer version, - @JsonProperty("availability") final Availability availability, + @JsonProperty( + "availability" + ) final PrebuiltOperator.Availability availability, @JsonProperty("config") final Map config, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -162,7 +164,7 @@ public final Integer getVersion() { return this.version; } - public final Availability getAvailability() { + public final PrebuiltOperator.Availability getAvailability() { return this.availability; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/Service.java b/src/main/java/com/twilio/rest/intelligence/v2/Service.java index b72a89dcaa..6a14108124 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/Service.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/Service.java @@ -117,7 +117,7 @@ public static Service fromJson( private final String uniqueName; private final URI url; private final String webhookUrl; - private final HttpMethod webhookHttpMethod; + private final Service.HttpMethod webhookHttpMethod; private final List readOnlyAttachedOperatorSids; private final Integer version; @@ -136,7 +136,9 @@ private Service( @JsonProperty("unique_name") final String uniqueName, @JsonProperty("url") final URI url, @JsonProperty("webhook_url") final String webhookUrl, - @JsonProperty("webhook_http_method") final HttpMethod webhookHttpMethod, + @JsonProperty( + "webhook_http_method" + ) final Service.HttpMethod webhookHttpMethod, @JsonProperty("read_only_attached_operator_sids") final List< String > readOnlyAttachedOperatorSids, @@ -212,7 +214,7 @@ public final String getWebhookUrl() { return this.webhookUrl; } - public final HttpMethod getWebhookHttpMethod() { + public final Service.HttpMethod getWebhookHttpMethod() { return this.webhookHttpMethod; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/Transcript.java b/src/main/java/com/twilio/rest/intelligence/v2/Transcript.java index 5ef033357a..0e19d311a1 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/Transcript.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/Transcript.java @@ -108,7 +108,7 @@ public static Transcript fromJson( private final String sid; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; - private final Status status; + private final Transcript.Status status; private final Map channel; private final Boolean dataLogging; private final String languageCode; @@ -126,7 +126,7 @@ private Transcript( @JsonProperty("sid") final String sid, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Transcript.Status status, @JsonProperty("channel") final Map channel, @JsonProperty("data_logging") final Boolean dataLogging, @JsonProperty("language_code") final String languageCode, @@ -175,7 +175,7 @@ public final ZonedDateTime getDateUpdated() { return this.dateUpdated; } - public final Status getStatus() { + public final Transcript.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/intelligence/v2/transcript/OperatorResult.java b/src/main/java/com/twilio/rest/intelligence/v2/transcript/OperatorResult.java index 6ceb37f984..8e734ee75a 100644 --- a/src/main/java/com/twilio/rest/intelligence/v2/transcript/OperatorResult.java +++ b/src/main/java/com/twilio/rest/intelligence/v2/transcript/OperatorResult.java @@ -95,7 +95,7 @@ public static OperatorResult fromJson( } } - private final OperatorType operatorType; + private final OperatorResult.OperatorType operatorType; private final String name; private final String operatorSid; private final Boolean extractMatch; @@ -114,7 +114,9 @@ public static OperatorResult fromJson( @JsonCreator private OperatorResult( - @JsonProperty("operator_type") final OperatorType operatorType, + @JsonProperty( + "operator_type" + ) final OperatorResult.OperatorType operatorType, @JsonProperty("name") final String name, @JsonProperty("operator_sid") final String operatorSid, @JsonProperty("extract_match") final Boolean extractMatch, @@ -162,7 +164,7 @@ private OperatorResult( this.url = url; } - public final OperatorType getOperatorType() { + public final OperatorResult.OperatorType getOperatorType() { return this.operatorType; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v1/Credential.java b/src/main/java/com/twilio/rest/ipmessaging/v1/Credential.java index 00a5ede142..c18921f709 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v1/Credential.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v1/Credential.java @@ -39,7 +39,7 @@ public class Credential extends Resource { private static final long serialVersionUID = 161183169234848L; - public static CredentialCreator creator(final PushService type) { + public static CredentialCreator creator(final Credential.PushService type) { return new CredentialCreator(type); } @@ -105,7 +105,7 @@ public static Credential fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final PushService type; + private final Credential.PushService type; private final String sandbox; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -116,7 +116,7 @@ private Credential( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final PushService type, + @JsonProperty("type") final Credential.PushService type, @JsonProperty("sandbox") final String sandbox, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final PushService getType() { + public final Credential.PushService getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v1/service/Channel.java b/src/main/java/com/twilio/rest/ipmessaging/v1/service/Channel.java index 3e872e729e..716231236c 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v1/service/Channel.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v1/service/Channel.java @@ -119,7 +119,7 @@ public static Channel fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final ChannelType type; + private final Channel.ChannelType type; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; @@ -136,7 +136,7 @@ private Channel( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("type") final ChannelType type, + @JsonProperty("type") final Channel.ChannelType type, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("created_by") final String createdBy, @@ -185,7 +185,7 @@ public final String getAttributes() { return this.attributes; } - public final ChannelType getType() { + public final Channel.ChannelType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v1/service/Role.java b/src/main/java/com/twilio/rest/ipmessaging/v1/service/Role.java index cca17cdc8e..85ffef93d3 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v1/service/Role.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v1/service/Role.java @@ -43,7 +43,7 @@ public class Role extends Resource { public static RoleCreator creator( final String pathServiceSid, final String friendlyName, - final RoleType type, + final Role.RoleType type, final List permission ) { return new RoleCreator(pathServiceSid, friendlyName, type, permission); @@ -122,7 +122,7 @@ public static Role fromJson( private final String accountSid; private final String serviceSid; private final String friendlyName; - private final RoleType type; + private final Role.RoleType type; private final List permissions; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -134,7 +134,7 @@ private Role( @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final RoleType type, + @JsonProperty("type") final Role.RoleType type, @JsonProperty("permissions") final List permissions, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -167,7 +167,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final RoleType getType() { + public final Role.RoleType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v1/service/user/UserChannel.java b/src/main/java/com/twilio/rest/ipmessaging/v1/service/user/UserChannel.java index 1aed0d0471..05ee6541e0 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v1/service/user/UserChannel.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v1/service/user/UserChannel.java @@ -92,7 +92,7 @@ public static UserChannel fromJson( private final String serviceSid; private final String channelSid; private final String memberSid; - private final ChannelStatus status; + private final UserChannel.ChannelStatus status; private final Integer lastConsumedMessageIndex; private final Integer unreadMessagesCount; private final Map links; @@ -103,7 +103,7 @@ private UserChannel( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("channel_sid") final String channelSid, @JsonProperty("member_sid") final String memberSid, - @JsonProperty("status") final ChannelStatus status, + @JsonProperty("status") final UserChannel.ChannelStatus status, @JsonProperty( "last_consumed_message_index" ) final Integer lastConsumedMessageIndex, @@ -138,7 +138,7 @@ public final String getMemberSid() { return this.memberSid; } - public final ChannelStatus getStatus() { + public final UserChannel.ChannelStatus getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/Credential.java b/src/main/java/com/twilio/rest/ipmessaging/v2/Credential.java index f7beefe431..9f6267c773 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/Credential.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/Credential.java @@ -39,7 +39,7 @@ public class Credential extends Resource { private static final long serialVersionUID = 161183169234848L; - public static CredentialCreator creator(final PushService type) { + public static CredentialCreator creator(final Credential.PushService type) { return new CredentialCreator(type); } @@ -105,7 +105,7 @@ public static Credential fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final PushService type; + private final Credential.PushService type; private final String sandbox; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -116,7 +116,7 @@ private Credential( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final PushService type, + @JsonProperty("type") final Credential.PushService type, @JsonProperty("sandbox") final String sandbox, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final PushService getType() { + public final Credential.PushService getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/service/Binding.java b/src/main/java/com/twilio/rest/ipmessaging/v2/service/Binding.java index fecd63144c..3004b0a963 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/service/Binding.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/service/Binding.java @@ -111,7 +111,7 @@ public static Binding fromJson( private final String endpoint; private final String identity; private final String credentialSid; - private final BindingType bindingType; + private final Binding.BindingType bindingType; private final List messageTypes; private final URI url; private final Map links; @@ -126,7 +126,7 @@ private Binding( @JsonProperty("endpoint") final String endpoint, @JsonProperty("identity") final String identity, @JsonProperty("credential_sid") final String credentialSid, - @JsonProperty("binding_type") final BindingType bindingType, + @JsonProperty("binding_type") final Binding.BindingType bindingType, @JsonProperty("message_types") final List messageTypes, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links @@ -177,7 +177,7 @@ public final String getCredentialSid() { return this.credentialSid; } - public final BindingType getBindingType() { + public final Binding.BindingType getBindingType() { return this.bindingType; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/service/Channel.java b/src/main/java/com/twilio/rest/ipmessaging/v2/service/Channel.java index 8b738c76e5..19ae5463c6 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/service/Channel.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/service/Channel.java @@ -119,7 +119,7 @@ public static Channel fromJson( private final String friendlyName; private final String uniqueName; private final String attributes; - private final ChannelType type; + private final Channel.ChannelType type; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String createdBy; @@ -136,7 +136,7 @@ private Channel( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, @JsonProperty("attributes") final String attributes, - @JsonProperty("type") final ChannelType type, + @JsonProperty("type") final Channel.ChannelType type, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("created_by") final String createdBy, @@ -185,7 +185,7 @@ public final String getAttributes() { return this.attributes; } - public final ChannelType getType() { + public final Channel.ChannelType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/service/Role.java b/src/main/java/com/twilio/rest/ipmessaging/v2/service/Role.java index b36d8e3ae7..3f44c5de6f 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/service/Role.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/service/Role.java @@ -43,7 +43,7 @@ public class Role extends Resource { public static RoleCreator creator( final String pathServiceSid, final String friendlyName, - final RoleType type, + final Role.RoleType type, final List permission ) { return new RoleCreator(pathServiceSid, friendlyName, type, permission); @@ -122,7 +122,7 @@ public static Role fromJson( private final String accountSid; private final String serviceSid; private final String friendlyName; - private final RoleType type; + private final Role.RoleType type; private final List permissions; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -134,7 +134,7 @@ private Role( @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final RoleType type, + @JsonProperty("type") final Role.RoleType type, @JsonProperty("permissions") final List permissions, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -167,7 +167,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final RoleType getType() { + public final Role.RoleType getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/service/channel/Webhook.java b/src/main/java/com/twilio/rest/ipmessaging/v2/service/channel/Webhook.java index 8674cc57fc..e4202e4268 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/service/channel/Webhook.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/service/channel/Webhook.java @@ -44,7 +44,7 @@ public class Webhook extends Resource { public static WebhookCreator creator( final String pathServiceSid, final String pathChannelSid, - final Type type + final Webhook.Type type ) { return new WebhookCreator(pathServiceSid, pathChannelSid, type); } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserBinding.java b/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserBinding.java index a9ccdfface..e43512d118 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserBinding.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserBinding.java @@ -115,7 +115,7 @@ public static UserBinding fromJson( private final String identity; private final String userSid; private final String credentialSid; - private final BindingType bindingType; + private final UserBinding.BindingType bindingType; private final List messageTypes; private final URI url; @@ -130,7 +130,7 @@ private UserBinding( @JsonProperty("identity") final String identity, @JsonProperty("user_sid") final String userSid, @JsonProperty("credential_sid") final String credentialSid, - @JsonProperty("binding_type") final BindingType bindingType, + @JsonProperty("binding_type") final UserBinding.BindingType bindingType, @JsonProperty("message_types") final List messageTypes, @JsonProperty("url") final URI url ) { @@ -184,7 +184,7 @@ public final String getCredentialSid() { return this.credentialSid; } - public final BindingType getBindingType() { + public final UserBinding.BindingType getBindingType() { return this.bindingType; } diff --git a/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserChannel.java b/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserChannel.java index 5b8761e478..780eca1a29 100644 --- a/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserChannel.java +++ b/src/main/java/com/twilio/rest/ipmessaging/v2/service/user/UserChannel.java @@ -130,12 +130,12 @@ public static UserChannel fromJson( private final String channelSid; private final String userSid; private final String memberSid; - private final ChannelStatus status; + private final UserChannel.ChannelStatus status; private final Integer lastConsumedMessageIndex; private final Integer unreadMessagesCount; private final Map links; private final URI url; - private final NotificationLevel notificationLevel; + private final UserChannel.NotificationLevel notificationLevel; @JsonCreator private UserChannel( @@ -144,7 +144,7 @@ private UserChannel( @JsonProperty("channel_sid") final String channelSid, @JsonProperty("user_sid") final String userSid, @JsonProperty("member_sid") final String memberSid, - @JsonProperty("status") final ChannelStatus status, + @JsonProperty("status") final UserChannel.ChannelStatus status, @JsonProperty( "last_consumed_message_index" ) final Integer lastConsumedMessageIndex, @@ -155,7 +155,7 @@ private UserChannel( @JsonProperty("url") final URI url, @JsonProperty( "notification_level" - ) final NotificationLevel notificationLevel + ) final UserChannel.NotificationLevel notificationLevel ) { this.accountSid = accountSid; this.serviceSid = serviceSid; @@ -190,7 +190,7 @@ public final String getMemberSid() { return this.memberSid; } - public final ChannelStatus getStatus() { + public final UserChannel.ChannelStatus getStatus() { return this.status; } @@ -210,7 +210,7 @@ public final URI getUrl() { return this.url; } - public final NotificationLevel getNotificationLevel() { + public final UserChannel.NotificationLevel getNotificationLevel() { return this.notificationLevel; } diff --git a/src/main/java/com/twilio/rest/knowledge/v1/Knowledge.java b/src/main/java/com/twilio/rest/knowledge/v1/Knowledge.java deleted file mode 100644 index 4e6b69d6a9..0000000000 --- a/src/main/java/com/twilio/rest/knowledge/v1/Knowledge.java +++ /dev/null @@ -1,409 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Knowledge - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.knowledge.v1; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.twilio.base.Resource; -import com.twilio.converter.DateConverter; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import java.io.IOException; -import java.io.InputStream; -import java.time.ZonedDateTime; -import java.util.Map; -import java.util.Map; -import java.util.Objects; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; -import lombok.ToString; - -@JsonIgnoreProperties(ignoreUnknown = true) -@ToString -public class Knowledge extends Resource { - - private static final long serialVersionUID = 142704301669097L; - - @ToString - public static class KnowledgeV1ServiceCreatePolicyRequest { - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("description") - @Getter - @Setter - private String description; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("id") - @Getter - @Setter - private String id; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("name") - @Getter - @Setter - private String name; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("policy_details") - @Getter - @Setter - private Object policyDetails; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("type") - @Getter - @Setter - private String type; - - public static KnowledgeV1ServiceCreatePolicyRequest fromJson( - String jsonString, - ObjectMapper mapper - ) throws IOException { - return mapper.readValue( - jsonString, - KnowledgeV1ServiceCreatePolicyRequest.class - ); - } - } - - @ToString - public static class KnowledgeV1ServiceCreateKnowledgeRequest { - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("description") - @Getter - @Setter - private String description; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("knowledge_source_details") - @Getter - @Setter - private Map knowledgeSourceDetails; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("name") - @Getter - @Setter - private String name; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("policy") - @Getter - @Setter - private KnowledgeV1ServiceCreatePolicyRequest policy; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("type") - @Getter - @Setter - private String type; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("embedding_model") - @Getter - @Setter - private String embeddingModel; - - public KnowledgeV1ServiceCreateKnowledgeRequest( - final String name, - final String type - ) { - this.name = name; - this.type = type; - } - - public static KnowledgeV1ServiceCreateKnowledgeRequest fromJson( - String jsonString, - ObjectMapper mapper - ) throws IOException { - return mapper.readValue( - jsonString, - KnowledgeV1ServiceCreateKnowledgeRequest.class - ); - } - } - - @ToString - public static class KnowledgeV1ServiceUpdateKnowledgeRequest { - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("description") - @Getter - @Setter - private String description; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("knowledge_source_details") - @Getter - @Setter - private Map knowledgeSourceDetails; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("name") - @Getter - @Setter - private String name; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("policy") - @Getter - @Setter - private KnowledgeV1ServiceCreatePolicyRequest policy; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("type") - @Getter - @Setter - private String type; - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - @JsonProperty("embedding_model") - @Getter - @Setter - private String embeddingModel; - - public KnowledgeV1ServiceUpdateKnowledgeRequest() {} - - public static KnowledgeV1ServiceUpdateKnowledgeRequest fromJson( - String jsonString, - ObjectMapper mapper - ) throws IOException { - return mapper.readValue( - jsonString, - KnowledgeV1ServiceUpdateKnowledgeRequest.class - ); - } - } - - public static KnowledgeCreator creator( - final KnowledgeV1ServiceCreateKnowledgeRequest knowledgeV1ServiceCreateKnowledgeRequest - ) { - return new KnowledgeCreator(knowledgeV1ServiceCreateKnowledgeRequest); - } - - public static KnowledgeDeleter deleter(final String pathId) { - return new KnowledgeDeleter(pathId); - } - - public static KnowledgeFetcher fetcher(final String pathId) { - return new KnowledgeFetcher(pathId); - } - - public static KnowledgeReader reader() { - return new KnowledgeReader(); - } - - public static KnowledgeUpdater updater(final String pathId) { - return new KnowledgeUpdater(pathId); - } - - /** - * Converts a JSON String into a Knowledge object using the provided ObjectMapper. - * - * @param json Raw JSON String - * @param objectMapper Jackson ObjectMapper - * @return Knowledge object represented by the provided JSON - */ - public static Knowledge fromJson( - final String json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, Knowledge.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - /** - * Converts a JSON InputStream into a Knowledge object using the provided - * ObjectMapper. - * - * @param json Raw JSON InputStream - * @param objectMapper Jackson ObjectMapper - * @return Knowledge object represented by the provided JSON - */ - public static Knowledge fromJson( - final InputStream json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, Knowledge.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - public static String toJson(Object object, ObjectMapper mapper) { - try { - return mapper.writeValueAsString(object); - } catch (final JsonMappingException e) { - throw new ApiException(e.getMessage(), e); - } catch (JsonProcessingException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - private final String description; - private final String id; - private final String accountSid; - private final Map knowledgeSourceDetails; - private final String name; - private final String status; - private final String type; - private final String url; - private final String embeddingModel; - private final ZonedDateTime dateCreated; - private final ZonedDateTime dateUpdated; - - @JsonCreator - private Knowledge( - @JsonProperty("description") final String description, - @JsonProperty("id") final String id, - @JsonProperty("account_sid") final String accountSid, - @JsonProperty("knowledge_source_details") final Map< - String, - Object - > knowledgeSourceDetails, - @JsonProperty("name") final String name, - @JsonProperty("status") final String status, - @JsonProperty("type") final String type, - @JsonProperty("url") final String url, - @JsonProperty("embedding_model") final String embeddingModel, - @JsonProperty("date_created") final String dateCreated, - @JsonProperty("date_updated") final String dateUpdated - ) { - this.description = description; - this.id = id; - this.accountSid = accountSid; - this.knowledgeSourceDetails = knowledgeSourceDetails; - this.name = name; - this.status = status; - this.type = type; - this.url = url; - this.embeddingModel = embeddingModel; - this.dateCreated = DateConverter.iso8601DateTimeFromString(dateCreated); - this.dateUpdated = DateConverter.iso8601DateTimeFromString(dateUpdated); - } - - public final String getDescription() { - return this.description; - } - - public final String getId() { - return this.id; - } - - public final String getAccountSid() { - return this.accountSid; - } - - public final Map getKnowledgeSourceDetails() { - return this.knowledgeSourceDetails; - } - - public final String getName() { - return this.name; - } - - public final String getStatus() { - return this.status; - } - - public final String getType() { - return this.type; - } - - public final String getUrl() { - return this.url; - } - - public final String getEmbeddingModel() { - return this.embeddingModel; - } - - public final ZonedDateTime getDateCreated() { - return this.dateCreated; - } - - public final ZonedDateTime getDateUpdated() { - return this.dateUpdated; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - - if (o == null || getClass() != o.getClass()) { - return false; - } - - Knowledge other = (Knowledge) o; - - return ( - Objects.equals(description, other.description) && - Objects.equals(id, other.id) && - Objects.equals(accountSid, other.accountSid) && - Objects.equals( - knowledgeSourceDetails, - other.knowledgeSourceDetails - ) && - Objects.equals(name, other.name) && - Objects.equals(status, other.status) && - Objects.equals(type, other.type) && - Objects.equals(url, other.url) && - Objects.equals(embeddingModel, other.embeddingModel) && - Objects.equals(dateCreated, other.dateCreated) && - Objects.equals(dateUpdated, other.dateUpdated) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - description, - id, - accountSid, - knowledgeSourceDetails, - name, - status, - type, - url, - embeddingModel, - dateCreated, - dateUpdated - ); - } -} diff --git a/src/main/java/com/twilio/rest/knowledge/v1/KnowledgeDeleter.java b/src/main/java/com/twilio/rest/knowledge/v1/KnowledgeDeleter.java deleted file mode 100644 index 59804cdc4e..0000000000 --- a/src/main/java/com/twilio/rest/knowledge/v1/KnowledgeDeleter.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Knowledge - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.knowledge.v1; - -import com.twilio.base.Deleter; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class KnowledgeDeleter extends Deleter { - - private String pathId; - - public KnowledgeDeleter(final String pathId) { - this.pathId = pathId; - } - - @Override - public boolean delete(final TwilioRestClient client) { - String path = "/v1/Knowledge/{id}"; - - path = path.replace("{" + "id" + "}", this.pathId.toString()); - - Request request = new Request( - HttpMethod.DELETE, - Domains.KNOWLEDGE.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "Knowledge delete failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - return response.getStatusCode() == 204; - } -} diff --git a/src/main/java/com/twilio/rest/knowledge/v1/KnowledgeFetcher.java b/src/main/java/com/twilio/rest/knowledge/v1/KnowledgeFetcher.java deleted file mode 100644 index 5e7aea48b0..0000000000 --- a/src/main/java/com/twilio/rest/knowledge/v1/KnowledgeFetcher.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Knowledge - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.knowledge.v1; - -import com.twilio.base.Fetcher; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class KnowledgeFetcher extends Fetcher { - - private String pathId; - - public KnowledgeFetcher(final String pathId) { - this.pathId = pathId; - } - - @Override - public Knowledge fetch(final TwilioRestClient client) { - String path = "/v1/Knowledge/{id}"; - - path = path.replace("{" + "id" + "}", this.pathId.toString()); - - Request request = new Request( - HttpMethod.GET, - Domains.KNOWLEDGE.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "Knowledge fetch failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return Knowledge.fromJson( - response.getStream(), - client.getObjectMapper() - ); - } -} diff --git a/src/main/java/com/twilio/rest/knowledge/v1/KnowledgeReader.java b/src/main/java/com/twilio/rest/knowledge/v1/KnowledgeReader.java deleted file mode 100644 index f0d8abd0f5..0000000000 --- a/src/main/java/com/twilio/rest/knowledge/v1/KnowledgeReader.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Knowledge - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.knowledge.v1; - -import com.twilio.base.Page; -import com.twilio.base.Reader; -import com.twilio.base.ResourceSet; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class KnowledgeReader extends Reader { - - private Integer pageSize; - private String tags; - - public KnowledgeReader() {} - - public KnowledgeReader setPageSize(final Integer pageSize) { - this.pageSize = pageSize; - return this; - } - - public KnowledgeReader setTags(final String tags) { - this.tags = tags; - return this; - } - - @Override - public ResourceSet read(final TwilioRestClient client) { - return new ResourceSet<>(this, client, firstPage(client)); - } - - public Page firstPage(final TwilioRestClient client) { - String path = "/v1/Knowledge"; - - Request request = new Request( - HttpMethod.GET, - Domains.KNOWLEDGE.toString(), - path - ); - - addQueryParams(request); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - return pageForRequest(client, request); - } - - private Page pageForRequest( - final TwilioRestClient client, - final Request request - ) { - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "Knowledge read failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return Page.fromJson( - "knowledge", - response.getContent(), - Knowledge.class, - client.getObjectMapper() - ); - } - - @Override - public Page previousPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getPreviousPageUrl(Domains.KNOWLEDGE.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page nextPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getNextPageUrl(Domains.KNOWLEDGE.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page getPage( - final String targetUrl, - final TwilioRestClient client - ) { - Request request = new Request(HttpMethod.GET, targetUrl); - - return pageForRequest(client, request); - } - - private void addQueryParams(final Request request) { - if (pageSize != null) { - request.addQueryParam("PageSize", pageSize.toString()); - } - if (tags != null) { - request.addQueryParam("Tags", tags); - } - - if (getPageSize() != null) { - request.addQueryParam("PageSize", Integer.toString(getPageSize())); - } - } -} diff --git a/src/main/java/com/twilio/rest/knowledge/v1/knowledge/Chunk.java b/src/main/java/com/twilio/rest/knowledge/v1/knowledge/Chunk.java deleted file mode 100644 index b0336d7aa9..0000000000 --- a/src/main/java/com/twilio/rest/knowledge/v1/knowledge/Chunk.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Knowledge - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.knowledge.v1.knowledge; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.twilio.base.Resource; -import com.twilio.converter.DateConverter; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import java.io.IOException; -import java.io.InputStream; -import java.time.ZonedDateTime; -import java.util.Map; -import java.util.Map; -import java.util.Objects; -import lombok.ToString; -import lombok.ToString; - -@JsonIgnoreProperties(ignoreUnknown = true) -@ToString -public class Chunk extends Resource { - - private static final long serialVersionUID = 152804488582909L; - - public static ChunkReader reader(final String pathId) { - return new ChunkReader(pathId); - } - - /** - * Converts a JSON String into a Chunk object using the provided ObjectMapper. - * - * @param json Raw JSON String - * @param objectMapper Jackson ObjectMapper - * @return Chunk object represented by the provided JSON - */ - public static Chunk fromJson( - final String json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, Chunk.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - /** - * Converts a JSON InputStream into a Chunk object using the provided - * ObjectMapper. - * - * @param json Raw JSON InputStream - * @param objectMapper Jackson ObjectMapper - * @return Chunk object represented by the provided JSON - */ - public static Chunk fromJson( - final InputStream json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, Chunk.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - private final String accountSid; - private final String content; - private final Map metadata; - private final ZonedDateTime dateCreated; - private final ZonedDateTime dateUpdated; - - @JsonCreator - private Chunk( - @JsonProperty("account_sid") final String accountSid, - @JsonProperty("content") final String content, - @JsonProperty("metadata") final Map metadata, - @JsonProperty("date_created") final String dateCreated, - @JsonProperty("date_updated") final String dateUpdated - ) { - this.accountSid = accountSid; - this.content = content; - this.metadata = metadata; - this.dateCreated = DateConverter.iso8601DateTimeFromString(dateCreated); - this.dateUpdated = DateConverter.iso8601DateTimeFromString(dateUpdated); - } - - public final String getAccountSid() { - return this.accountSid; - } - - public final String getContent() { - return this.content; - } - - public final Map getMetadata() { - return this.metadata; - } - - public final ZonedDateTime getDateCreated() { - return this.dateCreated; - } - - public final ZonedDateTime getDateUpdated() { - return this.dateUpdated; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - - if (o == null || getClass() != o.getClass()) { - return false; - } - - Chunk other = (Chunk) o; - - return ( - Objects.equals(accountSid, other.accountSid) && - Objects.equals(content, other.content) && - Objects.equals(metadata, other.metadata) && - Objects.equals(dateCreated, other.dateCreated) && - Objects.equals(dateUpdated, other.dateUpdated) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - accountSid, - content, - metadata, - dateCreated, - dateUpdated - ); - } -} diff --git a/src/main/java/com/twilio/rest/knowledge/v1/knowledge/ChunkReader.java b/src/main/java/com/twilio/rest/knowledge/v1/knowledge/ChunkReader.java deleted file mode 100644 index bceed7b7f8..0000000000 --- a/src/main/java/com/twilio/rest/knowledge/v1/knowledge/ChunkReader.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Knowledge - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.knowledge.v1.knowledge; - -import com.twilio.base.Page; -import com.twilio.base.Reader; -import com.twilio.base.ResourceSet; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class ChunkReader extends Reader { - - private String pathId; - private Integer pageSize; - - public ChunkReader(final String pathId) { - this.pathId = pathId; - } - - public ChunkReader setPageSize(final Integer pageSize) { - this.pageSize = pageSize; - return this; - } - - @Override - public ResourceSet read(final TwilioRestClient client) { - return new ResourceSet<>(this, client, firstPage(client)); - } - - public Page firstPage(final TwilioRestClient client) { - String path = "/v1/Knowledge/{id}/Chunks"; - path = path.replace("{" + "id" + "}", this.pathId.toString()); - - Request request = new Request( - HttpMethod.GET, - Domains.KNOWLEDGE.toString(), - path - ); - - addQueryParams(request); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - return pageForRequest(client, request); - } - - private Page pageForRequest( - final TwilioRestClient client, - final Request request - ) { - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "Chunk read failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return Page.fromJson( - "chunks", - response.getContent(), - Chunk.class, - client.getObjectMapper() - ); - } - - @Override - public Page previousPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getPreviousPageUrl(Domains.KNOWLEDGE.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page nextPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getNextPageUrl(Domains.KNOWLEDGE.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page getPage( - final String targetUrl, - final TwilioRestClient client - ) { - Request request = new Request(HttpMethod.GET, targetUrl); - - return pageForRequest(client, request); - } - - private void addQueryParams(final Request request) { - if (pageSize != null) { - request.addQueryParam("PageSize", pageSize.toString()); - } - - if (getPageSize() != null) { - request.addQueryParam("PageSize", Integer.toString(getPageSize())); - } - } -} diff --git a/src/main/java/com/twilio/rest/knowledge/v1/knowledge/KnowledgeStatus.java b/src/main/java/com/twilio/rest/knowledge/v1/knowledge/KnowledgeStatus.java deleted file mode 100644 index ded378b2d8..0000000000 --- a/src/main/java/com/twilio/rest/knowledge/v1/knowledge/KnowledgeStatus.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Knowledge - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.knowledge.v1.knowledge; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.twilio.base.Resource; -import com.twilio.converter.DateConverter; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import java.io.IOException; -import java.io.InputStream; -import java.time.ZonedDateTime; -import java.util.Objects; -import lombok.ToString; -import lombok.ToString; - -@JsonIgnoreProperties(ignoreUnknown = true) -@ToString -public class KnowledgeStatus extends Resource { - - private static final long serialVersionUID = 178959927465400L; - - public static KnowledgeStatusFetcher fetcher(final String pathId) { - return new KnowledgeStatusFetcher(pathId); - } - - /** - * Converts a JSON String into a KnowledgeStatus object using the provided ObjectMapper. - * - * @param json Raw JSON String - * @param objectMapper Jackson ObjectMapper - * @return KnowledgeStatus object represented by the provided JSON - */ - public static KnowledgeStatus fromJson( - final String json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, KnowledgeStatus.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - /** - * Converts a JSON InputStream into a KnowledgeStatus object using the provided - * ObjectMapper. - * - * @param json Raw JSON InputStream - * @param objectMapper Jackson ObjectMapper - * @return KnowledgeStatus object represented by the provided JSON - */ - public static KnowledgeStatus fromJson( - final InputStream json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, KnowledgeStatus.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - private final String accountSid; - private final String status; - private final String lastStatus; - private final ZonedDateTime dateUpdated; - - @JsonCreator - private KnowledgeStatus( - @JsonProperty("account_sid") final String accountSid, - @JsonProperty("status") final String status, - @JsonProperty("last_status") final String lastStatus, - @JsonProperty("date_updated") final String dateUpdated - ) { - this.accountSid = accountSid; - this.status = status; - this.lastStatus = lastStatus; - this.dateUpdated = DateConverter.iso8601DateTimeFromString(dateUpdated); - } - - public final String getAccountSid() { - return this.accountSid; - } - - public final String getStatus() { - return this.status; - } - - public final String getLastStatus() { - return this.lastStatus; - } - - public final ZonedDateTime getDateUpdated() { - return this.dateUpdated; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - - if (o == null || getClass() != o.getClass()) { - return false; - } - - KnowledgeStatus other = (KnowledgeStatus) o; - - return ( - Objects.equals(accountSid, other.accountSid) && - Objects.equals(status, other.status) && - Objects.equals(lastStatus, other.lastStatus) && - Objects.equals(dateUpdated, other.dateUpdated) - ); - } - - @Override - public int hashCode() { - return Objects.hash(accountSid, status, lastStatus, dateUpdated); - } -} diff --git a/src/main/java/com/twilio/rest/knowledge/v1/knowledge/KnowledgeStatusFetcher.java b/src/main/java/com/twilio/rest/knowledge/v1/knowledge/KnowledgeStatusFetcher.java deleted file mode 100644 index 93c2e7bfb6..0000000000 --- a/src/main/java/com/twilio/rest/knowledge/v1/knowledge/KnowledgeStatusFetcher.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Knowledge - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.knowledge.v1.knowledge; - -import com.twilio.base.Fetcher; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class KnowledgeStatusFetcher extends Fetcher { - - private String pathId; - - public KnowledgeStatusFetcher(final String pathId) { - this.pathId = pathId; - } - - @Override - public KnowledgeStatus fetch(final TwilioRestClient client) { - String path = "/v1/Knowledge/{id}/Status"; - - path = path.replace("{" + "id" + "}", this.pathId.toString()); - - Request request = new Request( - HttpMethod.GET, - Domains.KNOWLEDGE.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "KnowledgeStatus fetch failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return KnowledgeStatus.fromJson( - response.getStream(), - client.getObjectMapper() - ); - } -} diff --git a/src/main/java/com/twilio/rest/lookups/v2/Bucket.java b/src/main/java/com/twilio/rest/lookups/v2/Bucket.java new file mode 100644 index 0000000000..221da7456a --- /dev/null +++ b/src/main/java/com/twilio/rest/lookups/v2/Bucket.java @@ -0,0 +1,209 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Lookups + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.twilio.rest.lookups.v2; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.twilio.base.Resource; +import com.twilio.exception.ApiConnectionException; +import com.twilio.exception.ApiException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Objects; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.ToString; + +@JsonIgnoreProperties(ignoreUnknown = true) +@ToString +public class Bucket extends Resource { + + private static final long serialVersionUID = 277677635778369L; + + @ToString + public static class RateLimitRequest { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("limit") + @Getter + @Setter + private Integer limit; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("ttl") + @Getter + @Setter + private Integer ttl; + + public RateLimitRequest() {} + + public static RateLimitRequest fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, RateLimitRequest.class); + } + } + + public static BucketDeleter deleter( + final String pathField, + final String pathBucket + ) { + return new BucketDeleter(pathField, pathBucket); + } + + public static BucketFetcher fetcher( + final String pathField, + final String pathBucket + ) { + return new BucketFetcher(pathField, pathBucket); + } + + public static BucketUpdater updater( + final String pathField, + final String pathBucket + ) { + return new BucketUpdater(pathField, pathBucket); + } + + /** + * Converts a JSON String into a Bucket object using the provided ObjectMapper. + * + * @param json Raw JSON String + * @param objectMapper Jackson ObjectMapper + * @return Bucket object represented by the provided JSON + */ + public static Bucket fromJson( + final String json, + final ObjectMapper objectMapper + ) { + // Convert all checked exceptions to Runtime + try { + return objectMapper.readValue(json, Bucket.class); + } catch (final JsonMappingException | JsonParseException e) { + throw new ApiException(e.getMessage(), e); + } catch (final IOException e) { + throw new ApiConnectionException(e.getMessage(), e); + } + } + + /** + * Converts a JSON InputStream into a Bucket object using the provided + * ObjectMapper. + * + * @param json Raw JSON InputStream + * @param objectMapper Jackson ObjectMapper + * @return Bucket object represented by the provided JSON + */ + public static Bucket fromJson( + final InputStream json, + final ObjectMapper objectMapper + ) { + // Convert all checked exceptions to Runtime + try { + return objectMapper.readValue(json, Bucket.class); + } catch (final JsonMappingException | JsonParseException e) { + throw new ApiException(e.getMessage(), e); + } catch (final IOException e) { + throw new ApiConnectionException(e.getMessage(), e); + } + } + + public static String toJson(Object object, ObjectMapper mapper) { + try { + return mapper.writeValueAsString(object); + } catch (final JsonMappingException e) { + throw new ApiException(e.getMessage(), e); + } catch (JsonProcessingException e) { + throw new ApiException(e.getMessage(), e); + } catch (final IOException e) { + throw new ApiConnectionException(e.getMessage(), e); + } + } + + private final String field; + private final Integer limit; + private final String bucket; + private final String owner; + private final Integer ttl; + + @JsonCreator + private Bucket( + @JsonProperty("field") final String field, + @JsonProperty("limit") final Integer limit, + @JsonProperty("bucket") final String bucket, + @JsonProperty("owner") final String owner, + @JsonProperty("ttl") final Integer ttl + ) { + this.field = field; + this.limit = limit; + this.bucket = bucket; + this.owner = owner; + this.ttl = ttl; + } + + public final String getField() { + return this.field; + } + + public final Integer getLimit() { + return this.limit; + } + + public final String getBucket() { + return this.bucket; + } + + public final String getOwner() { + return this.owner; + } + + public final Integer getTtl() { + return this.ttl; + } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + + if (o == null || getClass() != o.getClass()) { + return false; + } + + Bucket other = (Bucket) o; + + return ( + Objects.equals(field, other.field) && + Objects.equals(limit, other.limit) && + Objects.equals(bucket, other.bucket) && + Objects.equals(owner, other.owner) && + Objects.equals(ttl, other.ttl) + ); + } + + @Override + public int hashCode() { + return Objects.hash(field, limit, bucket, owner, ttl); + } +} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AccountConfigDeleter.java b/src/main/java/com/twilio/rest/lookups/v2/BucketDeleter.java similarity index 73% rename from src/main/java/com/twilio/rest/microvisor/v1/AccountConfigDeleter.java rename to src/main/java/com/twilio/rest/lookups/v2/BucketDeleter.java index 9529bba7b5..511751bad2 100644 --- a/src/main/java/com/twilio/rest/microvisor/v1/AccountConfigDeleter.java +++ b/src/main/java/com/twilio/rest/lookups/v2/BucketDeleter.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Microvisor + * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -package com.twilio.rest.microvisor.v1; +package com.twilio.rest.lookups.v2; import com.twilio.base.Deleter; import com.twilio.constant.EnumConstants; @@ -25,23 +25,26 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class AccountConfigDeleter extends Deleter { +public class BucketDeleter extends Deleter { - private String pathKey; + private String pathField; + private String pathBucket; - public AccountConfigDeleter(final String pathKey) { - this.pathKey = pathKey; + public BucketDeleter(final String pathField, final String pathBucket) { + this.pathField = pathField; + this.pathBucket = pathBucket; } @Override public boolean delete(final TwilioRestClient client) { - String path = "/v1/Configs/{Key}"; + String path = "/v2/RateLimits/Fields/{Field}/Bucket/{Bucket}"; - path = path.replace("{" + "Key" + "}", this.pathKey.toString()); + path = path.replace("{" + "Field" + "}", this.pathField.toString()); + path = path.replace("{" + "Bucket" + "}", this.pathBucket.toString()); Request request = new Request( HttpMethod.DELETE, - Domains.MICROVISOR.toString(), + Domains.LOOKUPS.toString(), path ); request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); @@ -49,7 +52,7 @@ public boolean delete(final TwilioRestClient client) { if (response == null) { throw new ApiConnectionException( - "AccountConfig delete failed: Unable to connect to server" + "Bucket delete failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( diff --git a/src/main/java/com/twilio/rest/microvisor/v1/DeviceFetcher.java b/src/main/java/com/twilio/rest/lookups/v2/BucketFetcher.java similarity index 69% rename from src/main/java/com/twilio/rest/microvisor/v1/DeviceFetcher.java rename to src/main/java/com/twilio/rest/lookups/v2/BucketFetcher.java index 6192902ea2..c73c369da4 100644 --- a/src/main/java/com/twilio/rest/microvisor/v1/DeviceFetcher.java +++ b/src/main/java/com/twilio/rest/lookups/v2/BucketFetcher.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Microvisor + * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -package com.twilio.rest.microvisor.v1; +package com.twilio.rest.lookups.v2; import com.twilio.base.Fetcher; import com.twilio.constant.EnumConstants; @@ -25,23 +25,26 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class DeviceFetcher extends Fetcher { +public class BucketFetcher extends Fetcher { - private String pathSid; + private String pathField; + private String pathBucket; - public DeviceFetcher(final String pathSid) { - this.pathSid = pathSid; + public BucketFetcher(final String pathField, final String pathBucket) { + this.pathField = pathField; + this.pathBucket = pathBucket; } @Override - public Device fetch(final TwilioRestClient client) { - String path = "/v1/Devices/{Sid}"; + public Bucket fetch(final TwilioRestClient client) { + String path = "/v2/RateLimits/Fields/{Field}/Bucket/{Bucket}"; - path = path.replace("{" + "Sid" + "}", this.pathSid.toString()); + path = path.replace("{" + "Field" + "}", this.pathField.toString()); + path = path.replace("{" + "Bucket" + "}", this.pathBucket.toString()); Request request = new Request( HttpMethod.GET, - Domains.MICROVISOR.toString(), + Domains.LOOKUPS.toString(), path ); request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); @@ -49,7 +52,7 @@ public Device fetch(final TwilioRestClient client) { if (response == null) { throw new ApiConnectionException( - "Device fetch failed: Unable to connect to server" + "Bucket fetch failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -65,6 +68,6 @@ public Device fetch(final TwilioRestClient client) { throw new ApiException(restException); } - return Device.fromJson(response.getStream(), client.getObjectMapper()); + return Bucket.fromJson(response.getStream(), client.getObjectMapper()); } } diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AccountConfigUpdater.java b/src/main/java/com/twilio/rest/lookups/v2/BucketUpdater.java similarity index 53% rename from src/main/java/com/twilio/rest/microvisor/v1/AccountConfigUpdater.java rename to src/main/java/com/twilio/rest/lookups/v2/BucketUpdater.java index 0c2c55a496..ebb98856f1 100644 --- a/src/main/java/com/twilio/rest/microvisor/v1/AccountConfigUpdater.java +++ b/src/main/java/com/twilio/rest/lookups/v2/BucketUpdater.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Microvisor + * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,8 +12,9 @@ * Do not edit the class manually. */ -package com.twilio.rest.microvisor.v1; +package com.twilio.rest.lookups.v2; +import com.fasterxml.jackson.databind.ObjectMapper; import com.twilio.base.Updater; import com.twilio.constant.EnumConstants; import com.twilio.exception.ApiConnectionException; @@ -25,39 +26,42 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class AccountConfigUpdater extends Updater { +public class BucketUpdater extends Updater { - private String pathKey; - private String value; + private String pathField; + private String pathBucket; + private Bucket.RateLimitRequest rateLimitRequest; - public AccountConfigUpdater(final String pathKey, final String value) { - this.pathKey = pathKey; - this.value = value; + public BucketUpdater(final String pathField, final String pathBucket) { + this.pathField = pathField; + this.pathBucket = pathBucket; } - public AccountConfigUpdater setValue(final String value) { - this.value = value; + public BucketUpdater setRateLimitRequest( + final Bucket.RateLimitRequest rateLimitRequest + ) { + this.rateLimitRequest = rateLimitRequest; return this; } @Override - public AccountConfig update(final TwilioRestClient client) { - String path = "/v1/Configs/{Key}"; + public Bucket update(final TwilioRestClient client) { + String path = "/v2/RateLimits/Fields/{Field}/Bucket/{Bucket}"; - path = path.replace("{" + "Key" + "}", this.pathKey.toString()); - path = path.replace("{" + "Value" + "}", this.value.toString()); + path = path.replace("{" + "Field" + "}", this.pathField.toString()); + path = path.replace("{" + "Bucket" + "}", this.pathBucket.toString()); Request request = new Request( - HttpMethod.POST, - Domains.MICROVISOR.toString(), + HttpMethod.PUT, + Domains.LOOKUPS.toString(), path ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - addPostParams(request); + request.setContentType(EnumConstants.ContentType.JSON); + addPostParams(request, client); Response response = client.request(request); if (response == null) { throw new ApiConnectionException( - "AccountConfig update failed: Unable to connect to server" + "Bucket update failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -73,15 +77,13 @@ public AccountConfig update(final TwilioRestClient client) { throw new ApiException(restException); } - return AccountConfig.fromJson( - response.getStream(), - client.getObjectMapper() - ); + return Bucket.fromJson(response.getStream(), client.getObjectMapper()); } - private void addPostParams(final Request request) { - if (value != null) { - request.addPostParam("Value", value); + private void addPostParams(final Request request, TwilioRestClient client) { + ObjectMapper objectMapper = client.getObjectMapper(); + if (rateLimitRequest != null) { + request.setBody(Bucket.toJson(rateLimitRequest, objectMapper)); } } } diff --git a/src/main/java/com/twilio/rest/lookups/v2/LookupOverride.java b/src/main/java/com/twilio/rest/lookups/v2/LookupOverride.java new file mode 100644 index 0000000000..2762094bfa --- /dev/null +++ b/src/main/java/com/twilio/rest/lookups/v2/LookupOverride.java @@ -0,0 +1,337 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Lookups + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.twilio.rest.lookups.v2; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.twilio.base.Resource; +import com.twilio.converter.DateConverter; +import com.twilio.converter.Promoter; +import com.twilio.exception.ApiConnectionException; +import com.twilio.exception.ApiException; +import java.io.IOException; +import java.io.InputStream; +import java.time.ZonedDateTime; +import java.util.Objects; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.ToString; + +@JsonIgnoreProperties(ignoreUnknown = true) +@ToString +public class LookupOverride extends Resource { + + private static final long serialVersionUID = 147188354779019L; + + @ToString + public static class OverridesRequest { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("line_type") + @Getter + @Setter + private LineTypeEnum lineType; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("reason") + @Getter + @Setter + private String reason; + + public OverridesRequest() {} + + public static OverridesRequest fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, OverridesRequest.class); + } + } + + public static LookupOverrideCreator creator( + final String pathField, + final String pathPhoneNumber + ) { + return new LookupOverrideCreator(pathField, pathPhoneNumber); + } + + public static LookupOverrideDeleter deleter( + final String pathField, + final String pathPhoneNumber + ) { + return new LookupOverrideDeleter(pathField, pathPhoneNumber); + } + + public static LookupOverrideFetcher fetcher( + final String pathField, + final String pathPhoneNumber + ) { + return new LookupOverrideFetcher(pathField, pathPhoneNumber); + } + + public static LookupOverrideUpdater updater( + final String pathField, + final String pathPhoneNumber + ) { + return new LookupOverrideUpdater(pathField, pathPhoneNumber); + } + + /** + * Converts a JSON String into a LookupOverride object using the provided ObjectMapper. + * + * @param json Raw JSON String + * @param objectMapper Jackson ObjectMapper + * @return LookupOverride object represented by the provided JSON + */ + public static LookupOverride fromJson( + final String json, + final ObjectMapper objectMapper + ) { + // Convert all checked exceptions to Runtime + try { + return objectMapper.readValue(json, LookupOverride.class); + } catch (final JsonMappingException | JsonParseException e) { + throw new ApiException(e.getMessage(), e); + } catch (final IOException e) { + throw new ApiConnectionException(e.getMessage(), e); + } + } + + /** + * Converts a JSON InputStream into a LookupOverride object using the provided + * ObjectMapper. + * + * @param json Raw JSON InputStream + * @param objectMapper Jackson ObjectMapper + * @return LookupOverride object represented by the provided JSON + */ + public static LookupOverride fromJson( + final InputStream json, + final ObjectMapper objectMapper + ) { + // Convert all checked exceptions to Runtime + try { + return objectMapper.readValue(json, LookupOverride.class); + } catch (final JsonMappingException | JsonParseException e) { + throw new ApiException(e.getMessage(), e); + } catch (final IOException e) { + throw new ApiConnectionException(e.getMessage(), e); + } + } + + public static String toJson(Object object, ObjectMapper mapper) { + try { + return mapper.writeValueAsString(object); + } catch (final JsonMappingException e) { + throw new ApiException(e.getMessage(), e); + } catch (JsonProcessingException e) { + throw new ApiException(e.getMessage(), e); + } catch (final IOException e) { + throw new ApiConnectionException(e.getMessage(), e); + } + } + + private final String phoneNumber; + private final LookupOverride.OriginalLineTypeEnum originalLineType; + private final LookupOverride.OverriddenLineTypeEnum overriddenLineType; + private final String overrideReason; + private final ZonedDateTime overrideTimestamp; + private final String overriddenByAccountSid; + + @JsonCreator + private LookupOverride( + @JsonProperty("phone_number") final String phoneNumber, + @JsonProperty( + "original_line_type" + ) final LookupOverride.OriginalLineTypeEnum originalLineType, + @JsonProperty( + "overridden_line_type" + ) final LookupOverride.OverriddenLineTypeEnum overriddenLineType, + @JsonProperty("override_reason") final String overrideReason, + @JsonProperty("override_timestamp") final String overrideTimestamp, + @JsonProperty( + "overridden_by_account_sid" + ) final String overriddenByAccountSid + ) { + this.phoneNumber = phoneNumber; + this.originalLineType = originalLineType; + this.overriddenLineType = overriddenLineType; + this.overrideReason = overrideReason; + this.overrideTimestamp = + DateConverter.iso8601DateTimeFromString(overrideTimestamp); + this.overriddenByAccountSid = overriddenByAccountSid; + } + + public final String getPhoneNumber() { + return this.phoneNumber; + } + + public final LookupOverride.OriginalLineTypeEnum getOriginalLineType() { + return this.originalLineType; + } + + public final LookupOverride.OverriddenLineTypeEnum getOverriddenLineType() { + return this.overriddenLineType; + } + + public final String getOverrideReason() { + return this.overrideReason; + } + + public final ZonedDateTime getOverrideTimestamp() { + return this.overrideTimestamp; + } + + public final String getOverriddenByAccountSid() { + return this.overriddenByAccountSid; + } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + + if (o == null || getClass() != o.getClass()) { + return false; + } + + LookupOverride other = (LookupOverride) o; + + return ( + Objects.equals(phoneNumber, other.phoneNumber) && + Objects.equals(originalLineType, other.originalLineType) && + Objects.equals(overriddenLineType, other.overriddenLineType) && + Objects.equals(overrideReason, other.overrideReason) && + Objects.equals(overrideTimestamp, other.overrideTimestamp) && + Objects.equals(overriddenByAccountSid, other.overriddenByAccountSid) + ); + } + + @Override + public int hashCode() { + return Objects.hash( + phoneNumber, + originalLineType, + overriddenLineType, + overrideReason, + overrideTimestamp, + overriddenByAccountSid + ); + } + + public enum OriginalLineTypeEnum { + MOBILE("mobile"), + LANDLINE("landline"), + TOLLFREE("tollFree"), + FIXEDVOIP("fixedVoip"), + NONFIXEDVOIP("nonFixedVoip"), + PERSONAL("personal"), + PREMIUM("premium"), + VOICEMAIL("voicemail"), + SHAREDCOST("sharedCost"), + UAN("uan"), + PAGER("pager"), + UNKNOWN("unknown"); + + private final String value; + + private OriginalLineTypeEnum(final String value) { + this.value = value; + } + + public String toString() { + return value; + } + + @JsonCreator + public static OriginalLineTypeEnum forValue(final String value) { + return Promoter.enumFromString( + value, + OriginalLineTypeEnum.values() + ); + } + } + + public enum OverriddenLineTypeEnum { + MOBILE("mobile"), + LANDLINE("landline"), + TOLLFREE("tollFree"), + FIXEDVOIP("fixedVoip"), + NONFIXEDVOIP("nonFixedVoip"), + PERSONAL("personal"), + PREMIUM("premium"), + VOICEMAIL("voicemail"), + SHAREDCOST("sharedCost"), + UAN("uan"), + PAGER("pager"), + UNKNOWN("unknown"); + + private final String value; + + private OverriddenLineTypeEnum(final String value) { + this.value = value; + } + + public String toString() { + return value; + } + + @JsonCreator + public static OverriddenLineTypeEnum forValue(final String value) { + return Promoter.enumFromString( + value, + OverriddenLineTypeEnum.values() + ); + } + } + + public enum LineTypeEnum { + MOBILE("mobile"), + LANDLINE("landline"), + TOLLFREE("tollFree"), + FIXEDVOIP("fixedVoip"), + NONFIXEDVOIP("nonFixedVoip"), + PERSONAL("personal"), + PREMIUM("premium"), + VOICEMAIL("voicemail"), + SHAREDCOST("sharedCost"), + UAN("uan"), + PAGER("pager"), + UNKNOWN("unknown"); + + private final String value; + + private LineTypeEnum(final String value) { + this.value = value; + } + + public String toString() { + return value; + } + + @JsonCreator + public static LineTypeEnum forValue(final String value) { + return Promoter.enumFromString(value, LineTypeEnum.values()); + } + } +} diff --git a/src/main/java/com/twilio/rest/knowledge/v1/KnowledgeCreator.java b/src/main/java/com/twilio/rest/lookups/v2/LookupOverrideCreator.java similarity index 61% rename from src/main/java/com/twilio/rest/knowledge/v1/KnowledgeCreator.java rename to src/main/java/com/twilio/rest/lookups/v2/LookupOverrideCreator.java index 943ed52437..bdc0dc5304 100644 --- a/src/main/java/com/twilio/rest/knowledge/v1/KnowledgeCreator.java +++ b/src/main/java/com/twilio/rest/lookups/v2/LookupOverrideCreator.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Knowledge + * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -package com.twilio.rest.knowledge.v1; +package com.twilio.rest.lookups.v2; import com.fasterxml.jackson.databind.ObjectMapper; import com.twilio.base.Creator; @@ -26,38 +26,41 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class KnowledgeCreator extends Creator { +public class LookupOverrideCreator extends Creator { - private Knowledge.KnowledgeV1ServiceCreateKnowledgeRequest knowledgeV1ServiceCreateKnowledgeRequest; + private String pathField; + private String pathPhoneNumber; + private LookupOverride.OverridesRequest overridesRequest; - public KnowledgeCreator( - final Knowledge.KnowledgeV1ServiceCreateKnowledgeRequest knowledgeV1ServiceCreateKnowledgeRequest + public LookupOverrideCreator( + final String pathField, + final String pathPhoneNumber ) { - this.knowledgeV1ServiceCreateKnowledgeRequest = - knowledgeV1ServiceCreateKnowledgeRequest; + this.pathField = pathField; + this.pathPhoneNumber = pathPhoneNumber; } - public KnowledgeCreator setKnowledgeV1ServiceCreateKnowledgeRequest( - final Knowledge.KnowledgeV1ServiceCreateKnowledgeRequest knowledgeV1ServiceCreateKnowledgeRequest + public LookupOverrideCreator setOverridesRequest( + final LookupOverride.OverridesRequest overridesRequest ) { - this.knowledgeV1ServiceCreateKnowledgeRequest = - knowledgeV1ServiceCreateKnowledgeRequest; + this.overridesRequest = overridesRequest; return this; } @Override - public Knowledge create(final TwilioRestClient client) { - String path = "/v1/Knowledge"; + public LookupOverride create(final TwilioRestClient client) { + String path = "/v2/PhoneNumbers/{PhoneNumber}/Overrides/{Field}"; + path = path.replace("{" + "Field" + "}", this.pathField.toString()); path = path.replace( - "{" + "KnowledgeV1ServiceCreateKnowledgeRequest" + "}", - this.knowledgeV1ServiceCreateKnowledgeRequest.toString() + "{" + "PhoneNumber" + "}", + this.pathPhoneNumber.toString() ); Request request = new Request( HttpMethod.POST, - Domains.KNOWLEDGE.toString(), + Domains.LOOKUPS.toString(), path ); request.setContentType(EnumConstants.ContentType.JSON); @@ -65,7 +68,7 @@ public Knowledge create(final TwilioRestClient client) { Response response = client.request(request); if (response == null) { throw new ApiConnectionException( - "Knowledge creation failed: Unable to connect to server" + "LookupOverride creation failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -81,7 +84,7 @@ public Knowledge create(final TwilioRestClient client) { throw new ApiException(restException); } - return Knowledge.fromJson( + return LookupOverride.fromJson( response.getStream(), client.getObjectMapper() ); @@ -89,12 +92,9 @@ public Knowledge create(final TwilioRestClient client) { private void addPostParams(final Request request, TwilioRestClient client) { ObjectMapper objectMapper = client.getObjectMapper(); - if (knowledgeV1ServiceCreateKnowledgeRequest != null) { + if (overridesRequest != null) { request.setBody( - Knowledge.toJson( - knowledgeV1ServiceCreateKnowledgeRequest, - objectMapper - ) + LookupOverride.toJson(overridesRequest, objectMapper) ); } } diff --git a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigDeleter.java b/src/main/java/com/twilio/rest/lookups/v2/LookupOverrideDeleter.java similarity index 71% rename from src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigDeleter.java rename to src/main/java/com/twilio/rest/lookups/v2/LookupOverrideDeleter.java index e471b64a72..7a13b9fcf0 100644 --- a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigDeleter.java +++ b/src/main/java/com/twilio/rest/lookups/v2/LookupOverrideDeleter.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Microvisor + * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -package com.twilio.rest.microvisor.v1.device; +package com.twilio.rest.lookups.v2; import com.twilio.base.Deleter; import com.twilio.constant.EnumConstants; @@ -25,33 +25,33 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class DeviceConfigDeleter extends Deleter { +public class LookupOverrideDeleter extends Deleter { - private String pathDeviceSid; - private String pathKey; + private String pathField; + private String pathPhoneNumber; - public DeviceConfigDeleter( - final String pathDeviceSid, - final String pathKey + public LookupOverrideDeleter( + final String pathField, + final String pathPhoneNumber ) { - this.pathDeviceSid = pathDeviceSid; - this.pathKey = pathKey; + this.pathField = pathField; + this.pathPhoneNumber = pathPhoneNumber; } @Override public boolean delete(final TwilioRestClient client) { - String path = "/v1/Devices/{DeviceSid}/Configs/{Key}"; + String path = "/v2/PhoneNumbers/{PhoneNumber}/Overrides/{Field}"; + path = path.replace("{" + "Field" + "}", this.pathField.toString()); path = path.replace( - "{" + "DeviceSid" + "}", - this.pathDeviceSid.toString() + "{" + "PhoneNumber" + "}", + this.pathPhoneNumber.toString() ); - path = path.replace("{" + "Key" + "}", this.pathKey.toString()); Request request = new Request( HttpMethod.DELETE, - Domains.MICROVISOR.toString(), + Domains.LOOKUPS.toString(), path ); request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); @@ -59,7 +59,7 @@ public boolean delete(final TwilioRestClient client) { if (response == null) { throw new ApiConnectionException( - "DeviceConfig delete failed: Unable to connect to server" + "LookupOverride delete failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( diff --git a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigFetcher.java b/src/main/java/com/twilio/rest/lookups/v2/LookupOverrideFetcher.java similarity index 68% rename from src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigFetcher.java rename to src/main/java/com/twilio/rest/lookups/v2/LookupOverrideFetcher.java index 3b0d148d4a..f345b4a4e4 100644 --- a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigFetcher.java +++ b/src/main/java/com/twilio/rest/lookups/v2/LookupOverrideFetcher.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Microvisor + * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -package com.twilio.rest.microvisor.v1.device; +package com.twilio.rest.lookups.v2; import com.twilio.base.Fetcher; import com.twilio.constant.EnumConstants; @@ -25,33 +25,33 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class DeviceConfigFetcher extends Fetcher { +public class LookupOverrideFetcher extends Fetcher { - private String pathDeviceSid; - private String pathKey; + private String pathField; + private String pathPhoneNumber; - public DeviceConfigFetcher( - final String pathDeviceSid, - final String pathKey + public LookupOverrideFetcher( + final String pathField, + final String pathPhoneNumber ) { - this.pathDeviceSid = pathDeviceSid; - this.pathKey = pathKey; + this.pathField = pathField; + this.pathPhoneNumber = pathPhoneNumber; } @Override - public DeviceConfig fetch(final TwilioRestClient client) { - String path = "/v1/Devices/{DeviceSid}/Configs/{Key}"; + public LookupOverride fetch(final TwilioRestClient client) { + String path = "/v2/PhoneNumbers/{PhoneNumber}/Overrides/{Field}"; + path = path.replace("{" + "Field" + "}", this.pathField.toString()); path = path.replace( - "{" + "DeviceSid" + "}", - this.pathDeviceSid.toString() + "{" + "PhoneNumber" + "}", + this.pathPhoneNumber.toString() ); - path = path.replace("{" + "Key" + "}", this.pathKey.toString()); Request request = new Request( HttpMethod.GET, - Domains.MICROVISOR.toString(), + Domains.LOOKUPS.toString(), path ); request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); @@ -59,7 +59,7 @@ public DeviceConfig fetch(final TwilioRestClient client) { if (response == null) { throw new ApiConnectionException( - "DeviceConfig fetch failed: Unable to connect to server" + "LookupOverride fetch failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -75,7 +75,7 @@ public DeviceConfig fetch(final TwilioRestClient client) { throw new ApiException(restException); } - return DeviceConfig.fromJson( + return LookupOverride.fromJson( response.getStream(), client.getObjectMapper() ); diff --git a/src/main/java/com/twilio/rest/knowledge/v1/KnowledgeUpdater.java b/src/main/java/com/twilio/rest/lookups/v2/LookupOverrideUpdater.java similarity index 63% rename from src/main/java/com/twilio/rest/knowledge/v1/KnowledgeUpdater.java rename to src/main/java/com/twilio/rest/lookups/v2/LookupOverrideUpdater.java index bfa6ca6ee5..5674e6110a 100644 --- a/src/main/java/com/twilio/rest/knowledge/v1/KnowledgeUpdater.java +++ b/src/main/java/com/twilio/rest/lookups/v2/LookupOverrideUpdater.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Knowledge + * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -package com.twilio.rest.knowledge.v1; +package com.twilio.rest.lookups.v2; import com.fasterxml.jackson.databind.ObjectMapper; import com.twilio.base.Updater; @@ -26,32 +26,41 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class KnowledgeUpdater extends Updater { +public class LookupOverrideUpdater extends Updater { - private String pathId; - private Knowledge.KnowledgeV1ServiceUpdateKnowledgeRequest knowledgeV1ServiceUpdateKnowledgeRequest; + private String pathField; + private String pathPhoneNumber; + private LookupOverride.OverridesRequest overridesRequest; - public KnowledgeUpdater(final String pathId) { - this.pathId = pathId; + public LookupOverrideUpdater( + final String pathField, + final String pathPhoneNumber + ) { + this.pathField = pathField; + this.pathPhoneNumber = pathPhoneNumber; } - public KnowledgeUpdater setKnowledgeV1ServiceUpdateKnowledgeRequest( - final Knowledge.KnowledgeV1ServiceUpdateKnowledgeRequest knowledgeV1ServiceUpdateKnowledgeRequest + public LookupOverrideUpdater setOverridesRequest( + final LookupOverride.OverridesRequest overridesRequest ) { - this.knowledgeV1ServiceUpdateKnowledgeRequest = - knowledgeV1ServiceUpdateKnowledgeRequest; + this.overridesRequest = overridesRequest; return this; } @Override - public Knowledge update(final TwilioRestClient client) { - String path = "/v1/Knowledge/{id}"; + public LookupOverride update(final TwilioRestClient client) { + String path = "/v2/PhoneNumbers/{PhoneNumber}/Overrides/{Field}"; - path = path.replace("{" + "id" + "}", this.pathId.toString()); + path = path.replace("{" + "Field" + "}", this.pathField.toString()); + path = + path.replace( + "{" + "PhoneNumber" + "}", + this.pathPhoneNumber.toString() + ); Request request = new Request( HttpMethod.PUT, - Domains.KNOWLEDGE.toString(), + Domains.LOOKUPS.toString(), path ); request.setContentType(EnumConstants.ContentType.JSON); @@ -59,7 +68,7 @@ public Knowledge update(final TwilioRestClient client) { Response response = client.request(request); if (response == null) { throw new ApiConnectionException( - "Knowledge update failed: Unable to connect to server" + "LookupOverride update failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -75,7 +84,7 @@ public Knowledge update(final TwilioRestClient client) { throw new ApiException(restException); } - return Knowledge.fromJson( + return LookupOverride.fromJson( response.getStream(), client.getObjectMapper() ); @@ -83,12 +92,9 @@ public Knowledge update(final TwilioRestClient client) { private void addPostParams(final Request request, TwilioRestClient client) { ObjectMapper objectMapper = client.getObjectMapper(); - if (knowledgeV1ServiceUpdateKnowledgeRequest != null) { + if (overridesRequest != null) { request.setBody( - Knowledge.toJson( - knowledgeV1ServiceUpdateKnowledgeRequest, - objectMapper - ) + LookupOverride.toJson(overridesRequest, objectMapper) ); } } diff --git a/src/main/java/com/twilio/rest/lookups/v2/PhoneNumber.java b/src/main/java/com/twilio/rest/lookups/v2/PhoneNumber.java index 4b25a770ee..0bed3d57d4 100644 --- a/src/main/java/com/twilio/rest/lookups/v2/PhoneNumber.java +++ b/src/main/java/com/twilio/rest/lookups/v2/PhoneNumber.java @@ -92,7 +92,7 @@ public static PhoneNumber fromJson( private final com.twilio.type.PhoneNumber phoneNumber; private final String nationalFormat; private final Boolean valid; - private final List validationErrors; + private final List validationErrors; private final Map callerName; private final Map simSwap; private final Map callForwarding; @@ -115,7 +115,7 @@ private PhoneNumber( @JsonProperty("national_format") final String nationalFormat, @JsonProperty("valid") final Boolean valid, @JsonProperty("validation_errors") final List< - ValidationError + PhoneNumber.ValidationError > validationErrors, @JsonProperty("caller_name") final Map callerName, @JsonProperty("sim_swap") final Map simSwap, @@ -183,7 +183,7 @@ public final Boolean getValid() { return this.valid; } - public final List getValidationErrors() { + public final List getValidationErrors() { return this.validationErrors; } diff --git a/src/main/java/com/twilio/rest/lookups/v2/Query.java b/src/main/java/com/twilio/rest/lookups/v2/Query.java new file mode 100644 index 0000000000..14e8748259 --- /dev/null +++ b/src/main/java/com/twilio/rest/lookups/v2/Query.java @@ -0,0 +1,799 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Lookups + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.twilio.rest.lookups.v2; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.twilio.base.Resource; +import com.twilio.converter.Promoter; +import com.twilio.exception.ApiConnectionException; +import com.twilio.exception.ApiException; +import java.io.IOException; +import java.io.InputStream; +import java.time.ZonedDateTime; +import java.util.List; +import java.util.Objects; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.ToString; + +@JsonIgnoreProperties(ignoreUnknown = true) +@ToString +public class Query extends Resource { + + private static final long serialVersionUID = 115616150775512L; + + @ToString + public static class IdentityMatchParameters { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("first_name") + @Getter + @Setter + private String firstName; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("last_name") + @Getter + @Setter + private String lastName; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("address_line1") + @Getter + @Setter + private String addressLine1; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("address_line2") + @Getter + @Setter + private String addressLine2; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("city") + @Getter + @Setter + private String city; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("state") + @Getter + @Setter + private String state; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("postal_code") + @Getter + @Setter + private String postalCode; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("address_country_code") + @Getter + @Setter + private String addressCountryCode; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("national_id") + @Getter + @Setter + private String nationalId; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("date_of_birth") + @Getter + @Setter + private String dateOfBirth; + + public static IdentityMatchParameters fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, IdentityMatchParameters.class); + } + } + + @ToString + public static class ReassignedNumberRequest { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("last_verified_date") + @Getter + @Setter + private String lastVerifiedDate; + + public static ReassignedNumberRequest fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, ReassignedNumberRequest.class); + } + } + + @ToString + public static class SmsPumpingRiskParameters { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("partner_sub_id") + @Getter + @Setter + private String partnerSubId; + + public static SmsPumpingRiskParameters fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, SmsPumpingRiskParameters.class); + } + } + + @ToString + public static class LookupRequestWithCorId { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("correlation_id") + @Getter + @Setter + private String correlationId; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("phone_number") + @Getter + @Setter + private String phoneNumber; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("fields") + @Getter + @Setter + private List fields; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("country_code") + @Getter + @Setter + private String countryCode; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("identity_match") + @Getter + @Setter + private IdentityMatchParameters identityMatch; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("reassigned_number") + @Getter + @Setter + private ReassignedNumberRequest reassignedNumber; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("sms_pumping_risk") + @Getter + @Setter + private SmsPumpingRiskParameters smsPumpingRisk; + + public static LookupRequestWithCorId fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, LookupRequestWithCorId.class); + } + } + + @ToString + public static class LookupRequest1 { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("phone_numbers") + @Getter + @Setter + private List phoneNumbers; + + public LookupRequest1() {} + + public static LookupRequest1 fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, LookupRequest1.class); + } + } + + @ToString + public static class CallerName { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("caller_name") + @Getter + @Setter + private String callerName; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("caller_type") + @Getter + @Setter + private String callerType; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("error_code") + @Getter + @Setter + private Integer errorCode; + + public static CallerName fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, CallerName.class); + } + } + + @ToString + public static class LastSimSwap { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("last_sim_swap_date") + @Getter + @Setter + private ZonedDateTime lastSimSwapDate; + + public String getLastSimSwapDate() { + return lastSimSwapDate.toInstant().toString(); + } + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("swapped_period") + @Getter + @Setter + private String swappedPeriod; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("swapped_in_period") + @Getter + @Setter + private Boolean swappedInPeriod; + + public static LastSimSwap fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, LastSimSwap.class); + } + } + + @ToString + public static class SimSwap { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("last_sim_swap") + @Getter + @Setter + private LastSimSwap lastSimSwap; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("carrier_name") + @Getter + @Setter + private String carrierName; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("mobile_country_code") + @Getter + @Setter + private String mobileCountryCode; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("mobile_network_code") + @Getter + @Setter + private String mobileNetworkCode; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("error_code") + @Getter + @Setter + private Integer errorCode; + + public static SimSwap fromJson(String jsonString, ObjectMapper mapper) + throws IOException { + return mapper.readValue(jsonString, SimSwap.class); + } + } + + @ToString + public static class CallForwarding { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("call_forwarding_enabled") + @Getter + @Setter + private Boolean callForwardingEnabled; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("error_code") + @Getter + @Setter + private Integer errorCode; + + public static CallForwarding fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, CallForwarding.class); + } + } + + @ToString + public static class LineTypeIntelligence { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("type") + @Getter + @Setter + private String type; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("carrier_name") + @Getter + @Setter + private String carrierName; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("mobile_country_code") + @Getter + @Setter + private String mobileCountryCode; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("mobile_network_code") + @Getter + @Setter + private String mobileNetworkCode; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("error_code") + @Getter + @Setter + private Integer errorCode; + + public static LineTypeIntelligence fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, LineTypeIntelligence.class); + } + } + + @ToString + public static class LineStatus { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("status") + @Getter + @Setter + private String status; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("error_code") + @Getter + @Setter + private Integer errorCode; + + public static LineStatus fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, LineStatus.class); + } + } + + @ToString + public static class IdentityMatch { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("first_name_match") + @Getter + @Setter + private String firstNameMatch; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("last_name_match") + @Getter + @Setter + private String lastNameMatch; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("address_line_match") + @Getter + @Setter + private String addressLineMatch; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("city_match") + @Getter + @Setter + private String cityMatch; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("state_match") + @Getter + @Setter + private String stateMatch; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("postal_code_match") + @Getter + @Setter + private String postalCodeMatch; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("country_code_match") + @Getter + @Setter + private String countryCodeMatch; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("national_id_match") + @Getter + @Setter + private String nationalIdMatch; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("date_of_birth_match") + @Getter + @Setter + private String dateOfBirthMatch; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("summary_score") + @Getter + @Setter + private Integer summaryScore; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("error_code") + @Getter + @Setter + private Integer errorCode; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("error_message") + @Getter + @Setter + private String errorMessage; + + public static IdentityMatch fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, IdentityMatch.class); + } + } + + @ToString + public static class ReassignedNumberResponse { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("last_verified_date") + @Getter + @Setter + private String lastVerifiedDate; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("is_number_reassigned") + @Getter + @Setter + private String isNumberReassigned; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("error_code") + @Getter + @Setter + private String errorCode; + + public static ReassignedNumberResponse fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, ReassignedNumberResponse.class); + } + } + + @ToString + public static class SmsPumpingRisk { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("carrier_risk_category") + @Getter + @Setter + private String carrierRiskCategory; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("number_blocked") + @Getter + @Setter + private Boolean numberBlocked; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("number_blocked_date") + @Getter + @Setter + private ZonedDateTime numberBlockedDate; + + public String getNumberBlockedDate() { + return numberBlockedDate.toInstant().toString(); + } + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("number_blocked_last_3_months") + @Getter + @Setter + private Boolean numberBlockedLast3Months; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("sms_pumping_risk_score") + @Getter + @Setter + private Integer smsPumpingRiskScore; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("error_code") + @Getter + @Setter + private Integer errorCode; + + public static SmsPumpingRisk fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, SmsPumpingRisk.class); + } + } + + @ToString + public static class LookupResponseWithCorId { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("correlation_id") + @Getter + @Setter + private String correlationId; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("twilio_error_code") + @Getter + @Setter + private Integer twilioErrorCode; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("calling_country_code") + @Getter + @Setter + private String callingCountryCode; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("country_code") + @Getter + @Setter + private String countryCode; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("phone_number") + @Getter + @Setter + private String phoneNumber; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("national_format") + @Getter + @Setter + private String nationalFormat; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("valid") + @Getter + @Setter + private Boolean valid; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("validation_errors") + @Getter + @Setter + private List validationErrors; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("caller_name") + @Getter + @Setter + private CallerName callerName; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("sim_swap") + @Getter + @Setter + private SimSwap simSwap; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("call_forwarding") + @Getter + @Setter + private CallForwarding callForwarding; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("line_type_intelligence") + @Getter + @Setter + private LineTypeIntelligence lineTypeIntelligence; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("line_status") + @Getter + @Setter + private LineStatus lineStatus; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("identity_match") + @Getter + @Setter + private IdentityMatch identityMatch; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("reassigned_number") + @Getter + @Setter + private ReassignedNumberResponse reassignedNumber; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("sms_pumping_risk") + @Getter + @Setter + private SmsPumpingRisk smsPumpingRisk; + + public static LookupResponseWithCorId fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, LookupResponseWithCorId.class); + } + } + + public static QueryCreator creator() { + return new QueryCreator(); + } + + /** + * Converts a JSON String into a Query object using the provided ObjectMapper. + * + * @param json Raw JSON String + * @param objectMapper Jackson ObjectMapper + * @return Query object represented by the provided JSON + */ + public static Query fromJson( + final String json, + final ObjectMapper objectMapper + ) { + // Convert all checked exceptions to Runtime + try { + return objectMapper.readValue(json, Query.class); + } catch (final JsonMappingException | JsonParseException e) { + throw new ApiException(e.getMessage(), e); + } catch (final IOException e) { + throw new ApiConnectionException(e.getMessage(), e); + } + } + + /** + * Converts a JSON InputStream into a Query object using the provided + * ObjectMapper. + * + * @param json Raw JSON InputStream + * @param objectMapper Jackson ObjectMapper + * @return Query object represented by the provided JSON + */ + public static Query fromJson( + final InputStream json, + final ObjectMapper objectMapper + ) { + // Convert all checked exceptions to Runtime + try { + return objectMapper.readValue(json, Query.class); + } catch (final JsonMappingException | JsonParseException e) { + throw new ApiException(e.getMessage(), e); + } catch (final IOException e) { + throw new ApiConnectionException(e.getMessage(), e); + } + } + + public static String toJson(Object object, ObjectMapper mapper) { + try { + return mapper.writeValueAsString(object); + } catch (final JsonMappingException e) { + throw new ApiException(e.getMessage(), e); + } catch (JsonProcessingException e) { + throw new ApiException(e.getMessage(), e); + } catch (final IOException e) { + throw new ApiConnectionException(e.getMessage(), e); + } + } + + private final List phoneNumbers; + + @JsonCreator + private Query( + @JsonProperty("phone_numbers") final List< + LookupResponseWithCorId + > phoneNumbers + ) { + this.phoneNumbers = phoneNumbers; + } + + public final List getPhoneNumbers() { + return this.phoneNumbers; + } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + + if (o == null || getClass() != o.getClass()) { + return false; + } + + Query other = (Query) o; + + return Objects.equals(phoneNumbers, other.phoneNumbers); + } + + @Override + public int hashCode() { + return Objects.hash(phoneNumbers); + } + + public enum FieldsEnum { + CALLER_NAME("caller_name"), + SIM_SWAP("sim_swap"), + CALL_FORWARDING("call_forwarding"), + LINE_TYPE_INTELLIGENCE("line_type_intelligence"), + LINE_STATUS("line_status"), + IDENTITY_MATCH("identity_match"), + REASSIGNED_NUMBER("reassigned_number"), + SMS_PUMPING_RISK("sms_pumping_risk"); + + private final String value; + + private FieldsEnum(final String value) { + this.value = value; + } + + public String toString() { + return value; + } + + @JsonCreator + public static FieldsEnum forValue(final String value) { + return Promoter.enumFromString(value, FieldsEnum.values()); + } + } +} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretDeleter.java b/src/main/java/com/twilio/rest/lookups/v2/QueryCreator.java similarity index 58% rename from src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretDeleter.java rename to src/main/java/com/twilio/rest/lookups/v2/QueryCreator.java index 992f623f57..e7481c28d8 100644 --- a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretDeleter.java +++ b/src/main/java/com/twilio/rest/lookups/v2/QueryCreator.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Microvisor + * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,9 +12,10 @@ * Do not edit the class manually. */ -package com.twilio.rest.microvisor.v1.device; +package com.twilio.rest.lookups.v2; -import com.twilio.base.Deleter; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.twilio.base.Creator; import com.twilio.constant.EnumConstants; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; @@ -25,41 +26,34 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class DeviceSecretDeleter extends Deleter { +public class QueryCreator extends Creator { - private String pathDeviceSid; - private String pathKey; + private Query.LookupRequest1 lookupRequest1; - public DeviceSecretDeleter( - final String pathDeviceSid, - final String pathKey + public QueryCreator() {} + + public QueryCreator setLookupRequest1( + final Query.LookupRequest1 lookupRequest1 ) { - this.pathDeviceSid = pathDeviceSid; - this.pathKey = pathKey; + this.lookupRequest1 = lookupRequest1; + return this; } @Override - public boolean delete(final TwilioRestClient client) { - String path = "/v1/Devices/{DeviceSid}/Secrets/{Key}"; - - path = - path.replace( - "{" + "DeviceSid" + "}", - this.pathDeviceSid.toString() - ); - path = path.replace("{" + "Key" + "}", this.pathKey.toString()); + public Query create(final TwilioRestClient client) { + String path = "/v2/batch/query"; Request request = new Request( - HttpMethod.DELETE, - Domains.MICROVISOR.toString(), + HttpMethod.POST, + Domains.LOOKUPS.toString(), path ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); + request.setContentType(EnumConstants.ContentType.JSON); + addPostParams(request, client); Response response = client.request(request); - if (response == null) { throw new ApiConnectionException( - "DeviceSecret delete failed: Unable to connect to server" + "Query creation failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -74,6 +68,14 @@ public boolean delete(final TwilioRestClient client) { } throw new ApiException(restException); } - return response.getStatusCode() == 204; + + return Query.fromJson(response.getStream(), client.getObjectMapper()); + } + + private void addPostParams(final Request request, TwilioRestClient client) { + ObjectMapper objectMapper = client.getObjectMapper(); + if (lookupRequest1 != null) { + request.setBody(Query.toJson(lookupRequest1, objectMapper)); + } } } diff --git a/src/main/java/com/twilio/rest/microvisor/v1/app/AppManifest.java b/src/main/java/com/twilio/rest/lookups/v2/RateLimit.java similarity index 52% rename from src/main/java/com/twilio/rest/microvisor/v1/app/AppManifest.java rename to src/main/java/com/twilio/rest/lookups/v2/RateLimit.java index 9beb04ce48..0551523fd0 100644 --- a/src/main/java/com/twilio/rest/microvisor/v1/app/AppManifest.java +++ b/src/main/java/com/twilio/rest/lookups/v2/RateLimit.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Microvisor + * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,10 +12,11 @@ * Do not edit the class manually. */ -package com.twilio.rest.microvisor.v1.app; +package com.twilio.rest.lookups.v2; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; @@ -25,35 +26,78 @@ import com.twilio.exception.ApiException; import java.io.IOException; import java.io.InputStream; -import java.net.URI; +import java.util.List; import java.util.Objects; +import lombok.Getter; +import lombok.Setter; import lombok.ToString; import lombok.ToString; @JsonIgnoreProperties(ignoreUnknown = true) @ToString -public class AppManifest extends Resource { - - private static final long serialVersionUID = 249809073531699L; +public class RateLimit extends Resource { + + private static final long serialVersionUID = 36869169584327L; + + @ToString + public static class RateLimitResponse { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("field") + @Getter + @Setter + private String field; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("limit") + @Getter + @Setter + private Integer limit; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("bucket") + @Getter + @Setter + private String bucket; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("owner") + @Getter + @Setter + private String owner; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + @JsonProperty("ttl") + @Getter + @Setter + private Integer ttl; + + public static RateLimitResponse fromJson( + String jsonString, + ObjectMapper mapper + ) throws IOException { + return mapper.readValue(jsonString, RateLimitResponse.class); + } + } - public static AppManifestFetcher fetcher(final String pathAppSid) { - return new AppManifestFetcher(pathAppSid); + public static RateLimitFetcher fetcher() { + return new RateLimitFetcher(); } /** - * Converts a JSON String into a AppManifest object using the provided ObjectMapper. + * Converts a JSON String into a RateLimit object using the provided ObjectMapper. * * @param json Raw JSON String * @param objectMapper Jackson ObjectMapper - * @return AppManifest object represented by the provided JSON + * @return RateLimit object represented by the provided JSON */ - public static AppManifest fromJson( + public static RateLimit fromJson( final String json, final ObjectMapper objectMapper ) { // Convert all checked exceptions to Runtime try { - return objectMapper.readValue(json, AppManifest.class); + return objectMapper.readValue(json, RateLimit.class); } catch (final JsonMappingException | JsonParseException e) { throw new ApiException(e.getMessage(), e); } catch (final IOException e) { @@ -62,20 +106,20 @@ public static AppManifest fromJson( } /** - * Converts a JSON InputStream into a AppManifest object using the provided + * Converts a JSON InputStream into a RateLimit object using the provided * ObjectMapper. * * @param json Raw JSON InputStream * @param objectMapper Jackson ObjectMapper - * @return AppManifest object represented by the provided JSON + * @return RateLimit object represented by the provided JSON */ - public static AppManifest fromJson( + public static RateLimit fromJson( final InputStream json, final ObjectMapper objectMapper ) { // Convert all checked exceptions to Runtime try { - return objectMapper.readValue(json, AppManifest.class); + return objectMapper.readValue(json, RateLimit.class); } catch (final JsonMappingException | JsonParseException e) { throw new ApiException(e.getMessage(), e); } catch (final IOException e) { @@ -83,38 +127,17 @@ public static AppManifest fromJson( } } - private final String appSid; - private final String hash; - private final String encodedBytes; - private final URI url; + private final List rateLimits; @JsonCreator - private AppManifest( - @JsonProperty("app_sid") final String appSid, - @JsonProperty("hash") final String hash, - @JsonProperty("encoded_bytes") final String encodedBytes, - @JsonProperty("url") final URI url + private RateLimit( + @JsonProperty("rate_limits") final List rateLimits ) { - this.appSid = appSid; - this.hash = hash; - this.encodedBytes = encodedBytes; - this.url = url; - } - - public final String getAppSid() { - return this.appSid; - } - - public final String getHash() { - return this.hash; - } - - public final String getEncodedBytes() { - return this.encodedBytes; + this.rateLimits = rateLimits; } - public final URI getUrl() { - return this.url; + public final List getRateLimits() { + return this.rateLimits; } @Override @@ -127,18 +150,13 @@ public boolean equals(final Object o) { return false; } - AppManifest other = (AppManifest) o; + RateLimit other = (RateLimit) o; - return ( - Objects.equals(appSid, other.appSid) && - Objects.equals(hash, other.hash) && - Objects.equals(encodedBytes, other.encodedBytes) && - Objects.equals(url, other.url) - ); + return Objects.equals(rateLimits, other.rateLimits); } @Override public int hashCode() { - return Objects.hash(appSid, hash, encodedBytes, url); + return Objects.hash(rateLimits); } } diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeFetcher.java b/src/main/java/com/twilio/rest/lookups/v2/RateLimitFetcher.java similarity index 65% rename from src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeFetcher.java rename to src/main/java/com/twilio/rest/lookups/v2/RateLimitFetcher.java index deeb66ca54..8d3e241b82 100644 --- a/src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeFetcher.java +++ b/src/main/java/com/twilio/rest/lookups/v2/RateLimitFetcher.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Proxy + * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,10 +12,11 @@ * Do not edit the class manually. */ -package com.twilio.rest.proxy.v1.service; +package com.twilio.rest.lookups.v2; import com.twilio.base.Fetcher; import com.twilio.constant.EnumConstants; +import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; import com.twilio.exception.RestException; @@ -24,39 +25,39 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; +import java.util.List; -public class ShortCodeFetcher extends Fetcher { +public class RateLimitFetcher extends Fetcher { - private String pathServiceSid; - private String pathSid; + private List fields; - public ShortCodeFetcher(final String pathServiceSid, final String pathSid) { - this.pathServiceSid = pathServiceSid; - this.pathSid = pathSid; + public RateLimitFetcher() {} + + public RateLimitFetcher setFields(final List fields) { + this.fields = fields; + return this; } - @Override - public ShortCode fetch(final TwilioRestClient client) { - String path = "/v1/Services/{ServiceSid}/ShortCodes/{Sid}"; + public RateLimitFetcher setFields(final String fields) { + return setFields(Promoter.listOfOne(fields)); + } - path = - path.replace( - "{" + "ServiceSid" + "}", - this.pathServiceSid.toString() - ); - path = path.replace("{" + "Sid" + "}", this.pathSid.toString()); + @Override + public RateLimit fetch(final TwilioRestClient client) { + String path = "/v2/RateLimits"; Request request = new Request( HttpMethod.GET, - Domains.PROXY.toString(), + Domains.LOOKUPS.toString(), path ); + addQueryParams(request); request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); Response response = client.request(request); if (response == null) { throw new ApiConnectionException( - "ShortCode fetch failed: Unable to connect to server" + "RateLimit fetch failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -72,9 +73,17 @@ public ShortCode fetch(final TwilioRestClient client) { throw new ApiException(restException); } - return ShortCode.fromJson( + return RateLimit.fromJson( response.getStream(), client.getObjectMapper() ); } + + private void addQueryParams(final Request request) { + if (fields != null) { + for (String prop : fields) { + request.addQueryParam("Fields", prop); + } + } + } } diff --git a/src/main/java/com/twilio/rest/marketplace/v1/ReferralConversion.java b/src/main/java/com/twilio/rest/marketplace/v1/ReferralConversion.java index 4210a1e21c..2981e42916 100644 --- a/src/main/java/com/twilio/rest/marketplace/v1/ReferralConversion.java +++ b/src/main/java/com/twilio/rest/marketplace/v1/ReferralConversion.java @@ -62,7 +62,7 @@ public static CreateReferralConversionRequest fromJson( } public static ReferralConversionCreator creator( - final CreateReferralConversionRequest createReferralConversionRequest + final ReferralConversion.CreateReferralConversionRequest createReferralConversionRequest ) { return new ReferralConversionCreator(createReferralConversionRequest); } diff --git a/src/main/java/com/twilio/rest/marketplace/v1/installedaddon/InstalledAddOnUsage.java b/src/main/java/com/twilio/rest/marketplace/v1/installedaddon/InstalledAddOnUsage.java index 02d957a065..26949939ae 100644 --- a/src/main/java/com/twilio/rest/marketplace/v1/installedaddon/InstalledAddOnUsage.java +++ b/src/main/java/com/twilio/rest/marketplace/v1/installedaddon/InstalledAddOnUsage.java @@ -111,7 +111,7 @@ public static MarketplaceV1InstalledAddOnInstalledAddOnUsage fromJson( public static InstalledAddOnUsageCreator creator( final String pathInstalledAddOnSid, - final MarketplaceV1InstalledAddOnInstalledAddOnUsage marketplaceV1InstalledAddOnInstalledAddOnUsage + final InstalledAddOnUsage.MarketplaceV1InstalledAddOnInstalledAddOnUsage marketplaceV1InstalledAddOnInstalledAddOnUsage ) { return new InstalledAddOnUsageCreator( pathInstalledAddOnSid, diff --git a/src/main/java/com/twilio/rest/messaging/v1/BrandRegistration.java b/src/main/java/com/twilio/rest/messaging/v1/BrandRegistration.java index a485f926b2..1f04545099 100644 --- a/src/main/java/com/twilio/rest/messaging/v1/BrandRegistration.java +++ b/src/main/java/com/twilio/rest/messaging/v1/BrandRegistration.java @@ -114,14 +114,14 @@ public static BrandRegistration fromJson( private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String brandType; - private final Status status; + private final BrandRegistration.Status status; private final String tcrId; private final String failureReason; private final List> errors; private final URI url; private final Integer brandScore; - private final List brandFeedback; - private final IdentityStatus identityStatus; + private final List brandFeedback; + private final BrandRegistration.IdentityStatus identityStatus; private final Boolean russell3000; private final Boolean governmentEntity; private final String taxExemptStatus; @@ -142,14 +142,18 @@ private BrandRegistration( @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("brand_type") final String brandType, - @JsonProperty("status") final Status status, + @JsonProperty("status") final BrandRegistration.Status status, @JsonProperty("tcr_id") final String tcrId, @JsonProperty("failure_reason") final String failureReason, @JsonProperty("errors") final List> errors, @JsonProperty("url") final URI url, @JsonProperty("brand_score") final Integer brandScore, - @JsonProperty("brand_feedback") final List brandFeedback, - @JsonProperty("identity_status") final IdentityStatus identityStatus, + @JsonProperty("brand_feedback") final List< + BrandRegistration.BrandFeedback + > brandFeedback, + @JsonProperty( + "identity_status" + ) final BrandRegistration.IdentityStatus identityStatus, @JsonProperty("russell3000") final Boolean russell3000, @JsonProperty("government_entity") final Boolean governmentEntity, @JsonProperty("tax_exempt_status") final String taxExemptStatus, @@ -210,7 +214,7 @@ public final String getBrandType() { return this.brandType; } - public final Status getStatus() { + public final BrandRegistration.Status getStatus() { return this.status; } @@ -234,11 +238,11 @@ public final Integer getBrandScore() { return this.brandScore; } - public final List getBrandFeedback() { + public final List getBrandFeedback() { return this.brandFeedback; } - public final IdentityStatus getIdentityStatus() { + public final BrandRegistration.IdentityStatus getIdentityStatus() { return this.identityStatus; } diff --git a/src/main/java/com/twilio/rest/messaging/v1/Service.java b/src/main/java/com/twilio/rest/messaging/v1/Service.java index 9d320105f4..3775bf4572 100644 --- a/src/main/java/com/twilio/rest/messaging/v1/Service.java +++ b/src/main/java/com/twilio/rest/messaging/v1/Service.java @@ -118,7 +118,7 @@ public static Service fromJson( private final Boolean stickySender; private final Boolean mmsConverter; private final Boolean smartEncoding; - private final ScanMessageContent scanMessageContent; + private final Service.ScanMessageContent scanMessageContent; private final Boolean fallbackToLongCode; private final Boolean areaCodeGeomatch; private final Boolean synchronousValidation; @@ -146,7 +146,7 @@ private Service( @JsonProperty("smart_encoding") final Boolean smartEncoding, @JsonProperty( "scan_message_content" - ) final ScanMessageContent scanMessageContent, + ) final Service.ScanMessageContent scanMessageContent, @JsonProperty("fallback_to_long_code") final Boolean fallbackToLongCode, @JsonProperty("area_code_geomatch") final Boolean areaCodeGeomatch, @JsonProperty( @@ -240,7 +240,7 @@ public final Boolean getSmartEncoding() { return this.smartEncoding; } - public final ScanMessageContent getScanMessageContent() { + public final Service.ScanMessageContent getScanMessageContent() { return this.scanMessageContent; } diff --git a/src/main/java/com/twilio/rest/messaging/v1/TollfreeVerification.java b/src/main/java/com/twilio/rest/messaging/v1/TollfreeVerification.java index 2a189ab49f..da3ddb6f84 100644 --- a/src/main/java/com/twilio/rest/messaging/v1/TollfreeVerification.java +++ b/src/main/java/com/twilio/rest/messaging/v1/TollfreeVerification.java @@ -50,7 +50,7 @@ public static TollfreeVerificationCreator creator( final String useCaseSummary, final String productionMessageSample, final List optInImageUrls, - final OptInType optInType, + final TollfreeVerification.OptInType optInType, final String messageVolume, final String tollfreePhoneNumberSid ) { @@ -151,11 +151,11 @@ public static TollfreeVerification fromJson( private final String useCaseSummary; private final String productionMessageSample; private final List optInImageUrls; - private final OptInType optInType; + private final TollfreeVerification.OptInType optInType; private final String messageVolume; private final String additionalInformation; private final String tollfreePhoneNumberSid; - private final Status status; + private final TollfreeVerification.Status status; private final URI url; private final String rejectionReason; private final Integer errorCode; @@ -209,7 +209,9 @@ private TollfreeVerification( "production_message_sample" ) final String productionMessageSample, @JsonProperty("opt_in_image_urls") final List optInImageUrls, - @JsonProperty("opt_in_type") final OptInType optInType, + @JsonProperty( + "opt_in_type" + ) final TollfreeVerification.OptInType optInType, @JsonProperty("message_volume") final String messageVolume, @JsonProperty( "additional_information" @@ -217,7 +219,7 @@ private TollfreeVerification( @JsonProperty( "tollfree_phone_number_sid" ) final String tollfreePhoneNumberSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final TollfreeVerification.Status status, @JsonProperty("url") final URI url, @JsonProperty("rejection_reason") final String rejectionReason, @JsonProperty("error_code") final Integer errorCode, @@ -365,7 +367,7 @@ public final List getOptInImageUrls() { return this.optInImageUrls; } - public final OptInType getOptInType() { + public final TollfreeVerification.OptInType getOptInType() { return this.optInType; } @@ -381,7 +383,7 @@ public final String getTollfreePhoneNumberSid() { return this.tollfreePhoneNumberSid; } - public final Status getStatus() { + public final TollfreeVerification.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/messaging/v1/brandregistration/BrandVetting.java b/src/main/java/com/twilio/rest/messaging/v1/brandregistration/BrandVetting.java index 8c284bbaf7..7d7f8526b5 100644 --- a/src/main/java/com/twilio/rest/messaging/v1/brandregistration/BrandVetting.java +++ b/src/main/java/com/twilio/rest/messaging/v1/brandregistration/BrandVetting.java @@ -41,7 +41,7 @@ public class BrandVetting extends Resource { public static BrandVettingCreator creator( final String pathBrandSid, - final VettingProvider vettingProvider + final BrandVetting.VettingProvider vettingProvider ) { return new BrandVettingCreator(pathBrandSid, vettingProvider); } @@ -108,7 +108,7 @@ public static BrandVetting fromJson( private final String vettingId; private final String vettingClass; private final String vettingStatus; - private final VettingProvider vettingProvider; + private final BrandVetting.VettingProvider vettingProvider; private final URI url; @JsonCreator @@ -121,7 +121,9 @@ private BrandVetting( @JsonProperty("vetting_id") final String vettingId, @JsonProperty("vetting_class") final String vettingClass, @JsonProperty("vetting_status") final String vettingStatus, - @JsonProperty("vetting_provider") final VettingProvider vettingProvider, + @JsonProperty( + "vetting_provider" + ) final BrandVetting.VettingProvider vettingProvider, @JsonProperty("url") final URI url ) { this.accountSid = accountSid; @@ -168,7 +170,7 @@ public final String getVettingStatus() { return this.vettingStatus; } - public final VettingProvider getVettingProvider() { + public final BrandVetting.VettingProvider getVettingProvider() { return this.vettingProvider; } diff --git a/src/main/java/com/twilio/rest/messaging/v2/ChannelsSender.java b/src/main/java/com/twilio/rest/messaging/v2/ChannelsSender.java index c2650d66d0..668b7a85cb 100644 --- a/src/main/java/com/twilio/rest/messaging/v2/ChannelsSender.java +++ b/src/main/java/com/twilio/rest/messaging/v2/ChannelsSender.java @@ -441,7 +441,7 @@ public static MessagingV2ChannelsSenderOfflineReasonsItems fromJson( } public static ChannelsSenderCreator creator( - final MessagingV2ChannelsSenderRequestsCreate messagingV2ChannelsSenderRequestsCreate + final ChannelsSender.MessagingV2ChannelsSenderRequestsCreate messagingV2ChannelsSenderRequestsCreate ) { return new ChannelsSenderCreator( messagingV2ChannelsSenderRequestsCreate @@ -520,7 +520,7 @@ public static String toJson(Object object, ObjectMapper mapper) { } private final String sid; - private final Status status; + private final ChannelsSender.Status status; private final String senderId; private final MessagingV2ChannelsSenderConfiguration configuration; private final MessagingV2ChannelsSenderWebhook webhook; @@ -534,7 +534,7 @@ public static String toJson(Object object, ObjectMapper mapper) { @JsonCreator private ChannelsSender( @JsonProperty("sid") final String sid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final ChannelsSender.Status status, @JsonProperty("sender_id") final String senderId, @JsonProperty( "configuration" @@ -566,7 +566,7 @@ public final String getSid() { return this.sid; } - public final Status getStatus() { + public final ChannelsSender.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AccountConfig.java b/src/main/java/com/twilio/rest/microvisor/v1/AccountConfig.java deleted file mode 100644 index f51341b9ef..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/AccountConfig.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.twilio.base.Resource; -import com.twilio.converter.DateConverter; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.time.ZonedDateTime; -import java.util.Objects; -import lombok.ToString; -import lombok.ToString; - -@JsonIgnoreProperties(ignoreUnknown = true) -@ToString -public class AccountConfig extends Resource { - - private static final long serialVersionUID = 212393375904180L; - - public static AccountConfigCreator creator( - final String key, - final String value - ) { - return new AccountConfigCreator(key, value); - } - - public static AccountConfigDeleter deleter(final String pathKey) { - return new AccountConfigDeleter(pathKey); - } - - public static AccountConfigFetcher fetcher(final String pathKey) { - return new AccountConfigFetcher(pathKey); - } - - public static AccountConfigReader reader() { - return new AccountConfigReader(); - } - - public static AccountConfigUpdater updater( - final String pathKey, - final String value - ) { - return new AccountConfigUpdater(pathKey, value); - } - - /** - * Converts a JSON String into a AccountConfig object using the provided ObjectMapper. - * - * @param json Raw JSON String - * @param objectMapper Jackson ObjectMapper - * @return AccountConfig object represented by the provided JSON - */ - public static AccountConfig fromJson( - final String json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, AccountConfig.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - /** - * Converts a JSON InputStream into a AccountConfig object using the provided - * ObjectMapper. - * - * @param json Raw JSON InputStream - * @param objectMapper Jackson ObjectMapper - * @return AccountConfig object represented by the provided JSON - */ - public static AccountConfig fromJson( - final InputStream json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, AccountConfig.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - private final String key; - private final ZonedDateTime dateUpdated; - private final String value; - private final URI url; - - @JsonCreator - private AccountConfig( - @JsonProperty("key") final String key, - @JsonProperty("date_updated") final String dateUpdated, - @JsonProperty("value") final String value, - @JsonProperty("url") final URI url - ) { - this.key = key; - this.dateUpdated = DateConverter.iso8601DateTimeFromString(dateUpdated); - this.value = value; - this.url = url; - } - - public final String getKey() { - return this.key; - } - - public final ZonedDateTime getDateUpdated() { - return this.dateUpdated; - } - - public final String getValue() { - return this.value; - } - - public final URI getUrl() { - return this.url; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - - if (o == null || getClass() != o.getClass()) { - return false; - } - - AccountConfig other = (AccountConfig) o; - - return ( - Objects.equals(key, other.key) && - Objects.equals(dateUpdated, other.dateUpdated) && - Objects.equals(value, other.value) && - Objects.equals(url, other.url) - ); - } - - @Override - public int hashCode() { - return Objects.hash(key, dateUpdated, value, url); - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AccountConfigCreator.java b/src/main/java/com/twilio/rest/microvisor/v1/AccountConfigCreator.java deleted file mode 100644 index 7070bac8d9..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/AccountConfigCreator.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.twilio.base.Creator; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class AccountConfigCreator extends Creator { - - private String key; - private String value; - - public AccountConfigCreator(final String key, final String value) { - this.key = key; - this.value = value; - } - - public AccountConfigCreator setKey(final String key) { - this.key = key; - return this; - } - - public AccountConfigCreator setValue(final String value) { - this.value = value; - return this; - } - - @Override - public AccountConfig create(final TwilioRestClient client) { - String path = "/v1/Configs"; - - path = path.replace("{" + "Key" + "}", this.key.toString()); - path = path.replace("{" + "Value" + "}", this.value.toString()); - - Request request = new Request( - HttpMethod.POST, - Domains.MICROVISOR.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - addPostParams(request); - Response response = client.request(request); - if (response == null) { - throw new ApiConnectionException( - "AccountConfig creation failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return AccountConfig.fromJson( - response.getStream(), - client.getObjectMapper() - ); - } - - private void addPostParams(final Request request) { - if (key != null) { - request.addPostParam("Key", key); - } - if (value != null) { - request.addPostParam("Value", value); - } - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AccountConfigFetcher.java b/src/main/java/com/twilio/rest/microvisor/v1/AccountConfigFetcher.java deleted file mode 100644 index 54949a068e..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/AccountConfigFetcher.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.twilio.base.Fetcher; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class AccountConfigFetcher extends Fetcher { - - private String pathKey; - - public AccountConfigFetcher(final String pathKey) { - this.pathKey = pathKey; - } - - @Override - public AccountConfig fetch(final TwilioRestClient client) { - String path = "/v1/Configs/{Key}"; - - path = path.replace("{" + "Key" + "}", this.pathKey.toString()); - - Request request = new Request( - HttpMethod.GET, - Domains.MICROVISOR.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "AccountConfig fetch failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return AccountConfig.fromJson( - response.getStream(), - client.getObjectMapper() - ); - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AccountConfigReader.java b/src/main/java/com/twilio/rest/microvisor/v1/AccountConfigReader.java deleted file mode 100644 index 5e68b1b2bd..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/AccountConfigReader.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.twilio.base.Page; -import com.twilio.base.Reader; -import com.twilio.base.ResourceSet; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class AccountConfigReader extends Reader { - - private Long pageSize; - - public AccountConfigReader() {} - - public AccountConfigReader setPageSize(final Long pageSize) { - this.pageSize = pageSize; - return this; - } - - @Override - public ResourceSet read(final TwilioRestClient client) { - return new ResourceSet<>(this, client, firstPage(client)); - } - - public Page firstPage(final TwilioRestClient client) { - String path = "/v1/Configs"; - - Request request = new Request( - HttpMethod.GET, - Domains.MICROVISOR.toString(), - path - ); - - addQueryParams(request); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - return pageForRequest(client, request); - } - - private Page pageForRequest( - final TwilioRestClient client, - final Request request - ) { - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "AccountConfig read failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return Page.fromJson( - "configs", - response.getContent(), - AccountConfig.class, - client.getObjectMapper() - ); - } - - @Override - public Page previousPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getPreviousPageUrl(Domains.MICROVISOR.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page nextPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getNextPageUrl(Domains.MICROVISOR.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page getPage( - final String targetUrl, - final TwilioRestClient client - ) { - Request request = new Request(HttpMethod.GET, targetUrl); - - return pageForRequest(client, request); - } - - private void addQueryParams(final Request request) { - if (pageSize != null) { - request.addQueryParam("PageSize", pageSize.toString()); - } - - if (getPageSize() != null) { - request.addQueryParam("PageSize", Integer.toString(getPageSize())); - } - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AccountSecret.java b/src/main/java/com/twilio/rest/microvisor/v1/AccountSecret.java deleted file mode 100644 index 65fab57e56..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/AccountSecret.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.twilio.base.Resource; -import com.twilio.converter.DateConverter; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.time.ZonedDateTime; -import java.util.Objects; -import lombok.ToString; -import lombok.ToString; - -@JsonIgnoreProperties(ignoreUnknown = true) -@ToString -public class AccountSecret extends Resource { - - private static final long serialVersionUID = 245444757442788L; - - public static AccountSecretCreator creator( - final String key, - final String value - ) { - return new AccountSecretCreator(key, value); - } - - public static AccountSecretDeleter deleter(final String pathKey) { - return new AccountSecretDeleter(pathKey); - } - - public static AccountSecretFetcher fetcher(final String pathKey) { - return new AccountSecretFetcher(pathKey); - } - - public static AccountSecretReader reader() { - return new AccountSecretReader(); - } - - public static AccountSecretUpdater updater( - final String pathKey, - final String value - ) { - return new AccountSecretUpdater(pathKey, value); - } - - /** - * Converts a JSON String into a AccountSecret object using the provided ObjectMapper. - * - * @param json Raw JSON String - * @param objectMapper Jackson ObjectMapper - * @return AccountSecret object represented by the provided JSON - */ - public static AccountSecret fromJson( - final String json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, AccountSecret.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - /** - * Converts a JSON InputStream into a AccountSecret object using the provided - * ObjectMapper. - * - * @param json Raw JSON InputStream - * @param objectMapper Jackson ObjectMapper - * @return AccountSecret object represented by the provided JSON - */ - public static AccountSecret fromJson( - final InputStream json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, AccountSecret.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - private final String key; - private final ZonedDateTime dateRotated; - private final URI url; - - @JsonCreator - private AccountSecret( - @JsonProperty("key") final String key, - @JsonProperty("date_rotated") final String dateRotated, - @JsonProperty("url") final URI url - ) { - this.key = key; - this.dateRotated = DateConverter.iso8601DateTimeFromString(dateRotated); - this.url = url; - } - - public final String getKey() { - return this.key; - } - - public final ZonedDateTime getDateRotated() { - return this.dateRotated; - } - - public final URI getUrl() { - return this.url; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - - if (o == null || getClass() != o.getClass()) { - return false; - } - - AccountSecret other = (AccountSecret) o; - - return ( - Objects.equals(key, other.key) && - Objects.equals(dateRotated, other.dateRotated) && - Objects.equals(url, other.url) - ); - } - - @Override - public int hashCode() { - return Objects.hash(key, dateRotated, url); - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AccountSecretCreator.java b/src/main/java/com/twilio/rest/microvisor/v1/AccountSecretCreator.java deleted file mode 100644 index 2652846681..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/AccountSecretCreator.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.twilio.base.Creator; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class AccountSecretCreator extends Creator { - - private String key; - private String value; - - public AccountSecretCreator(final String key, final String value) { - this.key = key; - this.value = value; - } - - public AccountSecretCreator setKey(final String key) { - this.key = key; - return this; - } - - public AccountSecretCreator setValue(final String value) { - this.value = value; - return this; - } - - @Override - public AccountSecret create(final TwilioRestClient client) { - String path = "/v1/Secrets"; - - path = path.replace("{" + "Key" + "}", this.key.toString()); - path = path.replace("{" + "Value" + "}", this.value.toString()); - - Request request = new Request( - HttpMethod.POST, - Domains.MICROVISOR.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - addPostParams(request); - Response response = client.request(request); - if (response == null) { - throw new ApiConnectionException( - "AccountSecret creation failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return AccountSecret.fromJson( - response.getStream(), - client.getObjectMapper() - ); - } - - private void addPostParams(final Request request) { - if (key != null) { - request.addPostParam("Key", key); - } - if (value != null) { - request.addPostParam("Value", value); - } - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AccountSecretDeleter.java b/src/main/java/com/twilio/rest/microvisor/v1/AccountSecretDeleter.java deleted file mode 100644 index c427b71904..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/AccountSecretDeleter.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.twilio.base.Deleter; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class AccountSecretDeleter extends Deleter { - - private String pathKey; - - public AccountSecretDeleter(final String pathKey) { - this.pathKey = pathKey; - } - - @Override - public boolean delete(final TwilioRestClient client) { - String path = "/v1/Secrets/{Key}"; - - path = path.replace("{" + "Key" + "}", this.pathKey.toString()); - - Request request = new Request( - HttpMethod.DELETE, - Domains.MICROVISOR.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "AccountSecret delete failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - return response.getStatusCode() == 204; - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AccountSecretReader.java b/src/main/java/com/twilio/rest/microvisor/v1/AccountSecretReader.java deleted file mode 100644 index eeeccfb5f1..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/AccountSecretReader.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.twilio.base.Page; -import com.twilio.base.Reader; -import com.twilio.base.ResourceSet; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class AccountSecretReader extends Reader { - - private Long pageSize; - - public AccountSecretReader() {} - - public AccountSecretReader setPageSize(final Long pageSize) { - this.pageSize = pageSize; - return this; - } - - @Override - public ResourceSet read(final TwilioRestClient client) { - return new ResourceSet<>(this, client, firstPage(client)); - } - - public Page firstPage(final TwilioRestClient client) { - String path = "/v1/Secrets"; - - Request request = new Request( - HttpMethod.GET, - Domains.MICROVISOR.toString(), - path - ); - - addQueryParams(request); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - return pageForRequest(client, request); - } - - private Page pageForRequest( - final TwilioRestClient client, - final Request request - ) { - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "AccountSecret read failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return Page.fromJson( - "secrets", - response.getContent(), - AccountSecret.class, - client.getObjectMapper() - ); - } - - @Override - public Page previousPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getPreviousPageUrl(Domains.MICROVISOR.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page nextPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getNextPageUrl(Domains.MICROVISOR.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page getPage( - final String targetUrl, - final TwilioRestClient client - ) { - Request request = new Request(HttpMethod.GET, targetUrl); - - return pageForRequest(client, request); - } - - private void addQueryParams(final Request request) { - if (pageSize != null) { - request.addQueryParam("PageSize", pageSize.toString()); - } - - if (getPageSize() != null) { - request.addQueryParam("PageSize", Integer.toString(getPageSize())); - } - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/App.java b/src/main/java/com/twilio/rest/microvisor/v1/App.java deleted file mode 100644 index 23827af572..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/App.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.twilio.base.Resource; -import com.twilio.converter.DateConverter; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.time.ZonedDateTime; -import java.util.Map; -import java.util.Map; -import java.util.Objects; -import lombok.ToString; -import lombok.ToString; - -@JsonIgnoreProperties(ignoreUnknown = true) -@ToString -public class App extends Resource { - - private static final long serialVersionUID = 223120562272974L; - - public static AppDeleter deleter(final String pathSid) { - return new AppDeleter(pathSid); - } - - public static AppFetcher fetcher(final String pathSid) { - return new AppFetcher(pathSid); - } - - public static AppReader reader() { - return new AppReader(); - } - - /** - * Converts a JSON String into a App object using the provided ObjectMapper. - * - * @param json Raw JSON String - * @param objectMapper Jackson ObjectMapper - * @return App object represented by the provided JSON - */ - public static App fromJson( - final String json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, App.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - /** - * Converts a JSON InputStream into a App object using the provided - * ObjectMapper. - * - * @param json Raw JSON InputStream - * @param objectMapper Jackson ObjectMapper - * @return App object represented by the provided JSON - */ - public static App fromJson( - final InputStream json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, App.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - private final String sid; - private final String accountSid; - private final String hash; - private final String uniqueName; - private final ZonedDateTime dateCreated; - private final ZonedDateTime dateUpdated; - private final URI url; - private final Map links; - - @JsonCreator - private App( - @JsonProperty("sid") final String sid, - @JsonProperty("account_sid") final String accountSid, - @JsonProperty("hash") final String hash, - @JsonProperty("unique_name") final String uniqueName, - @JsonProperty("date_created") final String dateCreated, - @JsonProperty("date_updated") final String dateUpdated, - @JsonProperty("url") final URI url, - @JsonProperty("links") final Map links - ) { - this.sid = sid; - this.accountSid = accountSid; - this.hash = hash; - this.uniqueName = uniqueName; - this.dateCreated = DateConverter.iso8601DateTimeFromString(dateCreated); - this.dateUpdated = DateConverter.iso8601DateTimeFromString(dateUpdated); - this.url = url; - this.links = links; - } - - public final String getSid() { - return this.sid; - } - - public final String getAccountSid() { - return this.accountSid; - } - - public final String getHash() { - return this.hash; - } - - public final String getUniqueName() { - return this.uniqueName; - } - - public final ZonedDateTime getDateCreated() { - return this.dateCreated; - } - - public final ZonedDateTime getDateUpdated() { - return this.dateUpdated; - } - - public final URI getUrl() { - return this.url; - } - - public final Map getLinks() { - return this.links; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - - if (o == null || getClass() != o.getClass()) { - return false; - } - - App other = (App) o; - - return ( - Objects.equals(sid, other.sid) && - Objects.equals(accountSid, other.accountSid) && - Objects.equals(hash, other.hash) && - Objects.equals(uniqueName, other.uniqueName) && - Objects.equals(dateCreated, other.dateCreated) && - Objects.equals(dateUpdated, other.dateUpdated) && - Objects.equals(url, other.url) && - Objects.equals(links, other.links) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - sid, - accountSid, - hash, - uniqueName, - dateCreated, - dateUpdated, - url, - links - ); - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AppDeleter.java b/src/main/java/com/twilio/rest/microvisor/v1/AppDeleter.java deleted file mode 100644 index ee834cbce9..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/AppDeleter.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.twilio.base.Deleter; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class AppDeleter extends Deleter { - - private String pathSid; - - public AppDeleter(final String pathSid) { - this.pathSid = pathSid; - } - - @Override - public boolean delete(final TwilioRestClient client) { - String path = "/v1/Apps/{Sid}"; - - path = path.replace("{" + "Sid" + "}", this.pathSid.toString()); - - Request request = new Request( - HttpMethod.DELETE, - Domains.MICROVISOR.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "App delete failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - return response.getStatusCode() == 204; - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AppFetcher.java b/src/main/java/com/twilio/rest/microvisor/v1/AppFetcher.java deleted file mode 100644 index e5f7fb789a..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/AppFetcher.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.twilio.base.Fetcher; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class AppFetcher extends Fetcher { - - private String pathSid; - - public AppFetcher(final String pathSid) { - this.pathSid = pathSid; - } - - @Override - public App fetch(final TwilioRestClient client) { - String path = "/v1/Apps/{Sid}"; - - path = path.replace("{" + "Sid" + "}", this.pathSid.toString()); - - Request request = new Request( - HttpMethod.GET, - Domains.MICROVISOR.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "App fetch failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return App.fromJson(response.getStream(), client.getObjectMapper()); - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AppReader.java b/src/main/java/com/twilio/rest/microvisor/v1/AppReader.java deleted file mode 100644 index 2c0d0efdf5..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/AppReader.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.twilio.base.Page; -import com.twilio.base.Reader; -import com.twilio.base.ResourceSet; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class AppReader extends Reader { - - private Long pageSize; - - public AppReader() {} - - public AppReader setPageSize(final Long pageSize) { - this.pageSize = pageSize; - return this; - } - - @Override - public ResourceSet read(final TwilioRestClient client) { - return new ResourceSet<>(this, client, firstPage(client)); - } - - public Page firstPage(final TwilioRestClient client) { - String path = "/v1/Apps"; - - Request request = new Request( - HttpMethod.GET, - Domains.MICROVISOR.toString(), - path - ); - - addQueryParams(request); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - return pageForRequest(client, request); - } - - private Page pageForRequest( - final TwilioRestClient client, - final Request request - ) { - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "App read failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return Page.fromJson( - "apps", - response.getContent(), - App.class, - client.getObjectMapper() - ); - } - - @Override - public Page previousPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getPreviousPageUrl(Domains.MICROVISOR.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page nextPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getNextPageUrl(Domains.MICROVISOR.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page getPage( - final String targetUrl, - final TwilioRestClient client - ) { - Request request = new Request(HttpMethod.GET, targetUrl); - - return pageForRequest(client, request); - } - - private void addQueryParams(final Request request) { - if (pageSize != null) { - request.addQueryParam("PageSize", pageSize.toString()); - } - - if (getPageSize() != null) { - request.addQueryParam("PageSize", Integer.toString(getPageSize())); - } - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/Device.java b/src/main/java/com/twilio/rest/microvisor/v1/Device.java deleted file mode 100644 index 6775341645..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/Device.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.twilio.base.Resource; -import com.twilio.converter.DateConverter; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.time.ZonedDateTime; -import java.util.Map; -import java.util.Map; -import java.util.Objects; -import lombok.ToString; -import lombok.ToString; - -@JsonIgnoreProperties(ignoreUnknown = true) -@ToString -public class Device extends Resource { - - private static final long serialVersionUID = 266652017538801L; - - public static DeviceFetcher fetcher(final String pathSid) { - return new DeviceFetcher(pathSid); - } - - public static DeviceReader reader() { - return new DeviceReader(); - } - - public static DeviceUpdater updater(final String pathSid) { - return new DeviceUpdater(pathSid); - } - - /** - * Converts a JSON String into a Device object using the provided ObjectMapper. - * - * @param json Raw JSON String - * @param objectMapper Jackson ObjectMapper - * @return Device object represented by the provided JSON - */ - public static Device fromJson( - final String json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, Device.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - /** - * Converts a JSON InputStream into a Device object using the provided - * ObjectMapper. - * - * @param json Raw JSON InputStream - * @param objectMapper Jackson ObjectMapper - * @return Device object represented by the provided JSON - */ - public static Device fromJson( - final InputStream json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, Device.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - private final String sid; - private final String uniqueName; - private final String accountSid; - private final Map app; - private final Map logging; - private final ZonedDateTime dateCreated; - private final ZonedDateTime dateUpdated; - private final URI url; - private final Map links; - - @JsonCreator - private Device( - @JsonProperty("sid") final String sid, - @JsonProperty("unique_name") final String uniqueName, - @JsonProperty("account_sid") final String accountSid, - @JsonProperty("app") final Map app, - @JsonProperty("logging") final Map logging, - @JsonProperty("date_created") final String dateCreated, - @JsonProperty("date_updated") final String dateUpdated, - @JsonProperty("url") final URI url, - @JsonProperty("links") final Map links - ) { - this.sid = sid; - this.uniqueName = uniqueName; - this.accountSid = accountSid; - this.app = app; - this.logging = logging; - this.dateCreated = DateConverter.iso8601DateTimeFromString(dateCreated); - this.dateUpdated = DateConverter.iso8601DateTimeFromString(dateUpdated); - this.url = url; - this.links = links; - } - - public final String getSid() { - return this.sid; - } - - public final String getUniqueName() { - return this.uniqueName; - } - - public final String getAccountSid() { - return this.accountSid; - } - - public final Map getApp() { - return this.app; - } - - public final Map getLogging() { - return this.logging; - } - - public final ZonedDateTime getDateCreated() { - return this.dateCreated; - } - - public final ZonedDateTime getDateUpdated() { - return this.dateUpdated; - } - - public final URI getUrl() { - return this.url; - } - - public final Map getLinks() { - return this.links; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - - if (o == null || getClass() != o.getClass()) { - return false; - } - - Device other = (Device) o; - - return ( - Objects.equals(sid, other.sid) && - Objects.equals(uniqueName, other.uniqueName) && - Objects.equals(accountSid, other.accountSid) && - Objects.equals(app, other.app) && - Objects.equals(logging, other.logging) && - Objects.equals(dateCreated, other.dateCreated) && - Objects.equals(dateUpdated, other.dateUpdated) && - Objects.equals(url, other.url) && - Objects.equals(links, other.links) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - sid, - uniqueName, - accountSid, - app, - logging, - dateCreated, - dateUpdated, - url, - links - ); - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/DeviceUpdater.java b/src/main/java/com/twilio/rest/microvisor/v1/DeviceUpdater.java deleted file mode 100644 index 4c451aa3c0..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/DeviceUpdater.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1; - -import com.twilio.base.Updater; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class DeviceUpdater extends Updater { - - private String pathSid; - private String uniqueName; - private String targetApp; - private Boolean loggingEnabled; - private Boolean restartApp; - - public DeviceUpdater(final String pathSid) { - this.pathSid = pathSid; - } - - public DeviceUpdater setUniqueName(final String uniqueName) { - this.uniqueName = uniqueName; - return this; - } - - public DeviceUpdater setTargetApp(final String targetApp) { - this.targetApp = targetApp; - return this; - } - - public DeviceUpdater setLoggingEnabled(final Boolean loggingEnabled) { - this.loggingEnabled = loggingEnabled; - return this; - } - - public DeviceUpdater setRestartApp(final Boolean restartApp) { - this.restartApp = restartApp; - return this; - } - - @Override - public Device update(final TwilioRestClient client) { - String path = "/v1/Devices/{Sid}"; - - path = path.replace("{" + "Sid" + "}", this.pathSid.toString()); - - Request request = new Request( - HttpMethod.POST, - Domains.MICROVISOR.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - addPostParams(request); - Response response = client.request(request); - if (response == null) { - throw new ApiConnectionException( - "Device update failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return Device.fromJson(response.getStream(), client.getObjectMapper()); - } - - private void addPostParams(final Request request) { - if (uniqueName != null) { - request.addPostParam("UniqueName", uniqueName); - } - if (targetApp != null) { - request.addPostParam("TargetApp", targetApp); - } - if (loggingEnabled != null) { - request.addPostParam("LoggingEnabled", loggingEnabled.toString()); - } - if (restartApp != null) { - request.addPostParam("RestartApp", restartApp.toString()); - } - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/app/AppManifestFetcher.java b/src/main/java/com/twilio/rest/microvisor/v1/app/AppManifestFetcher.java deleted file mode 100644 index 296b8d3a0a..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/app/AppManifestFetcher.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1.app; - -import com.twilio.base.Fetcher; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class AppManifestFetcher extends Fetcher { - - private String pathAppSid; - - public AppManifestFetcher(final String pathAppSid) { - this.pathAppSid = pathAppSid; - } - - @Override - public AppManifest fetch(final TwilioRestClient client) { - String path = "/v1/Apps/{AppSid}/Manifest"; - - path = path.replace("{" + "AppSid" + "}", this.pathAppSid.toString()); - - Request request = new Request( - HttpMethod.GET, - Domains.MICROVISOR.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "AppManifest fetch failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return AppManifest.fromJson( - response.getStream(), - client.getObjectMapper() - ); - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfig.java b/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfig.java deleted file mode 100644 index 3574a6e773..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfig.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1.device; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.twilio.base.Resource; -import com.twilio.converter.DateConverter; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.time.ZonedDateTime; -import java.util.Objects; -import lombok.ToString; -import lombok.ToString; - -@JsonIgnoreProperties(ignoreUnknown = true) -@ToString -public class DeviceConfig extends Resource { - - private static final long serialVersionUID = 4121523224128L; - - public static DeviceConfigCreator creator( - final String pathDeviceSid, - final String key, - final String value - ) { - return new DeviceConfigCreator(pathDeviceSid, key, value); - } - - public static DeviceConfigDeleter deleter( - final String pathDeviceSid, - final String pathKey - ) { - return new DeviceConfigDeleter(pathDeviceSid, pathKey); - } - - public static DeviceConfigFetcher fetcher( - final String pathDeviceSid, - final String pathKey - ) { - return new DeviceConfigFetcher(pathDeviceSid, pathKey); - } - - public static DeviceConfigReader reader(final String pathDeviceSid) { - return new DeviceConfigReader(pathDeviceSid); - } - - public static DeviceConfigUpdater updater( - final String pathDeviceSid, - final String pathKey, - final String value - ) { - return new DeviceConfigUpdater(pathDeviceSid, pathKey, value); - } - - /** - * Converts a JSON String into a DeviceConfig object using the provided ObjectMapper. - * - * @param json Raw JSON String - * @param objectMapper Jackson ObjectMapper - * @return DeviceConfig object represented by the provided JSON - */ - public static DeviceConfig fromJson( - final String json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, DeviceConfig.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - /** - * Converts a JSON InputStream into a DeviceConfig object using the provided - * ObjectMapper. - * - * @param json Raw JSON InputStream - * @param objectMapper Jackson ObjectMapper - * @return DeviceConfig object represented by the provided JSON - */ - public static DeviceConfig fromJson( - final InputStream json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, DeviceConfig.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - private final String deviceSid; - private final String key; - private final String value; - private final ZonedDateTime dateUpdated; - private final URI url; - - @JsonCreator - private DeviceConfig( - @JsonProperty("device_sid") final String deviceSid, - @JsonProperty("key") final String key, - @JsonProperty("value") final String value, - @JsonProperty("date_updated") final String dateUpdated, - @JsonProperty("url") final URI url - ) { - this.deviceSid = deviceSid; - this.key = key; - this.value = value; - this.dateUpdated = DateConverter.iso8601DateTimeFromString(dateUpdated); - this.url = url; - } - - public final String getDeviceSid() { - return this.deviceSid; - } - - public final String getKey() { - return this.key; - } - - public final String getValue() { - return this.value; - } - - public final ZonedDateTime getDateUpdated() { - return this.dateUpdated; - } - - public final URI getUrl() { - return this.url; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - - if (o == null || getClass() != o.getClass()) { - return false; - } - - DeviceConfig other = (DeviceConfig) o; - - return ( - Objects.equals(deviceSid, other.deviceSid) && - Objects.equals(key, other.key) && - Objects.equals(value, other.value) && - Objects.equals(dateUpdated, other.dateUpdated) && - Objects.equals(url, other.url) - ); - } - - @Override - public int hashCode() { - return Objects.hash(deviceSid, key, value, dateUpdated, url); - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigCreator.java b/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigCreator.java deleted file mode 100644 index badaac3ead..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigCreator.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1.device; - -import com.twilio.base.Creator; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class DeviceConfigCreator extends Creator { - - private String pathDeviceSid; - private String key; - private String value; - - public DeviceConfigCreator( - final String pathDeviceSid, - final String key, - final String value - ) { - this.pathDeviceSid = pathDeviceSid; - this.key = key; - this.value = value; - } - - public DeviceConfigCreator setKey(final String key) { - this.key = key; - return this; - } - - public DeviceConfigCreator setValue(final String value) { - this.value = value; - return this; - } - - @Override - public DeviceConfig create(final TwilioRestClient client) { - String path = "/v1/Devices/{DeviceSid}/Configs"; - - path = - path.replace( - "{" + "DeviceSid" + "}", - this.pathDeviceSid.toString() - ); - path = path.replace("{" + "Key" + "}", this.key.toString()); - path = path.replace("{" + "Value" + "}", this.value.toString()); - - Request request = new Request( - HttpMethod.POST, - Domains.MICROVISOR.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - addPostParams(request); - Response response = client.request(request); - if (response == null) { - throw new ApiConnectionException( - "DeviceConfig creation failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return DeviceConfig.fromJson( - response.getStream(), - client.getObjectMapper() - ); - } - - private void addPostParams(final Request request) { - if (key != null) { - request.addPostParam("Key", key); - } - if (value != null) { - request.addPostParam("Value", value); - } - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigReader.java b/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigReader.java deleted file mode 100644 index aa855c227d..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigReader.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1.device; - -import com.twilio.base.Page; -import com.twilio.base.Reader; -import com.twilio.base.ResourceSet; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class DeviceConfigReader extends Reader { - - private String pathDeviceSid; - private Long pageSize; - - public DeviceConfigReader(final String pathDeviceSid) { - this.pathDeviceSid = pathDeviceSid; - } - - public DeviceConfigReader setPageSize(final Long pageSize) { - this.pageSize = pageSize; - return this; - } - - @Override - public ResourceSet read(final TwilioRestClient client) { - return new ResourceSet<>(this, client, firstPage(client)); - } - - public Page firstPage(final TwilioRestClient client) { - String path = "/v1/Devices/{DeviceSid}/Configs"; - path = - path.replace( - "{" + "DeviceSid" + "}", - this.pathDeviceSid.toString() - ); - - Request request = new Request( - HttpMethod.GET, - Domains.MICROVISOR.toString(), - path - ); - - addQueryParams(request); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - return pageForRequest(client, request); - } - - private Page pageForRequest( - final TwilioRestClient client, - final Request request - ) { - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "DeviceConfig read failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return Page.fromJson( - "configs", - response.getContent(), - DeviceConfig.class, - client.getObjectMapper() - ); - } - - @Override - public Page previousPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getPreviousPageUrl(Domains.MICROVISOR.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page nextPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getNextPageUrl(Domains.MICROVISOR.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page getPage( - final String targetUrl, - final TwilioRestClient client - ) { - Request request = new Request(HttpMethod.GET, targetUrl); - - return pageForRequest(client, request); - } - - private void addQueryParams(final Request request) { - if (pageSize != null) { - request.addQueryParam("PageSize", pageSize.toString()); - } - - if (getPageSize() != null) { - request.addQueryParam("PageSize", Integer.toString(getPageSize())); - } - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigUpdater.java b/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigUpdater.java deleted file mode 100644 index d2f55627e1..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceConfigUpdater.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1.device; - -import com.twilio.base.Updater; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class DeviceConfigUpdater extends Updater { - - private String pathDeviceSid; - private String pathKey; - private String value; - - public DeviceConfigUpdater( - final String pathDeviceSid, - final String pathKey, - final String value - ) { - this.pathDeviceSid = pathDeviceSid; - this.pathKey = pathKey; - this.value = value; - } - - public DeviceConfigUpdater setValue(final String value) { - this.value = value; - return this; - } - - @Override - public DeviceConfig update(final TwilioRestClient client) { - String path = "/v1/Devices/{DeviceSid}/Configs/{Key}"; - - path = - path.replace( - "{" + "DeviceSid" + "}", - this.pathDeviceSid.toString() - ); - path = path.replace("{" + "Key" + "}", this.pathKey.toString()); - path = path.replace("{" + "Value" + "}", this.value.toString()); - - Request request = new Request( - HttpMethod.POST, - Domains.MICROVISOR.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - addPostParams(request); - Response response = client.request(request); - if (response == null) { - throw new ApiConnectionException( - "DeviceConfig update failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return DeviceConfig.fromJson( - response.getStream(), - client.getObjectMapper() - ); - } - - private void addPostParams(final Request request) { - if (value != null) { - request.addPostParam("Value", value); - } - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecret.java b/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecret.java deleted file mode 100644 index 36e7e8916a..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecret.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1.device; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.twilio.base.Resource; -import com.twilio.converter.DateConverter; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.time.ZonedDateTime; -import java.util.Objects; -import lombok.ToString; -import lombok.ToString; - -@JsonIgnoreProperties(ignoreUnknown = true) -@ToString -public class DeviceSecret extends Resource { - - private static final long serialVersionUID = 4318157927104L; - - public static DeviceSecretCreator creator( - final String pathDeviceSid, - final String key, - final String value - ) { - return new DeviceSecretCreator(pathDeviceSid, key, value); - } - - public static DeviceSecretDeleter deleter( - final String pathDeviceSid, - final String pathKey - ) { - return new DeviceSecretDeleter(pathDeviceSid, pathKey); - } - - public static DeviceSecretFetcher fetcher( - final String pathDeviceSid, - final String pathKey - ) { - return new DeviceSecretFetcher(pathDeviceSid, pathKey); - } - - public static DeviceSecretReader reader(final String pathDeviceSid) { - return new DeviceSecretReader(pathDeviceSid); - } - - public static DeviceSecretUpdater updater( - final String pathDeviceSid, - final String pathKey, - final String value - ) { - return new DeviceSecretUpdater(pathDeviceSid, pathKey, value); - } - - /** - * Converts a JSON String into a DeviceSecret object using the provided ObjectMapper. - * - * @param json Raw JSON String - * @param objectMapper Jackson ObjectMapper - * @return DeviceSecret object represented by the provided JSON - */ - public static DeviceSecret fromJson( - final String json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, DeviceSecret.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - /** - * Converts a JSON InputStream into a DeviceSecret object using the provided - * ObjectMapper. - * - * @param json Raw JSON InputStream - * @param objectMapper Jackson ObjectMapper - * @return DeviceSecret object represented by the provided JSON - */ - public static DeviceSecret fromJson( - final InputStream json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, DeviceSecret.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - private final String deviceSid; - private final String key; - private final ZonedDateTime dateRotated; - private final URI url; - - @JsonCreator - private DeviceSecret( - @JsonProperty("device_sid") final String deviceSid, - @JsonProperty("key") final String key, - @JsonProperty("date_rotated") final String dateRotated, - @JsonProperty("url") final URI url - ) { - this.deviceSid = deviceSid; - this.key = key; - this.dateRotated = DateConverter.iso8601DateTimeFromString(dateRotated); - this.url = url; - } - - public final String getDeviceSid() { - return this.deviceSid; - } - - public final String getKey() { - return this.key; - } - - public final ZonedDateTime getDateRotated() { - return this.dateRotated; - } - - public final URI getUrl() { - return this.url; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - - if (o == null || getClass() != o.getClass()) { - return false; - } - - DeviceSecret other = (DeviceSecret) o; - - return ( - Objects.equals(deviceSid, other.deviceSid) && - Objects.equals(key, other.key) && - Objects.equals(dateRotated, other.dateRotated) && - Objects.equals(url, other.url) - ); - } - - @Override - public int hashCode() { - return Objects.hash(deviceSid, key, dateRotated, url); - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretCreator.java b/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretCreator.java deleted file mode 100644 index 33e07b238c..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretCreator.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1.device; - -import com.twilio.base.Creator; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class DeviceSecretCreator extends Creator { - - private String pathDeviceSid; - private String key; - private String value; - - public DeviceSecretCreator( - final String pathDeviceSid, - final String key, - final String value - ) { - this.pathDeviceSid = pathDeviceSid; - this.key = key; - this.value = value; - } - - public DeviceSecretCreator setKey(final String key) { - this.key = key; - return this; - } - - public DeviceSecretCreator setValue(final String value) { - this.value = value; - return this; - } - - @Override - public DeviceSecret create(final TwilioRestClient client) { - String path = "/v1/Devices/{DeviceSid}/Secrets"; - - path = - path.replace( - "{" + "DeviceSid" + "}", - this.pathDeviceSid.toString() - ); - path = path.replace("{" + "Key" + "}", this.key.toString()); - path = path.replace("{" + "Value" + "}", this.value.toString()); - - Request request = new Request( - HttpMethod.POST, - Domains.MICROVISOR.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - addPostParams(request); - Response response = client.request(request); - if (response == null) { - throw new ApiConnectionException( - "DeviceSecret creation failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return DeviceSecret.fromJson( - response.getStream(), - client.getObjectMapper() - ); - } - - private void addPostParams(final Request request) { - if (key != null) { - request.addPostParam("Key", key); - } - if (value != null) { - request.addPostParam("Value", value); - } - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretFetcher.java b/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretFetcher.java deleted file mode 100644 index 363d966e83..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretFetcher.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1.device; - -import com.twilio.base.Fetcher; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class DeviceSecretFetcher extends Fetcher { - - private String pathDeviceSid; - private String pathKey; - - public DeviceSecretFetcher( - final String pathDeviceSid, - final String pathKey - ) { - this.pathDeviceSid = pathDeviceSid; - this.pathKey = pathKey; - } - - @Override - public DeviceSecret fetch(final TwilioRestClient client) { - String path = "/v1/Devices/{DeviceSid}/Secrets/{Key}"; - - path = - path.replace( - "{" + "DeviceSid" + "}", - this.pathDeviceSid.toString() - ); - path = path.replace("{" + "Key" + "}", this.pathKey.toString()); - - Request request = new Request( - HttpMethod.GET, - Domains.MICROVISOR.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "DeviceSecret fetch failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return DeviceSecret.fromJson( - response.getStream(), - client.getObjectMapper() - ); - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretReader.java b/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretReader.java deleted file mode 100644 index 4eb5e21ae8..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretReader.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1.device; - -import com.twilio.base.Page; -import com.twilio.base.Reader; -import com.twilio.base.ResourceSet; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class DeviceSecretReader extends Reader { - - private String pathDeviceSid; - private Long pageSize; - - public DeviceSecretReader(final String pathDeviceSid) { - this.pathDeviceSid = pathDeviceSid; - } - - public DeviceSecretReader setPageSize(final Long pageSize) { - this.pageSize = pageSize; - return this; - } - - @Override - public ResourceSet read(final TwilioRestClient client) { - return new ResourceSet<>(this, client, firstPage(client)); - } - - public Page firstPage(final TwilioRestClient client) { - String path = "/v1/Devices/{DeviceSid}/Secrets"; - path = - path.replace( - "{" + "DeviceSid" + "}", - this.pathDeviceSid.toString() - ); - - Request request = new Request( - HttpMethod.GET, - Domains.MICROVISOR.toString(), - path - ); - - addQueryParams(request); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - return pageForRequest(client, request); - } - - private Page pageForRequest( - final TwilioRestClient client, - final Request request - ) { - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "DeviceSecret read failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return Page.fromJson( - "secrets", - response.getContent(), - DeviceSecret.class, - client.getObjectMapper() - ); - } - - @Override - public Page previousPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getPreviousPageUrl(Domains.MICROVISOR.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page nextPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getNextPageUrl(Domains.MICROVISOR.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page getPage( - final String targetUrl, - final TwilioRestClient client - ) { - Request request = new Request(HttpMethod.GET, targetUrl); - - return pageForRequest(client, request); - } - - private void addQueryParams(final Request request) { - if (pageSize != null) { - request.addQueryParam("PageSize", pageSize.toString()); - } - - if (getPageSize() != null) { - request.addQueryParam("PageSize", Integer.toString(getPageSize())); - } - } -} diff --git a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretUpdater.java b/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretUpdater.java deleted file mode 100644 index ec9105b461..0000000000 --- a/src/main/java/com/twilio/rest/microvisor/v1/device/DeviceSecretUpdater.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Microvisor - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.microvisor.v1.device; - -import com.twilio.base.Updater; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class DeviceSecretUpdater extends Updater { - - private String pathDeviceSid; - private String pathKey; - private String value; - - public DeviceSecretUpdater( - final String pathDeviceSid, - final String pathKey, - final String value - ) { - this.pathDeviceSid = pathDeviceSid; - this.pathKey = pathKey; - this.value = value; - } - - public DeviceSecretUpdater setValue(final String value) { - this.value = value; - return this; - } - - @Override - public DeviceSecret update(final TwilioRestClient client) { - String path = "/v1/Devices/{DeviceSid}/Secrets/{Key}"; - - path = - path.replace( - "{" + "DeviceSid" + "}", - this.pathDeviceSid.toString() - ); - path = path.replace("{" + "Key" + "}", this.pathKey.toString()); - path = path.replace("{" + "Value" + "}", this.value.toString()); - - Request request = new Request( - HttpMethod.POST, - Domains.MICROVISOR.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - addPostParams(request); - Response response = client.request(request); - if (response == null) { - throw new ApiConnectionException( - "DeviceSecret update failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return DeviceSecret.fromJson( - response.getStream(), - client.getObjectMapper() - ); - } - - private void addPostParams(final Request request) { - if (value != null) { - request.addPostParam("Value", value); - } - } -} diff --git a/src/main/java/com/twilio/rest/notify/v1/Credential.java b/src/main/java/com/twilio/rest/notify/v1/Credential.java index 26d2e47199..316599eb29 100644 --- a/src/main/java/com/twilio/rest/notify/v1/Credential.java +++ b/src/main/java/com/twilio/rest/notify/v1/Credential.java @@ -39,7 +39,7 @@ public class Credential extends Resource { private static final long serialVersionUID = 161183169234848L; - public static CredentialCreator creator(final PushService type) { + public static CredentialCreator creator(final Credential.PushService type) { return new CredentialCreator(type); } @@ -105,7 +105,7 @@ public static Credential fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final PushService type; + private final Credential.PushService type; private final String sandbox; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -116,7 +116,7 @@ private Credential( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final PushService type, + @JsonProperty("type") final Credential.PushService type, @JsonProperty("sandbox") final String sandbox, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final PushService getType() { + public final Credential.PushService getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/notify/v1/service/Binding.java b/src/main/java/com/twilio/rest/notify/v1/service/Binding.java index e5d9cf47db..a61e6c16e0 100644 --- a/src/main/java/com/twilio/rest/notify/v1/service/Binding.java +++ b/src/main/java/com/twilio/rest/notify/v1/service/Binding.java @@ -45,7 +45,7 @@ public class Binding extends Resource { public static BindingCreator creator( final String pathServiceSid, final String identity, - final BindingType bindingType, + final Binding.BindingType bindingType, final String address ) { return new BindingCreator( diff --git a/src/main/java/com/twilio/rest/notify/v1/service/Notification.java b/src/main/java/com/twilio/rest/notify/v1/service/Notification.java index 2fd78f20f6..432641c6cb 100644 --- a/src/main/java/com/twilio/rest/notify/v1/service/Notification.java +++ b/src/main/java/com/twilio/rest/notify/v1/service/Notification.java @@ -95,7 +95,7 @@ public static Notification fromJson( private final List identities; private final List tags; private final List segments; - private final Priority priority; + private final Notification.Priority priority; private final Integer ttl; private final String title; private final String body; @@ -118,7 +118,7 @@ private Notification( @JsonProperty("identities") final List identities, @JsonProperty("tags") final List tags, @JsonProperty("segments") final List segments, - @JsonProperty("priority") final Priority priority, + @JsonProperty("priority") final Notification.Priority priority, @JsonProperty("ttl") final Integer ttl, @JsonProperty("title") final String title, @JsonProperty("body") final String body, @@ -185,7 +185,7 @@ public final List getSegments() { return this.segments; } - public final Priority getPriority() { + public final Notification.Priority getPriority() { return this.priority; } diff --git a/src/main/java/com/twilio/rest/numbers/v1/PortingPortability.java b/src/main/java/com/twilio/rest/numbers/v1/PortingPortability.java index 1559a8f88f..f047290739 100644 --- a/src/main/java/com/twilio/rest/numbers/v1/PortingPortability.java +++ b/src/main/java/com/twilio/rest/numbers/v1/PortingPortability.java @@ -92,7 +92,7 @@ public static PortingPortability fromJson( private final Boolean pinAndAccountNumberRequired; private final String notPortableReason; private final Integer notPortableReasonCode; - private final NumberType numberType; + private final PortingPortability.NumberType numberType; private final String country; private final URI url; @@ -110,7 +110,9 @@ private PortingPortability( @JsonProperty( "not_portable_reason_code" ) final Integer notPortableReasonCode, - @JsonProperty("number_type") final NumberType numberType, + @JsonProperty( + "number_type" + ) final PortingPortability.NumberType numberType, @JsonProperty("country") final String country, @JsonProperty("url") final URI url ) { @@ -149,7 +151,7 @@ public final Integer getNotPortableReasonCode() { return this.notPortableReasonCode; } - public final NumberType getNumberType() { + public final PortingPortability.NumberType getNumberType() { return this.numberType; } diff --git a/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationDelete.java b/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationDelete.java index 40d6a5d8e9..cec172e3a1 100644 --- a/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationDelete.java +++ b/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationDelete.java @@ -35,7 +35,7 @@ public class PortingWebhookConfigurationDelete extends Resource { private static final long serialVersionUID = 0L; public static PortingWebhookConfigurationDeleteDeleter deleter( - final WebhookType webhookType + final PortingWebhookConfigurationDelete.WebhookType webhookType ) { return new PortingWebhookConfigurationDeleteDeleter(webhookType); } diff --git a/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetch.java b/src/main/java/com/twilio/rest/numbers/v1/Webhook.java similarity index 82% rename from src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetch.java rename to src/main/java/com/twilio/rest/numbers/v1/Webhook.java index 53c0f02a23..6e9c6921dd 100644 --- a/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetch.java +++ b/src/main/java/com/twilio/rest/numbers/v1/Webhook.java @@ -35,31 +35,28 @@ @JsonIgnoreProperties(ignoreUnknown = true) @ToString -public class PortingWebhookConfigurationFetch extends Resource { +public class Webhook extends Resource { private static final long serialVersionUID = 270526030240961L; - public static PortingWebhookConfigurationFetchFetcher fetcher() { - return new PortingWebhookConfigurationFetchFetcher(); + public static WebhookFetcher fetcher() { + return new WebhookFetcher(); } /** - * Converts a JSON String into a PortingWebhookConfigurationFetch object using the provided ObjectMapper. + * Converts a JSON String into a Webhook object using the provided ObjectMapper. * * @param json Raw JSON String * @param objectMapper Jackson ObjectMapper - * @return PortingWebhookConfigurationFetch object represented by the provided JSON + * @return Webhook object represented by the provided JSON */ - public static PortingWebhookConfigurationFetch fromJson( + public static Webhook fromJson( final String json, final ObjectMapper objectMapper ) { // Convert all checked exceptions to Runtime try { - return objectMapper.readValue( - json, - PortingWebhookConfigurationFetch.class - ); + return objectMapper.readValue(json, Webhook.class); } catch (final JsonMappingException | JsonParseException e) { throw new ApiException(e.getMessage(), e); } catch (final IOException e) { @@ -68,23 +65,20 @@ public static PortingWebhookConfigurationFetch fromJson( } /** - * Converts a JSON InputStream into a PortingWebhookConfigurationFetch object using the provided + * Converts a JSON InputStream into a Webhook object using the provided * ObjectMapper. * * @param json Raw JSON InputStream * @param objectMapper Jackson ObjectMapper - * @return PortingWebhookConfigurationFetch object represented by the provided JSON + * @return Webhook object represented by the provided JSON */ - public static PortingWebhookConfigurationFetch fromJson( + public static Webhook fromJson( final InputStream json, final ObjectMapper objectMapper ) { // Convert all checked exceptions to Runtime try { - return objectMapper.readValue( - json, - PortingWebhookConfigurationFetch.class - ); + return objectMapper.readValue(json, Webhook.class); } catch (final JsonMappingException | JsonParseException e) { throw new ApiException(e.getMessage(), e); } catch (final IOException e) { @@ -100,7 +94,7 @@ public static PortingWebhookConfigurationFetch fromJson( private final ZonedDateTime portOutTargetDateCreated; @JsonCreator - private PortingWebhookConfigurationFetch( + private Webhook( @JsonProperty("url") final URI url, @JsonProperty("port_in_target_url") final URI portInTargetUrl, @JsonProperty("port_out_target_url") final URI portOutTargetUrl, @@ -156,8 +150,7 @@ public boolean equals(final Object o) { return false; } - PortingWebhookConfigurationFetch other = - (PortingWebhookConfigurationFetch) o; + Webhook other = (Webhook) o; return ( Objects.equals(url, other.url) && diff --git a/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetchFetcher.java b/src/main/java/com/twilio/rest/numbers/v1/WebhookFetcher.java similarity index 79% rename from src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetchFetcher.java rename to src/main/java/com/twilio/rest/numbers/v1/WebhookFetcher.java index 59d0dc599f..ccffc00624 100644 --- a/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetchFetcher.java +++ b/src/main/java/com/twilio/rest/numbers/v1/WebhookFetcher.java @@ -25,15 +25,12 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class PortingWebhookConfigurationFetchFetcher - extends Fetcher { +public class WebhookFetcher extends Fetcher { - public PortingWebhookConfigurationFetchFetcher() {} + public WebhookFetcher() {} @Override - public PortingWebhookConfigurationFetch fetch( - final TwilioRestClient client - ) { + public Webhook fetch(final TwilioRestClient client) { String path = "/v1/Porting/Configuration/Webhook"; Request request = new Request( @@ -46,7 +43,7 @@ public PortingWebhookConfigurationFetch fetch( if (response == null) { throw new ApiConnectionException( - "PortingWebhookConfigurationFetch fetch failed: Unable to connect to server" + "Webhook fetch failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -62,9 +59,6 @@ public PortingWebhookConfigurationFetch fetch( throw new ApiException(restException); } - return PortingWebhookConfigurationFetch.fromJson( - response.getStream(), - client.getObjectMapper() - ); + return Webhook.fromJson(response.getStream(), client.getObjectMapper()); } } diff --git a/src/main/java/com/twilio/rest/numbers/v2/AuthorizationDocument.java b/src/main/java/com/twilio/rest/numbers/v2/AuthorizationDocument.java index e46f361687..0c3aa64569 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/AuthorizationDocument.java +++ b/src/main/java/com/twilio/rest/numbers/v2/AuthorizationDocument.java @@ -113,7 +113,7 @@ public static AuthorizationDocument fromJson( private final String sid; private final String addressSid; - private final Status status; + private final AuthorizationDocument.Status status; private final String email; private final List ccEmails; private final ZonedDateTime dateCreated; @@ -125,7 +125,7 @@ public static AuthorizationDocument fromJson( private AuthorizationDocument( @JsonProperty("sid") final String sid, @JsonProperty("address_sid") final String addressSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final AuthorizationDocument.Status status, @JsonProperty("email") final String email, @JsonProperty("cc_emails") final List ccEmails, @JsonProperty("date_created") final String dateCreated, @@ -152,7 +152,7 @@ public final String getAddressSid() { return this.addressSid; } - public final Status getStatus() { + public final AuthorizationDocument.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/BulkHostedNumberOrder.java b/src/main/java/com/twilio/rest/numbers/v2/BulkHostedNumberOrder.java index a4d6136a15..d491067489 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/BulkHostedNumberOrder.java +++ b/src/main/java/com/twilio/rest/numbers/v2/BulkHostedNumberOrder.java @@ -109,7 +109,7 @@ public static String toJson(Object object, ObjectMapper mapper) { } private final String bulkHostingSid; - private final RequestStatus requestStatus; + private final BulkHostedNumberOrder.RequestStatus requestStatus; private final String friendlyName; private final String notificationEmail; private final ZonedDateTime dateCreated; @@ -121,7 +121,9 @@ public static String toJson(Object object, ObjectMapper mapper) { @JsonCreator private BulkHostedNumberOrder( @JsonProperty("bulk_hosting_sid") final String bulkHostingSid, - @JsonProperty("request_status") final RequestStatus requestStatus, + @JsonProperty( + "request_status" + ) final BulkHostedNumberOrder.RequestStatus requestStatus, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("notification_email") final String notificationEmail, @JsonProperty("date_created") final String dateCreated, @@ -146,7 +148,7 @@ public final String getBulkHostingSid() { return this.bulkHostingSid; } - public final RequestStatus getRequestStatus() { + public final BulkHostedNumberOrder.RequestStatus getRequestStatus() { return this.requestStatus; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/BundleClone.java b/src/main/java/com/twilio/rest/numbers/v2/BundleClone.java index 8f4376dfe5..8462b057d5 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/BundleClone.java +++ b/src/main/java/com/twilio/rest/numbers/v2/BundleClone.java @@ -93,7 +93,7 @@ public static BundleClone fromJson( private final String accountSid; private final String regulationSid; private final String friendlyName; - private final Status status; + private final BundleClone.Status status; private final ZonedDateTime validUntil; private final String email; private final URI statusCallback; @@ -107,7 +107,7 @@ private BundleClone( @JsonProperty("account_sid") final String accountSid, @JsonProperty("regulation_sid") final String regulationSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final Status status, + @JsonProperty("status") final BundleClone.Status status, @JsonProperty("valid_until") final String validUntil, @JsonProperty("email") final String email, @JsonProperty("status_callback") final URI statusCallback, @@ -144,7 +144,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Status getStatus() { + public final BundleClone.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/HostedNumberOrder.java b/src/main/java/com/twilio/rest/numbers/v2/HostedNumberOrder.java index 4b6531f726..6363d99966 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/HostedNumberOrder.java +++ b/src/main/java/com/twilio/rest/numbers/v2/HostedNumberOrder.java @@ -69,7 +69,7 @@ public static HostedNumberOrderReader reader() { public static HostedNumberOrderUpdater updater( final String pathSid, - final Status status + final HostedNumberOrder.Status status ) { return new HostedNumberOrderUpdater(pathSid, status); } @@ -125,7 +125,7 @@ public static HostedNumberOrder fromJson( private final com.twilio.type.PhoneNumber phoneNumber; private final PhoneNumberCapabilities capabilities; private final String friendlyName; - private final Status status; + private final HostedNumberOrder.Status status; private final String failureReason; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -141,7 +141,7 @@ public static HostedNumberOrder fromJson( private final Integer verificationCallDelay; private final String verificationCallExtension; private final String verificationCode; - private final VerificationType verificationType; + private final HostedNumberOrder.VerificationType verificationType; @JsonCreator private HostedNumberOrder( @@ -159,7 +159,7 @@ private HostedNumberOrder( "capabilities" ) final PhoneNumberCapabilities capabilities, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final Status status, + @JsonProperty("status") final HostedNumberOrder.Status status, @JsonProperty("failure_reason") final String failureReason, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -189,7 +189,7 @@ private HostedNumberOrder( @JsonProperty("verification_code") final String verificationCode, @JsonProperty( "verification_type" - ) final VerificationType verificationType + ) final HostedNumberOrder.VerificationType verificationType ) { this.sid = sid; this.accountSid = accountSid; @@ -250,7 +250,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Status getStatus() { + public final HostedNumberOrder.Status getStatus() { return this.status; } @@ -314,7 +314,7 @@ public final String getVerificationCode() { return this.verificationCode; } - public final VerificationType getVerificationType() { + public final HostedNumberOrder.VerificationType getVerificationType() { return this.verificationType; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/authorizationdocument/DependentHostedNumberOrder.java b/src/main/java/com/twilio/rest/numbers/v2/authorizationdocument/DependentHostedNumberOrder.java index c27f699fe5..01b4345f77 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/authorizationdocument/DependentHostedNumberOrder.java +++ b/src/main/java/com/twilio/rest/numbers/v2/authorizationdocument/DependentHostedNumberOrder.java @@ -105,7 +105,7 @@ public static DependentHostedNumberOrder fromJson( private final com.twilio.type.PhoneNumber phoneNumber; private final PhoneNumberCapabilities capabilities; private final String friendlyName; - private final Status status; + private final DependentHostedNumberOrder.Status status; private final String failureReason; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -134,7 +134,7 @@ private DependentHostedNumberOrder( "capabilities" ) final PhoneNumberCapabilities capabilities, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final Status status, + @JsonProperty("status") final DependentHostedNumberOrder.Status status, @JsonProperty("failure_reason") final String failureReason, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -205,7 +205,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Status getStatus() { + public final DependentHostedNumberOrder.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Bundle.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Bundle.java index 1245b44248..9371ac3164 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Bundle.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Bundle.java @@ -111,7 +111,7 @@ public static Bundle fromJson( private final String accountSid; private final String regulationSid; private final String friendlyName; - private final Status status; + private final Bundle.Status status; private final ZonedDateTime validUntil; private final String email; private final URI statusCallback; @@ -126,7 +126,7 @@ private Bundle( @JsonProperty("account_sid") final String accountSid, @JsonProperty("regulation_sid") final String regulationSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Bundle.Status status, @JsonProperty("valid_until") final String validUntil, @JsonProperty("email") final String email, @JsonProperty("status_callback") final URI statusCallback, @@ -165,7 +165,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Status getStatus() { + public final Bundle.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUser.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUser.java index 57f8bc63d6..6bfd90c4ab 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUser.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/EndUser.java @@ -43,7 +43,7 @@ public class EndUser extends Resource { public static EndUserCreator creator( final String friendlyName, - final Type type + final EndUser.Type type ) { return new EndUserCreator(friendlyName, type); } @@ -110,7 +110,7 @@ public static EndUser fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final Type type; + private final EndUser.Type type; private final Map attributes; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -121,7 +121,7 @@ private EndUser( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("type") final Type type, + @JsonProperty("type") final EndUser.Type type, @JsonProperty("attributes") final Map attributes, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -149,7 +149,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Type getType() { + public final EndUser.Type getType() { return this.type; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Regulation.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Regulation.java index 16fdea60d1..5c89d54944 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Regulation.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/Regulation.java @@ -94,7 +94,7 @@ public static Regulation fromJson( private final String friendlyName; private final String isoCountry; private final String numberType; - private final EndUserType endUserType; + private final Regulation.EndUserType endUserType; private final Map requirements; private final URI url; @@ -104,7 +104,7 @@ private Regulation( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("iso_country") final String isoCountry, @JsonProperty("number_type") final String numberType, - @JsonProperty("end_user_type") final EndUserType endUserType, + @JsonProperty("end_user_type") final Regulation.EndUserType endUserType, @JsonProperty("requirements") final Map requirements, @JsonProperty("url") final URI url ) { @@ -133,7 +133,7 @@ public final String getNumberType() { return this.numberType; } - public final EndUserType getEndUserType() { + public final Regulation.EndUserType getEndUserType() { return this.endUserType; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocument.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocument.java index 7562f95557..50135af80f 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocument.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/SupportingDocument.java @@ -112,7 +112,7 @@ public static SupportingDocument fromJson( private final String accountSid; private final String friendlyName; private final String mimeType; - private final Status status; + private final SupportingDocument.Status status; private final String failureReason; private final List> errors; private final String type; @@ -127,7 +127,7 @@ private SupportingDocument( @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("mime_type") final String mimeType, - @JsonProperty("status") final Status status, + @JsonProperty("status") final SupportingDocument.Status status, @JsonProperty("failure_reason") final String failureReason, @JsonProperty("errors") final List> errors, @JsonProperty("type") final String type, @@ -166,7 +166,7 @@ public final String getMimeType() { return this.mimeType; } - public final Status getStatus() { + public final SupportingDocument.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/BundleCopy.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/BundleCopy.java index f769beb1da..04ac0cb803 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/BundleCopy.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/BundleCopy.java @@ -94,7 +94,7 @@ public static BundleCopy fromJson( private final String accountSid; private final String regulationSid; private final String friendlyName; - private final Status status; + private final BundleCopy.Status status; private final ZonedDateTime validUntil; private final String email; private final URI statusCallback; @@ -107,7 +107,7 @@ private BundleCopy( @JsonProperty("account_sid") final String accountSid, @JsonProperty("regulation_sid") final String regulationSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final Status status, + @JsonProperty("status") final BundleCopy.Status status, @JsonProperty("valid_until") final String validUntil, @JsonProperty("email") final String email, @JsonProperty("status_callback") final URI statusCallback, @@ -142,7 +142,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Status getStatus() { + public final BundleCopy.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/Evaluation.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/Evaluation.java index 4cd6b14db5..669f216872 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/Evaluation.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/Evaluation.java @@ -104,7 +104,7 @@ public static Evaluation fromJson( private final String accountSid; private final String regulationSid; private final String bundleSid; - private final Status status; + private final Evaluation.Status status; private final List> results; private final ZonedDateTime dateCreated; private final URI url; @@ -115,7 +115,7 @@ private Evaluation( @JsonProperty("account_sid") final String accountSid, @JsonProperty("regulation_sid") final String regulationSid, @JsonProperty("bundle_sid") final String bundleSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Evaluation.Status status, @JsonProperty("results") final List> results, @JsonProperty("date_created") final String dateCreated, @JsonProperty("url") final URI url @@ -146,7 +146,7 @@ public final String getBundleSid() { return this.bundleSid; } - public final Status getStatus() { + public final Evaluation.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/ReplaceItems.java b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/ReplaceItems.java index 77fec453f4..9af6e75dac 100644 --- a/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/ReplaceItems.java +++ b/src/main/java/com/twilio/rest/numbers/v2/regulatorycompliance/bundle/ReplaceItems.java @@ -93,7 +93,7 @@ public static ReplaceItems fromJson( private final String accountSid; private final String regulationSid; private final String friendlyName; - private final Status status; + private final ReplaceItems.Status status; private final ZonedDateTime validUntil; private final String email; private final URI statusCallback; @@ -106,7 +106,7 @@ private ReplaceItems( @JsonProperty("account_sid") final String accountSid, @JsonProperty("regulation_sid") final String regulationSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final Status status, + @JsonProperty("status") final ReplaceItems.Status status, @JsonProperty("valid_until") final String validUntil, @JsonProperty("email") final String email, @JsonProperty("status_callback") final URI statusCallback, @@ -141,7 +141,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Status getStatus() { + public final ReplaceItems.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/preview/hostedNumbers/AuthorizationDocument.java b/src/main/java/com/twilio/rest/preview/hostedNumbers/AuthorizationDocument.java index 7370fc631f..9bb552cfaf 100644 --- a/src/main/java/com/twilio/rest/preview/hostedNumbers/AuthorizationDocument.java +++ b/src/main/java/com/twilio/rest/preview/hostedNumbers/AuthorizationDocument.java @@ -115,7 +115,7 @@ public static AuthorizationDocument fromJson( private final String sid; private final String addressSid; - private final Status status; + private final AuthorizationDocument.Status status; private final String email; private final List ccEmails; private final ZonedDateTime dateCreated; @@ -127,7 +127,7 @@ public static AuthorizationDocument fromJson( private AuthorizationDocument( @JsonProperty("sid") final String sid, @JsonProperty("address_sid") final String addressSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final AuthorizationDocument.Status status, @JsonProperty("email") final String email, @JsonProperty("cc_emails") final List ccEmails, @JsonProperty("date_created") final String dateCreated, @@ -154,7 +154,7 @@ public final String getAddressSid() { return this.addressSid; } - public final Status getStatus() { + public final AuthorizationDocument.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/preview/hostedNumbers/HostedNumberOrder.java b/src/main/java/com/twilio/rest/preview/hostedNumbers/HostedNumberOrder.java index d3b6e61791..1accd8a6ea 100644 --- a/src/main/java/com/twilio/rest/preview/hostedNumbers/HostedNumberOrder.java +++ b/src/main/java/com/twilio/rest/preview/hostedNumbers/HostedNumberOrder.java @@ -116,7 +116,7 @@ public static HostedNumberOrder fromJson( private final PhoneNumberCapabilities capabilities; private final String friendlyName; private final String uniqueName; - private final Status status; + private final HostedNumberOrder.Status status; private final String failureReason; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -124,7 +124,7 @@ public static HostedNumberOrder fromJson( private final String email; private final List ccEmails; private final URI url; - private final VerificationType verificationType; + private final HostedNumberOrder.VerificationType verificationType; private final String verificationDocumentSid; private final String extension; private final Integer callDelay; @@ -148,7 +148,7 @@ private HostedNumberOrder( ) final PhoneNumberCapabilities capabilities, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, - @JsonProperty("status") final Status status, + @JsonProperty("status") final HostedNumberOrder.Status status, @JsonProperty("failure_reason") final String failureReason, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -160,7 +160,7 @@ private HostedNumberOrder( @JsonProperty("url") final URI url, @JsonProperty( "verification_type" - ) final VerificationType verificationType, + ) final HostedNumberOrder.VerificationType verificationType, @JsonProperty( "verification_document_sid" ) final String verificationDocumentSid, @@ -232,7 +232,7 @@ public final String getUniqueName() { return this.uniqueName; } - public final Status getStatus() { + public final HostedNumberOrder.Status getStatus() { return this.status; } @@ -264,7 +264,7 @@ public final URI getUrl() { return this.url; } - public final VerificationType getVerificationType() { + public final HostedNumberOrder.VerificationType getVerificationType() { return this.verificationType; } diff --git a/src/main/java/com/twilio/rest/preview/hostedNumbers/authorizationdocument/DependentHostedNumberOrder.java b/src/main/java/com/twilio/rest/preview/hostedNumbers/authorizationdocument/DependentHostedNumberOrder.java index 2ca263c614..a568b081d8 100644 --- a/src/main/java/com/twilio/rest/preview/hostedNumbers/authorizationdocument/DependentHostedNumberOrder.java +++ b/src/main/java/com/twilio/rest/preview/hostedNumbers/authorizationdocument/DependentHostedNumberOrder.java @@ -104,14 +104,14 @@ public static DependentHostedNumberOrder fromJson( private final PhoneNumberCapabilities capabilities; private final String friendlyName; private final String uniqueName; - private final Status status; + private final DependentHostedNumberOrder.Status status; private final String failureReason; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Integer verificationAttempts; private final String email; private final List ccEmails; - private final VerificationType verificationType; + private final DependentHostedNumberOrder.VerificationType verificationType; private final String verificationDocumentSid; private final String extension; private final Integer callDelay; @@ -135,7 +135,7 @@ private DependentHostedNumberOrder( ) final PhoneNumberCapabilities capabilities, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("unique_name") final String uniqueName, - @JsonProperty("status") final Status status, + @JsonProperty("status") final DependentHostedNumberOrder.Status status, @JsonProperty("failure_reason") final String failureReason, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -146,7 +146,7 @@ private DependentHostedNumberOrder( @JsonProperty("cc_emails") final List ccEmails, @JsonProperty( "verification_type" - ) final VerificationType verificationType, + ) final DependentHostedNumberOrder.VerificationType verificationType, @JsonProperty( "verification_document_sid" ) final String verificationDocumentSid, @@ -217,7 +217,7 @@ public final String getUniqueName() { return this.uniqueName; } - public final Status getStatus() { + public final DependentHostedNumberOrder.Status getStatus() { return this.status; } @@ -245,7 +245,7 @@ public final List getCcEmails() { return this.ccEmails; } - public final VerificationType getVerificationType() { + public final DependentHostedNumberOrder.VerificationType getVerificationType() { return this.verificationType; } diff --git a/src/main/java/com/twilio/rest/previewiam/organizations/Account.java b/src/main/java/com/twilio/rest/previewiam/organizations/Account.java index 5186823e23..388b31fa34 100644 --- a/src/main/java/com/twilio/rest/previewiam/organizations/Account.java +++ b/src/main/java/com/twilio/rest/previewiam/organizations/Account.java @@ -94,7 +94,7 @@ public static Account fromJson( private final String accountSid; private final String friendlyName; - private final StatusEnum status; + private final Account.StatusEnum status; private final String ownerSid; private final ZonedDateTime dateCreated; @@ -102,7 +102,7 @@ public static Account fromJson( private Account( @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final StatusEnum status, + @JsonProperty("status") final Account.StatusEnum status, @JsonProperty("owner_sid") final String ownerSid, @JsonProperty("date_created") final String dateCreated ) { @@ -121,7 +121,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final StatusEnum getStatus() { + public final Account.StatusEnum getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/previewiam/organizations/RoleAssignment.java b/src/main/java/com/twilio/rest/previewiam/organizations/RoleAssignment.java index f02a6ad8fa..875068a004 100644 --- a/src/main/java/com/twilio/rest/previewiam/organizations/RoleAssignment.java +++ b/src/main/java/com/twilio/rest/previewiam/organizations/RoleAssignment.java @@ -83,7 +83,7 @@ public static PublicApiCreateRoleAssignmentRequest fromJson( public static RoleAssignmentCreator creator( final String pathOrganizationSid, - final PublicApiCreateRoleAssignmentRequest publicApiCreateRoleAssignmentRequest + final RoleAssignment.PublicApiCreateRoleAssignmentRequest publicApiCreateRoleAssignmentRequest ) { return new RoleAssignmentCreator( pathOrganizationSid, diff --git a/src/main/java/com/twilio/rest/previewiam/organizations/User.java b/src/main/java/com/twilio/rest/previewiam/organizations/User.java index 923872e3e5..2e3a501701 100644 --- a/src/main/java/com/twilio/rest/previewiam/organizations/User.java +++ b/src/main/java/com/twilio/rest/previewiam/organizations/User.java @@ -213,7 +213,7 @@ public static ScimUser fromJson(String jsonString, ObjectMapper mapper) public static UserCreator creator( final String pathOrganizationSid, - final ScimUser scimUser + final User.ScimUser scimUser ) { return new UserCreator(pathOrganizationSid, scimUser); } @@ -239,7 +239,7 @@ public static UserReader reader(final String pathOrganizationSid) { public static UserUpdater updater( final String pathOrganizationSid, final String pathUserSid, - final ScimUser scimUser + final User.ScimUser scimUser ) { return new UserUpdater(pathOrganizationSid, pathUserSid, scimUser); } diff --git a/src/main/java/com/twilio/rest/pricing/v1/messaging/Country.java b/src/main/java/com/twilio/rest/pricing/v1/messaging/Country.java index 80882ed263..b94e824fc8 100644 --- a/src/main/java/com/twilio/rest/pricing/v1/messaging/Country.java +++ b/src/main/java/com/twilio/rest/pricing/v1/messaging/Country.java @@ -111,7 +111,7 @@ private Country( InboundSmsPrice > inboundSmsPrices, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v1/phonenumber/Country.java b/src/main/java/com/twilio/rest/pricing/v1/phonenumber/Country.java index 8c3d1a112f..b7460493df 100644 --- a/src/main/java/com/twilio/rest/pricing/v1/phonenumber/Country.java +++ b/src/main/java/com/twilio/rest/pricing/v1/phonenumber/Country.java @@ -106,7 +106,7 @@ private Country( PhoneNumberPrice > phoneNumberPrices, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v1/voice/Country.java b/src/main/java/com/twilio/rest/pricing/v1/voice/Country.java index 571bdc47f3..766b5a0ced 100644 --- a/src/main/java/com/twilio/rest/pricing/v1/voice/Country.java +++ b/src/main/java/com/twilio/rest/pricing/v1/voice/Country.java @@ -111,7 +111,7 @@ private Country( InboundCallPrice > inboundCallPrices, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v1/voice/Number.java b/src/main/java/com/twilio/rest/pricing/v1/voice/Number.java index c3554827ba..84501022ef 100644 --- a/src/main/java/com/twilio/rest/pricing/v1/voice/Number.java +++ b/src/main/java/com/twilio/rest/pricing/v1/voice/Number.java @@ -110,7 +110,7 @@ private Number( "inbound_call_price" ) final InboundCallPrice inboundCallPrice, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v2/Country.java b/src/main/java/com/twilio/rest/pricing/v2/Country.java index 337a60e819..a95ebb6743 100644 --- a/src/main/java/com/twilio/rest/pricing/v2/Country.java +++ b/src/main/java/com/twilio/rest/pricing/v2/Country.java @@ -111,7 +111,7 @@ private Country( InboundCallPrice > originatingCallPrices, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v2/Number.java b/src/main/java/com/twilio/rest/pricing/v2/Number.java index f23418faf6..3d8c0f89fe 100644 --- a/src/main/java/com/twilio/rest/pricing/v2/Number.java +++ b/src/main/java/com/twilio/rest/pricing/v2/Number.java @@ -117,7 +117,7 @@ private Number( "originating_call_price" ) final InboundCallPrice originatingCallPrice, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v2/voice/Country.java b/src/main/java/com/twilio/rest/pricing/v2/voice/Country.java index 678cc56bda..18a482f54f 100644 --- a/src/main/java/com/twilio/rest/pricing/v2/voice/Country.java +++ b/src/main/java/com/twilio/rest/pricing/v2/voice/Country.java @@ -111,7 +111,7 @@ private Country( InboundCallPrice > inboundCallPrices, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/pricing/v2/voice/Number.java b/src/main/java/com/twilio/rest/pricing/v2/voice/Number.java index c34fd46796..cb87bffd51 100644 --- a/src/main/java/com/twilio/rest/pricing/v2/voice/Number.java +++ b/src/main/java/com/twilio/rest/pricing/v2/voice/Number.java @@ -117,7 +117,7 @@ private Number( "inbound_call_price" ) final InboundCallPrice inboundCallPrice, @JsonProperty("price_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency priceUnit, @JsonProperty("url") final URI url ) { diff --git a/src/main/java/com/twilio/rest/proxy/v1/Service.java b/src/main/java/com/twilio/rest/proxy/v1/Service.java index 58fe5e69af..65eb5245f6 100644 --- a/src/main/java/com/twilio/rest/proxy/v1/Service.java +++ b/src/main/java/com/twilio/rest/proxy/v1/Service.java @@ -110,8 +110,8 @@ public static Service fromJson( private final String chatInstanceSid; private final URI callbackUrl; private final Integer defaultTtl; - private final NumberSelectionBehavior numberSelectionBehavior; - private final GeoMatchLevel geoMatchLevel; + private final Service.NumberSelectionBehavior numberSelectionBehavior; + private final Service.GeoMatchLevel geoMatchLevel; private final URI interceptCallbackUrl; private final URI outOfSessionCallbackUrl; private final ZonedDateTime dateCreated; @@ -129,8 +129,10 @@ private Service( @JsonProperty("default_ttl") final Integer defaultTtl, @JsonProperty( "number_selection_behavior" - ) final NumberSelectionBehavior numberSelectionBehavior, - @JsonProperty("geo_match_level") final GeoMatchLevel geoMatchLevel, + ) final Service.NumberSelectionBehavior numberSelectionBehavior, + @JsonProperty( + "geo_match_level" + ) final Service.GeoMatchLevel geoMatchLevel, @JsonProperty("intercept_callback_url") final URI interceptCallbackUrl, @JsonProperty( "out_of_session_callback_url" @@ -180,11 +182,11 @@ public final Integer getDefaultTtl() { return this.defaultTtl; } - public final NumberSelectionBehavior getNumberSelectionBehavior() { + public final Service.NumberSelectionBehavior getNumberSelectionBehavior() { return this.numberSelectionBehavior; } - public final GeoMatchLevel getGeoMatchLevel() { + public final Service.GeoMatchLevel getGeoMatchLevel() { return this.geoMatchLevel; } diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/Session.java b/src/main/java/com/twilio/rest/proxy/v1/service/Session.java index 07b22595d9..2c8db7c6ad 100644 --- a/src/main/java/com/twilio/rest/proxy/v1/service/Session.java +++ b/src/main/java/com/twilio/rest/proxy/v1/service/Session.java @@ -121,10 +121,10 @@ public static Session fromJson( private final ZonedDateTime dateLastInteraction; private final ZonedDateTime dateExpiry; private final String uniqueName; - private final Status status; + private final Session.Status status; private final String closedReason; private final Integer ttl; - private final Mode mode; + private final Session.Mode mode; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -140,10 +140,10 @@ private Session( @JsonProperty("date_last_interaction") final String dateLastInteraction, @JsonProperty("date_expiry") final String dateExpiry, @JsonProperty("unique_name") final String uniqueName, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Session.Status status, @JsonProperty("closed_reason") final String closedReason, @JsonProperty("ttl") final Integer ttl, - @JsonProperty("mode") final Mode mode, + @JsonProperty("mode") final Session.Mode mode, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url, @@ -200,7 +200,7 @@ public final String getUniqueName() { return this.uniqueName; } - public final Status getStatus() { + public final Session.Status getStatus() { return this.status; } @@ -212,7 +212,7 @@ public final Integer getTtl() { return this.ttl; } - public final Mode getMode() { + public final Session.Mode getMode() { return this.mode; } diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/SessionCreator.java b/src/main/java/com/twilio/rest/proxy/v1/service/SessionCreator.java index 8a936a5902..db40a233aa 100644 --- a/src/main/java/com/twilio/rest/proxy/v1/service/SessionCreator.java +++ b/src/main/java/com/twilio/rest/proxy/v1/service/SessionCreator.java @@ -15,8 +15,9 @@ package com.twilio.rest.proxy.v1.service; import com.twilio.base.Creator; -import com.twilio.converter.Converter; import com.twilio.constant.EnumConstants; +import com.twilio.converter.Converter; +import com.twilio.converter.Converter; import com.twilio.converter.Promoter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/ShortCode.java b/src/main/java/com/twilio/rest/proxy/v1/service/ShortCode.java deleted file mode 100644 index f329ccddf9..0000000000 --- a/src/main/java/com/twilio/rest/proxy/v1/service/ShortCode.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Proxy - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.proxy.v1.service; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.twilio.base.Resource; -import com.twilio.converter.DateConverter; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.type.PhoneNumberCapabilities; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.time.ZonedDateTime; -import java.util.Objects; -import lombok.ToString; -import lombok.ToString; - -@JsonIgnoreProperties(ignoreUnknown = true) -@ToString -public class ShortCode extends Resource { - - private static final long serialVersionUID = 222849980654127L; - - public static ShortCodeCreator creator( - final String pathServiceSid, - final String sid - ) { - return new ShortCodeCreator(pathServiceSid, sid); - } - - public static ShortCodeDeleter deleter( - final String pathServiceSid, - final String pathSid - ) { - return new ShortCodeDeleter(pathServiceSid, pathSid); - } - - public static ShortCodeFetcher fetcher( - final String pathServiceSid, - final String pathSid - ) { - return new ShortCodeFetcher(pathServiceSid, pathSid); - } - - public static ShortCodeReader reader(final String pathServiceSid) { - return new ShortCodeReader(pathServiceSid); - } - - public static ShortCodeUpdater updater( - final String pathServiceSid, - final String pathSid - ) { - return new ShortCodeUpdater(pathServiceSid, pathSid); - } - - /** - * Converts a JSON String into a ShortCode object using the provided ObjectMapper. - * - * @param json Raw JSON String - * @param objectMapper Jackson ObjectMapper - * @return ShortCode object represented by the provided JSON - */ - public static ShortCode fromJson( - final String json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, ShortCode.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - /** - * Converts a JSON InputStream into a ShortCode object using the provided - * ObjectMapper. - * - * @param json Raw JSON InputStream - * @param objectMapper Jackson ObjectMapper - * @return ShortCode object represented by the provided JSON - */ - public static ShortCode fromJson( - final InputStream json, - final ObjectMapper objectMapper - ) { - // Convert all checked exceptions to Runtime - try { - return objectMapper.readValue(json, ShortCode.class); - } catch (final JsonMappingException | JsonParseException e) { - throw new ApiException(e.getMessage(), e); - } catch (final IOException e) { - throw new ApiConnectionException(e.getMessage(), e); - } - } - - private final String sid; - private final String accountSid; - private final String serviceSid; - private final ZonedDateTime dateCreated; - private final ZonedDateTime dateUpdated; - private final String shortCode; - private final String isoCountry; - private final PhoneNumberCapabilities capabilities; - private final URI url; - private final Boolean isReserved; - - @JsonCreator - private ShortCode( - @JsonProperty("sid") final String sid, - @JsonProperty("account_sid") final String accountSid, - @JsonProperty("service_sid") final String serviceSid, - @JsonProperty("date_created") final String dateCreated, - @JsonProperty("date_updated") final String dateUpdated, - @JsonProperty("short_code") final String shortCode, - @JsonProperty("iso_country") final String isoCountry, - @JsonProperty( - "capabilities" - ) final PhoneNumberCapabilities capabilities, - @JsonProperty("url") final URI url, - @JsonProperty("is_reserved") final Boolean isReserved - ) { - this.sid = sid; - this.accountSid = accountSid; - this.serviceSid = serviceSid; - this.dateCreated = DateConverter.iso8601DateTimeFromString(dateCreated); - this.dateUpdated = DateConverter.iso8601DateTimeFromString(dateUpdated); - this.shortCode = shortCode; - this.isoCountry = isoCountry; - this.capabilities = capabilities; - this.url = url; - this.isReserved = isReserved; - } - - public final String getSid() { - return this.sid; - } - - public final String getAccountSid() { - return this.accountSid; - } - - public final String getServiceSid() { - return this.serviceSid; - } - - public final ZonedDateTime getDateCreated() { - return this.dateCreated; - } - - public final ZonedDateTime getDateUpdated() { - return this.dateUpdated; - } - - public final String getShortCode() { - return this.shortCode; - } - - public final String getIsoCountry() { - return this.isoCountry; - } - - public final PhoneNumberCapabilities getCapabilities() { - return this.capabilities; - } - - public final URI getUrl() { - return this.url; - } - - public final Boolean getIsReserved() { - return this.isReserved; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - - if (o == null || getClass() != o.getClass()) { - return false; - } - - ShortCode other = (ShortCode) o; - - return ( - Objects.equals(sid, other.sid) && - Objects.equals(accountSid, other.accountSid) && - Objects.equals(serviceSid, other.serviceSid) && - Objects.equals(dateCreated, other.dateCreated) && - Objects.equals(dateUpdated, other.dateUpdated) && - Objects.equals(shortCode, other.shortCode) && - Objects.equals(isoCountry, other.isoCountry) && - Objects.equals(capabilities, other.capabilities) && - Objects.equals(url, other.url) && - Objects.equals(isReserved, other.isReserved) - ); - } - - @Override - public int hashCode() { - return Objects.hash( - sid, - accountSid, - serviceSid, - dateCreated, - dateUpdated, - shortCode, - isoCountry, - capabilities, - url, - isReserved - ); - } -} diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeDeleter.java b/src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeDeleter.java deleted file mode 100644 index 488b8600c0..0000000000 --- a/src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeDeleter.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Proxy - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.proxy.v1.service; - -import com.twilio.base.Deleter; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class ShortCodeDeleter extends Deleter { - - private String pathServiceSid; - private String pathSid; - - public ShortCodeDeleter(final String pathServiceSid, final String pathSid) { - this.pathServiceSid = pathServiceSid; - this.pathSid = pathSid; - } - - @Override - public boolean delete(final TwilioRestClient client) { - String path = "/v1/Services/{ServiceSid}/ShortCodes/{Sid}"; - - path = - path.replace( - "{" + "ServiceSid" + "}", - this.pathServiceSid.toString() - ); - path = path.replace("{" + "Sid" + "}", this.pathSid.toString()); - - Request request = new Request( - HttpMethod.DELETE, - Domains.PROXY.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "ShortCode delete failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - return response.getStatusCode() == 204; - } -} diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeReader.java b/src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeReader.java deleted file mode 100644 index 1a88f3707d..0000000000 --- a/src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeReader.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Proxy - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.proxy.v1.service; - -import com.twilio.base.Page; -import com.twilio.base.Reader; -import com.twilio.base.ResourceSet; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class ShortCodeReader extends Reader { - - private String pathServiceSid; - private Long pageSize; - - public ShortCodeReader(final String pathServiceSid) { - this.pathServiceSid = pathServiceSid; - } - - public ShortCodeReader setPageSize(final Long pageSize) { - this.pageSize = pageSize; - return this; - } - - @Override - public ResourceSet read(final TwilioRestClient client) { - return new ResourceSet<>(this, client, firstPage(client)); - } - - public Page firstPage(final TwilioRestClient client) { - String path = "/v1/Services/{ServiceSid}/ShortCodes"; - path = - path.replace( - "{" + "ServiceSid" + "}", - this.pathServiceSid.toString() - ); - - Request request = new Request( - HttpMethod.GET, - Domains.PROXY.toString(), - path - ); - - addQueryParams(request); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - return pageForRequest(client, request); - } - - private Page pageForRequest( - final TwilioRestClient client, - final Request request - ) { - Response response = client.request(request); - - if (response == null) { - throw new ApiConnectionException( - "ShortCode read failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return Page.fromJson( - "short_codes", - response.getContent(), - ShortCode.class, - client.getObjectMapper() - ); - } - - @Override - public Page previousPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getPreviousPageUrl(Domains.PROXY.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page nextPage( - final Page page, - final TwilioRestClient client - ) { - Request request = new Request( - HttpMethod.GET, - page.getNextPageUrl(Domains.PROXY.toString()) - ); - return pageForRequest(client, request); - } - - @Override - public Page getPage( - final String targetUrl, - final TwilioRestClient client - ) { - Request request = new Request(HttpMethod.GET, targetUrl); - - return pageForRequest(client, request); - } - - private void addQueryParams(final Request request) { - if (pageSize != null) { - request.addQueryParam("PageSize", pageSize.toString()); - } - - if (getPageSize() != null) { - request.addQueryParam("PageSize", Integer.toString(getPageSize())); - } - } -} diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeUpdater.java b/src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeUpdater.java deleted file mode 100644 index 6672e14a7e..0000000000 --- a/src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeUpdater.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Proxy - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.twilio.rest.proxy.v1.service; - -import com.twilio.base.Updater; -import com.twilio.constant.EnumConstants; -import com.twilio.exception.ApiConnectionException; -import com.twilio.exception.ApiException; -import com.twilio.exception.RestException; -import com.twilio.http.HttpMethod; -import com.twilio.http.Request; -import com.twilio.http.Response; -import com.twilio.http.TwilioRestClient; -import com.twilio.rest.Domains; - -public class ShortCodeUpdater extends Updater { - - private String pathServiceSid; - private String pathSid; - private Boolean isReserved; - - public ShortCodeUpdater(final String pathServiceSid, final String pathSid) { - this.pathServiceSid = pathServiceSid; - this.pathSid = pathSid; - } - - public ShortCodeUpdater setIsReserved(final Boolean isReserved) { - this.isReserved = isReserved; - return this; - } - - @Override - public ShortCode update(final TwilioRestClient client) { - String path = "/v1/Services/{ServiceSid}/ShortCodes/{Sid}"; - - path = - path.replace( - "{" + "ServiceSid" + "}", - this.pathServiceSid.toString() - ); - path = path.replace("{" + "Sid" + "}", this.pathSid.toString()); - - Request request = new Request( - HttpMethod.POST, - Domains.PROXY.toString(), - path - ); - request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); - addPostParams(request); - Response response = client.request(request); - if (response == null) { - throw new ApiConnectionException( - "ShortCode update failed: Unable to connect to server" - ); - } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { - RestException restException = RestException.fromJson( - response.getStream(), - client.getObjectMapper() - ); - if (restException == null) { - throw new ApiException( - "Server Error, no content", - response.getStatusCode() - ); - } - throw new ApiException(restException); - } - - return ShortCode.fromJson( - response.getStream(), - client.getObjectMapper() - ); - } - - private void addPostParams(final Request request) { - if (isReserved != null) { - request.addPostParam("IsReserved", isReserved.toString()); - } - } -} diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/session/Interaction.java b/src/main/java/com/twilio/rest/proxy/v1/service/session/Interaction.java index 67ee90770a..9167ddc0a9 100644 --- a/src/main/java/com/twilio/rest/proxy/v1/service/session/Interaction.java +++ b/src/main/java/com/twilio/rest/proxy/v1/service/session/Interaction.java @@ -110,15 +110,15 @@ public static Interaction fromJson( private final String serviceSid; private final String accountSid; private final String data; - private final Type type; + private final Interaction.Type type; private final String inboundParticipantSid; private final String inboundResourceSid; - private final ResourceStatus inboundResourceStatus; + private final Interaction.ResourceStatus inboundResourceStatus; private final String inboundResourceType; private final URI inboundResourceUrl; private final String outboundParticipantSid; private final String outboundResourceSid; - private final ResourceStatus outboundResourceStatus; + private final Interaction.ResourceStatus outboundResourceStatus; private final String outboundResourceType; private final URI outboundResourceUrl; private final ZonedDateTime dateCreated; @@ -132,14 +132,14 @@ private Interaction( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("data") final String data, - @JsonProperty("type") final Type type, + @JsonProperty("type") final Interaction.Type type, @JsonProperty( "inbound_participant_sid" ) final String inboundParticipantSid, @JsonProperty("inbound_resource_sid") final String inboundResourceSid, @JsonProperty( "inbound_resource_status" - ) final ResourceStatus inboundResourceStatus, + ) final Interaction.ResourceStatus inboundResourceStatus, @JsonProperty("inbound_resource_type") final String inboundResourceType, @JsonProperty("inbound_resource_url") final URI inboundResourceUrl, @JsonProperty( @@ -148,7 +148,7 @@ private Interaction( @JsonProperty("outbound_resource_sid") final String outboundResourceSid, @JsonProperty( "outbound_resource_status" - ) final ResourceStatus outboundResourceStatus, + ) final Interaction.ResourceStatus outboundResourceStatus, @JsonProperty( "outbound_resource_type" ) final String outboundResourceType, @@ -198,7 +198,7 @@ public final String getData() { return this.data; } - public final Type getType() { + public final Interaction.Type getType() { return this.type; } @@ -210,7 +210,7 @@ public final String getInboundResourceSid() { return this.inboundResourceSid; } - public final ResourceStatus getInboundResourceStatus() { + public final Interaction.ResourceStatus getInboundResourceStatus() { return this.inboundResourceStatus; } @@ -230,7 +230,7 @@ public final String getOutboundResourceSid() { return this.outboundResourceSid; } - public final ResourceStatus getOutboundResourceStatus() { + public final Interaction.ResourceStatus getOutboundResourceStatus() { return this.outboundResourceStatus; } diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/session/participant/MessageInteraction.java b/src/main/java/com/twilio/rest/proxy/v1/service/session/participant/MessageInteraction.java index fffb740206..2cc5764aa6 100644 --- a/src/main/java/com/twilio/rest/proxy/v1/service/session/participant/MessageInteraction.java +++ b/src/main/java/com/twilio/rest/proxy/v1/service/session/participant/MessageInteraction.java @@ -142,16 +142,16 @@ public static MessageInteraction fromJson( private final String serviceSid; private final String accountSid; private final String data; - private final Type type; + private final MessageInteraction.Type type; private final String participantSid; private final String inboundParticipantSid; private final String inboundResourceSid; - private final ResourceStatus inboundResourceStatus; + private final MessageInteraction.ResourceStatus inboundResourceStatus; private final String inboundResourceType; private final URI inboundResourceUrl; private final String outboundParticipantSid; private final String outboundResourceSid; - private final ResourceStatus outboundResourceStatus; + private final MessageInteraction.ResourceStatus outboundResourceStatus; private final String outboundResourceType; private final URI outboundResourceUrl; private final ZonedDateTime dateCreated; @@ -165,7 +165,7 @@ private MessageInteraction( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("data") final String data, - @JsonProperty("type") final Type type, + @JsonProperty("type") final MessageInteraction.Type type, @JsonProperty("participant_sid") final String participantSid, @JsonProperty( "inbound_participant_sid" @@ -173,7 +173,7 @@ private MessageInteraction( @JsonProperty("inbound_resource_sid") final String inboundResourceSid, @JsonProperty( "inbound_resource_status" - ) final ResourceStatus inboundResourceStatus, + ) final MessageInteraction.ResourceStatus inboundResourceStatus, @JsonProperty("inbound_resource_type") final String inboundResourceType, @JsonProperty("inbound_resource_url") final URI inboundResourceUrl, @JsonProperty( @@ -182,7 +182,7 @@ private MessageInteraction( @JsonProperty("outbound_resource_sid") final String outboundResourceSid, @JsonProperty( "outbound_resource_status" - ) final ResourceStatus outboundResourceStatus, + ) final MessageInteraction.ResourceStatus outboundResourceStatus, @JsonProperty( "outbound_resource_type" ) final String outboundResourceType, @@ -233,7 +233,7 @@ public final String getData() { return this.data; } - public final Type getType() { + public final MessageInteraction.Type getType() { return this.type; } @@ -249,7 +249,7 @@ public final String getInboundResourceSid() { return this.inboundResourceSid; } - public final ResourceStatus getInboundResourceStatus() { + public final MessageInteraction.ResourceStatus getInboundResourceStatus() { return this.inboundResourceStatus; } @@ -269,7 +269,7 @@ public final String getOutboundResourceSid() { return this.outboundResourceSid; } - public final ResourceStatus getOutboundResourceStatus() { + public final MessageInteraction.ResourceStatus getOutboundResourceStatus() { return this.outboundResourceStatus; } diff --git a/src/main/java/com/twilio/rest/serverless/v1/service/Build.java b/src/main/java/com/twilio/rest/serverless/v1/service/Build.java index aefb0ce32d..30dfe72cf9 100644 --- a/src/main/java/com/twilio/rest/serverless/v1/service/Build.java +++ b/src/main/java/com/twilio/rest/serverless/v1/service/Build.java @@ -110,11 +110,11 @@ public static Build fromJson( private final String sid; private final String accountSid; private final String serviceSid; - private final Status status; + private final Build.Status status; private final List> assetVersions; private final List> functionVersions; private final List> dependencies; - private final Runtime runtime; + private final Build.Runtime runtime; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -125,7 +125,7 @@ private Build( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Build.Status status, @JsonProperty("asset_versions") final List< Map > assetVersions, @@ -135,7 +135,7 @@ private Build( @JsonProperty("dependencies") final List< Map > dependencies, - @JsonProperty("runtime") final Runtime runtime, + @JsonProperty("runtime") final Build.Runtime runtime, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url, @@ -167,7 +167,7 @@ public final String getServiceSid() { return this.serviceSid; } - public final Status getStatus() { + public final Build.Status getStatus() { return this.status; } @@ -183,7 +183,7 @@ public final List> getDependencies() { return this.dependencies; } - public final Runtime getRuntime() { + public final Build.Runtime getRuntime() { return this.runtime; } diff --git a/src/main/java/com/twilio/rest/serverless/v1/service/asset/AssetVersion.java b/src/main/java/com/twilio/rest/serverless/v1/service/asset/AssetVersion.java index 42be38212b..a8cc25e5b0 100644 --- a/src/main/java/com/twilio/rest/serverless/v1/service/asset/AssetVersion.java +++ b/src/main/java/com/twilio/rest/serverless/v1/service/asset/AssetVersion.java @@ -102,7 +102,7 @@ public static AssetVersion fromJson( private final String serviceSid; private final String assetSid; private final String path; - private final Visibility visibility; + private final AssetVersion.Visibility visibility; private final ZonedDateTime dateCreated; private final URI url; @@ -113,7 +113,7 @@ private AssetVersion( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("asset_sid") final String assetSid, @JsonProperty("path") final String path, - @JsonProperty("visibility") final Visibility visibility, + @JsonProperty("visibility") final AssetVersion.Visibility visibility, @JsonProperty("date_created") final String dateCreated, @JsonProperty("url") final URI url ) { @@ -147,7 +147,7 @@ public final String getPath() { return this.path; } - public final Visibility getVisibility() { + public final AssetVersion.Visibility getVisibility() { return this.visibility; } diff --git a/src/main/java/com/twilio/rest/serverless/v1/service/build/BuildStatus.java b/src/main/java/com/twilio/rest/serverless/v1/service/build/BuildStatus.java index 583fcb0fab..f00e9175cb 100644 --- a/src/main/java/com/twilio/rest/serverless/v1/service/build/BuildStatus.java +++ b/src/main/java/com/twilio/rest/serverless/v1/service/build/BuildStatus.java @@ -90,7 +90,7 @@ public static BuildStatus fromJson( private final String sid; private final String accountSid; private final String serviceSid; - private final Status status; + private final BuildStatus.Status status; private final URI url; @JsonCreator @@ -98,7 +98,7 @@ private BuildStatus( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final BuildStatus.Status status, @JsonProperty("url") final URI url ) { this.sid = sid; @@ -120,7 +120,7 @@ public final String getServiceSid() { return this.serviceSid; } - public final Status getStatus() { + public final BuildStatus.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/serverless/v1/service/function/FunctionVersion.java b/src/main/java/com/twilio/rest/serverless/v1/service/function/FunctionVersion.java index 46b6d6388f..af9004b2c4 100644 --- a/src/main/java/com/twilio/rest/serverless/v1/service/function/FunctionVersion.java +++ b/src/main/java/com/twilio/rest/serverless/v1/service/function/FunctionVersion.java @@ -108,7 +108,7 @@ public static FunctionVersion fromJson( private final String serviceSid; private final String functionSid; private final String path; - private final Visibility visibility; + private final FunctionVersion.Visibility visibility; private final ZonedDateTime dateCreated; private final URI url; private final Map links; @@ -120,7 +120,7 @@ private FunctionVersion( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("function_sid") final String functionSid, @JsonProperty("path") final String path, - @JsonProperty("visibility") final Visibility visibility, + @JsonProperty("visibility") final FunctionVersion.Visibility visibility, @JsonProperty("date_created") final String dateCreated, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links @@ -156,7 +156,7 @@ public final String getPath() { return this.path; } - public final Visibility getVisibility() { + public final FunctionVersion.Visibility getVisibility() { return this.visibility; } diff --git a/src/main/java/com/twilio/rest/studio/v1/Flow.java b/src/main/java/com/twilio/rest/studio/v1/Flow.java index 6a84d3a01b..e54921d904 100644 --- a/src/main/java/com/twilio/rest/studio/v1/Flow.java +++ b/src/main/java/com/twilio/rest/studio/v1/Flow.java @@ -99,7 +99,7 @@ public static Flow fromJson( private final String sid; private final String accountSid; private final String friendlyName; - private final Status status; + private final Flow.Status status; private final Integer version; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -111,7 +111,7 @@ private Flow( @JsonProperty("sid") final String sid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Flow.Status status, @JsonProperty("version") final Integer version, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -141,7 +141,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Status getStatus() { + public final Flow.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/studio/v1/flow/Engagement.java b/src/main/java/com/twilio/rest/studio/v1/flow/Engagement.java index 99e517ac68..1b5c29b55b 100644 --- a/src/main/java/com/twilio/rest/studio/v1/flow/Engagement.java +++ b/src/main/java/com/twilio/rest/studio/v1/flow/Engagement.java @@ -116,7 +116,7 @@ public static Engagement fromJson( private final String contactSid; private final String contactChannelAddress; private final Map context; - private final Status status; + private final Engagement.Status status; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -132,7 +132,7 @@ private Engagement( "contact_channel_address" ) final String contactChannelAddress, @JsonProperty("context") final Map context, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Engagement.Status status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url, @@ -175,7 +175,7 @@ public final Map getContext() { return this.context; } - public final Status getStatus() { + public final Engagement.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/studio/v1/flow/Execution.java b/src/main/java/com/twilio/rest/studio/v1/flow/Execution.java index a79863d930..7806f0e36d 100644 --- a/src/main/java/com/twilio/rest/studio/v1/flow/Execution.java +++ b/src/main/java/com/twilio/rest/studio/v1/flow/Execution.java @@ -70,7 +70,7 @@ public static ExecutionReader reader(final String pathFlowSid) { public static ExecutionUpdater updater( final String pathFlowSid, final String pathSid, - final Status status + final Execution.Status status ) { return new ExecutionUpdater(pathFlowSid, pathSid, status); } @@ -124,7 +124,7 @@ public static Execution fromJson( private final String contactSid; private final String contactChannelAddress; private final Map context; - private final Status status; + private final Execution.Status status; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -140,7 +140,7 @@ private Execution( "contact_channel_address" ) final String contactChannelAddress, @JsonProperty("context") final Map context, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Execution.Status status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url, @@ -183,7 +183,7 @@ public final Map getContext() { return this.context; } - public final Status getStatus() { + public final Execution.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/studio/v2/Flow.java b/src/main/java/com/twilio/rest/studio/v2/Flow.java index 7677d433dd..989e733f30 100644 --- a/src/main/java/com/twilio/rest/studio/v2/Flow.java +++ b/src/main/java/com/twilio/rest/studio/v2/Flow.java @@ -44,7 +44,7 @@ public class Flow extends Resource { public static FlowCreator creator( final String friendlyName, - final Status status, + final Flow.Status status, final Object definition ) { return new FlowCreator(friendlyName, status, definition); @@ -64,7 +64,7 @@ public static FlowReader reader() { public static FlowUpdater updater( final String pathSid, - final Status status + final Flow.Status status ) { return new FlowUpdater(pathSid, status); } @@ -116,7 +116,7 @@ public static Flow fromJson( private final String accountSid; private final String friendlyName; private final Map definition; - private final Status status; + private final Flow.Status status; private final Integer revision; private final String commitMessage; private final Boolean valid; @@ -134,7 +134,7 @@ private Flow( @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("definition") final Map definition, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Flow.Status status, @JsonProperty("revision") final Integer revision, @JsonProperty("commit_message") final String commitMessage, @JsonProperty("valid") final Boolean valid, @@ -179,7 +179,7 @@ public final Map getDefinition() { return this.definition; } - public final Status getStatus() { + public final Flow.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/studio/v2/FlowValidate.java b/src/main/java/com/twilio/rest/studio/v2/FlowValidate.java index 1024e89519..6eba3f66e9 100644 --- a/src/main/java/com/twilio/rest/studio/v2/FlowValidate.java +++ b/src/main/java/com/twilio/rest/studio/v2/FlowValidate.java @@ -38,7 +38,7 @@ public class FlowValidate extends Resource { public static FlowValidateUpdater updater( final String friendlyName, - final Status status, + final FlowValidate.Status status, final Object definition ) { return new FlowValidateUpdater(friendlyName, status, definition); diff --git a/src/main/java/com/twilio/rest/studio/v2/flow/Execution.java b/src/main/java/com/twilio/rest/studio/v2/flow/Execution.java index be8fa736c7..a39e679402 100644 --- a/src/main/java/com/twilio/rest/studio/v2/flow/Execution.java +++ b/src/main/java/com/twilio/rest/studio/v2/flow/Execution.java @@ -70,7 +70,7 @@ public static ExecutionReader reader(final String pathFlowSid) { public static ExecutionUpdater updater( final String pathFlowSid, final String pathSid, - final Status status + final Execution.Status status ) { return new ExecutionUpdater(pathFlowSid, pathSid, status); } @@ -123,7 +123,7 @@ public static Execution fromJson( private final String flowSid; private final String contactChannelAddress; private final Map context; - private final Status status; + private final Execution.Status status; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -138,7 +138,7 @@ private Execution( "contact_channel_address" ) final String contactChannelAddress, @JsonProperty("context") final Map context, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Execution.Status status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url, @@ -176,7 +176,7 @@ public final Map getContext() { return this.context; } - public final Status getStatus() { + public final Execution.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/studio/v2/flow/FlowRevision.java b/src/main/java/com/twilio/rest/studio/v2/flow/FlowRevision.java index 852a110e87..c92a4d7238 100644 --- a/src/main/java/com/twilio/rest/studio/v2/flow/FlowRevision.java +++ b/src/main/java/com/twilio/rest/studio/v2/flow/FlowRevision.java @@ -100,7 +100,7 @@ public static FlowRevision fromJson( private final String accountSid; private final String friendlyName; private final Map definition; - private final Status status; + private final FlowRevision.Status status; private final Integer revision; private final String commitMessage; private final Boolean valid; @@ -115,7 +115,7 @@ private FlowRevision( @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("definition") final Map definition, - @JsonProperty("status") final Status status, + @JsonProperty("status") final FlowRevision.Status status, @JsonProperty("revision") final Integer revision, @JsonProperty("commit_message") final String commitMessage, @JsonProperty("valid") final Boolean valid, @@ -154,7 +154,7 @@ public final Map getDefinition() { return this.definition; } - public final Status getStatus() { + public final FlowRevision.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/EsimProfile.java b/src/main/java/com/twilio/rest/supersim/v1/EsimProfile.java index 311216484a..5d3e1b08eb 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/EsimProfile.java +++ b/src/main/java/com/twilio/rest/supersim/v1/EsimProfile.java @@ -98,7 +98,7 @@ public static EsimProfile fromJson( private final String accountSid; private final String iccid; private final String simSid; - private final Status status; + private final EsimProfile.Status status; private final String eid; private final URI smdpPlusAddress; private final String matchingId; @@ -115,7 +115,7 @@ private EsimProfile( @JsonProperty("account_sid") final String accountSid, @JsonProperty("iccid") final String iccid, @JsonProperty("sim_sid") final String simSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final EsimProfile.Status status, @JsonProperty("eid") final String eid, @JsonProperty("smdp_plus_address") final URI smdpPlusAddress, @JsonProperty("matching_id") final String matchingId, @@ -158,7 +158,7 @@ public final String getSimSid() { return this.simSid; } - public final Status getStatus() { + public final EsimProfile.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/Fleet.java b/src/main/java/com/twilio/rest/supersim/v1/Fleet.java index 2b9adfe683..19c54502b2 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/Fleet.java +++ b/src/main/java/com/twilio/rest/supersim/v1/Fleet.java @@ -107,7 +107,7 @@ public static Fleet fromJson( private final URI url; private final Boolean dataEnabled; private final Integer dataLimit; - private final DataMetering dataMetering; + private final Fleet.DataMetering dataMetering; private final Boolean smsCommandsEnabled; private final URI smsCommandsUrl; private final HttpMethod smsCommandsMethod; @@ -125,7 +125,7 @@ private Fleet( @JsonProperty("url") final URI url, @JsonProperty("data_enabled") final Boolean dataEnabled, @JsonProperty("data_limit") final Integer dataLimit, - @JsonProperty("data_metering") final DataMetering dataMetering, + @JsonProperty("data_metering") final Fleet.DataMetering dataMetering, @JsonProperty("sms_commands_enabled") final Boolean smsCommandsEnabled, @JsonProperty("sms_commands_url") final URI smsCommandsUrl, @JsonProperty("sms_commands_method") final HttpMethod smsCommandsMethod, @@ -184,7 +184,7 @@ public final Integer getDataLimit() { return this.dataLimit; } - public final DataMetering getDataMetering() { + public final Fleet.DataMetering getDataMetering() { return this.dataMetering; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/IpCommand.java b/src/main/java/com/twilio/rest/supersim/v1/IpCommand.java index aedeae6f5e..da34f019a3 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/IpCommand.java +++ b/src/main/java/com/twilio/rest/supersim/v1/IpCommand.java @@ -102,11 +102,11 @@ public static IpCommand fromJson( private final String accountSid; private final String simSid; private final String simIccid; - private final Status status; - private final Direction direction; + private final IpCommand.Status status; + private final IpCommand.Direction direction; private final String deviceIp; private final Integer devicePort; - private final PayloadType payloadType; + private final IpCommand.PayloadType payloadType; private final String payload; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -118,11 +118,11 @@ private IpCommand( @JsonProperty("account_sid") final String accountSid, @JsonProperty("sim_sid") final String simSid, @JsonProperty("sim_iccid") final String simIccid, - @JsonProperty("status") final Status status, - @JsonProperty("direction") final Direction direction, + @JsonProperty("status") final IpCommand.Status status, + @JsonProperty("direction") final IpCommand.Direction direction, @JsonProperty("device_ip") final String deviceIp, @JsonProperty("device_port") final Integer devicePort, - @JsonProperty("payload_type") final PayloadType payloadType, + @JsonProperty("payload_type") final IpCommand.PayloadType payloadType, @JsonProperty("payload") final String payload, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -159,11 +159,11 @@ public final String getSimIccid() { return this.simIccid; } - public final Status getStatus() { + public final IpCommand.Status getStatus() { return this.status; } - public final Direction getDirection() { + public final IpCommand.Direction getDirection() { return this.direction; } @@ -175,7 +175,7 @@ public final Integer getDevicePort() { return this.devicePort; } - public final PayloadType getPayloadType() { + public final IpCommand.PayloadType getPayloadType() { return this.payloadType; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/SettingsUpdate.java b/src/main/java/com/twilio/rest/supersim/v1/SettingsUpdate.java index 05a18f96f5..4d3dbc2f17 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/SettingsUpdate.java +++ b/src/main/java/com/twilio/rest/supersim/v1/SettingsUpdate.java @@ -91,7 +91,7 @@ public static SettingsUpdate fromJson( private final String sid; private final String iccid; private final String simSid; - private final Status status; + private final SettingsUpdate.Status status; private final List> packages; private final ZonedDateTime dateCompleted; private final ZonedDateTime dateCreated; @@ -102,7 +102,7 @@ private SettingsUpdate( @JsonProperty("sid") final String sid, @JsonProperty("iccid") final String iccid, @JsonProperty("sim_sid") final String simSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final SettingsUpdate.Status status, @JsonProperty("packages") final List> packages, @JsonProperty("date_completed") final String dateCompleted, @JsonProperty("date_created") final String dateCreated, @@ -131,7 +131,7 @@ public final String getSimSid() { return this.simSid; } - public final Status getStatus() { + public final SettingsUpdate.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/Sim.java b/src/main/java/com/twilio/rest/supersim/v1/Sim.java index 2829cf05ba..072e1815fb 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/Sim.java +++ b/src/main/java/com/twilio/rest/supersim/v1/Sim.java @@ -107,7 +107,7 @@ public static Sim fromJson( private final String uniqueName; private final String accountSid; private final String iccid; - private final Status status; + private final Sim.Status status; private final String fleetSid; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -120,7 +120,7 @@ private Sim( @JsonProperty("unique_name") final String uniqueName, @JsonProperty("account_sid") final String accountSid, @JsonProperty("iccid") final String iccid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Sim.Status status, @JsonProperty("fleet_sid") final String fleetSid, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -155,7 +155,7 @@ public final String getIccid() { return this.iccid; } - public final Status getStatus() { + public final Sim.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/SmsCommand.java b/src/main/java/com/twilio/rest/supersim/v1/SmsCommand.java index 6e22dd0e57..ab1c698aa7 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/SmsCommand.java +++ b/src/main/java/com/twilio/rest/supersim/v1/SmsCommand.java @@ -101,8 +101,8 @@ public static SmsCommand fromJson( private final String accountSid; private final String simSid; private final String payload; - private final Status status; - private final Direction direction; + private final SmsCommand.Status status; + private final SmsCommand.Direction direction; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -113,8 +113,8 @@ private SmsCommand( @JsonProperty("account_sid") final String accountSid, @JsonProperty("sim_sid") final String simSid, @JsonProperty("payload") final String payload, - @JsonProperty("status") final Status status, - @JsonProperty("direction") final Direction direction, + @JsonProperty("status") final SmsCommand.Status status, + @JsonProperty("direction") final SmsCommand.Direction direction, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url @@ -146,11 +146,11 @@ public final String getPayload() { return this.payload; } - public final Status getStatus() { + public final SmsCommand.Status getStatus() { return this.status; } - public final Direction getDirection() { + public final SmsCommand.Direction getDirection() { return this.direction; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/UsageRecord.java b/src/main/java/com/twilio/rest/supersim/v1/UsageRecord.java index dd18ce4249..2b7510e170 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/UsageRecord.java +++ b/src/main/java/com/twilio/rest/supersim/v1/UsageRecord.java @@ -114,7 +114,7 @@ private UsageRecord( @JsonProperty("data_total") final Long dataTotal, @JsonProperty("data_total_billed") final BigDecimal dataTotalBilled, @JsonProperty("billed_unit") @JsonDeserialize( - using = CurrencyDeserializer.class + using = com.twilio.converter.CurrencyDeserializer.class ) final Currency billedUnit ) { this.accountSid = accountSid; diff --git a/src/main/java/com/twilio/rest/supersim/v1/sim/BillingPeriod.java b/src/main/java/com/twilio/rest/supersim/v1/sim/BillingPeriod.java index 2cd6b48046..d73822c5b7 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/sim/BillingPeriod.java +++ b/src/main/java/com/twilio/rest/supersim/v1/sim/BillingPeriod.java @@ -90,7 +90,7 @@ public static BillingPeriod fromJson( private final String simSid; private final ZonedDateTime startTime; private final ZonedDateTime endTime; - private final BpType periodType; + private final BillingPeriod.BpType periodType; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -101,7 +101,7 @@ private BillingPeriod( @JsonProperty("sim_sid") final String simSid, @JsonProperty("start_time") final String startTime, @JsonProperty("end_time") final String endTime, - @JsonProperty("period_type") final BpType periodType, + @JsonProperty("period_type") final BillingPeriod.BpType periodType, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated ) { @@ -135,7 +135,7 @@ public final ZonedDateTime getEndTime() { return this.endTime; } - public final BpType getPeriodType() { + public final BillingPeriod.BpType getPeriodType() { return this.periodType; } diff --git a/src/main/java/com/twilio/rest/supersim/v1/sim/SimIpAddress.java b/src/main/java/com/twilio/rest/supersim/v1/sim/SimIpAddress.java index 88f3361ac7..2983f71ba4 100644 --- a/src/main/java/com/twilio/rest/supersim/v1/sim/SimIpAddress.java +++ b/src/main/java/com/twilio/rest/supersim/v1/sim/SimIpAddress.java @@ -84,14 +84,14 @@ public static SimIpAddress fromJson( } private final String ipAddress; - private final IpAddressVersion ipAddressVersion; + private final SimIpAddress.IpAddressVersion ipAddressVersion; @JsonCreator private SimIpAddress( @JsonProperty("ip_address") final String ipAddress, @JsonProperty( "ip_address_version" - ) final IpAddressVersion ipAddressVersion + ) final SimIpAddress.IpAddressVersion ipAddressVersion ) { this.ipAddress = ipAddress; this.ipAddressVersion = ipAddressVersion; @@ -101,7 +101,7 @@ public final String getIpAddress() { return this.ipAddress; } - public final IpAddressVersion getIpAddressVersion() { + public final SimIpAddress.IpAddressVersion getIpAddressVersion() { return this.ipAddressVersion; } diff --git a/src/main/java/com/twilio/rest/sync/v1/service/DocumentCreator.java b/src/main/java/com/twilio/rest/sync/v1/service/DocumentCreator.java index 3ad46deab0..9b5eca36b7 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/DocumentCreator.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/DocumentCreator.java @@ -26,12 +26,14 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; +import java.util.Map; +import java.util.Map; public class DocumentCreator extends Creator { private String pathServiceSid; private String uniqueName; - private Object data; + private Map data; private Integer ttl; public DocumentCreator(final String pathServiceSid) { @@ -43,7 +45,7 @@ public DocumentCreator setUniqueName(final String uniqueName) { return this; } - public DocumentCreator setData(final Object data) { + public DocumentCreator setData(final Map data) { this.data = data; return this; } @@ -100,7 +102,7 @@ private void addPostParams(final Request request) { request.addPostParam("UniqueName", uniqueName); } if (data != null) { - request.addPostParam("Data", Converter.objectToJson(data)); + request.addPostParam("Data", Converter.mapToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/DocumentUpdater.java b/src/main/java/com/twilio/rest/sync/v1/service/DocumentUpdater.java index 8c4bb058d5..1561d4c8a2 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/DocumentUpdater.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/DocumentUpdater.java @@ -25,13 +25,14 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; +import java.util.Map; public class DocumentUpdater extends Updater { private String pathServiceSid; private String pathSid; private String ifMatch; - private Object data; + private Map data; private Integer ttl; public DocumentUpdater(final String pathServiceSid, final String pathSid) { @@ -44,7 +45,7 @@ public DocumentUpdater setIfMatch(final String ifMatch) { return this; } - public DocumentUpdater setData(final Object data) { + public DocumentUpdater setData(final Map data) { this.data = data; return this; } @@ -100,7 +101,7 @@ public Document update(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.objectToJson(data)); + request.addPostParam("Data", Converter.mapToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItem.java b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItem.java index 00bbcafebd..c0d70df086 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItem.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItem.java @@ -44,7 +44,7 @@ public class SyncListItem extends Resource { public static SyncListItemCreator creator( final String pathServiceSid, final String pathListSid, - final Object data + final Map data ) { return new SyncListItemCreator(pathServiceSid, pathListSid, data); } diff --git a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemCreator.java b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemCreator.java index 4d8ac8f192..2af4101ee6 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemCreator.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemCreator.java @@ -26,12 +26,14 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; +import java.util.Map; +import java.util.Map; public class SyncListItemCreator extends Creator { private String pathServiceSid; private String pathListSid; - private Object data; + private Map data; private Integer ttl; private Integer itemTtl; private Integer collectionTtl; @@ -39,14 +41,14 @@ public class SyncListItemCreator extends Creator { public SyncListItemCreator( final String pathServiceSid, final String pathListSid, - final Object data + final Map data ) { this.pathServiceSid = pathServiceSid; this.pathListSid = pathListSid; this.data = data; } - public SyncListItemCreator setData(final Object data) { + public SyncListItemCreator setData(final Map data) { this.data = data; return this; } @@ -112,7 +114,7 @@ public SyncListItem create(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.objectToJson(data)); + request.addPostParam("Data", Converter.mapToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemUpdater.java b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemUpdater.java index 24dde562ca..df538d9384 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemUpdater.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemUpdater.java @@ -25,6 +25,7 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; +import java.util.Map; public class SyncListItemUpdater extends Updater { @@ -32,7 +33,7 @@ public class SyncListItemUpdater extends Updater { private String pathListSid; private Integer pathIndex; private String ifMatch; - private Object data; + private Map data; private Integer ttl; private Integer itemTtl; private Integer collectionTtl; @@ -52,7 +53,7 @@ public SyncListItemUpdater setIfMatch(final String ifMatch) { return this; } - public SyncListItemUpdater setData(final Object data) { + public SyncListItemUpdater setData(final Map data) { this.data = data; return this; } @@ -119,7 +120,7 @@ public SyncListItem update(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.objectToJson(data)); + request.addPostParam("Data", Converter.mapToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItem.java b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItem.java index f134d6fb0c..e2c25935cf 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItem.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItem.java @@ -45,7 +45,7 @@ public static SyncMapItemCreator creator( final String pathServiceSid, final String pathMapSid, final String key, - final Object data + final Map data ) { return new SyncMapItemCreator(pathServiceSid, pathMapSid, key, data); } diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemCreator.java b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemCreator.java index c85bdbfeb9..095e615ca2 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemCreator.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemCreator.java @@ -26,13 +26,15 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; +import java.util.Map; +import java.util.Map; public class SyncMapItemCreator extends Creator { private String pathServiceSid; private String pathMapSid; private String key; - private Object data; + private Map data; private Integer ttl; private Integer itemTtl; private Integer collectionTtl; @@ -41,7 +43,7 @@ public SyncMapItemCreator( final String pathServiceSid, final String pathMapSid, final String key, - final Object data + final Map data ) { this.pathServiceSid = pathServiceSid; this.pathMapSid = pathMapSid; @@ -54,7 +56,7 @@ public SyncMapItemCreator setKey(final String key) { return this; } - public SyncMapItemCreator setData(final Object data) { + public SyncMapItemCreator setData(final Map data) { this.data = data; return this; } @@ -124,7 +126,7 @@ private void addPostParams(final Request request) { request.addPostParam("Key", key); } if (data != null) { - request.addPostParam("Data", Converter.objectToJson(data)); + request.addPostParam("Data", Converter.mapToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemUpdater.java b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemUpdater.java index b0b1a151c0..f9cb5af292 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemUpdater.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemUpdater.java @@ -25,6 +25,7 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; +import java.util.Map; public class SyncMapItemUpdater extends Updater { @@ -32,7 +33,7 @@ public class SyncMapItemUpdater extends Updater { private String pathMapSid; private String pathKey; private String ifMatch; - private Object data; + private Map data; private Integer ttl; private Integer itemTtl; private Integer collectionTtl; @@ -52,7 +53,7 @@ public SyncMapItemUpdater setIfMatch(final String ifMatch) { return this; } - public SyncMapItemUpdater setData(final Object data) { + public SyncMapItemUpdater setData(final Map data) { this.data = data; return this; } @@ -119,7 +120,7 @@ public SyncMapItem update(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.objectToJson(data)); + request.addPostParam("Data", Converter.mapToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessage.java b/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessage.java index b787e9d5a1..7191f3acc2 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessage.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessage.java @@ -40,7 +40,7 @@ public class StreamMessage extends Resource { public static StreamMessageCreator creator( final String pathServiceSid, final String pathStreamSid, - final Object data + final Map data ) { return new StreamMessageCreator(pathServiceSid, pathStreamSid, data); } diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessageCreator.java b/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessageCreator.java index 015002f303..5739a6e69d 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessageCreator.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessageCreator.java @@ -26,24 +26,26 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; +import java.util.Map; +import java.util.Map; public class StreamMessageCreator extends Creator { private String pathServiceSid; private String pathStreamSid; - private Object data; + private Map data; public StreamMessageCreator( final String pathServiceSid, final String pathStreamSid, - final Object data + final Map data ) { this.pathServiceSid = pathServiceSid; this.pathStreamSid = pathStreamSid; this.data = data; } - public StreamMessageCreator setData(final Object data) { + public StreamMessageCreator setData(final Map data) { this.data = data; return this; } @@ -98,7 +100,7 @@ public StreamMessage create(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.objectToJson(data)); + request.addPostParam("Data", Converter.mapToJson(data)); } } } diff --git a/src/main/java/com/twilio/rest/taskrouter/v1/Workspace.java b/src/main/java/com/twilio/rest/taskrouter/v1/Workspace.java index 9d2660f685..4ab41a8013 100644 --- a/src/main/java/com/twilio/rest/taskrouter/v1/Workspace.java +++ b/src/main/java/com/twilio/rest/taskrouter/v1/Workspace.java @@ -116,7 +116,7 @@ public static Workspace fromJson( private final String sid; private final String timeoutActivityName; private final String timeoutActivitySid; - private final QueueOrder prioritizeQueueOrder; + private final Workspace.QueueOrder prioritizeQueueOrder; private final URI url; private final Map links; @@ -136,7 +136,7 @@ private Workspace( @JsonProperty("timeout_activity_sid") final String timeoutActivitySid, @JsonProperty( "prioritize_queue_order" - ) final QueueOrder prioritizeQueueOrder, + ) final Workspace.QueueOrder prioritizeQueueOrder, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links ) { @@ -205,7 +205,7 @@ public final String getTimeoutActivitySid() { return this.timeoutActivitySid; } - public final QueueOrder getPrioritizeQueueOrder() { + public final Workspace.QueueOrder getPrioritizeQueueOrder() { return this.prioritizeQueueOrder; } diff --git a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/Task.java b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/Task.java index 09f55e1d04..5179bf0053 100644 --- a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/Task.java +++ b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/Task.java @@ -115,7 +115,7 @@ public static Task fromJson( private final String accountSid; private final Integer age; - private final Status assignmentStatus; + private final Task.Status assignmentStatus; private final String attributes; private final String addons; private final ZonedDateTime dateCreated; @@ -142,7 +142,7 @@ public static Task fromJson( private Task( @JsonProperty("account_sid") final String accountSid, @JsonProperty("age") final Integer age, - @JsonProperty("assignment_status") final Status assignmentStatus, + @JsonProperty("assignment_status") final Task.Status assignmentStatus, @JsonProperty("attributes") final String attributes, @JsonProperty("addons") final String addons, @JsonProperty("date_created") final String dateCreated, @@ -209,7 +209,7 @@ public final Integer getAge() { return this.age; } - public final Status getAssignmentStatus() { + public final Task.Status getAssignmentStatus() { return this.assignmentStatus; } diff --git a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/TaskQueue.java b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/TaskQueue.java index 28550cc4ce..15f1dfabef 100644 --- a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/TaskQueue.java +++ b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/TaskQueue.java @@ -127,7 +127,7 @@ public static TaskQueue fromJson( private final String reservationActivityName; private final String sid; private final String targetWorkers; - private final TaskOrder taskOrder; + private final TaskQueue.TaskOrder taskOrder; private final URI url; private final String workspaceSid; private final Map links; @@ -153,7 +153,7 @@ private TaskQueue( ) final String reservationActivityName, @JsonProperty("sid") final String sid, @JsonProperty("target_workers") final String targetWorkers, - @JsonProperty("task_order") final TaskOrder taskOrder, + @JsonProperty("task_order") final TaskQueue.TaskOrder taskOrder, @JsonProperty("url") final URI url, @JsonProperty("workspace_sid") final String workspaceSid, @JsonProperty("links") final Map links @@ -219,7 +219,7 @@ public final String getTargetWorkers() { return this.targetWorkers; } - public final TaskOrder getTaskOrder() { + public final TaskQueue.TaskOrder getTaskOrder() { return this.taskOrder; } diff --git a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/task/Reservation.java b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/task/Reservation.java index 14ae6d69c9..e3755218cc 100644 --- a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/task/Reservation.java +++ b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/task/Reservation.java @@ -110,7 +110,7 @@ public static Reservation fromJson( private final String accountSid; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; - private final Status reservationStatus; + private final Reservation.Status reservationStatus; private final String sid; private final String taskSid; private final String workerName; @@ -124,7 +124,9 @@ private Reservation( @JsonProperty("account_sid") final String accountSid, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, - @JsonProperty("reservation_status") final Status reservationStatus, + @JsonProperty( + "reservation_status" + ) final Reservation.Status reservationStatus, @JsonProperty("sid") final String sid, @JsonProperty("task_sid") final String taskSid, @JsonProperty("worker_name") final String workerName, @@ -158,7 +160,7 @@ public final ZonedDateTime getDateUpdated() { return this.dateUpdated; } - public final Status getReservationStatus() { + public final Reservation.Status getReservationStatus() { return this.reservationStatus; } diff --git a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/worker/Reservation.java b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/worker/Reservation.java index 89c4a7f9d4..3c6c7d48d6 100644 --- a/src/main/java/com/twilio/rest/taskrouter/v1/workspace/worker/Reservation.java +++ b/src/main/java/com/twilio/rest/taskrouter/v1/workspace/worker/Reservation.java @@ -110,7 +110,7 @@ public static Reservation fromJson( private final String accountSid; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; - private final Status reservationStatus; + private final Reservation.Status reservationStatus; private final String sid; private final String taskSid; private final String workerName; @@ -124,7 +124,9 @@ private Reservation( @JsonProperty("account_sid") final String accountSid, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, - @JsonProperty("reservation_status") final Status reservationStatus, + @JsonProperty( + "reservation_status" + ) final Reservation.Status reservationStatus, @JsonProperty("sid") final String sid, @JsonProperty("task_sid") final String taskSid, @JsonProperty("worker_name") final String workerName, @@ -158,7 +160,7 @@ public final ZonedDateTime getDateUpdated() { return this.dateUpdated; } - public final Status getReservationStatus() { + public final Reservation.Status getReservationStatus() { return this.reservationStatus; } diff --git a/src/main/java/com/twilio/rest/trunking/v1/Trunk.java b/src/main/java/com/twilio/rest/trunking/v1/Trunk.java index 48919cb239..6ddece0cab 100644 --- a/src/main/java/com/twilio/rest/trunking/v1/Trunk.java +++ b/src/main/java/com/twilio/rest/trunking/v1/Trunk.java @@ -41,7 +41,7 @@ @ToString public class Trunk extends Resource { - private static final long serialVersionUID = 225938897286327L; + private static final long serialVersionUID = 232204827569278L; public static TrunkCreator creator() { return new TrunkCreator(); @@ -113,10 +113,11 @@ public static Trunk fromJson( private final String friendlyName; private final Boolean secure; private final Map recording; - private final TransferSetting transferMode; - private final TransferCallerId transferCallerId; + private final Trunk.TransferSetting transferMode; + private final Trunk.TransferCallerId transferCallerId; private final Boolean cnamLookupEnabled; private final String authType; + private final Boolean symmetricRtpEnabled; private final List authTypeSet; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -135,12 +136,15 @@ private Trunk( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("secure") final Boolean secure, @JsonProperty("recording") final Map recording, - @JsonProperty("transfer_mode") final TransferSetting transferMode, + @JsonProperty("transfer_mode") final Trunk.TransferSetting transferMode, @JsonProperty( "transfer_caller_id" - ) final TransferCallerId transferCallerId, + ) final Trunk.TransferCallerId transferCallerId, @JsonProperty("cnam_lookup_enabled") final Boolean cnamLookupEnabled, @JsonProperty("auth_type") final String authType, + @JsonProperty( + "symmetric_rtp_enabled" + ) final Boolean symmetricRtpEnabled, @JsonProperty("auth_type_set") final List authTypeSet, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -159,6 +163,7 @@ private Trunk( this.transferCallerId = transferCallerId; this.cnamLookupEnabled = cnamLookupEnabled; this.authType = authType; + this.symmetricRtpEnabled = symmetricRtpEnabled; this.authTypeSet = authTypeSet; this.dateCreated = DateConverter.iso8601DateTimeFromString(dateCreated); this.dateUpdated = DateConverter.iso8601DateTimeFromString(dateUpdated); @@ -195,11 +200,11 @@ public final Map getRecording() { return this.recording; } - public final TransferSetting getTransferMode() { + public final Trunk.TransferSetting getTransferMode() { return this.transferMode; } - public final TransferCallerId getTransferCallerId() { + public final Trunk.TransferCallerId getTransferCallerId() { return this.transferCallerId; } @@ -211,6 +216,10 @@ public final String getAuthType() { return this.authType; } + public final Boolean getSymmetricRtpEnabled() { + return this.symmetricRtpEnabled; + } + public final List getAuthTypeSet() { return this.authTypeSet; } @@ -262,6 +271,7 @@ public boolean equals(final Object o) { Objects.equals(transferCallerId, other.transferCallerId) && Objects.equals(cnamLookupEnabled, other.cnamLookupEnabled) && Objects.equals(authType, other.authType) && + Objects.equals(symmetricRtpEnabled, other.symmetricRtpEnabled) && Objects.equals(authTypeSet, other.authTypeSet) && Objects.equals(dateCreated, other.dateCreated) && Objects.equals(dateUpdated, other.dateUpdated) && @@ -285,6 +295,7 @@ public int hashCode() { transferCallerId, cnamLookupEnabled, authType, + symmetricRtpEnabled, authTypeSet, dateCreated, dateUpdated, diff --git a/src/main/java/com/twilio/rest/trunking/v1/trunk/PhoneNumber.java b/src/main/java/com/twilio/rest/trunking/v1/trunk/PhoneNumber.java index beef3087ff..733b18311c 100644 --- a/src/main/java/com/twilio/rest/trunking/v1/trunk/PhoneNumber.java +++ b/src/main/java/com/twilio/rest/trunking/v1/trunk/PhoneNumber.java @@ -111,7 +111,7 @@ public static PhoneNumber fromJson( } private final String accountSid; - private final AddressRequirement addressRequirements; + private final PhoneNumber.AddressRequirement addressRequirements; private final String apiVersion; private final Boolean beta; private final Map capabilities; @@ -142,7 +142,7 @@ private PhoneNumber( @JsonProperty("account_sid") final String accountSid, @JsonProperty( "address_requirements" - ) final AddressRequirement addressRequirements, + ) final PhoneNumber.AddressRequirement addressRequirements, @JsonProperty("api_version") final String apiVersion, @JsonProperty("beta") final Boolean beta, @JsonProperty("capabilities") final Map capabilities, @@ -208,7 +208,7 @@ public final String getAccountSid() { return this.accountSid; } - public final AddressRequirement getAddressRequirements() { + public final PhoneNumber.AddressRequirement getAddressRequirements() { return this.addressRequirements; } diff --git a/src/main/java/com/twilio/rest/trunking/v1/trunk/Recording.java b/src/main/java/com/twilio/rest/trunking/v1/trunk/Recording.java index 709ccb95c9..022e65d0b9 100644 --- a/src/main/java/com/twilio/rest/trunking/v1/trunk/Recording.java +++ b/src/main/java/com/twilio/rest/trunking/v1/trunk/Recording.java @@ -87,23 +87,23 @@ public static Recording fromJson( } } - private final RecordingMode mode; - private final RecordingTrim trim; + private final Recording.RecordingMode mode; + private final Recording.RecordingTrim trim; @JsonCreator private Recording( - @JsonProperty("mode") final RecordingMode mode, - @JsonProperty("trim") final RecordingTrim trim + @JsonProperty("mode") final Recording.RecordingMode mode, + @JsonProperty("trim") final Recording.RecordingTrim trim ) { this.mode = mode; this.trim = trim; } - public final RecordingMode getMode() { + public final Recording.RecordingMode getMode() { return this.mode; } - public final RecordingTrim getTrim() { + public final Recording.RecordingTrim getTrim() { return this.trim; } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/ComplianceRegistrationInquiries.java b/src/main/java/com/twilio/rest/trusthub/v1/ComplianceRegistrationInquiries.java index 76a614b6e0..b633de24f7 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/ComplianceRegistrationInquiries.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/ComplianceRegistrationInquiries.java @@ -38,8 +38,8 @@ public class ComplianceRegistrationInquiries extends Resource { private static final long serialVersionUID = 153862952025802L; public static ComplianceRegistrationInquiriesCreator creator( - final EndUserType endUserType, - final PhoneNumberType phoneNumberType + final ComplianceRegistrationInquiries.EndUserType endUserType, + final ComplianceRegistrationInquiries.PhoneNumberType phoneNumberType ) { return new ComplianceRegistrationInquiriesCreator( endUserType, diff --git a/src/main/java/com/twilio/rest/trusthub/v1/CustomerProfiles.java b/src/main/java/com/twilio/rest/trusthub/v1/CustomerProfiles.java index 7225389bcd..9217f2067b 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/CustomerProfiles.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/CustomerProfiles.java @@ -113,7 +113,7 @@ public static CustomerProfiles fromJson( private final String accountSid; private final String policySid; private final String friendlyName; - private final Status status; + private final CustomerProfiles.Status status; private final ZonedDateTime validUntil; private final String email; private final URI statusCallback; @@ -129,7 +129,7 @@ private CustomerProfiles( @JsonProperty("account_sid") final String accountSid, @JsonProperty("policy_sid") final String policySid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final Status status, + @JsonProperty("status") final CustomerProfiles.Status status, @JsonProperty("valid_until") final String validUntil, @JsonProperty("email") final String email, @JsonProperty("status_callback") final URI statusCallback, @@ -170,7 +170,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Status getStatus() { + public final CustomerProfiles.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocument.java b/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocument.java index e9c68d404c..fcb0e31305 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocument.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/SupportingDocument.java @@ -111,7 +111,7 @@ public static SupportingDocument fromJson( private final String accountSid; private final String friendlyName; private final String mimeType; - private final Status status; + private final SupportingDocument.Status status; private final String type; private final Map attributes; private final ZonedDateTime dateCreated; @@ -124,7 +124,7 @@ private SupportingDocument( @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("mime_type") final String mimeType, - @JsonProperty("status") final Status status, + @JsonProperty("status") final SupportingDocument.Status status, @JsonProperty("type") final String type, @JsonProperty("attributes") final Map attributes, @JsonProperty("date_created") final String dateCreated, @@ -159,7 +159,7 @@ public final String getMimeType() { return this.mimeType; } - public final Status getStatus() { + public final SupportingDocument.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/TrustProducts.java b/src/main/java/com/twilio/rest/trusthub/v1/TrustProducts.java index 97afa46975..a1be16ed7e 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/TrustProducts.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/TrustProducts.java @@ -113,7 +113,7 @@ public static TrustProducts fromJson( private final String accountSid; private final String policySid; private final String friendlyName; - private final Status status; + private final TrustProducts.Status status; private final ZonedDateTime validUntil; private final String email; private final URI statusCallback; @@ -129,7 +129,7 @@ private TrustProducts( @JsonProperty("account_sid") final String accountSid, @JsonProperty("policy_sid") final String policySid, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final Status status, + @JsonProperty("status") final TrustProducts.Status status, @JsonProperty("valid_until") final String validUntil, @JsonProperty("email") final String email, @JsonProperty("status_callback") final URI statusCallback, @@ -170,7 +170,7 @@ public final String getFriendlyName() { return this.friendlyName; } - public final Status getStatus() { + public final TrustProducts.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/customerprofiles/CustomerProfilesEvaluations.java b/src/main/java/com/twilio/rest/trusthub/v1/customerprofiles/CustomerProfilesEvaluations.java index 04af325a8b..27d0116ac0 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/customerprofiles/CustomerProfilesEvaluations.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/customerprofiles/CustomerProfilesEvaluations.java @@ -121,7 +121,7 @@ public static CustomerProfilesEvaluations fromJson( private final String accountSid; private final String policySid; private final String customerProfileSid; - private final Status status; + private final CustomerProfilesEvaluations.Status status; private final List> results; private final ZonedDateTime dateCreated; private final URI url; @@ -132,7 +132,7 @@ private CustomerProfilesEvaluations( @JsonProperty("account_sid") final String accountSid, @JsonProperty("policy_sid") final String policySid, @JsonProperty("customer_profile_sid") final String customerProfileSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final CustomerProfilesEvaluations.Status status, @JsonProperty("results") final List> results, @JsonProperty("date_created") final String dateCreated, @JsonProperty("url") final URI url @@ -163,7 +163,7 @@ public final String getCustomerProfileSid() { return this.customerProfileSid; } - public final Status getStatus() { + public final CustomerProfilesEvaluations.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/trusthub/v1/trustproducts/TrustProductsEvaluations.java b/src/main/java/com/twilio/rest/trusthub/v1/trustproducts/TrustProductsEvaluations.java index 9c10b40232..c2aee8cf6b 100644 --- a/src/main/java/com/twilio/rest/trusthub/v1/trustproducts/TrustProductsEvaluations.java +++ b/src/main/java/com/twilio/rest/trusthub/v1/trustproducts/TrustProductsEvaluations.java @@ -115,7 +115,7 @@ public static TrustProductsEvaluations fromJson( private final String accountSid; private final String policySid; private final String trustProductSid; - private final Status status; + private final TrustProductsEvaluations.Status status; private final List> results; private final ZonedDateTime dateCreated; private final URI url; @@ -126,7 +126,7 @@ private TrustProductsEvaluations( @JsonProperty("account_sid") final String accountSid, @JsonProperty("policy_sid") final String policySid, @JsonProperty("trust_product_sid") final String trustProductSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final TrustProductsEvaluations.Status status, @JsonProperty("results") final List> results, @JsonProperty("date_created") final String dateCreated, @JsonProperty("url") final URI url @@ -157,7 +157,7 @@ public final String getTrustProductSid() { return this.trustProductSid; } - public final Status getStatus() { + public final TrustProductsEvaluations.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/verify/v2/Form.java b/src/main/java/com/twilio/rest/verify/v2/Form.java index 0511a234b7..c6f82158f9 100644 --- a/src/main/java/com/twilio/rest/verify/v2/Form.java +++ b/src/main/java/com/twilio/rest/verify/v2/Form.java @@ -39,7 +39,7 @@ public class Form extends Resource { private static final long serialVersionUID = 202517967097226L; - public static FormFetcher fetcher(final FormTypes formType) { + public static FormFetcher fetcher(final Form.FormTypes formType) { return new FormFetcher(formType); } @@ -86,14 +86,14 @@ public static Form fromJson( } } - private final FormTypes formType; + private final Form.FormTypes formType; private final Map forms; private final Map formMeta; private final URI url; @JsonCreator private Form( - @JsonProperty("form_type") final FormTypes formType, + @JsonProperty("form_type") final Form.FormTypes formType, @JsonProperty("forms") final Map forms, @JsonProperty("form_meta") final Map formMeta, @JsonProperty("url") final URI url @@ -104,7 +104,7 @@ private Form( this.url = url; } - public final FormTypes getFormType() { + public final Form.FormTypes getFormType() { return this.formType; } diff --git a/src/main/java/com/twilio/rest/verify/v2/VerificationAttempt.java b/src/main/java/com/twilio/rest/verify/v2/VerificationAttempt.java index de89169b16..5fc710aaf4 100644 --- a/src/main/java/com/twilio/rest/verify/v2/VerificationAttempt.java +++ b/src/main/java/com/twilio/rest/verify/v2/VerificationAttempt.java @@ -98,8 +98,8 @@ public static VerificationAttempt fromJson( private final String verificationSid; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; - private final ConversionStatus conversionStatus; - private final Channels channel; + private final VerificationAttempt.ConversionStatus conversionStatus; + private final VerificationAttempt.Channels channel; private final Map price; private final Map channelData; private final URI url; @@ -114,8 +114,8 @@ private VerificationAttempt( @JsonProperty("date_updated") final String dateUpdated, @JsonProperty( "conversion_status" - ) final ConversionStatus conversionStatus, - @JsonProperty("channel") final Channels channel, + ) final VerificationAttempt.ConversionStatus conversionStatus, + @JsonProperty("channel") final VerificationAttempt.Channels channel, @JsonProperty("price") final Map price, @JsonProperty("channel_data") final Map channelData, @JsonProperty("url") final URI url @@ -157,11 +157,11 @@ public final ZonedDateTime getDateUpdated() { return this.dateUpdated; } - public final ConversionStatus getConversionStatus() { + public final VerificationAttempt.ConversionStatus getConversionStatus() { return this.conversionStatus; } - public final Channels getChannel() { + public final VerificationAttempt.Channels getChannel() { return this.channel; } @@ -246,8 +246,7 @@ public enum Channels { CALL("call"), EMAIL("email"), WHATSAPP("whatsapp"), - RBM("rbm"), - SNA("sna"); + RBM("rbm"); private final String value; diff --git a/src/main/java/com/twilio/rest/verify/v2/VerificationAttemptsSummary.java b/src/main/java/com/twilio/rest/verify/v2/VerificationAttemptsSummary.java index 5566ca5174..925f76b700 100644 --- a/src/main/java/com/twilio/rest/verify/v2/VerificationAttemptsSummary.java +++ b/src/main/java/com/twilio/rest/verify/v2/VerificationAttemptsSummary.java @@ -172,7 +172,8 @@ public enum Channels { SMS("sms"), CALL("call"), EMAIL("email"), - WHATSAPP("whatsapp"); + WHATSAPP("whatsapp"), + RBM("rbm"); private final String value; diff --git a/src/main/java/com/twilio/rest/verify/v2/service/AccessToken.java b/src/main/java/com/twilio/rest/verify/v2/service/AccessToken.java index 64f406878e..e8ed33b57d 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/AccessToken.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/AccessToken.java @@ -42,7 +42,7 @@ public class AccessToken extends Resource { public static AccessTokenCreator creator( final String pathServiceSid, final String identity, - final FactorTypes factorType + final AccessToken.FactorTypes factorType ) { return new AccessTokenCreator(pathServiceSid, identity, factorType); } @@ -101,7 +101,7 @@ public static AccessToken fromJson( private final String accountSid; private final String serviceSid; private final String entityIdentity; - private final FactorTypes factorType; + private final AccessToken.FactorTypes factorType; private final String factorFriendlyName; private final String token; private final URI url; @@ -114,7 +114,7 @@ private AccessToken( @JsonProperty("account_sid") final String accountSid, @JsonProperty("service_sid") final String serviceSid, @JsonProperty("entity_identity") final String entityIdentity, - @JsonProperty("factor_type") final FactorTypes factorType, + @JsonProperty("factor_type") final AccessToken.FactorTypes factorType, @JsonProperty("factor_friendly_name") final String factorFriendlyName, @JsonProperty("token") final String token, @JsonProperty("url") final URI url, @@ -149,7 +149,7 @@ public final String getEntityIdentity() { return this.entityIdentity; } - public final FactorTypes getFactorType() { + public final AccessToken.FactorTypes getFactorType() { return this.factorType; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/Verification.java b/src/main/java/com/twilio/rest/verify/v2/service/Verification.java index c46be724eb..913b0b4db9 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/Verification.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/Verification.java @@ -60,7 +60,7 @@ public static VerificationFetcher fetcher( public static VerificationUpdater updater( final String pathServiceSid, final String pathSid, - final Status status + final Verification.Status status ) { return new VerificationUpdater(pathServiceSid, pathSid, status); } @@ -112,7 +112,7 @@ public static Verification fromJson( private final String serviceSid; private final String accountSid; private final String to; - private final Channel channel; + private final Verification.Channel channel; private final String status; private final Boolean valid; private final Map lookup; @@ -130,7 +130,7 @@ private Verification( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("to") final String to, - @JsonProperty("channel") final Channel channel, + @JsonProperty("channel") final Verification.Channel channel, @JsonProperty("status") final String status, @JsonProperty("valid") final Boolean valid, @JsonProperty("lookup") final Map lookup, @@ -177,7 +177,7 @@ public final String getTo() { return this.to; } - public final Channel getChannel() { + public final Verification.Channel getChannel() { return this.channel; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/VerificationCheck.java b/src/main/java/com/twilio/rest/verify/v2/service/VerificationCheck.java index 938c708c7e..303b066dae 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/VerificationCheck.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/VerificationCheck.java @@ -94,7 +94,7 @@ public static VerificationCheck fromJson( private final String serviceSid; private final String accountSid; private final String to; - private final Channel channel; + private final VerificationCheck.Channel channel; private final String status; private final Boolean valid; private final String amount; @@ -109,7 +109,7 @@ private VerificationCheck( @JsonProperty("service_sid") final String serviceSid, @JsonProperty("account_sid") final String accountSid, @JsonProperty("to") final String to, - @JsonProperty("channel") final Channel channel, + @JsonProperty("channel") final VerificationCheck.Channel channel, @JsonProperty("status") final String status, @JsonProperty("valid") final Boolean valid, @JsonProperty("amount") final String amount, @@ -150,7 +150,7 @@ public final String getTo() { return this.to; } - public final Channel getChannel() { + public final VerificationCheck.Channel getChannel() { return this.channel; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/Webhook.java b/src/main/java/com/twilio/rest/verify/v2/service/Webhook.java index 1ac1c6672d..16a7742d11 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/Webhook.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/Webhook.java @@ -127,10 +127,10 @@ public static Webhook fromJson( private final String accountSid; private final String friendlyName; private final List eventTypes; - private final Status status; - private final Version version; + private final Webhook.Status status; + private final Webhook.Version version; private final URI webhookUrl; - private final Methods webhookMethod; + private final Webhook.Methods webhookMethod; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -142,10 +142,10 @@ private Webhook( @JsonProperty("account_sid") final String accountSid, @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("event_types") final List eventTypes, - @JsonProperty("status") final Status status, - @JsonProperty("version") final Version version, + @JsonProperty("status") final Webhook.Status status, + @JsonProperty("version") final Webhook.Version version, @JsonProperty("webhook_url") final URI webhookUrl, - @JsonProperty("webhook_method") final Methods webhookMethod, + @JsonProperty("webhook_method") final Webhook.Methods webhookMethod, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url @@ -184,11 +184,11 @@ public final List getEventTypes() { return this.eventTypes; } - public final Status getStatus() { + public final Webhook.Status getStatus() { return this.status; } - public final Version getVersion() { + public final Webhook.Version getVersion() { return this.version; } @@ -196,7 +196,7 @@ public final URI getWebhookUrl() { return this.webhookUrl; } - public final Methods getWebhookMethod() { + public final Webhook.Methods getWebhookMethod() { return this.webhookMethod; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/entity/Challenge.java b/src/main/java/com/twilio/rest/verify/v2/service/entity/Challenge.java index 448f620207..0d62df7622 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/entity/Challenge.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/entity/Challenge.java @@ -125,12 +125,12 @@ public static Challenge fromJson( private final ZonedDateTime dateUpdated; private final ZonedDateTime dateResponded; private final ZonedDateTime expirationDate; - private final ChallengeStatuses status; - private final ChallengeReasons respondedReason; + private final Challenge.ChallengeStatuses status; + private final Challenge.ChallengeReasons respondedReason; private final Map details; private final Map hiddenDetails; private final Map metadata; - private final FactorTypes factorType; + private final Challenge.FactorTypes factorType; private final URI url; private final Map links; @@ -146,14 +146,14 @@ private Challenge( @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("date_responded") final String dateResponded, @JsonProperty("expiration_date") final String expirationDate, - @JsonProperty("status") final ChallengeStatuses status, + @JsonProperty("status") final Challenge.ChallengeStatuses status, @JsonProperty( "responded_reason" - ) final ChallengeReasons respondedReason, + ) final Challenge.ChallengeReasons respondedReason, @JsonProperty("details") final Map details, @JsonProperty("hidden_details") final Map hiddenDetails, @JsonProperty("metadata") final Map metadata, - @JsonProperty("factor_type") final FactorTypes factorType, + @JsonProperty("factor_type") final Challenge.FactorTypes factorType, @JsonProperty("url") final URI url, @JsonProperty("links") final Map links ) { @@ -219,11 +219,11 @@ public final ZonedDateTime getExpirationDate() { return this.expirationDate; } - public final ChallengeStatuses getStatus() { + public final Challenge.ChallengeStatuses getStatus() { return this.status; } - public final ChallengeReasons getRespondedReason() { + public final Challenge.ChallengeReasons getRespondedReason() { return this.respondedReason; } @@ -239,7 +239,7 @@ public final Map getMetadata() { return this.metadata; } - public final FactorTypes getFactorType() { + public final Challenge.FactorTypes getFactorType() { return this.factorType; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/entity/Factor.java b/src/main/java/com/twilio/rest/verify/v2/service/entity/Factor.java index ba24c6e972..edeafe8f4e 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/entity/Factor.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/entity/Factor.java @@ -123,8 +123,8 @@ public static Factor fromJson( private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String friendlyName; - private final FactorStatuses status; - private final FactorTypes factorType; + private final Factor.FactorStatuses status; + private final Factor.FactorTypes factorType; private final Map config; private final Map metadata; private final URI url; @@ -139,8 +139,8 @@ private Factor( @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final FactorStatuses status, - @JsonProperty("factor_type") final FactorTypes factorType, + @JsonProperty("status") final Factor.FactorStatuses status, + @JsonProperty("factor_type") final Factor.FactorTypes factorType, @JsonProperty("config") final Map config, @JsonProperty("metadata") final Map metadata, @JsonProperty("url") final URI url @@ -192,11 +192,11 @@ public final String getFriendlyName() { return this.friendlyName; } - public final FactorStatuses getStatus() { + public final Factor.FactorStatuses getStatus() { return this.status; } - public final FactorTypes getFactorType() { + public final Factor.FactorTypes getFactorType() { return this.factorType; } diff --git a/src/main/java/com/twilio/rest/verify/v2/service/entity/NewFactor.java b/src/main/java/com/twilio/rest/verify/v2/service/entity/NewFactor.java index b5b249668f..308d23c721 100644 --- a/src/main/java/com/twilio/rest/verify/v2/service/entity/NewFactor.java +++ b/src/main/java/com/twilio/rest/verify/v2/service/entity/NewFactor.java @@ -45,7 +45,7 @@ public static NewFactorCreator creator( final String pathServiceSid, final String pathIdentity, final String friendlyName, - final FactorTypes factorType + final NewFactor.FactorTypes factorType ) { return new NewFactorCreator( pathServiceSid, @@ -107,8 +107,8 @@ public static NewFactor fromJson( private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String friendlyName; - private final FactorStatuses status; - private final FactorTypes factorType; + private final NewFactor.FactorStatuses status; + private final NewFactor.FactorTypes factorType; private final Map config; private final Map metadata; private final URI url; @@ -124,8 +124,8 @@ private NewFactor( @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("friendly_name") final String friendlyName, - @JsonProperty("status") final FactorStatuses status, - @JsonProperty("factor_type") final FactorTypes factorType, + @JsonProperty("status") final NewFactor.FactorStatuses status, + @JsonProperty("factor_type") final NewFactor.FactorTypes factorType, @JsonProperty("config") final Map config, @JsonProperty("metadata") final Map metadata, @JsonProperty("url") final URI url @@ -182,11 +182,11 @@ public final String getFriendlyName() { return this.friendlyName; } - public final FactorStatuses getStatus() { + public final NewFactor.FactorStatuses getStatus() { return this.status; } - public final FactorTypes getFactorType() { + public final NewFactor.FactorTypes getFactorType() { return this.factorType; } diff --git a/src/main/java/com/twilio/rest/video/v1/Composition.java b/src/main/java/com/twilio/rest/video/v1/Composition.java index cdb8c529ea..c58d12e102 100644 --- a/src/main/java/com/twilio/rest/video/v1/Composition.java +++ b/src/main/java/com/twilio/rest/video/v1/Composition.java @@ -103,7 +103,7 @@ public static Composition fromJson( } private final String accountSid; - private final Status status; + private final Composition.Status status; private final ZonedDateTime dateCreated; private final ZonedDateTime dateCompleted; private final ZonedDateTime dateDeleted; @@ -114,7 +114,7 @@ public static Composition fromJson( private final Map videoLayout; private final String resolution; private final Boolean trim; - private final Format format; + private final Composition.Format format; private final Integer bitrate; private final Long size; private final Integer duration; @@ -127,7 +127,7 @@ public static Composition fromJson( @JsonCreator private Composition( @JsonProperty("account_sid") final String accountSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Composition.Status status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_completed") final String dateCompleted, @JsonProperty("date_deleted") final String dateDeleted, @@ -140,7 +140,7 @@ private Composition( @JsonProperty("video_layout") final Map videoLayout, @JsonProperty("resolution") final String resolution, @JsonProperty("trim") final Boolean trim, - @JsonProperty("format") final Format format, + @JsonProperty("format") final Composition.Format format, @JsonProperty("bitrate") final Integer bitrate, @JsonProperty("size") final Long size, @JsonProperty("duration") final Integer duration, @@ -182,7 +182,7 @@ public final String getAccountSid() { return this.accountSid; } - public final Status getStatus() { + public final Composition.Status getStatus() { return this.status; } @@ -226,7 +226,7 @@ public final Boolean getTrim() { return this.trim; } - public final Format getFormat() { + public final Composition.Format getFormat() { return this.format; } diff --git a/src/main/java/com/twilio/rest/video/v1/CompositionHook.java b/src/main/java/com/twilio/rest/video/v1/CompositionHook.java index c311f937ea..4c28fa2a64 100644 --- a/src/main/java/com/twilio/rest/video/v1/CompositionHook.java +++ b/src/main/java/com/twilio/rest/video/v1/CompositionHook.java @@ -120,7 +120,7 @@ public static CompositionHook fromJson( private final Map videoLayout; private final String resolution; private final Boolean trim; - private final Format format; + private final CompositionHook.Format format; private final URI statusCallback; private final HttpMethod statusCallbackMethod; private final URI url; @@ -140,7 +140,7 @@ private CompositionHook( @JsonProperty("video_layout") final Map videoLayout, @JsonProperty("resolution") final String resolution, @JsonProperty("trim") final Boolean trim, - @JsonProperty("format") final Format format, + @JsonProperty("format") final CompositionHook.Format format, @JsonProperty("status_callback") final URI statusCallback, @JsonProperty( "status_callback_method" @@ -208,7 +208,7 @@ public final Boolean getTrim() { return this.trim; } - public final Format getFormat() { + public final CompositionHook.Format getFormat() { return this.format; } diff --git a/src/main/java/com/twilio/rest/video/v1/Recording.java b/src/main/java/com/twilio/rest/video/v1/Recording.java index 8c7e6debb8..4f21119419 100644 --- a/src/main/java/com/twilio/rest/video/v1/Recording.java +++ b/src/main/java/com/twilio/rest/video/v1/Recording.java @@ -98,16 +98,16 @@ public static Recording fromJson( } private final String accountSid; - private final Status status; + private final Recording.Status status; private final ZonedDateTime dateCreated; private final String sid; private final String sourceSid; private final Long size; private final URI url; - private final Type type; + private final Recording.Type type; private final Integer duration; - private final Format containerFormat; - private final Codec codec; + private final Recording.Format containerFormat; + private final Recording.Codec codec; private final Map groupingSids; private final String trackName; private final Long offset; @@ -119,16 +119,18 @@ public static Recording fromJson( @JsonCreator private Recording( @JsonProperty("account_sid") final String accountSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Recording.Status status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("sid") final String sid, @JsonProperty("source_sid") final String sourceSid, @JsonProperty("size") final Long size, @JsonProperty("url") final URI url, - @JsonProperty("type") final Type type, + @JsonProperty("type") final Recording.Type type, @JsonProperty("duration") final Integer duration, - @JsonProperty("container_format") final Format containerFormat, - @JsonProperty("codec") final Codec codec, + @JsonProperty( + "container_format" + ) final Recording.Format containerFormat, + @JsonProperty("codec") final Recording.Codec codec, @JsonProperty("grouping_sids") final Map groupingSids, @JsonProperty("track_name") final String trackName, @JsonProperty("offset") final Long offset, @@ -165,7 +167,7 @@ public final String getAccountSid() { return this.accountSid; } - public final Status getStatus() { + public final Recording.Status getStatus() { return this.status; } @@ -189,7 +191,7 @@ public final URI getUrl() { return this.url; } - public final Type getType() { + public final Recording.Type getType() { return this.type; } @@ -197,11 +199,11 @@ public final Integer getDuration() { return this.duration; } - public final Format getContainerFormat() { + public final Recording.Format getContainerFormat() { return this.containerFormat; } - public final Codec getCodec() { + public final Recording.Codec getCodec() { return this.codec; } diff --git a/src/main/java/com/twilio/rest/video/v1/Room.java b/src/main/java/com/twilio/rest/video/v1/Room.java index 3ed9520d58..77a513b610 100644 --- a/src/main/java/com/twilio/rest/video/v1/Room.java +++ b/src/main/java/com/twilio/rest/video/v1/Room.java @@ -57,7 +57,7 @@ public static RoomReader reader() { public static RoomUpdater updater( final String pathSid, - final RoomStatus status + final Room.RoomStatus status ) { return new RoomUpdater(pathSid, status); } @@ -106,7 +106,7 @@ public static Room fromJson( } private final String sid; - private final RoomStatus status; + private final Room.RoomStatus status; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final String accountSid; @@ -116,12 +116,12 @@ public static Room fromJson( private final HttpMethod statusCallbackMethod; private final ZonedDateTime endTime; private final Integer duration; - private final RoomType type; + private final Room.RoomType type; private final Integer maxParticipants; private final Integer maxParticipantDuration; private final Integer maxConcurrentPublishedTracks; private final Boolean recordParticipantsOnConnect; - private final List videoCodecs; + private final List videoCodecs; private final String mediaRegion; private final Boolean audioOnly; private final Integer emptyRoomTimeout; @@ -133,7 +133,7 @@ public static Room fromJson( @JsonCreator private Room( @JsonProperty("sid") final String sid, - @JsonProperty("status") final RoomStatus status, + @JsonProperty("status") final Room.RoomStatus status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("account_sid") final String accountSid, @@ -145,7 +145,7 @@ private Room( ) final HttpMethod statusCallbackMethod, @JsonProperty("end_time") final String endTime, @JsonProperty("duration") final Integer duration, - @JsonProperty("type") final RoomType type, + @JsonProperty("type") final Room.RoomType type, @JsonProperty("max_participants") final Integer maxParticipants, @JsonProperty( "max_participant_duration" @@ -156,7 +156,7 @@ private Room( @JsonProperty( "record_participants_on_connect" ) final Boolean recordParticipantsOnConnect, - @JsonProperty("video_codecs") final List videoCodecs, + @JsonProperty("video_codecs") final List videoCodecs, @JsonProperty("media_region") final String mediaRegion, @JsonProperty("audio_only") final Boolean audioOnly, @JsonProperty("empty_room_timeout") final Integer emptyRoomTimeout, @@ -195,7 +195,7 @@ public final String getSid() { return this.sid; } - public final RoomStatus getStatus() { + public final Room.RoomStatus getStatus() { return this.status; } @@ -235,7 +235,7 @@ public final Integer getDuration() { return this.duration; } - public final RoomType getType() { + public final Room.RoomType getType() { return this.type; } @@ -255,7 +255,7 @@ public final Boolean getRecordParticipantsOnConnect() { return this.recordParticipantsOnConnect; } - public final List getVideoCodecs() { + public final List getVideoCodecs() { return this.videoCodecs; } diff --git a/src/main/java/com/twilio/rest/video/v1/room/Participant.java b/src/main/java/com/twilio/rest/video/v1/room/Participant.java index 83a9ab8d84..e424615a76 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/Participant.java +++ b/src/main/java/com/twilio/rest/video/v1/room/Participant.java @@ -105,7 +105,7 @@ public static Participant fromJson( private final String sid; private final String roomSid; private final String accountSid; - private final Status status; + private final Participant.Status status; private final String identity; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -120,7 +120,7 @@ private Participant( @JsonProperty("sid") final String sid, @JsonProperty("room_sid") final String roomSid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Participant.Status status, @JsonProperty("identity") final String identity, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -156,7 +156,7 @@ public final String getAccountSid() { return this.accountSid; } - public final Status getStatus() { + public final Participant.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/video/v1/room/RoomRecording.java b/src/main/java/com/twilio/rest/video/v1/room/RoomRecording.java index 506eaea365..7a37f4e2ad 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/RoomRecording.java +++ b/src/main/java/com/twilio/rest/video/v1/room/RoomRecording.java @@ -103,16 +103,16 @@ public static RoomRecording fromJson( } private final String accountSid; - private final Status status; + private final RoomRecording.Status status; private final ZonedDateTime dateCreated; private final String sid; private final String sourceSid; private final Long size; private final URI url; - private final Type type; + private final RoomRecording.Type type; private final Integer duration; - private final Format containerFormat; - private final Codec codec; + private final RoomRecording.Format containerFormat; + private final RoomRecording.Codec codec; private final Map groupingSids; private final String trackName; private final Long offset; @@ -123,16 +123,18 @@ public static RoomRecording fromJson( @JsonCreator private RoomRecording( @JsonProperty("account_sid") final String accountSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final RoomRecording.Status status, @JsonProperty("date_created") final String dateCreated, @JsonProperty("sid") final String sid, @JsonProperty("source_sid") final String sourceSid, @JsonProperty("size") final Long size, @JsonProperty("url") final URI url, - @JsonProperty("type") final Type type, + @JsonProperty("type") final RoomRecording.Type type, @JsonProperty("duration") final Integer duration, - @JsonProperty("container_format") final Format containerFormat, - @JsonProperty("codec") final Codec codec, + @JsonProperty( + "container_format" + ) final RoomRecording.Format containerFormat, + @JsonProperty("codec") final RoomRecording.Codec codec, @JsonProperty("grouping_sids") final Map groupingSids, @JsonProperty("track_name") final String trackName, @JsonProperty("offset") final Long offset, @@ -165,7 +167,7 @@ public final String getAccountSid() { return this.accountSid; } - public final Status getStatus() { + public final RoomRecording.Status getStatus() { return this.status; } @@ -189,7 +191,7 @@ public final URI getUrl() { return this.url; } - public final Type getType() { + public final RoomRecording.Type getType() { return this.type; } @@ -197,11 +199,11 @@ public final Integer getDuration() { return this.duration; } - public final Format getContainerFormat() { + public final RoomRecording.Format getContainerFormat() { return this.containerFormat; } - public final Codec getCodec() { + public final RoomRecording.Codec getCodec() { return this.codec; } diff --git a/src/main/java/com/twilio/rest/video/v1/room/Transcriptions.java b/src/main/java/com/twilio/rest/video/v1/room/Transcriptions.java new file mode 100644 index 0000000000..d5f741d671 --- /dev/null +++ b/src/main/java/com/twilio/rest/video/v1/room/Transcriptions.java @@ -0,0 +1,255 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Video + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.twilio.rest.video.v1.room; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.twilio.base.Resource; +import com.twilio.converter.DateConverter; +import com.twilio.converter.Promoter; +import com.twilio.exception.ApiConnectionException; +import com.twilio.exception.ApiException; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.time.ZonedDateTime; +import java.util.Objects; +import lombok.ToString; +import lombok.ToString; + +@JsonIgnoreProperties(ignoreUnknown = true) +@ToString +public class Transcriptions extends Resource { + + private static final long serialVersionUID = 265092932948237L; + + public static TranscriptionsCreator creator(final String pathRoomSid) { + return new TranscriptionsCreator(pathRoomSid); + } + + public static TranscriptionsFetcher fetcher( + final String pathRoomSid, + final String pathTtid + ) { + return new TranscriptionsFetcher(pathRoomSid, pathTtid); + } + + public static TranscriptionsReader reader(final String pathRoomSid) { + return new TranscriptionsReader(pathRoomSid); + } + + public static TranscriptionsUpdater updater( + final String pathRoomSid, + final String pathTtid + ) { + return new TranscriptionsUpdater(pathRoomSid, pathTtid); + } + + /** + * Converts a JSON String into a Transcriptions object using the provided ObjectMapper. + * + * @param json Raw JSON String + * @param objectMapper Jackson ObjectMapper + * @return Transcriptions object represented by the provided JSON + */ + public static Transcriptions fromJson( + final String json, + final ObjectMapper objectMapper + ) { + // Convert all checked exceptions to Runtime + try { + return objectMapper.readValue(json, Transcriptions.class); + } catch (final JsonMappingException | JsonParseException e) { + throw new ApiException(e.getMessage(), e); + } catch (final IOException e) { + throw new ApiConnectionException(e.getMessage(), e); + } + } + + /** + * Converts a JSON InputStream into a Transcriptions object using the provided + * ObjectMapper. + * + * @param json Raw JSON InputStream + * @param objectMapper Jackson ObjectMapper + * @return Transcriptions object represented by the provided JSON + */ + public static Transcriptions fromJson( + final InputStream json, + final ObjectMapper objectMapper + ) { + // Convert all checked exceptions to Runtime + try { + return objectMapper.readValue(json, Transcriptions.class); + } catch (final JsonMappingException | JsonParseException e) { + throw new ApiException(e.getMessage(), e); + } catch (final IOException e) { + throw new ApiConnectionException(e.getMessage(), e); + } + } + + private final String ttid; + private final String accountSid; + private final String roomSid; + private final Transcriptions.Status status; + private final String identity; + private final ZonedDateTime dateCreated; + private final ZonedDateTime dateUpdated; + private final ZonedDateTime startTime; + private final ZonedDateTime endTime; + private final Integer duration; + private final URI url; + + @JsonCreator + private Transcriptions( + @JsonProperty("ttid") final String ttid, + @JsonProperty("account_sid") final String accountSid, + @JsonProperty("room_sid") final String roomSid, + @JsonProperty("status") final Transcriptions.Status status, + @JsonProperty("identity") final String identity, + @JsonProperty("date_created") final String dateCreated, + @JsonProperty("date_updated") final String dateUpdated, + @JsonProperty("start_time") final String startTime, + @JsonProperty("end_time") final String endTime, + @JsonProperty("duration") final Integer duration, + @JsonProperty("url") final URI url + ) { + this.ttid = ttid; + this.accountSid = accountSid; + this.roomSid = roomSid; + this.status = status; + this.identity = identity; + this.dateCreated = DateConverter.iso8601DateTimeFromString(dateCreated); + this.dateUpdated = DateConverter.iso8601DateTimeFromString(dateUpdated); + this.startTime = DateConverter.iso8601DateTimeFromString(startTime); + this.endTime = DateConverter.iso8601DateTimeFromString(endTime); + this.duration = duration; + this.url = url; + } + + public final String getTtid() { + return this.ttid; + } + + public final String getAccountSid() { + return this.accountSid; + } + + public final String getRoomSid() { + return this.roomSid; + } + + public final Transcriptions.Status getStatus() { + return this.status; + } + + public final String getIdentity() { + return this.identity; + } + + public final ZonedDateTime getDateCreated() { + return this.dateCreated; + } + + public final ZonedDateTime getDateUpdated() { + return this.dateUpdated; + } + + public final ZonedDateTime getStartTime() { + return this.startTime; + } + + public final ZonedDateTime getEndTime() { + return this.endTime; + } + + public final Integer getDuration() { + return this.duration; + } + + public final URI getUrl() { + return this.url; + } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + + if (o == null || getClass() != o.getClass()) { + return false; + } + + Transcriptions other = (Transcriptions) o; + + return ( + Objects.equals(ttid, other.ttid) && + Objects.equals(accountSid, other.accountSid) && + Objects.equals(roomSid, other.roomSid) && + Objects.equals(status, other.status) && + Objects.equals(identity, other.identity) && + Objects.equals(dateCreated, other.dateCreated) && + Objects.equals(dateUpdated, other.dateUpdated) && + Objects.equals(startTime, other.startTime) && + Objects.equals(endTime, other.endTime) && + Objects.equals(duration, other.duration) && + Objects.equals(url, other.url) + ); + } + + @Override + public int hashCode() { + return Objects.hash( + ttid, + accountSid, + roomSid, + status, + identity, + dateCreated, + dateUpdated, + startTime, + endTime, + duration, + url + ); + } + + public enum Status { + CREATED("created"), + STARTED("started"), + STOPPED("stopped"), + FAILED("failed"); + + private final String value; + + private Status(final String value) { + this.value = value; + } + + public String toString() { + return value; + } + + @JsonCreator + public static Status forValue(final String value) { + return Promoter.enumFromString(value, Status.values()); + } + } +} diff --git a/src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeCreator.java b/src/main/java/com/twilio/rest/video/v1/room/TranscriptionsCreator.java similarity index 63% rename from src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeCreator.java rename to src/main/java/com/twilio/rest/video/v1/room/TranscriptionsCreator.java index 534da26b49..92947f94ea 100644 --- a/src/main/java/com/twilio/rest/proxy/v1/service/ShortCodeCreator.java +++ b/src/main/java/com/twilio/rest/video/v1/room/TranscriptionsCreator.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Proxy + * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,10 +12,12 @@ * Do not edit the class manually. */ -package com.twilio.rest.proxy.v1.service; +package com.twilio.rest.video.v1.room; import com.twilio.base.Creator; import com.twilio.constant.EnumConstants; +import com.twilio.converter.Converter; +import com.twilio.converter.Converter; import com.twilio.exception.ApiConnectionException; import com.twilio.exception.ApiException; import com.twilio.exception.RestException; @@ -24,36 +26,34 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; +import java.util.Map; +import java.util.Map; -public class ShortCodeCreator extends Creator { +public class TranscriptionsCreator extends Creator { - private String pathServiceSid; - private String sid; + private String pathRoomSid; + private Map configuration; - public ShortCodeCreator(final String pathServiceSid, final String sid) { - this.pathServiceSid = pathServiceSid; - this.sid = sid; + public TranscriptionsCreator(final String pathRoomSid) { + this.pathRoomSid = pathRoomSid; } - public ShortCodeCreator setSid(final String sid) { - this.sid = sid; + public TranscriptionsCreator setConfiguration( + final Map configuration + ) { + this.configuration = configuration; return this; } @Override - public ShortCode create(final TwilioRestClient client) { - String path = "/v1/Services/{ServiceSid}/ShortCodes"; + public Transcriptions create(final TwilioRestClient client) { + String path = "/v1/Rooms/{RoomSid}/Transcriptions"; - path = - path.replace( - "{" + "ServiceSid" + "}", - this.pathServiceSid.toString() - ); - path = path.replace("{" + "Sid" + "}", this.sid.toString()); + path = path.replace("{" + "RoomSid" + "}", this.pathRoomSid.toString()); Request request = new Request( HttpMethod.POST, - Domains.PROXY.toString(), + Domains.VIDEO.toString(), path ); request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); @@ -61,7 +61,7 @@ public ShortCode create(final TwilioRestClient client) { Response response = client.request(request); if (response == null) { throw new ApiConnectionException( - "ShortCode creation failed: Unable to connect to server" + "Transcriptions creation failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -77,15 +77,18 @@ public ShortCode create(final TwilioRestClient client) { throw new ApiException(restException); } - return ShortCode.fromJson( + return Transcriptions.fromJson( response.getStream(), client.getObjectMapper() ); } private void addPostParams(final Request request) { - if (sid != null) { - request.addPostParam("Sid", sid); + if (configuration != null) { + request.addPostParam( + "Configuration", + Converter.mapToJson(configuration) + ); } } } diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AccountSecretFetcher.java b/src/main/java/com/twilio/rest/video/v1/room/TranscriptionsFetcher.java similarity index 69% rename from src/main/java/com/twilio/rest/microvisor/v1/AccountSecretFetcher.java rename to src/main/java/com/twilio/rest/video/v1/room/TranscriptionsFetcher.java index 78b58fca72..b1a311a59e 100644 --- a/src/main/java/com/twilio/rest/microvisor/v1/AccountSecretFetcher.java +++ b/src/main/java/com/twilio/rest/video/v1/room/TranscriptionsFetcher.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Microvisor + * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -package com.twilio.rest.microvisor.v1; +package com.twilio.rest.video.v1.room; import com.twilio.base.Fetcher; import com.twilio.constant.EnumConstants; @@ -25,23 +25,29 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class AccountSecretFetcher extends Fetcher { +public class TranscriptionsFetcher extends Fetcher { - private String pathKey; + private String pathRoomSid; + private String pathTtid; - public AccountSecretFetcher(final String pathKey) { - this.pathKey = pathKey; + public TranscriptionsFetcher( + final String pathRoomSid, + final String pathTtid + ) { + this.pathRoomSid = pathRoomSid; + this.pathTtid = pathTtid; } @Override - public AccountSecret fetch(final TwilioRestClient client) { - String path = "/v1/Secrets/{Key}"; + public Transcriptions fetch(final TwilioRestClient client) { + String path = "/v1/Rooms/{RoomSid}/Transcriptions/{Ttid}"; - path = path.replace("{" + "Key" + "}", this.pathKey.toString()); + path = path.replace("{" + "RoomSid" + "}", this.pathRoomSid.toString()); + path = path.replace("{" + "Ttid" + "}", this.pathTtid.toString()); Request request = new Request( HttpMethod.GET, - Domains.MICROVISOR.toString(), + Domains.VIDEO.toString(), path ); request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); @@ -49,7 +55,7 @@ public AccountSecret fetch(final TwilioRestClient client) { if (response == null) { throw new ApiConnectionException( - "AccountSecret fetch failed: Unable to connect to server" + "Transcriptions fetch failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -65,7 +71,7 @@ public AccountSecret fetch(final TwilioRestClient client) { throw new ApiException(restException); } - return AccountSecret.fromJson( + return Transcriptions.fromJson( response.getStream(), client.getObjectMapper() ); diff --git a/src/main/java/com/twilio/rest/microvisor/v1/DeviceReader.java b/src/main/java/com/twilio/rest/video/v1/room/TranscriptionsReader.java similarity index 72% rename from src/main/java/com/twilio/rest/microvisor/v1/DeviceReader.java rename to src/main/java/com/twilio/rest/video/v1/room/TranscriptionsReader.java index 28cec8e051..7cb0570421 100644 --- a/src/main/java/com/twilio/rest/microvisor/v1/DeviceReader.java +++ b/src/main/java/com/twilio/rest/video/v1/room/TranscriptionsReader.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Microvisor + * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -package com.twilio.rest.microvisor.v1; +package com.twilio.rest.video.v1.room; import com.twilio.base.Page; import com.twilio.base.Reader; @@ -27,28 +27,32 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class DeviceReader extends Reader { +public class TranscriptionsReader extends Reader { + private String pathRoomSid; private Long pageSize; - public DeviceReader() {} + public TranscriptionsReader(final String pathRoomSid) { + this.pathRoomSid = pathRoomSid; + } - public DeviceReader setPageSize(final Long pageSize) { + public TranscriptionsReader setPageSize(final Long pageSize) { this.pageSize = pageSize; return this; } @Override - public ResourceSet read(final TwilioRestClient client) { + public ResourceSet read(final TwilioRestClient client) { return new ResourceSet<>(this, client, firstPage(client)); } - public Page firstPage(final TwilioRestClient client) { - String path = "/v1/Devices"; + public Page firstPage(final TwilioRestClient client) { + String path = "/v1/Rooms/{RoomSid}/Transcriptions"; + path = path.replace("{" + "RoomSid" + "}", this.pathRoomSid.toString()); Request request = new Request( HttpMethod.GET, - Domains.MICROVISOR.toString(), + Domains.VIDEO.toString(), path ); @@ -57,7 +61,7 @@ public Page firstPage(final TwilioRestClient client) { return pageForRequest(client, request); } - private Page pageForRequest( + private Page pageForRequest( final TwilioRestClient client, final Request request ) { @@ -65,7 +69,7 @@ private Page pageForRequest( if (response == null) { throw new ApiConnectionException( - "Device read failed: Unable to connect to server" + "Transcriptions read failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -82,39 +86,39 @@ private Page pageForRequest( } return Page.fromJson( - "devices", + "extensions", response.getContent(), - Device.class, + Transcriptions.class, client.getObjectMapper() ); } @Override - public Page previousPage( - final Page page, + public Page previousPage( + final Page page, final TwilioRestClient client ) { Request request = new Request( HttpMethod.GET, - page.getPreviousPageUrl(Domains.MICROVISOR.toString()) + page.getPreviousPageUrl(Domains.VIDEO.toString()) ); return pageForRequest(client, request); } @Override - public Page nextPage( - final Page page, + public Page nextPage( + final Page page, final TwilioRestClient client ) { Request request = new Request( HttpMethod.GET, - page.getNextPageUrl(Domains.MICROVISOR.toString()) + page.getNextPageUrl(Domains.VIDEO.toString()) ); return pageForRequest(client, request); } @Override - public Page getPage( + public Page getPage( final String targetUrl, final TwilioRestClient client ) { diff --git a/src/main/java/com/twilio/rest/microvisor/v1/AccountSecretUpdater.java b/src/main/java/com/twilio/rest/video/v1/room/TranscriptionsUpdater.java similarity index 64% rename from src/main/java/com/twilio/rest/microvisor/v1/AccountSecretUpdater.java rename to src/main/java/com/twilio/rest/video/v1/room/TranscriptionsUpdater.java index fc4e3c61eb..ff6487e71d 100644 --- a/src/main/java/com/twilio/rest/microvisor/v1/AccountSecretUpdater.java +++ b/src/main/java/com/twilio/rest/video/v1/room/TranscriptionsUpdater.java @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Microvisor + * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -package com.twilio.rest.microvisor.v1; +package com.twilio.rest.video.v1.room; import com.twilio.base.Updater; import com.twilio.constant.EnumConstants; @@ -25,31 +25,35 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class AccountSecretUpdater extends Updater { +public class TranscriptionsUpdater extends Updater { - private String pathKey; - private String value; + private String pathRoomSid; + private String pathTtid; + private Transcriptions.Status status; - public AccountSecretUpdater(final String pathKey, final String value) { - this.pathKey = pathKey; - this.value = value; + public TranscriptionsUpdater( + final String pathRoomSid, + final String pathTtid + ) { + this.pathRoomSid = pathRoomSid; + this.pathTtid = pathTtid; } - public AccountSecretUpdater setValue(final String value) { - this.value = value; + public TranscriptionsUpdater setStatus(final Transcriptions.Status status) { + this.status = status; return this; } @Override - public AccountSecret update(final TwilioRestClient client) { - String path = "/v1/Secrets/{Key}"; + public Transcriptions update(final TwilioRestClient client) { + String path = "/v1/Rooms/{RoomSid}/Transcriptions/{Ttid}"; - path = path.replace("{" + "Key" + "}", this.pathKey.toString()); - path = path.replace("{" + "Value" + "}", this.value.toString()); + path = path.replace("{" + "RoomSid" + "}", this.pathRoomSid.toString()); + path = path.replace("{" + "Ttid" + "}", this.pathTtid.toString()); Request request = new Request( HttpMethod.POST, - Domains.MICROVISOR.toString(), + Domains.VIDEO.toString(), path ); request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); @@ -57,7 +61,7 @@ public AccountSecret update(final TwilioRestClient client) { Response response = client.request(request); if (response == null) { throw new ApiConnectionException( - "AccountSecret update failed: Unable to connect to server" + "Transcriptions update failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -73,15 +77,15 @@ public AccountSecret update(final TwilioRestClient client) { throw new ApiException(restException); } - return AccountSecret.fromJson( + return Transcriptions.fromJson( response.getStream(), client.getObjectMapper() ); } private void addPostParams(final Request request) { - if (value != null) { - request.addPostParam("Value", value); + if (status != null) { + request.addPostParam("Status", status.toString()); } } } diff --git a/src/main/java/com/twilio/rest/video/v1/room/participant/Anonymize.java b/src/main/java/com/twilio/rest/video/v1/room/participant/Anonymize.java index 898d66175f..13cd56e05e 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/participant/Anonymize.java +++ b/src/main/java/com/twilio/rest/video/v1/room/participant/Anonymize.java @@ -92,7 +92,7 @@ public static Anonymize fromJson( private final String sid; private final String roomSid; private final String accountSid; - private final Status status; + private final Anonymize.Status status; private final String identity; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; @@ -106,7 +106,7 @@ private Anonymize( @JsonProperty("sid") final String sid, @JsonProperty("room_sid") final String roomSid, @JsonProperty("account_sid") final String accountSid, - @JsonProperty("status") final Status status, + @JsonProperty("status") final Anonymize.Status status, @JsonProperty("identity") final String identity, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @@ -140,7 +140,7 @@ public final String getAccountSid() { return this.accountSid; } - public final Status getStatus() { + public final Anonymize.Status getStatus() { return this.status; } diff --git a/src/main/java/com/twilio/rest/video/v1/room/participant/PublishedTrack.java b/src/main/java/com/twilio/rest/video/v1/room/participant/PublishedTrack.java index d48e5ad022..38798ef161 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/participant/PublishedTrack.java +++ b/src/main/java/com/twilio/rest/video/v1/room/participant/PublishedTrack.java @@ -108,7 +108,7 @@ public static PublishedTrack fromJson( private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Boolean enabled; - private final Kind kind; + private final PublishedTrack.Kind kind; private final URI url; @JsonCreator @@ -120,7 +120,7 @@ private PublishedTrack( @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("enabled") final Boolean enabled, - @JsonProperty("kind") final Kind kind, + @JsonProperty("kind") final PublishedTrack.Kind kind, @JsonProperty("url") final URI url ) { this.sid = sid; @@ -162,7 +162,7 @@ public final Boolean getEnabled() { return this.enabled; } - public final Kind getKind() { + public final PublishedTrack.Kind getKind() { return this.kind; } diff --git a/src/main/java/com/twilio/rest/video/v1/room/participant/SubscribedTrack.java b/src/main/java/com/twilio/rest/video/v1/room/participant/SubscribedTrack.java index 23c88fbcc7..d31de8e3c5 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/participant/SubscribedTrack.java +++ b/src/main/java/com/twilio/rest/video/v1/room/participant/SubscribedTrack.java @@ -109,7 +109,7 @@ public static SubscribedTrack fromJson( private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final Boolean enabled; - private final Kind kind; + private final SubscribedTrack.Kind kind; private final URI url; @JsonCreator @@ -122,7 +122,7 @@ private SubscribedTrack( @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("enabled") final Boolean enabled, - @JsonProperty("kind") final Kind kind, + @JsonProperty("kind") final SubscribedTrack.Kind kind, @JsonProperty("url") final URI url ) { this.sid = sid; @@ -169,7 +169,7 @@ public final Boolean getEnabled() { return this.enabled; } - public final Kind getKind() { + public final SubscribedTrack.Kind getKind() { return this.kind; } diff --git a/src/main/java/com/twilio/rest/wireless/v1/Command.java b/src/main/java/com/twilio/rest/wireless/v1/Command.java index bd545d7403..e1c79cb63b 100644 --- a/src/main/java/com/twilio/rest/wireless/v1/Command.java +++ b/src/main/java/com/twilio/rest/wireless/v1/Command.java @@ -102,11 +102,11 @@ public static Command fromJson( private final String accountSid; private final String simSid; private final String command; - private final CommandMode commandMode; - private final Transport transport; + private final Command.CommandMode commandMode; + private final Command.Transport transport; private final Boolean deliveryReceiptRequested; - private final Status status; - private final Direction direction; + private final Command.Status status; + private final Command.Direction direction; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final URI url; @@ -117,13 +117,13 @@ private Command( @JsonProperty("account_sid") final String accountSid, @JsonProperty("sim_sid") final String simSid, @JsonProperty("command") final String command, - @JsonProperty("command_mode") final CommandMode commandMode, - @JsonProperty("transport") final Transport transport, + @JsonProperty("command_mode") final Command.CommandMode commandMode, + @JsonProperty("transport") final Command.Transport transport, @JsonProperty( "delivery_receipt_requested" ) final Boolean deliveryReceiptRequested, - @JsonProperty("status") final Status status, - @JsonProperty("direction") final Direction direction, + @JsonProperty("status") final Command.Status status, + @JsonProperty("direction") final Command.Direction direction, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("url") final URI url @@ -158,11 +158,11 @@ public final String getCommand() { return this.command; } - public final CommandMode getCommandMode() { + public final Command.CommandMode getCommandMode() { return this.commandMode; } - public final Transport getTransport() { + public final Command.Transport getTransport() { return this.transport; } @@ -170,11 +170,11 @@ public final Boolean getDeliveryReceiptRequested() { return this.deliveryReceiptRequested; } - public final Status getStatus() { + public final Command.Status getStatus() { return this.status; } - public final Direction getDirection() { + public final Command.Direction getDirection() { return this.direction; } diff --git a/src/main/java/com/twilio/rest/wireless/v1/Sim.java b/src/main/java/com/twilio/rest/wireless/v1/Sim.java index 6410f6d200..ccfd84da74 100644 --- a/src/main/java/com/twilio/rest/wireless/v1/Sim.java +++ b/src/main/java/com/twilio/rest/wireless/v1/Sim.java @@ -108,8 +108,8 @@ public static Sim fromJson( private final String friendlyName; private final String iccid; private final String eId; - private final Status status; - private final ResetStatus resetStatus; + private final Sim.Status status; + private final Sim.ResetStatus resetStatus; private final URI commandsCallbackUrl; private final HttpMethod commandsCallbackMethod; private final HttpMethod smsFallbackMethod; @@ -135,8 +135,8 @@ private Sim( @JsonProperty("friendly_name") final String friendlyName, @JsonProperty("iccid") final String iccid, @JsonProperty("e_id") final String eId, - @JsonProperty("status") final Status status, - @JsonProperty("reset_status") final ResetStatus resetStatus, + @JsonProperty("status") final Sim.Status status, + @JsonProperty("reset_status") final Sim.ResetStatus resetStatus, @JsonProperty("commands_callback_url") final URI commandsCallbackUrl, @JsonProperty( "commands_callback_method" @@ -211,11 +211,11 @@ public final String getEId() { return this.eId; } - public final Status getStatus() { + public final Sim.Status getStatus() { return this.status; } - public final ResetStatus getResetStatus() { + public final Sim.ResetStatus getResetStatus() { return this.resetStatus; } diff --git a/src/main/java/com/twilio/twiml/voice/Dial.java b/src/main/java/com/twilio/twiml/voice/Dial.java index 0314d5ec65..27eeda82c8 100644 --- a/src/main/java/com/twilio/twiml/voice/Dial.java +++ b/src/main/java/com/twilio/twiml/voice/Dial.java @@ -801,6 +801,15 @@ public Builder application(Application application) { return this; } + /** + * Add a child {@code } element + */ + @JacksonXmlProperty(isAttribute = false, localName = "WhatsApp") + public Builder whatsApp(WhatsApp whatsApp) { + this.children.add(whatsApp); + return this; + } + /** * Create and return resulting {@code } element */ diff --git a/src/main/java/com/twilio/twiml/voice/WhatsApp.java b/src/main/java/com/twilio/twiml/voice/WhatsApp.java new file mode 100644 index 0000000000..1556ead3c4 --- /dev/null +++ b/src/main/java/com/twilio/twiml/voice/WhatsApp.java @@ -0,0 +1,299 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +package com.twilio.twiml.voice; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.twilio.converter.Promoter; +import com.twilio.http.HttpMethod; +import com.twilio.twiml.TwiML; +import com.twilio.twiml.TwiMLException; + +import java.net.URI; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * TwiML wrapper for {@code } + */ +@JsonDeserialize(builder = WhatsApp.Builder.class) +public class WhatsApp extends TwiML { + public enum Event { + INITIATED("initiated"), + RINGING("ringing"), + ANSWERED("answered"), + COMPLETED("completed"); + + private final String value; + + private Event(final String value) { + this.value = value; + } + + public String toString() { + return value; + } + } + + private final URI url; + private final HttpMethod method; + private final List statusCallbackEvent; + private final URI statusCallback; + private final HttpMethod statusCallbackMethod; + private final com.twilio.type.PhoneNumber phoneNumber; + + /** + * For XML Serialization/Deserialization + */ + private WhatsApp() { + this(new Builder((com.twilio.type.PhoneNumber) null)); + } + + /** + * Create a new {@code } element + */ + private WhatsApp(Builder b) { + super("WhatsApp", b); + this.url = b.url; + this.method = b.method; + this.statusCallbackEvent = b.statusCallbackEvent; + this.statusCallback = b.statusCallback; + this.statusCallbackMethod = b.statusCallbackMethod; + this.phoneNumber = b.phoneNumber; + } + + /** + * The body of the TwiML element + * + * @return Element body as a string if present else null + */ + protected String getElementBody() { + return this.getPhoneNumber() == null ? null : this.getPhoneNumber().toString(); + } + + /** + * Attributes to set on the generated XML element + * + * @return A Map of attribute keys to values + */ + protected Map getElementAttributes() { + // Preserve order of attributes + Map attrs = new HashMap<>(); + + if (this.getUrl() != null) { + attrs.put("url", this.getUrl().toString()); + } + if (this.getMethod() != null) { + attrs.put("method", this.getMethod().toString()); + } + if (this.getStatusCallbackEvents() != null) { + attrs.put("statusCallbackEvent", this.getStatusCallbackEventsAsString()); + } + if (this.getStatusCallback() != null) { + attrs.put("statusCallback", this.getStatusCallback().toString()); + } + if (this.getStatusCallbackMethod() != null) { + attrs.put("statusCallbackMethod", this.getStatusCallbackMethod().toString()); + } + + return attrs; + } + + /** + * TwiML URL + * + * @return TwiML URL + */ + public URI getUrl() { + return url; + } + + /** + * TwiML URL Method + * + * @return TwiML URL Method + */ + public HttpMethod getMethod() { + return method; + } + + /** + * Events to trigger status callback + * + * @return Events to trigger status callback + */ + public List getStatusCallbackEvents() { + return statusCallbackEvent; + } + + protected String getStatusCallbackEventsAsString() { + StringBuilder sb = new StringBuilder(); + Iterator iter = this.getStatusCallbackEvents().iterator(); + while (iter.hasNext()) { + sb.append(iter.next().toString()); + if (iter.hasNext()) { + sb.append(" "); + } + } + return sb.toString(); + } + + /** + * Status Callback URL + * + * @return Status Callback URL + */ + public URI getStatusCallback() { + return statusCallback; + } + + /** + * Status Callback URL Method + * + * @return Status Callback URL Method + */ + public HttpMethod getStatusCallbackMethod() { + return statusCallbackMethod; + } + + /** + * WhatsApp Phone Number to dial + * + * @return WhatsApp Phone Number to dial + */ + public com.twilio.type.PhoneNumber getPhoneNumber() { + return phoneNumber; + } + + /** + * Create a new {@code } element + */ + @JsonPOJOBuilder(withPrefix = "") + public static class Builder extends TwiML.Builder { + /** + * Create and return a {@code } from an XML string + */ + public static Builder fromXml(final String xml) throws TwiMLException { + try { + return OBJECT_MAPPER.readValue(xml, Builder.class); + } catch (final JsonProcessingException jpe) { + throw new TwiMLException( + "Failed to deserialize a WhatsApp.Builder from the provided XML string: " + jpe.getMessage()); + } catch (final Exception e) { + throw new TwiMLException("Unhandled exception: " + e.getMessage()); + } + } + + private URI url; + private HttpMethod method; + private List statusCallbackEvent; + private URI statusCallback; + private HttpMethod statusCallbackMethod; + private com.twilio.type.PhoneNumber phoneNumber; + + /** + * Create a {@code } with phoneNumber + */ + public Builder(com.twilio.type.PhoneNumber phoneNumber) { + this.phoneNumber = phoneNumber; + } + + /** + * Create a {@code } with phoneNumber + */ + public Builder(String phoneNumber) { + this.phoneNumber = Promoter.phoneNumberFromString(phoneNumber); + } + + /** + * Create a {@code } (for XML deserialization) + */ + private Builder() { + } + + /** + * TwiML URL + */ + @JacksonXmlProperty(isAttribute = true, localName = "url") + public Builder url(URI url) { + this.url = url; + return this; + } + + /** + * TwiML URL + */ + public Builder url(String url) { + this.url = Promoter.uriFromString(url); + return this; + } + + /** + * TwiML URL Method + */ + @JacksonXmlProperty(isAttribute = true, localName = "method") + public Builder method(HttpMethod method) { + this.method = method; + return this; + } + + /** + * Events to trigger status callback + */ + @JacksonXmlProperty(isAttribute = true, localName = "statusCallbackEvent") + public Builder statusCallbackEvents(List statusCallbackEvent) { + this.statusCallbackEvent = statusCallbackEvent; + return this; + } + + /** + * Events to trigger status callback + */ + public Builder statusCallbackEvents(WhatsApp.Event statusCallbackEvent) { + this.statusCallbackEvent = Promoter.listOfOne(statusCallbackEvent); + return this; + } + + /** + * Status Callback URL + */ + @JacksonXmlProperty(isAttribute = true, localName = "statusCallback") + public Builder statusCallback(URI statusCallback) { + this.statusCallback = statusCallback; + return this; + } + + /** + * Status Callback URL + */ + public Builder statusCallback(String statusCallback) { + this.statusCallback = Promoter.uriFromString(statusCallback); + return this; + } + + /** + * Status Callback URL Method + */ + @JacksonXmlProperty(isAttribute = true, localName = "statusCallbackMethod") + public Builder statusCallbackMethod(HttpMethod statusCallbackMethod) { + this.statusCallbackMethod = statusCallbackMethod; + return this; + } + + /** + * Create and return resulting {@code } element + */ + public WhatsApp build() { + return new WhatsApp(this); + } + } +} \ No newline at end of file diff --git a/src/test/java/com/twilio/twiml/voice/DialTest.java b/src/test/java/com/twilio/twiml/voice/DialTest.java index df5e2d3b31..8d6da7c853 100644 --- a/src/test/java/com/twilio/twiml/voice/DialTest.java +++ b/src/test/java/com/twilio/twiml/voice/DialTest.java @@ -167,6 +167,14 @@ public void testElementWithChildren() { .copyParentTo(true) .build()); + builder.whatsApp(new WhatsApp.Builder(new com.twilio.type.PhoneNumber("+15017122661")) + .url(URI.create("https://example.com")) + .method(HttpMethod.GET) + .statusCallbackEvents(Promoter.listOfOne(WhatsApp.Event.INITIATED)) + .statusCallback(URI.create("https://example.com")) + .statusCallbackMethod(HttpMethod.GET) + .build()); + Dial elem = builder.build(); Assert.assertEquals( @@ -179,6 +187,7 @@ public void testElementWithChildren() { "DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + "https://example.com" + "application_sid" + + "+15017122661" + "", elem.toXml() ); @@ -379,6 +388,14 @@ public void testXmlChildrenDeserialization() { .copyParentTo(true) .build()); + builder.whatsApp(new WhatsApp.Builder(new com.twilio.type.PhoneNumber("+15017122661")) + .url(URI.create("https://example.com")) + .method(HttpMethod.GET) + .statusCallbackEvents(Promoter.listOfOne(WhatsApp.Event.INITIATED)) + .statusCallback(URI.create("https://example.com")) + .statusCallbackMethod(HttpMethod.GET) + .build()); + final Dial elem = builder.build(); Assert.assertEquals( @@ -390,6 +407,7 @@ public void testXmlChildrenDeserialization() { "DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + "https://example.com" + "application_sid" + + "+15017122661" + "").build().toXml(), elem.toXml() ); diff --git a/src/test/java/com/twilio/twiml/voice/WhatsAppTest.java b/src/test/java/com/twilio/twiml/voice/WhatsAppTest.java new file mode 100644 index 0000000000..4c6b47bfa1 --- /dev/null +++ b/src/test/java/com/twilio/twiml/voice/WhatsAppTest.java @@ -0,0 +1,54 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +package com.twilio.twiml.voice; + +import com.twilio.converter.Promoter; +import com.twilio.http.HttpMethod; +import org.junit.Assert; +import org.junit.Test; + +import java.net.URI; +import java.util.List; + +/** + * Test class for {@link WhatsApp} + */ +public class WhatsAppTest { + @Test + public void testElementWithParams() { + WhatsApp elem = new WhatsApp.Builder(new com.twilio.type.PhoneNumber("+15017122661")) + .url(URI.create("https://example.com")) + .method(HttpMethod.GET) + .statusCallbackEvents(Promoter.listOfOne(WhatsApp.Event.INITIATED)) + .statusCallback(URI.create("https://example.com")) + .statusCallbackMethod(HttpMethod.GET) + .build(); + + Assert.assertEquals( + "" + + "+15017122661", + elem.toXml() + ); + } + + @Test + public void testXmlAttributesDeserialization() { + final WhatsApp elem = new WhatsApp.Builder(new com.twilio.type.PhoneNumber("+15017122661")) + .url(URI.create("https://example.com")) + .method(HttpMethod.GET) + .statusCallbackEvents(Promoter.listOfOne(WhatsApp.Event.INITIATED)) + .statusCallback(URI.create("https://example.com")) + .statusCallbackMethod(HttpMethod.GET) + .build(); + + Assert.assertEquals( + WhatsApp.Builder.fromXml("+15017122661").build().toXml(), + elem.toXml() + ); + } +} \ No newline at end of file From 04f1e083084ec3e9a10dc5b70474656b3c925c2c Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 3 Jul 2025 09:41:54 +0000 Subject: [PATCH 05/12] Release 11.0.0-rc.1 --- pom.xml | 6 +++--- src/main/java/com/twilio/Twilio.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index ccd11db341..c000ec13c2 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ twilio jar twilio - 11.0.0-rc.0 + 11.0.0-rc.1 Twilio Java Helper Library https://www.twilio.com @@ -19,7 +19,7 @@ git@github.com:twilio/twilio-java.git scm:git:git@github.com:twilio/twilio-java.git scm:git:git@github.com:twilio/twilio-java.git - 10.9.2 + 11.0.0-rc.1 @@ -490,4 +490,4 @@ - + \ No newline at end of file diff --git a/src/main/java/com/twilio/Twilio.java b/src/main/java/com/twilio/Twilio.java index b2827de8f3..1fb6a5f9b5 100644 --- a/src/main/java/com/twilio/Twilio.java +++ b/src/main/java/com/twilio/Twilio.java @@ -24,7 +24,7 @@ */ public class Twilio { - public static final String VERSION = "11.0.0-rc.0"; + public static final String VERSION = "11.0.0-rc.1"; public static final String JAVA_VERSION = System.getProperty("java.version"); public static final String OS_NAME = System.getProperty("os.name"); public static final String OS_ARCH = System.getProperty("os.arch"); From 9c2ba4dbc185c5576e67fbeb82ec6f4899093e79 Mon Sep 17 00:00:00 2001 From: Shubham Date: Fri, 4 Jul 2025 12:04:19 +0530 Subject: [PATCH 06/12] chore: updating maven repository link in release notes (#876) --- .github/workflows/test-and-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 07178db5f3..d9aace8a70 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -62,7 +62,7 @@ jobs: with: distribution: 'zulu' java-version: '17' - + - name: SonarCloud Scan if: ${{ (github.event_name == 'pull_request' || github.ref_type == 'branch') && matrix.java == 11 && !github.event.pull_request.head.repo.fork }} env: @@ -94,7 +94,7 @@ jobs: - name: Create GitHub Release uses: sendgrid/dx-automator/actions/release@main with: - footer: '**[Maven](https://mvnrepository.com/artifact/com.twilio.sdk/twilio/${version})**' + footer: '**[Maven](https://central.sonatype.com/artifact/com.twilio.sdk/twilio/${version})**' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c469b61dd40c60d3c81e7dff439a2be95bed14c8 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 10 Jul 2025 11:47:40 +0000 Subject: [PATCH 07/12] [Librarian] Regenerated @ 39bbd47c92a659f8a7464cedcc75b92c7ba69773 f51169e3becf53bb375f9c7413aec0c78fe78fcc --- CHANGES.md | 6 ++++ .../rest/lookups/v2/LookupOverride.java | 30 ++++++++--------- ... => PortingWebhookConfigurationFetch.java} | 33 +++++++++++-------- ...tingWebhookConfigurationFetchFetcher.java} | 16 ++++++--- .../rest/sync/v1/service/DocumentCreator.java | 8 ++--- .../rest/sync/v1/service/DocumentUpdater.java | 7 ++-- .../v1/service/synclist/SyncListItem.java | 2 +- .../service/synclist/SyncListItemCreator.java | 10 +++--- .../service/synclist/SyncListItemUpdater.java | 7 ++-- .../sync/v1/service/syncmap/SyncMapItem.java | 2 +- .../service/syncmap/SyncMapItemCreator.java | 10 +++--- .../service/syncmap/SyncMapItemUpdater.java | 7 ++-- .../v1/service/syncstream/StreamMessage.java | 2 +- .../syncstream/StreamMessageCreator.java | 10 +++--- .../rest/video/v1/CompositionCreator.java | 10 ++---- .../rest/video/v1/CompositionHookCreator.java | 10 ++---- .../rest/video/v1/CompositionHookUpdater.java | 9 ++--- .../com/twilio/rest/video/v1/RoomCreator.java | 8 ++--- .../video/v1/room/RecordingRulesUpdater.java | 7 ++-- .../rest/video/v1/room/Transcriptions.java | 29 ++++++++-------- .../video/v1/room/TranscriptionsReader.java | 2 +- .../participant/SubscribeRulesUpdater.java | 7 ++-- 22 files changed, 113 insertions(+), 119 deletions(-) rename src/main/java/com/twilio/rest/numbers/v1/{Webhook.java => PortingWebhookConfigurationFetch.java} (82%) rename src/main/java/com/twilio/rest/numbers/v1/{WebhookFetcher.java => PortingWebhookConfigurationFetchFetcher.java} (79%) diff --git a/CHANGES.md b/CHANGES.md index 9ef65ffab7..46534c7b6d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,12 @@ twilio-java changelog ===================== +[2025-07-10] Version 11.0.0-rc.2 +-------------------------------- +**Flex** +- update team name for web_channel, webchat_init_token, webchat_refresh_token + + [2025-07-03] Version 11.0.0-rc.1 -------------------------------- **Library - Chore** diff --git a/src/main/java/com/twilio/rest/lookups/v2/LookupOverride.java b/src/main/java/com/twilio/rest/lookups/v2/LookupOverride.java index 2762094bfa..69b4c42558 100644 --- a/src/main/java/com/twilio/rest/lookups/v2/LookupOverride.java +++ b/src/main/java/com/twilio/rest/lookups/v2/LookupOverride.java @@ -239,7 +239,7 @@ public int hashCode() { ); } - public enum OriginalLineTypeEnum { + public enum OverriddenLineTypeEnum { MOBILE("mobile"), LANDLINE("landline"), TOLLFREE("tollFree"), @@ -255,7 +255,7 @@ public enum OriginalLineTypeEnum { private final String value; - private OriginalLineTypeEnum(final String value) { + private OverriddenLineTypeEnum(final String value) { this.value = value; } @@ -264,15 +264,15 @@ public String toString() { } @JsonCreator - public static OriginalLineTypeEnum forValue(final String value) { + public static OverriddenLineTypeEnum forValue(final String value) { return Promoter.enumFromString( value, - OriginalLineTypeEnum.values() + OverriddenLineTypeEnum.values() ); } } - public enum OverriddenLineTypeEnum { + public enum LineTypeEnum { MOBILE("mobile"), LANDLINE("landline"), TOLLFREE("tollFree"), @@ -288,7 +288,7 @@ public enum OverriddenLineTypeEnum { private final String value; - private OverriddenLineTypeEnum(final String value) { + private LineTypeEnum(final String value) { this.value = value; } @@ -297,15 +297,12 @@ public String toString() { } @JsonCreator - public static OverriddenLineTypeEnum forValue(final String value) { - return Promoter.enumFromString( - value, - OverriddenLineTypeEnum.values() - ); + public static LineTypeEnum forValue(final String value) { + return Promoter.enumFromString(value, LineTypeEnum.values()); } } - public enum LineTypeEnum { + public enum OriginalLineTypeEnum { MOBILE("mobile"), LANDLINE("landline"), TOLLFREE("tollFree"), @@ -321,7 +318,7 @@ public enum LineTypeEnum { private final String value; - private LineTypeEnum(final String value) { + private OriginalLineTypeEnum(final String value) { this.value = value; } @@ -330,8 +327,11 @@ public String toString() { } @JsonCreator - public static LineTypeEnum forValue(final String value) { - return Promoter.enumFromString(value, LineTypeEnum.values()); + public static OriginalLineTypeEnum forValue(final String value) { + return Promoter.enumFromString( + value, + OriginalLineTypeEnum.values() + ); } } } diff --git a/src/main/java/com/twilio/rest/numbers/v1/Webhook.java b/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetch.java similarity index 82% rename from src/main/java/com/twilio/rest/numbers/v1/Webhook.java rename to src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetch.java index 6e9c6921dd..53c0f02a23 100644 --- a/src/main/java/com/twilio/rest/numbers/v1/Webhook.java +++ b/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetch.java @@ -35,28 +35,31 @@ @JsonIgnoreProperties(ignoreUnknown = true) @ToString -public class Webhook extends Resource { +public class PortingWebhookConfigurationFetch extends Resource { private static final long serialVersionUID = 270526030240961L; - public static WebhookFetcher fetcher() { - return new WebhookFetcher(); + public static PortingWebhookConfigurationFetchFetcher fetcher() { + return new PortingWebhookConfigurationFetchFetcher(); } /** - * Converts a JSON String into a Webhook object using the provided ObjectMapper. + * Converts a JSON String into a PortingWebhookConfigurationFetch object using the provided ObjectMapper. * * @param json Raw JSON String * @param objectMapper Jackson ObjectMapper - * @return Webhook object represented by the provided JSON + * @return PortingWebhookConfigurationFetch object represented by the provided JSON */ - public static Webhook fromJson( + public static PortingWebhookConfigurationFetch fromJson( final String json, final ObjectMapper objectMapper ) { // Convert all checked exceptions to Runtime try { - return objectMapper.readValue(json, Webhook.class); + return objectMapper.readValue( + json, + PortingWebhookConfigurationFetch.class + ); } catch (final JsonMappingException | JsonParseException e) { throw new ApiException(e.getMessage(), e); } catch (final IOException e) { @@ -65,20 +68,23 @@ public static Webhook fromJson( } /** - * Converts a JSON InputStream into a Webhook object using the provided + * Converts a JSON InputStream into a PortingWebhookConfigurationFetch object using the provided * ObjectMapper. * * @param json Raw JSON InputStream * @param objectMapper Jackson ObjectMapper - * @return Webhook object represented by the provided JSON + * @return PortingWebhookConfigurationFetch object represented by the provided JSON */ - public static Webhook fromJson( + public static PortingWebhookConfigurationFetch fromJson( final InputStream json, final ObjectMapper objectMapper ) { // Convert all checked exceptions to Runtime try { - return objectMapper.readValue(json, Webhook.class); + return objectMapper.readValue( + json, + PortingWebhookConfigurationFetch.class + ); } catch (final JsonMappingException | JsonParseException e) { throw new ApiException(e.getMessage(), e); } catch (final IOException e) { @@ -94,7 +100,7 @@ public static Webhook fromJson( private final ZonedDateTime portOutTargetDateCreated; @JsonCreator - private Webhook( + private PortingWebhookConfigurationFetch( @JsonProperty("url") final URI url, @JsonProperty("port_in_target_url") final URI portInTargetUrl, @JsonProperty("port_out_target_url") final URI portOutTargetUrl, @@ -150,7 +156,8 @@ public boolean equals(final Object o) { return false; } - Webhook other = (Webhook) o; + PortingWebhookConfigurationFetch other = + (PortingWebhookConfigurationFetch) o; return ( Objects.equals(url, other.url) && diff --git a/src/main/java/com/twilio/rest/numbers/v1/WebhookFetcher.java b/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetchFetcher.java similarity index 79% rename from src/main/java/com/twilio/rest/numbers/v1/WebhookFetcher.java rename to src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetchFetcher.java index ccffc00624..59d0dc599f 100644 --- a/src/main/java/com/twilio/rest/numbers/v1/WebhookFetcher.java +++ b/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetchFetcher.java @@ -25,12 +25,15 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class WebhookFetcher extends Fetcher { +public class PortingWebhookConfigurationFetchFetcher + extends Fetcher { - public WebhookFetcher() {} + public PortingWebhookConfigurationFetchFetcher() {} @Override - public Webhook fetch(final TwilioRestClient client) { + public PortingWebhookConfigurationFetch fetch( + final TwilioRestClient client + ) { String path = "/v1/Porting/Configuration/Webhook"; Request request = new Request( @@ -43,7 +46,7 @@ public Webhook fetch(final TwilioRestClient client) { if (response == null) { throw new ApiConnectionException( - "Webhook fetch failed: Unable to connect to server" + "PortingWebhookConfigurationFetch fetch failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -59,6 +62,9 @@ public Webhook fetch(final TwilioRestClient client) { throw new ApiException(restException); } - return Webhook.fromJson(response.getStream(), client.getObjectMapper()); + return PortingWebhookConfigurationFetch.fromJson( + response.getStream(), + client.getObjectMapper() + ); } } diff --git a/src/main/java/com/twilio/rest/sync/v1/service/DocumentCreator.java b/src/main/java/com/twilio/rest/sync/v1/service/DocumentCreator.java index 9b5eca36b7..3ad46deab0 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/DocumentCreator.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/DocumentCreator.java @@ -26,14 +26,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class DocumentCreator extends Creator { private String pathServiceSid; private String uniqueName; - private Map data; + private Object data; private Integer ttl; public DocumentCreator(final String pathServiceSid) { @@ -45,7 +43,7 @@ public DocumentCreator setUniqueName(final String uniqueName) { return this; } - public DocumentCreator setData(final Map data) { + public DocumentCreator setData(final Object data) { this.data = data; return this; } @@ -102,7 +100,7 @@ private void addPostParams(final Request request) { request.addPostParam("UniqueName", uniqueName); } if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/DocumentUpdater.java b/src/main/java/com/twilio/rest/sync/v1/service/DocumentUpdater.java index 1561d4c8a2..8c4bb058d5 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/DocumentUpdater.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/DocumentUpdater.java @@ -25,14 +25,13 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class DocumentUpdater extends Updater { private String pathServiceSid; private String pathSid; private String ifMatch; - private Map data; + private Object data; private Integer ttl; public DocumentUpdater(final String pathServiceSid, final String pathSid) { @@ -45,7 +44,7 @@ public DocumentUpdater setIfMatch(final String ifMatch) { return this; } - public DocumentUpdater setData(final Map data) { + public DocumentUpdater setData(final Object data) { this.data = data; return this; } @@ -101,7 +100,7 @@ public Document update(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItem.java b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItem.java index c0d70df086..00bbcafebd 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItem.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItem.java @@ -44,7 +44,7 @@ public class SyncListItem extends Resource { public static SyncListItemCreator creator( final String pathServiceSid, final String pathListSid, - final Map data + final Object data ) { return new SyncListItemCreator(pathServiceSid, pathListSid, data); } diff --git a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemCreator.java b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemCreator.java index 2af4101ee6..4d8ac8f192 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemCreator.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemCreator.java @@ -26,14 +26,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class SyncListItemCreator extends Creator { private String pathServiceSid; private String pathListSid; - private Map data; + private Object data; private Integer ttl; private Integer itemTtl; private Integer collectionTtl; @@ -41,14 +39,14 @@ public class SyncListItemCreator extends Creator { public SyncListItemCreator( final String pathServiceSid, final String pathListSid, - final Map data + final Object data ) { this.pathServiceSid = pathServiceSid; this.pathListSid = pathListSid; this.data = data; } - public SyncListItemCreator setData(final Map data) { + public SyncListItemCreator setData(final Object data) { this.data = data; return this; } @@ -114,7 +112,7 @@ public SyncListItem create(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemUpdater.java b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemUpdater.java index df538d9384..24dde562ca 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemUpdater.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/synclist/SyncListItemUpdater.java @@ -25,7 +25,6 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class SyncListItemUpdater extends Updater { @@ -33,7 +32,7 @@ public class SyncListItemUpdater extends Updater { private String pathListSid; private Integer pathIndex; private String ifMatch; - private Map data; + private Object data; private Integer ttl; private Integer itemTtl; private Integer collectionTtl; @@ -53,7 +52,7 @@ public SyncListItemUpdater setIfMatch(final String ifMatch) { return this; } - public SyncListItemUpdater setData(final Map data) { + public SyncListItemUpdater setData(final Object data) { this.data = data; return this; } @@ -120,7 +119,7 @@ public SyncListItem update(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItem.java b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItem.java index e2c25935cf..f134d6fb0c 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItem.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItem.java @@ -45,7 +45,7 @@ public static SyncMapItemCreator creator( final String pathServiceSid, final String pathMapSid, final String key, - final Map data + final Object data ) { return new SyncMapItemCreator(pathServiceSid, pathMapSid, key, data); } diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemCreator.java b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemCreator.java index 095e615ca2..c85bdbfeb9 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemCreator.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemCreator.java @@ -26,15 +26,13 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class SyncMapItemCreator extends Creator { private String pathServiceSid; private String pathMapSid; private String key; - private Map data; + private Object data; private Integer ttl; private Integer itemTtl; private Integer collectionTtl; @@ -43,7 +41,7 @@ public SyncMapItemCreator( final String pathServiceSid, final String pathMapSid, final String key, - final Map data + final Object data ) { this.pathServiceSid = pathServiceSid; this.pathMapSid = pathMapSid; @@ -56,7 +54,7 @@ public SyncMapItemCreator setKey(final String key) { return this; } - public SyncMapItemCreator setData(final Map data) { + public SyncMapItemCreator setData(final Object data) { this.data = data; return this; } @@ -126,7 +124,7 @@ private void addPostParams(final Request request) { request.addPostParam("Key", key); } if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemUpdater.java b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemUpdater.java index f9cb5af292..b0b1a151c0 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemUpdater.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncmap/SyncMapItemUpdater.java @@ -25,7 +25,6 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class SyncMapItemUpdater extends Updater { @@ -33,7 +32,7 @@ public class SyncMapItemUpdater extends Updater { private String pathMapSid; private String pathKey; private String ifMatch; - private Map data; + private Object data; private Integer ttl; private Integer itemTtl; private Integer collectionTtl; @@ -53,7 +52,7 @@ public SyncMapItemUpdater setIfMatch(final String ifMatch) { return this; } - public SyncMapItemUpdater setData(final Map data) { + public SyncMapItemUpdater setData(final Object data) { this.data = data; return this; } @@ -120,7 +119,7 @@ public SyncMapItem update(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } if (ttl != null) { request.addPostParam("Ttl", ttl.toString()); diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessage.java b/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessage.java index 7191f3acc2..b787e9d5a1 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessage.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessage.java @@ -40,7 +40,7 @@ public class StreamMessage extends Resource { public static StreamMessageCreator creator( final String pathServiceSid, final String pathStreamSid, - final Map data + final Object data ) { return new StreamMessageCreator(pathServiceSid, pathStreamSid, data); } diff --git a/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessageCreator.java b/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessageCreator.java index 5739a6e69d..015002f303 100644 --- a/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessageCreator.java +++ b/src/main/java/com/twilio/rest/sync/v1/service/syncstream/StreamMessageCreator.java @@ -26,26 +26,24 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; -import java.util.Map; public class StreamMessageCreator extends Creator { private String pathServiceSid; private String pathStreamSid; - private Map data; + private Object data; public StreamMessageCreator( final String pathServiceSid, final String pathStreamSid, - final Map data + final Object data ) { this.pathServiceSid = pathServiceSid; this.pathStreamSid = pathStreamSid; this.data = data; } - public StreamMessageCreator setData(final Map data) { + public StreamMessageCreator setData(final Object data) { this.data = data; return this; } @@ -100,7 +98,7 @@ public StreamMessage create(final TwilioRestClient client) { private void addPostParams(final Request request) { if (data != null) { - request.addPostParam("Data", Converter.mapToJson(data)); + request.addPostParam("Data", Converter.objectToJson(data)); } } } diff --git a/src/main/java/com/twilio/rest/video/v1/CompositionCreator.java b/src/main/java/com/twilio/rest/video/v1/CompositionCreator.java index 3c579d6781..f162cd921c 100644 --- a/src/main/java/com/twilio/rest/video/v1/CompositionCreator.java +++ b/src/main/java/com/twilio/rest/video/v1/CompositionCreator.java @@ -31,13 +31,11 @@ import java.net.URI; import java.util.List; import java.util.List; -import java.util.Map; -import java.util.Map; public class CompositionCreator extends Creator { private String roomSid; - private Map videoLayout; + private Object videoLayout; private List audioSources; private List audioSourcesExcluded; private String resolution; @@ -55,9 +53,7 @@ public CompositionCreator setRoomSid(final String roomSid) { return this; } - public CompositionCreator setVideoLayout( - final Map videoLayout - ) { + public CompositionCreator setVideoLayout(final Object videoLayout) { this.videoLayout = videoLayout; return this; } @@ -162,7 +158,7 @@ private void addPostParams(final Request request) { if (videoLayout != null) { request.addPostParam( "VideoLayout", - Converter.mapToJson(videoLayout) + Converter.objectToJson(videoLayout) ); } if (audioSources != null) { diff --git a/src/main/java/com/twilio/rest/video/v1/CompositionHookCreator.java b/src/main/java/com/twilio/rest/video/v1/CompositionHookCreator.java index 356fac4185..627d5ef831 100644 --- a/src/main/java/com/twilio/rest/video/v1/CompositionHookCreator.java +++ b/src/main/java/com/twilio/rest/video/v1/CompositionHookCreator.java @@ -31,14 +31,12 @@ import java.net.URI; import java.util.List; import java.util.List; -import java.util.Map; -import java.util.Map; public class CompositionHookCreator extends Creator { private String friendlyName; private Boolean enabled; - private Map videoLayout; + private Object videoLayout; private List audioSources; private List audioSourcesExcluded; private String resolution; @@ -61,9 +59,7 @@ public CompositionHookCreator setEnabled(final Boolean enabled) { return this; } - public CompositionHookCreator setVideoLayout( - final Map videoLayout - ) { + public CompositionHookCreator setVideoLayout(final Object videoLayout) { this.videoLayout = videoLayout; return this; } @@ -181,7 +177,7 @@ private void addPostParams(final Request request) { if (videoLayout != null) { request.addPostParam( "VideoLayout", - Converter.mapToJson(videoLayout) + Converter.objectToJson(videoLayout) ); } if (audioSources != null) { diff --git a/src/main/java/com/twilio/rest/video/v1/CompositionHookUpdater.java b/src/main/java/com/twilio/rest/video/v1/CompositionHookUpdater.java index 90c84daa88..7fe754444a 100644 --- a/src/main/java/com/twilio/rest/video/v1/CompositionHookUpdater.java +++ b/src/main/java/com/twilio/rest/video/v1/CompositionHookUpdater.java @@ -28,14 +28,13 @@ import com.twilio.rest.Domains; import java.net.URI; import java.util.List; -import java.util.Map; public class CompositionHookUpdater extends Updater { private String pathSid; private String friendlyName; private Boolean enabled; - private Map videoLayout; + private Object videoLayout; private List audioSources; private List audioSourcesExcluded; private Boolean trim; @@ -62,9 +61,7 @@ public CompositionHookUpdater setEnabled(final Boolean enabled) { return this; } - public CompositionHookUpdater setVideoLayout( - final Map videoLayout - ) { + public CompositionHookUpdater setVideoLayout(final Object videoLayout) { this.videoLayout = videoLayout; return this; } @@ -183,7 +180,7 @@ private void addPostParams(final Request request) { if (videoLayout != null) { request.addPostParam( "VideoLayout", - Converter.mapToJson(videoLayout) + Converter.objectToJson(videoLayout) ); } if (audioSources != null) { diff --git a/src/main/java/com/twilio/rest/video/v1/RoomCreator.java b/src/main/java/com/twilio/rest/video/v1/RoomCreator.java index 01acec6599..fae39d57e0 100644 --- a/src/main/java/com/twilio/rest/video/v1/RoomCreator.java +++ b/src/main/java/com/twilio/rest/video/v1/RoomCreator.java @@ -46,7 +46,7 @@ public class RoomCreator extends Creator { private Boolean transcribeParticipantsOnConnect; private List videoCodecs; private String mediaRegion; - private Map recordingRules; + private Object recordingRules; private Map transcriptionsConfiguration; private Boolean audioOnly; private Integer maxParticipantDuration; @@ -120,9 +120,7 @@ public RoomCreator setMediaRegion(final String mediaRegion) { return this; } - public RoomCreator setRecordingRules( - final Map recordingRules - ) { + public RoomCreator setRecordingRules(final Object recordingRules) { this.recordingRules = recordingRules; return this; } @@ -239,7 +237,7 @@ private void addPostParams(final Request request) { if (recordingRules != null) { request.addPostParam( "RecordingRules", - Converter.mapToJson(recordingRules) + Converter.objectToJson(recordingRules) ); } if (transcriptionsConfiguration != null) { diff --git a/src/main/java/com/twilio/rest/video/v1/room/RecordingRulesUpdater.java b/src/main/java/com/twilio/rest/video/v1/room/RecordingRulesUpdater.java index 4a726e6315..e4a8477092 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/RecordingRulesUpdater.java +++ b/src/main/java/com/twilio/rest/video/v1/room/RecordingRulesUpdater.java @@ -25,18 +25,17 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class RecordingRulesUpdater extends Updater { private String pathRoomSid; - private Map rules; + private Object rules; public RecordingRulesUpdater(final String pathRoomSid) { this.pathRoomSid = pathRoomSid; } - public RecordingRulesUpdater setRules(final Map rules) { + public RecordingRulesUpdater setRules(final Object rules) { this.rules = rules; return this; } @@ -81,7 +80,7 @@ public RecordingRules update(final TwilioRestClient client) { private void addPostParams(final Request request) { if (rules != null) { - request.addPostParam("Rules", Converter.mapToJson(rules)); + request.addPostParam("Rules", Converter.objectToJson(rules)); } } } diff --git a/src/main/java/com/twilio/rest/video/v1/room/Transcriptions.java b/src/main/java/com/twilio/rest/video/v1/room/Transcriptions.java index d5f741d671..ed27576b7e 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/Transcriptions.java +++ b/src/main/java/com/twilio/rest/video/v1/room/Transcriptions.java @@ -29,6 +29,8 @@ import java.io.InputStream; import java.net.URI; import java.time.ZonedDateTime; +import java.util.Map; +import java.util.Map; import java.util.Objects; import lombok.ToString; import lombok.ToString; @@ -37,7 +39,7 @@ @ToString public class Transcriptions extends Resource { - private static final long serialVersionUID = 265092932948237L; + private static final long serialVersionUID = 69820289152110L; public static TranscriptionsCreator creator(final String pathRoomSid) { return new TranscriptionsCreator(pathRoomSid); @@ -108,13 +110,13 @@ public static Transcriptions fromJson( private final String accountSid; private final String roomSid; private final Transcriptions.Status status; - private final String identity; private final ZonedDateTime dateCreated; private final ZonedDateTime dateUpdated; private final ZonedDateTime startTime; private final ZonedDateTime endTime; private final Integer duration; private final URI url; + private final Map configuration; @JsonCreator private Transcriptions( @@ -122,25 +124,25 @@ private Transcriptions( @JsonProperty("account_sid") final String accountSid, @JsonProperty("room_sid") final String roomSid, @JsonProperty("status") final Transcriptions.Status status, - @JsonProperty("identity") final String identity, @JsonProperty("date_created") final String dateCreated, @JsonProperty("date_updated") final String dateUpdated, @JsonProperty("start_time") final String startTime, @JsonProperty("end_time") final String endTime, @JsonProperty("duration") final Integer duration, - @JsonProperty("url") final URI url + @JsonProperty("url") final URI url, + @JsonProperty("configuration") final Map configuration ) { this.ttid = ttid; this.accountSid = accountSid; this.roomSid = roomSid; this.status = status; - this.identity = identity; this.dateCreated = DateConverter.iso8601DateTimeFromString(dateCreated); this.dateUpdated = DateConverter.iso8601DateTimeFromString(dateUpdated); this.startTime = DateConverter.iso8601DateTimeFromString(startTime); this.endTime = DateConverter.iso8601DateTimeFromString(endTime); this.duration = duration; this.url = url; + this.configuration = configuration; } public final String getTtid() { @@ -159,10 +161,6 @@ public final Transcriptions.Status getStatus() { return this.status; } - public final String getIdentity() { - return this.identity; - } - public final ZonedDateTime getDateCreated() { return this.dateCreated; } @@ -187,6 +185,10 @@ public final URI getUrl() { return this.url; } + public final Map getConfiguration() { + return this.configuration; + } + @Override public boolean equals(final Object o) { if (this == o) { @@ -204,13 +206,13 @@ public boolean equals(final Object o) { Objects.equals(accountSid, other.accountSid) && Objects.equals(roomSid, other.roomSid) && Objects.equals(status, other.status) && - Objects.equals(identity, other.identity) && Objects.equals(dateCreated, other.dateCreated) && Objects.equals(dateUpdated, other.dateUpdated) && Objects.equals(startTime, other.startTime) && Objects.equals(endTime, other.endTime) && Objects.equals(duration, other.duration) && - Objects.equals(url, other.url) + Objects.equals(url, other.url) && + Objects.equals(configuration, other.configuration) ); } @@ -221,18 +223,17 @@ public int hashCode() { accountSid, roomSid, status, - identity, dateCreated, dateUpdated, startTime, endTime, duration, - url + url, + configuration ); } public enum Status { - CREATED("created"), STARTED("started"), STOPPED("stopped"), FAILED("failed"); diff --git a/src/main/java/com/twilio/rest/video/v1/room/TranscriptionsReader.java b/src/main/java/com/twilio/rest/video/v1/room/TranscriptionsReader.java index 7cb0570421..32ee246d4a 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/TranscriptionsReader.java +++ b/src/main/java/com/twilio/rest/video/v1/room/TranscriptionsReader.java @@ -86,7 +86,7 @@ private Page pageForRequest( } return Page.fromJson( - "extensions", + "transcriptions", response.getContent(), Transcriptions.class, client.getObjectMapper() diff --git a/src/main/java/com/twilio/rest/video/v1/room/participant/SubscribeRulesUpdater.java b/src/main/java/com/twilio/rest/video/v1/room/participant/SubscribeRulesUpdater.java index 6878b5373b..f33515b655 100644 --- a/src/main/java/com/twilio/rest/video/v1/room/participant/SubscribeRulesUpdater.java +++ b/src/main/java/com/twilio/rest/video/v1/room/participant/SubscribeRulesUpdater.java @@ -25,13 +25,12 @@ import com.twilio.http.Response; import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -import java.util.Map; public class SubscribeRulesUpdater extends Updater { private String pathRoomSid; private String pathParticipantSid; - private Map rules; + private Object rules; public SubscribeRulesUpdater( final String pathRoomSid, @@ -41,7 +40,7 @@ public SubscribeRulesUpdater( this.pathParticipantSid = pathParticipantSid; } - public SubscribeRulesUpdater setRules(final Map rules) { + public SubscribeRulesUpdater setRules(final Object rules) { this.rules = rules; return this; } @@ -92,7 +91,7 @@ public SubscribeRules update(final TwilioRestClient client) { private void addPostParams(final Request request) { if (rules != null) { - request.addPostParam("Rules", Converter.mapToJson(rules)); + request.addPostParam("Rules", Converter.objectToJson(rules)); } } } From 3ba6d3c95e5c4db06650721e454979266ba5982b Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 10 Jul 2025 11:50:42 +0000 Subject: [PATCH 08/12] Release 11.0.0-rc.2 --- pom.xml | 4 ++-- src/main/java/com/twilio/Twilio.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c000ec13c2..6550cce867 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ twilio jar twilio - 11.0.0-rc.1 + 11.0.0-rc.2 Twilio Java Helper Library https://www.twilio.com @@ -19,7 +19,7 @@ git@github.com:twilio/twilio-java.git scm:git:git@github.com:twilio/twilio-java.git scm:git:git@github.com:twilio/twilio-java.git - 11.0.0-rc.1 + 11.0.0-rc.2 diff --git a/src/main/java/com/twilio/Twilio.java b/src/main/java/com/twilio/Twilio.java index 1fb6a5f9b5..a41f0fa68b 100644 --- a/src/main/java/com/twilio/Twilio.java +++ b/src/main/java/com/twilio/Twilio.java @@ -24,7 +24,7 @@ */ public class Twilio { - public static final String VERSION = "11.0.0-rc.1"; + public static final String VERSION = "11.0.0-rc.2"; public static final String JAVA_VERSION = System.getProperty("java.version"); public static final String OS_NAME = System.getProperty("os.name"); public static final String OS_ARCH = System.getProperty("os.arch"); From 5845dc39f3bc2933b7c851f7ee88607bdfc32e1e Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 24 Jul 2025 07:59:12 +0000 Subject: [PATCH 09/12] [Librarian] Regenerated @ 4b32678e9d8859e19f1feb1af566eea8533a36c9 51518c9f2f9294597fd0471d5c647016ef4023ee --- CHANGES.md | 11 + .../rest/events/v1/SubscriptionUpdater.java | 9 - .../rest/insights/v1/CallSummariesReader.java | 38 ++ ...okConfigurationFetch.java => Webhook.java} | 33 +- ...nFetchFetcher.java => WebhookFetcher.java} | 16 +- src/main/java/com/twilio/twiml/voice/Say.java | 384 +++++++++++++++++- 6 files changed, 447 insertions(+), 44 deletions(-) rename src/main/java/com/twilio/rest/numbers/v1/{PortingWebhookConfigurationFetch.java => Webhook.java} (82%) rename src/main/java/com/twilio/rest/numbers/v1/{PortingWebhookConfigurationFetchFetcher.java => WebhookFetcher.java} (79%) diff --git a/CHANGES.md b/CHANGES.md index 46534c7b6d..b410ee82df 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,17 @@ twilio-java changelog ===================== +[2025-07-24] Version 11.0.0-rc.3 +-------------------------------- +**Events** +- Remove `SinkSid` parameter when updating subscriptions. **(breaking change)** + +**Twiml** +- Remove Duplicates. +- Add Polly Generative voices. +- Add Latest Google (Chirp3-HD) voices. + + [2025-07-10] Version 11.0.0-rc.2 -------------------------------- **Flex** diff --git a/src/main/java/com/twilio/rest/events/v1/SubscriptionUpdater.java b/src/main/java/com/twilio/rest/events/v1/SubscriptionUpdater.java index adefd8eab6..a6907cb6e5 100644 --- a/src/main/java/com/twilio/rest/events/v1/SubscriptionUpdater.java +++ b/src/main/java/com/twilio/rest/events/v1/SubscriptionUpdater.java @@ -29,7 +29,6 @@ public class SubscriptionUpdater extends Updater { private String pathSid; private String description; - private String sinkSid; public SubscriptionUpdater(final String pathSid) { this.pathSid = pathSid; @@ -40,11 +39,6 @@ public SubscriptionUpdater setDescription(final String description) { return this; } - public SubscriptionUpdater setSinkSid(final String sinkSid) { - this.sinkSid = sinkSid; - return this; - } - @Override public Subscription update(final TwilioRestClient client) { String path = "/v1/Subscriptions/{Sid}"; @@ -87,8 +81,5 @@ private void addPostParams(final Request request) { if (description != null) { request.addPostParam("Description", description); } - if (sinkSid != null) { - request.addPostParam("SinkSid", sinkSid); - } } } diff --git a/src/main/java/com/twilio/rest/insights/v1/CallSummariesReader.java b/src/main/java/com/twilio/rest/insights/v1/CallSummariesReader.java index 5c1f1334a7..b298cde879 100644 --- a/src/main/java/com/twilio/rest/insights/v1/CallSummariesReader.java +++ b/src/main/java/com/twilio/rest/insights/v1/CallSummariesReader.java @@ -55,6 +55,10 @@ public class CallSummariesReader extends Reader { private Boolean brandedEnabled; private Boolean voiceIntegrityEnabled; private String brandedBundleSid; + private Boolean brandedLogo; + private String brandedType; + private String brandedUseCase; + private String brandedCallReason; private String voiceIntegrityBundleSid; private String voiceIntegrityUseCase; private String businessProfileIdentity; @@ -215,6 +219,28 @@ public CallSummariesReader setBrandedBundleSid( return this; } + public CallSummariesReader setBrandedLogo(final Boolean brandedLogo) { + this.brandedLogo = brandedLogo; + return this; + } + + public CallSummariesReader setBrandedType(final String brandedType) { + this.brandedType = brandedType; + return this; + } + + public CallSummariesReader setBrandedUseCase(final String brandedUseCase) { + this.brandedUseCase = brandedUseCase; + return this; + } + + public CallSummariesReader setBrandedCallReason( + final String brandedCallReason + ) { + this.brandedCallReason = brandedCallReason; + return this; + } + public CallSummariesReader setVoiceIntegrityBundleSid( final String voiceIntegrityBundleSid ) { @@ -441,6 +467,18 @@ private void addQueryParams(final Request request) { if (brandedBundleSid != null) { request.addQueryParam("BrandedBundleSid", brandedBundleSid); } + if (brandedLogo != null) { + request.addQueryParam("BrandedLogo", brandedLogo.toString()); + } + if (brandedType != null) { + request.addQueryParam("BrandedType", brandedType); + } + if (brandedUseCase != null) { + request.addQueryParam("BrandedUseCase", brandedUseCase); + } + if (brandedCallReason != null) { + request.addQueryParam("BrandedCallReason", brandedCallReason); + } if (voiceIntegrityBundleSid != null) { request.addQueryParam( "VoiceIntegrityBundleSid", diff --git a/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetch.java b/src/main/java/com/twilio/rest/numbers/v1/Webhook.java similarity index 82% rename from src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetch.java rename to src/main/java/com/twilio/rest/numbers/v1/Webhook.java index 53c0f02a23..6e9c6921dd 100644 --- a/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetch.java +++ b/src/main/java/com/twilio/rest/numbers/v1/Webhook.java @@ -35,31 +35,28 @@ @JsonIgnoreProperties(ignoreUnknown = true) @ToString -public class PortingWebhookConfigurationFetch extends Resource { +public class Webhook extends Resource { private static final long serialVersionUID = 270526030240961L; - public static PortingWebhookConfigurationFetchFetcher fetcher() { - return new PortingWebhookConfigurationFetchFetcher(); + public static WebhookFetcher fetcher() { + return new WebhookFetcher(); } /** - * Converts a JSON String into a PortingWebhookConfigurationFetch object using the provided ObjectMapper. + * Converts a JSON String into a Webhook object using the provided ObjectMapper. * * @param json Raw JSON String * @param objectMapper Jackson ObjectMapper - * @return PortingWebhookConfigurationFetch object represented by the provided JSON + * @return Webhook object represented by the provided JSON */ - public static PortingWebhookConfigurationFetch fromJson( + public static Webhook fromJson( final String json, final ObjectMapper objectMapper ) { // Convert all checked exceptions to Runtime try { - return objectMapper.readValue( - json, - PortingWebhookConfigurationFetch.class - ); + return objectMapper.readValue(json, Webhook.class); } catch (final JsonMappingException | JsonParseException e) { throw new ApiException(e.getMessage(), e); } catch (final IOException e) { @@ -68,23 +65,20 @@ public static PortingWebhookConfigurationFetch fromJson( } /** - * Converts a JSON InputStream into a PortingWebhookConfigurationFetch object using the provided + * Converts a JSON InputStream into a Webhook object using the provided * ObjectMapper. * * @param json Raw JSON InputStream * @param objectMapper Jackson ObjectMapper - * @return PortingWebhookConfigurationFetch object represented by the provided JSON + * @return Webhook object represented by the provided JSON */ - public static PortingWebhookConfigurationFetch fromJson( + public static Webhook fromJson( final InputStream json, final ObjectMapper objectMapper ) { // Convert all checked exceptions to Runtime try { - return objectMapper.readValue( - json, - PortingWebhookConfigurationFetch.class - ); + return objectMapper.readValue(json, Webhook.class); } catch (final JsonMappingException | JsonParseException e) { throw new ApiException(e.getMessage(), e); } catch (final IOException e) { @@ -100,7 +94,7 @@ public static PortingWebhookConfigurationFetch fromJson( private final ZonedDateTime portOutTargetDateCreated; @JsonCreator - private PortingWebhookConfigurationFetch( + private Webhook( @JsonProperty("url") final URI url, @JsonProperty("port_in_target_url") final URI portInTargetUrl, @JsonProperty("port_out_target_url") final URI portOutTargetUrl, @@ -156,8 +150,7 @@ public boolean equals(final Object o) { return false; } - PortingWebhookConfigurationFetch other = - (PortingWebhookConfigurationFetch) o; + Webhook other = (Webhook) o; return ( Objects.equals(url, other.url) && diff --git a/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetchFetcher.java b/src/main/java/com/twilio/rest/numbers/v1/WebhookFetcher.java similarity index 79% rename from src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetchFetcher.java rename to src/main/java/com/twilio/rest/numbers/v1/WebhookFetcher.java index 59d0dc599f..ccffc00624 100644 --- a/src/main/java/com/twilio/rest/numbers/v1/PortingWebhookConfigurationFetchFetcher.java +++ b/src/main/java/com/twilio/rest/numbers/v1/WebhookFetcher.java @@ -25,15 +25,12 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.Domains; -public class PortingWebhookConfigurationFetchFetcher - extends Fetcher { +public class WebhookFetcher extends Fetcher { - public PortingWebhookConfigurationFetchFetcher() {} + public WebhookFetcher() {} @Override - public PortingWebhookConfigurationFetch fetch( - final TwilioRestClient client - ) { + public Webhook fetch(final TwilioRestClient client) { String path = "/v1/Porting/Configuration/Webhook"; Request request = new Request( @@ -46,7 +43,7 @@ public PortingWebhookConfigurationFetch fetch( if (response == null) { throw new ApiConnectionException( - "PortingWebhookConfigurationFetch fetch failed: Unable to connect to server" + "Webhook fetch failed: Unable to connect to server" ); } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { RestException restException = RestException.fromJson( @@ -62,9 +59,6 @@ public PortingWebhookConfigurationFetch fetch( throw new ApiException(restException); } - return PortingWebhookConfigurationFetch.fromJson( - response.getStream(), - client.getObjectMapper() - ); + return Webhook.fromJson(response.getStream(), client.getObjectMapper()); } } diff --git a/src/main/java/com/twilio/twiml/voice/Say.java b/src/main/java/com/twilio/twiml/voice/Say.java index 094000e5a7..c317fe078e 100644 --- a/src/main/java/com/twilio/twiml/voice/Say.java +++ b/src/main/java/com/twilio/twiml/voice/Say.java @@ -31,6 +31,14 @@ public enum Voice { GOOGLE_AM_ET_STANDARD_B("Google.am-ET-Standard-B"), GOOGLE_AM_ET_WAVENET_A("Google.am-ET-Wavenet-A"), GOOGLE_AM_ET_WAVENET_B("Google.am-ET-Wavenet-B"), + GOOGLE_AR_XA_CHIRP3_HD_AOEDE("Google.ar-XA-Chirp3-HD-Aoede"), + GOOGLE_AR_XA_CHIRP3_HD_CHARON("Google.ar-XA-Chirp3-HD-Charon"), + GOOGLE_AR_XA_CHIRP3_HD_FENRIR("Google.ar-XA-Chirp3-HD-Fenrir"), + GOOGLE_AR_XA_CHIRP3_HD_KORE("Google.ar-XA-Chirp3-HD-Kore"), + GOOGLE_AR_XA_CHIRP3_HD_LEDA("Google.ar-XA-Chirp3-HD-Leda"), + GOOGLE_AR_XA_CHIRP3_HD_ORUS("Google.ar-XA-Chirp3-HD-Orus"), + GOOGLE_AR_XA_CHIRP3_HD_PUCK("Google.ar-XA-Chirp3-HD-Puck"), + GOOGLE_AR_XA_CHIRP3_HD_ZEPHYR("Google.ar-XA-Chirp3-HD-Zephyr"), GOOGLE_AR_XA_STANDARD_A("Google.ar-XA-Standard-A"), GOOGLE_AR_XA_STANDARD_B("Google.ar-XA-Standard-B"), GOOGLE_AR_XA_STANDARD_C("Google.ar-XA-Standard-C"), @@ -40,11 +48,33 @@ public enum Voice { GOOGLE_AR_XA_WAVENET_C("Google.ar-XA-Wavenet-C"), GOOGLE_AR_XA_WAVENET_D("Google.ar-XA-Wavenet-D"), GOOGLE_BG_BG_STANDARD_A("Google.bg-BG-Standard-A"), + GOOGLE_BG_BG_STANDARD_B("Google.bg-BG-Standard-B"), + GOOGLE_BN_IN_CHIRP3_HD_AOEDE("Google.bn-IN-Chirp3-HD-Aoede"), + GOOGLE_BN_IN_CHIRP3_HD_CHARON("Google.bn-IN-Chirp3-HD-Charon"), + GOOGLE_BN_IN_CHIRP3_HD_FENRIR("Google.bn-IN-Chirp3-HD-Fenrir"), + GOOGLE_BN_IN_CHIRP3_HD_KORE("Google.bn-IN-Chirp3-HD-Kore"), + GOOGLE_BN_IN_CHIRP3_HD_LEDA("Google.bn-IN-Chirp3-HD-Leda"), + GOOGLE_BN_IN_CHIRP3_HD_ORUS("Google.bn-IN-Chirp3-HD-Orus"), + GOOGLE_BN_IN_CHIRP3_HD_PUCK("Google.bn-IN-Chirp3-HD-Puck"), + GOOGLE_BN_IN_CHIRP3_HD_ZEPHYR("Google.bn-IN-Chirp3-HD-Zephyr"), + GOOGLE_BN_IN_STANDARD_A("Google.bn-IN-Standard-A"), + GOOGLE_BN_IN_STANDARD_B("Google.bn-IN-Standard-B"), GOOGLE_BN_IN_STANDARD_C("Google.bn-IN-Standard-C"), GOOGLE_BN_IN_STANDARD_D("Google.bn-IN-Standard-D"), + GOOGLE_BN_IN_WAVENET_A("Google.bn-IN-Wavenet-A"), + GOOGLE_BN_IN_WAVENET_B("Google.bn-IN-Wavenet-B"), GOOGLE_BN_IN_WAVENET_C("Google.bn-IN-Wavenet-C"), GOOGLE_BN_IN_WAVENET_D("Google.bn-IN-Wavenet-D"), GOOGLE_CA_ES_STANDARD_A("Google.ca-ES-Standard-A"), + GOOGLE_CA_ES_STANDARD_B("Google.ca-ES-Standard-B"), + GOOGLE_CMN_CN_CHIRP3_HD_AOEDE("Google.cmn-CN-Chirp3-HD-Aoede"), + GOOGLE_CMN_CN_CHIRP3_HD_CHARON("Google.cmn-CN-Chirp3-HD-Charon"), + GOOGLE_CMN_CN_CHIRP3_HD_FENRIR("Google.cmn-CN-Chirp3-HD-Fenrir"), + GOOGLE_CMN_CN_CHIRP3_HD_KORE("Google.cmn-CN-Chirp3-HD-Kore"), + GOOGLE_CMN_CN_CHIRP3_HD_LEDA("Google.cmn-CN-Chirp3-HD-Leda"), + GOOGLE_CMN_CN_CHIRP3_HD_ORUS("Google.cmn-CN-Chirp3-HD-Orus"), + GOOGLE_CMN_CN_CHIRP3_HD_PUCK("Google.cmn-CN-Chirp3-HD-Puck"), + GOOGLE_CMN_CN_CHIRP3_HD_ZEPHYR("Google.cmn-CN-Chirp3-HD-Zephyr"), GOOGLE_CMN_CN_STANDARD_A("Google.cmn-CN-Standard-A"), GOOGLE_CMN_CN_STANDARD_B("Google.cmn-CN-Standard-B"), GOOGLE_CMN_CN_STANDARD_C("Google.cmn-CN-Standard-C"), @@ -60,36 +90,66 @@ public enum Voice { GOOGLE_CMN_TW_WAVENET_B("Google.cmn-TW-Wavenet-B"), GOOGLE_CMN_TW_WAVENET_C("Google.cmn-TW-Wavenet-C"), GOOGLE_CS_CZ_STANDARD_A("Google.cs-CZ-Standard-A"), + GOOGLE_CS_CZ_STANDARD_B("Google.cs-CZ-Standard-B"), GOOGLE_CS_CZ_WAVENET_A("Google.cs-CZ-Wavenet-A"), + GOOGLE_CS_CZ_WAVENET_B("Google.cs-CZ-Wavenet-B"), GOOGLE_DA_DK_NEURAL2_D("Google.da-DK-Neural2-D"), GOOGLE_DA_DK_NEURAL2_F("Google.da-DK-Neural2-F"), GOOGLE_DA_DK_STANDARD_A("Google.da-DK-Standard-A"), GOOGLE_DA_DK_STANDARD_C("Google.da-DK-Standard-C"), GOOGLE_DA_DK_STANDARD_D("Google.da-DK-Standard-D"), GOOGLE_DA_DK_STANDARD_E("Google.da-DK-Standard-E"), + GOOGLE_DA_DK_STANDARD_F("Google.da-DK-Standard-F"), + GOOGLE_DA_DK_STANDARD_G("Google.da-DK-Standard-G"), GOOGLE_DA_DK_WAVENET_A("Google.da-DK-Wavenet-A"), GOOGLE_DA_DK_WAVENET_C("Google.da-DK-Wavenet-C"), GOOGLE_DA_DK_WAVENET_D("Google.da-DK-Wavenet-D"), GOOGLE_DA_DK_WAVENET_E("Google.da-DK-Wavenet-E"), + GOOGLE_DA_DK_WAVENET_F("Google.da-DK-Wavenet-F"), + GOOGLE_DA_DK_WAVENET_G("Google.da-DK-Wavenet-G"), + GOOGLE_DE_DE_CHIRP3_HD_AOEDE("Google.de-DE-Chirp3-HD-Aoede"), + GOOGLE_DE_DE_CHIRP3_HD_CHARON("Google.de-DE-Chirp3-HD-Charon"), + GOOGLE_DE_DE_CHIRP3_HD_FENRIR("Google.de-DE-Chirp3-HD-Fenrir"), + GOOGLE_DE_DE_CHIRP3_HD_KORE("Google.de-DE-Chirp3-HD-Kore"), + GOOGLE_DE_DE_CHIRP3_HD_LEDA("Google.de-DE-Chirp3-HD-Leda"), + GOOGLE_DE_DE_CHIRP3_HD_ORUS("Google.de-DE-Chirp3-HD-Orus"), + GOOGLE_DE_DE_CHIRP3_HD_PUCK("Google.de-DE-Chirp3-HD-Puck"), + GOOGLE_DE_DE_CHIRP3_HD_ZEPHYR("Google.de-DE-Chirp3-HD-Zephyr"), GOOGLE_DE_DE_NEURAL2_A("Google.de-DE-Neural2-A"), GOOGLE_DE_DE_NEURAL2_B("Google.de-DE-Neural2-B"), GOOGLE_DE_DE_NEURAL2_C("Google.de-DE-Neural2-C"), GOOGLE_DE_DE_NEURAL2_D("Google.de-DE-Neural2-D"), GOOGLE_DE_DE_NEURAL2_F("Google.de-DE-Neural2-F"), + GOOGLE_DE_DE_NEURAL2_G("Google.de-DE-Neural2-G"), + GOOGLE_DE_DE_NEURAL2_H("Google.de-DE-Neural2-H"), GOOGLE_DE_DE_STANDARD_A("Google.de-DE-Standard-A"), GOOGLE_DE_DE_STANDARD_B("Google.de-DE-Standard-B"), GOOGLE_DE_DE_STANDARD_C("Google.de-DE-Standard-C"), GOOGLE_DE_DE_STANDARD_D("Google.de-DE-Standard-D"), GOOGLE_DE_DE_STANDARD_E("Google.de-DE-Standard-E"), GOOGLE_DE_DE_STANDARD_F("Google.de-DE-Standard-F"), + GOOGLE_DE_DE_STANDARD_G("Google.de-DE-Standard-G"), + GOOGLE_DE_DE_STANDARD_H("Google.de-DE-Standard-H"), GOOGLE_DE_DE_WAVENET_A("Google.de-DE-Wavenet-A"), GOOGLE_DE_DE_WAVENET_B("Google.de-DE-Wavenet-B"), GOOGLE_DE_DE_WAVENET_C("Google.de-DE-Wavenet-C"), GOOGLE_DE_DE_WAVENET_D("Google.de-DE-Wavenet-D"), GOOGLE_DE_DE_WAVENET_E("Google.de-DE-Wavenet-E"), GOOGLE_DE_DE_WAVENET_F("Google.de-DE-Wavenet-F"), + GOOGLE_DE_DE_WAVENET_G("Google.de-DE-Wavenet-G"), + GOOGLE_DE_DE_WAVENET_H("Google.de-DE-Wavenet-H"), GOOGLE_EL_GR_STANDARD_A("Google.el-GR-Standard-A"), + GOOGLE_EL_GR_STANDARD_B("Google.el-GR-Standard-B"), GOOGLE_EL_GR_WAVENET_A("Google.el-GR-Wavenet-A"), + GOOGLE_EL_GR_WAVENET_B("Google.el-GR-Wavenet-B"), + GOOGLE_EN_AU_CHIRP3_HD_AOEDE("Google.en-AU-Chirp3-HD-Aoede"), + GOOGLE_EN_AU_CHIRP3_HD_CHARON("Google.en-AU-Chirp3-HD-Charon"), + GOOGLE_EN_AU_CHIRP3_HD_FENRIR("Google.en-AU-Chirp3-HD-Fenrir"), + GOOGLE_EN_AU_CHIRP3_HD_KORE("Google.en-AU-Chirp3-HD-Kore"), + GOOGLE_EN_AU_CHIRP3_HD_LEDA("Google.en-AU-Chirp3-HD-Leda"), + GOOGLE_EN_AU_CHIRP3_HD_ORUS("Google.en-AU-Chirp3-HD-Orus"), + GOOGLE_EN_AU_CHIRP3_HD_PUCK("Google.en-AU-Chirp3-HD-Puck"), + GOOGLE_EN_AU_CHIRP3_HD_ZEPHYR("Google.en-AU-Chirp3-HD-Zephyr"), GOOGLE_EN_AU_NEURAL2_A("Google.en-AU-Neural2-A"), GOOGLE_EN_AU_NEURAL2_B("Google.en-AU-Neural2-B"), GOOGLE_EN_AU_NEURAL2_C("Google.en-AU-Neural2-C"), @@ -102,21 +162,43 @@ public enum Voice { GOOGLE_EN_AU_WAVENET_B("Google.en-AU-Wavenet-B"), GOOGLE_EN_AU_WAVENET_C("Google.en-AU-Wavenet-C"), GOOGLE_EN_AU_WAVENET_D("Google.en-AU-Wavenet-D"), + GOOGLE_EN_GB_CHIRP3_HD_AOEDE("Google.en-GB-Chirp3-HD-Aoede"), + GOOGLE_EN_GB_CHIRP3_HD_CHARON("Google.en-GB-Chirp3-HD-Charon"), + GOOGLE_EN_GB_CHIRP3_HD_FENRIR("Google.en-GB-Chirp3-HD-Fenrir"), + GOOGLE_EN_GB_CHIRP3_HD_KORE("Google.en-GB-Chirp3-HD-Kore"), + GOOGLE_EN_GB_CHIRP3_HD_LEDA("Google.en-GB-Chirp3-HD-Leda"), + GOOGLE_EN_GB_CHIRP3_HD_ORUS("Google.en-GB-Chirp3-HD-Orus"), + GOOGLE_EN_GB_CHIRP3_HD_PUCK("Google.en-GB-Chirp3-HD-Puck"), + GOOGLE_EN_GB_CHIRP3_HD_ZEPHYR("Google.en-GB-Chirp3-HD-Zephyr"), GOOGLE_EN_GB_NEURAL2_A("Google.en-GB-Neural2-A"), GOOGLE_EN_GB_NEURAL2_B("Google.en-GB-Neural2-B"), GOOGLE_EN_GB_NEURAL2_C("Google.en-GB-Neural2-C"), GOOGLE_EN_GB_NEURAL2_D("Google.en-GB-Neural2-D"), GOOGLE_EN_GB_NEURAL2_F("Google.en-GB-Neural2-F"), + GOOGLE_EN_GB_NEURAL2_N("Google.en-GB-Neural2-N"), + GOOGLE_EN_GB_NEURAL2_O("Google.en-GB-Neural2-O"), GOOGLE_EN_GB_STANDARD_A("Google.en-GB-Standard-A"), GOOGLE_EN_GB_STANDARD_B("Google.en-GB-Standard-B"), GOOGLE_EN_GB_STANDARD_C("Google.en-GB-Standard-C"), GOOGLE_EN_GB_STANDARD_D("Google.en-GB-Standard-D"), GOOGLE_EN_GB_STANDARD_F("Google.en-GB-Standard-F"), + GOOGLE_EN_GB_STANDARD_N("Google.en-GB-Standard-N"), + GOOGLE_EN_GB_STANDARD_O("Google.en-GB-Standard-O"), GOOGLE_EN_GB_WAVENET_A("Google.en-GB-Wavenet-A"), GOOGLE_EN_GB_WAVENET_B("Google.en-GB-Wavenet-B"), GOOGLE_EN_GB_WAVENET_C("Google.en-GB-Wavenet-C"), GOOGLE_EN_GB_WAVENET_D("Google.en-GB-Wavenet-D"), GOOGLE_EN_GB_WAVENET_F("Google.en-GB-Wavenet-F"), + GOOGLE_EN_GB_WAVENET_N("Google.en-GB-Wavenet-N"), + GOOGLE_EN_GB_WAVENET_O("Google.en-GB-Wavenet-O"), + GOOGLE_EN_IN_CHIRP3_HD_AOEDE("Google.en-IN-Chirp3-HD-Aoede"), + GOOGLE_EN_IN_CHIRP3_HD_CHARON("Google.en-IN-Chirp3-HD-Charon"), + GOOGLE_EN_IN_CHIRP3_HD_FENRIR("Google.en-IN-Chirp3-HD-Fenrir"), + GOOGLE_EN_IN_CHIRP3_HD_KORE("Google.en-IN-Chirp3-HD-Kore"), + GOOGLE_EN_IN_CHIRP3_HD_LEDA("Google.en-IN-Chirp3-HD-Leda"), + GOOGLE_EN_IN_CHIRP3_HD_ORUS("Google.en-IN-Chirp3-HD-Orus"), + GOOGLE_EN_IN_CHIRP3_HD_PUCK("Google.en-IN-Chirp3-HD-Puck"), + GOOGLE_EN_IN_CHIRP3_HD_ZEPHYR("Google.en-IN-Chirp3-HD-Zephyr"), GOOGLE_EN_IN_NEURAL2_A("Google.en-IN-Neural2-A"), GOOGLE_EN_IN_NEURAL2_B("Google.en-IN-Neural2-B"), GOOGLE_EN_IN_NEURAL2_C("Google.en-IN-Neural2-C"), @@ -125,10 +207,22 @@ public enum Voice { GOOGLE_EN_IN_STANDARD_B("Google.en-IN-Standard-B"), GOOGLE_EN_IN_STANDARD_C("Google.en-IN-Standard-C"), GOOGLE_EN_IN_STANDARD_D("Google.en-IN-Standard-D"), + GOOGLE_EN_IN_STANDARD_E("Google.en-IN-Standard-E"), + GOOGLE_EN_IN_STANDARD_F("Google.en-IN-Standard-F"), GOOGLE_EN_IN_WAVENET_A("Google.en-IN-Wavenet-A"), GOOGLE_EN_IN_WAVENET_B("Google.en-IN-Wavenet-B"), GOOGLE_EN_IN_WAVENET_C("Google.en-IN-Wavenet-C"), GOOGLE_EN_IN_WAVENET_D("Google.en-IN-Wavenet-D"), + GOOGLE_EN_IN_WAVENET_E("Google.en-IN-Wavenet-E"), + GOOGLE_EN_IN_WAVENET_F("Google.en-IN-Wavenet-F"), + GOOGLE_EN_US_CHIRP3_HD_AOEDE("Google.en-US-Chirp3-HD-Aoede"), + GOOGLE_EN_US_CHIRP3_HD_CHARON("Google.en-US-Chirp3-HD-Charon"), + GOOGLE_EN_US_CHIRP3_HD_FENRIR("Google.en-US-Chirp3-HD-Fenrir"), + GOOGLE_EN_US_CHIRP3_HD_KORE("Google.en-US-Chirp3-HD-Kore"), + GOOGLE_EN_US_CHIRP3_HD_LEDA("Google.en-US-Chirp3-HD-Leda"), + GOOGLE_EN_US_CHIRP3_HD_ORUS("Google.en-US-Chirp3-HD-Orus"), + GOOGLE_EN_US_CHIRP3_HD_PUCK("Google.en-US-Chirp3-HD-Puck"), + GOOGLE_EN_US_CHIRP3_HD_ZEPHYR("Google.en-US-Chirp3-HD-Zephyr"), GOOGLE_EN_US_NEURAL2_A("Google.en-US-Neural2-A"), GOOGLE_EN_US_NEURAL2_C("Google.en-US-Neural2-C"), GOOGLE_EN_US_NEURAL2_D("Google.en-US-Neural2-D"), @@ -158,18 +252,45 @@ public enum Voice { GOOGLE_EN_US_WAVENET_H("Google.en-US-Wavenet-H"), GOOGLE_EN_US_WAVENET_I("Google.en-US-Wavenet-I"), GOOGLE_EN_US_WAVENET_J("Google.en-US-Wavenet-J"), + GOOGLE_ES_ES_CHIRP3_HD_AOEDE("Google.es-ES-Chirp3-HD-Aoede"), + GOOGLE_ES_ES_CHIRP3_HD_CHARON("Google.es-ES-Chirp3-HD-Charon"), + GOOGLE_ES_ES_CHIRP3_HD_FENRIR("Google.es-ES-Chirp3-HD-Fenrir"), + GOOGLE_ES_ES_CHIRP3_HD_KORE("Google.es-ES-Chirp3-HD-Kore"), + GOOGLE_ES_ES_CHIRP3_HD_LEDA("Google.es-ES-Chirp3-HD-Leda"), + GOOGLE_ES_ES_CHIRP3_HD_ORUS("Google.es-ES-Chirp3-HD-Orus"), + GOOGLE_ES_ES_CHIRP3_HD_PUCK("Google.es-ES-Chirp3-HD-Puck"), + GOOGLE_ES_ES_CHIRP3_HD_ZEPHYR("Google.es-ES-Chirp3-HD-Zephyr"), GOOGLE_ES_ES_NEURAL2_A("Google.es-ES-Neural2-A"), GOOGLE_ES_ES_NEURAL2_B("Google.es-ES-Neural2-B"), GOOGLE_ES_ES_NEURAL2_C("Google.es-ES-Neural2-C"), GOOGLE_ES_ES_NEURAL2_D("Google.es-ES-Neural2-D"), GOOGLE_ES_ES_NEURAL2_E("Google.es-ES-Neural2-E"), GOOGLE_ES_ES_NEURAL2_F("Google.es-ES-Neural2-F"), + GOOGLE_ES_ES_NEURAL2_G("Google.es-ES-Neural2-G"), + GOOGLE_ES_ES_NEURAL2_H("Google.es-ES-Neural2-H"), + GOOGLE_ES_ES_STANDARD_A("Google.es-ES-Standard-A"), GOOGLE_ES_ES_STANDARD_B("Google.es-ES-Standard-B"), GOOGLE_ES_ES_STANDARD_C("Google.es-ES-Standard-C"), GOOGLE_ES_ES_STANDARD_D("Google.es-ES-Standard-D"), + GOOGLE_ES_ES_STANDARD_E("Google.es-ES-Standard-E"), + GOOGLE_ES_ES_STANDARD_F("Google.es-ES-Standard-F"), + GOOGLE_ES_ES_STANDARD_G("Google.es-ES-Standard-G"), + GOOGLE_ES_ES_STANDARD_H("Google.es-ES-Standard-H"), GOOGLE_ES_ES_WAVENET_B("Google.es-ES-Wavenet-B"), GOOGLE_ES_ES_WAVENET_C("Google.es-ES-Wavenet-C"), GOOGLE_ES_ES_WAVENET_D("Google.es-ES-Wavenet-D"), + GOOGLE_ES_ES_WAVENET_E("Google.es-ES-Wavenet-E"), + GOOGLE_ES_ES_WAVENET_F("Google.es-ES-Wavenet-F"), + GOOGLE_ES_ES_WAVENET_G("Google.es-ES-Wavenet-G"), + GOOGLE_ES_ES_WAVENET_H("Google.es-ES-Wavenet-H"), + GOOGLE_ES_US_CHIRP3_HD_AOEDE("Google.es-US-Chirp3-HD-Aoede"), + GOOGLE_ES_US_CHIRP3_HD_CHARON("Google.es-US-Chirp3-HD-Charon"), + GOOGLE_ES_US_CHIRP3_HD_FENRIR("Google.es-US-Chirp3-HD-Fenrir"), + GOOGLE_ES_US_CHIRP3_HD_KORE("Google.es-US-Chirp3-HD-Kore"), + GOOGLE_ES_US_CHIRP3_HD_LEDA("Google.es-US-Chirp3-HD-Leda"), + GOOGLE_ES_US_CHIRP3_HD_ORUS("Google.es-US-Chirp3-HD-Orus"), + GOOGLE_ES_US_CHIRP3_HD_PUCK("Google.es-US-Chirp3-HD-Puck"), + GOOGLE_ES_US_CHIRP3_HD_ZEPHYR("Google.es-US-Chirp3-HD-Zephyr"), GOOGLE_ES_US_NEURAL2_A("Google.es-US-Neural2-A"), GOOGLE_ES_US_NEURAL2_B("Google.es-US-Neural2-B"), GOOGLE_ES_US_NEURAL2_C("Google.es-US-Neural2-C"), @@ -180,8 +301,13 @@ public enum Voice { GOOGLE_ES_US_WAVENET_B("Google.es-US-Wavenet-B"), GOOGLE_ES_US_WAVENET_C("Google.es-US-Wavenet-C"), GOOGLE_EU_ES_STANDARD_A("Google.eu-ES-Standard-A"), + GOOGLE_EU_ES_STANDARD_B("Google.eu-ES-Standard-B"), GOOGLE_FI_FI_STANDARD_A("Google.fi-FI-Standard-A"), + GOOGLE_FI_FI_STANDARD_B("Google.fi-FI-Standard-B"), GOOGLE_FI_FI_WAVENET_A("Google.fi-FI-Wavenet-A"), + GOOGLE_FI_FI_WAVENET_B("Google.fi-FI-Wavenet-B"), + GOOGLE_FIL_PH_NEURAL2_A("Google.fil-ph-Neural2-A"), + GOOGLE_FIL_PH_NEURAL2_D("Google.fil-ph-Neural2-D"), GOOGLE_FIL_PH_STANDARD_A("Google.fil-PH-Standard-A"), GOOGLE_FIL_PH_STANDARD_B("Google.fil-PH-Standard-B"), GOOGLE_FIL_PH_STANDARD_C("Google.fil-PH-Standard-C"), @@ -190,8 +316,14 @@ public enum Voice { GOOGLE_FIL_PH_WAVENET_B("Google.fil-PH-Wavenet-B"), GOOGLE_FIL_PH_WAVENET_C("Google.fil-PH-Wavenet-C"), GOOGLE_FIL_PH_WAVENET_D("Google.fil-PH-Wavenet-D"), - GOOGLE_FIL_PH_NEURAL2_A("Google.fil-ph-Neural2-A"), - GOOGLE_FIL_PH_NEURAL2_D("Google.fil-ph-Neural2-D"), + GOOGLE_FR_CA_CHIRP3_HD_AOEDE("Google.fr-CA-Chirp3-HD-Aoede"), + GOOGLE_FR_CA_CHIRP3_HD_CHARON("Google.fr-CA-Chirp3-HD-Charon"), + GOOGLE_FR_CA_CHIRP3_HD_FENRIR("Google.fr-CA-Chirp3-HD-Fenrir"), + GOOGLE_FR_CA_CHIRP3_HD_KORE("Google.fr-CA-Chirp3-HD-Kore"), + GOOGLE_FR_CA_CHIRP3_HD_LEDA("Google.fr-CA-Chirp3-HD-Leda"), + GOOGLE_FR_CA_CHIRP3_HD_ORUS("Google.fr-CA-Chirp3-HD-Orus"), + GOOGLE_FR_CA_CHIRP3_HD_PUCK("Google.fr-CA-Chirp3-HD-Puck"), + GOOGLE_FR_CA_CHIRP3_HD_ZEPHYR("Google.fr-CA-Chirp3-HD-Zephyr"), GOOGLE_FR_CA_NEURAL2_A("Google.fr-CA-Neural2-A"), GOOGLE_FR_CA_NEURAL2_B("Google.fr-CA-Neural2-B"), GOOGLE_FR_CA_NEURAL2_C("Google.fr-CA-Neural2-C"), @@ -204,24 +336,51 @@ public enum Voice { GOOGLE_FR_CA_WAVENET_B("Google.fr-CA-Wavenet-B"), GOOGLE_FR_CA_WAVENET_C("Google.fr-CA-Wavenet-C"), GOOGLE_FR_CA_WAVENET_D("Google.fr-CA-Wavenet-D"), + GOOGLE_FR_FR_CHIRP3_HD_AOEDE("Google.fr-FR-Chirp3-HD-Aoede"), + GOOGLE_FR_FR_CHIRP3_HD_CHARON("Google.fr-FR-Chirp3-HD-Charon"), + GOOGLE_FR_FR_CHIRP3_HD_FENRIR("Google.fr-FR-Chirp3-HD-Fenrir"), + GOOGLE_FR_FR_CHIRP3_HD_KORE("Google.fr-FR-Chirp3-HD-Kore"), + GOOGLE_FR_FR_CHIRP3_HD_LEDA("Google.fr-FR-Chirp3-HD-Leda"), + GOOGLE_FR_FR_CHIRP3_HD_ORUS("Google.fr-FR-Chirp3-HD-Orus"), + GOOGLE_FR_FR_CHIRP3_HD_PUCK("Google.fr-FR-Chirp3-HD-Puck"), + GOOGLE_FR_FR_CHIRP3_HD_ZEPHYR("Google.fr-FR-Chirp3-HD-Zephyr"), GOOGLE_FR_FR_NEURAL2_A("Google.fr-FR-Neural2-A"), GOOGLE_FR_FR_NEURAL2_B("Google.fr-FR-Neural2-B"), GOOGLE_FR_FR_NEURAL2_C("Google.fr-FR-Neural2-C"), GOOGLE_FR_FR_NEURAL2_D("Google.fr-FR-Neural2-D"), GOOGLE_FR_FR_NEURAL2_E("Google.fr-FR-Neural2-E"), + GOOGLE_FR_FR_NEURAL2_F("Google.fr-FR-Neural2-F"), + GOOGLE_FR_FR_NEURAL2_G("Google.fr-FR-Neural2-G"), GOOGLE_FR_FR_STANDARD_A("Google.fr-FR-Standard-A"), GOOGLE_FR_FR_STANDARD_B("Google.fr-FR-Standard-B"), GOOGLE_FR_FR_STANDARD_C("Google.fr-FR-Standard-C"), GOOGLE_FR_FR_STANDARD_D("Google.fr-FR-Standard-D"), GOOGLE_FR_FR_STANDARD_E("Google.fr-FR-Standard-E"), + GOOGLE_FR_FR_STANDARD_F("Google.fr-FR-Standard-F"), + GOOGLE_FR_FR_STANDARD_G("Google.fr-FR-Standard-G"), GOOGLE_FR_FR_WAVENET_A("Google.fr-FR-Wavenet-A"), GOOGLE_FR_FR_WAVENET_B("Google.fr-FR-Wavenet-B"), GOOGLE_FR_FR_WAVENET_C("Google.fr-FR-Wavenet-C"), GOOGLE_FR_FR_WAVENET_D("Google.fr-FR-Wavenet-D"), GOOGLE_FR_FR_WAVENET_E("Google.fr-FR-Wavenet-E"), + GOOGLE_FR_FR_WAVENET_F("Google.fr-FR-Wavenet-F"), + GOOGLE_FR_FR_WAVENET_G("Google.fr-FR-Wavenet-G"), GOOGLE_GL_ES_STANDARD_A("Google.gl-ES-Standard-A"), + GOOGLE_GL_ES_STANDARD_B("Google.gl-ES-Standard-B"), + GOOGLE_GU_IN_CHIRP3_HD_AOEDE("Google.gu-IN-Chirp3-HD-Aoede"), + GOOGLE_GU_IN_CHIRP3_HD_CHARON("Google.gu-IN-Chirp3-HD-Charon"), + GOOGLE_GU_IN_CHIRP3_HD_FENRIR("Google.gu-IN-Chirp3-HD-Fenrir"), + GOOGLE_GU_IN_CHIRP3_HD_KORE("Google.gu-IN-Chirp3-HD-Kore"), + GOOGLE_GU_IN_CHIRP3_HD_LEDA("Google.gu-IN-Chirp3-HD-Leda"), + GOOGLE_GU_IN_CHIRP3_HD_ORUS("Google.gu-IN-Chirp3-HD-Orus"), + GOOGLE_GU_IN_CHIRP3_HD_PUCK("Google.gu-IN-Chirp3-HD-Puck"), + GOOGLE_GU_IN_CHIRP3_HD_ZEPHYR("Google.gu-IN-Chirp3-HD-Zephyr"), + GOOGLE_GU_IN_STANDARD_A("Google.gu-IN-Standard-A"), + GOOGLE_GU_IN_STANDARD_B("Google.gu-IN-Standard-B"), GOOGLE_GU_IN_STANDARD_C("Google.gu-IN-Standard-C"), GOOGLE_GU_IN_STANDARD_D("Google.gu-IN-Standard-D"), + GOOGLE_GU_IN_WAVENET_A("Google.gu-IN-Wavenet-A"), + GOOGLE_GU_IN_WAVENET_B("Google.gu-IN-Wavenet-B"), GOOGLE_GU_IN_WAVENET_C("Google.gu-IN-Wavenet-C"), GOOGLE_GU_IN_WAVENET_D("Google.gu-IN-Wavenet-D"), GOOGLE_HE_IL_STANDARD_A("Google.he-IL-Standard-A"), @@ -232,6 +391,14 @@ public enum Voice { GOOGLE_HE_IL_WAVENET_B("Google.he-IL-Wavenet-B"), GOOGLE_HE_IL_WAVENET_C("Google.he-IL-Wavenet-C"), GOOGLE_HE_IL_WAVENET_D("Google.he-IL-Wavenet-D"), + GOOGLE_HI_IN_CHIRP3_HD_AOEDE("Google.hi-IN-Chirp3-HD-Aoede"), + GOOGLE_HI_IN_CHIRP3_HD_CHARON("Google.hi-IN-Chirp3-HD-Charon"), + GOOGLE_HI_IN_CHIRP3_HD_FENRIR("Google.hi-IN-Chirp3-HD-Fenrir"), + GOOGLE_HI_IN_CHIRP3_HD_KORE("Google.hi-IN-Chirp3-HD-Kore"), + GOOGLE_HI_IN_CHIRP3_HD_LEDA("Google.hi-IN-Chirp3-HD-Leda"), + GOOGLE_HI_IN_CHIRP3_HD_ORUS("Google.hi-IN-Chirp3-HD-Orus"), + GOOGLE_HI_IN_CHIRP3_HD_PUCK("Google.hi-IN-Chirp3-HD-Puck"), + GOOGLE_HI_IN_CHIRP3_HD_ZEPHYR("Google.hi-IN-Chirp3-HD-Zephyr"), GOOGLE_HI_IN_NEURAL2_A("Google.hi-IN-Neural2-A"), GOOGLE_HI_IN_NEURAL2_B("Google.hi-IN-Neural2-B"), GOOGLE_HI_IN_NEURAL2_C("Google.hi-IN-Neural2-C"), @@ -240,12 +407,25 @@ public enum Voice { GOOGLE_HI_IN_STANDARD_B("Google.hi-IN-Standard-B"), GOOGLE_HI_IN_STANDARD_C("Google.hi-IN-Standard-C"), GOOGLE_HI_IN_STANDARD_D("Google.hi-IN-Standard-D"), + GOOGLE_HI_IN_STANDARD_E("Google.hi-IN-Standard-E"), + GOOGLE_HI_IN_STANDARD_F("Google.hi-IN-Standard-F"), GOOGLE_HI_IN_WAVENET_A("Google.hi-IN-Wavenet-A"), GOOGLE_HI_IN_WAVENET_B("Google.hi-IN-Wavenet-B"), GOOGLE_HI_IN_WAVENET_C("Google.hi-IN-Wavenet-C"), GOOGLE_HI_IN_WAVENET_D("Google.hi-IN-Wavenet-D"), + GOOGLE_HI_IN_WAVENET_E("Google.hi-IN-Wavenet-E"), + GOOGLE_HI_IN_WAVENET_F("Google.hi-IN-Wavenet-F"), GOOGLE_HU_HU_STANDARD_A("Google.hu-HU-Standard-A"), + GOOGLE_HU_HU_STANDARD_B("Google.hu-HU-Standard-B"), GOOGLE_HU_HU_WAVENET_A("Google.hu-HU-Wavenet-A"), + GOOGLE_ID_ID_CHIRP3_HD_AOEDE("Google.id-ID-Chirp3-HD-Aoede"), + GOOGLE_ID_ID_CHIRP3_HD_CHARON("Google.id-ID-Chirp3-HD-Charon"), + GOOGLE_ID_ID_CHIRP3_HD_FENRIR("Google.id-ID-Chirp3-HD-Fenrir"), + GOOGLE_ID_ID_CHIRP3_HD_KORE("Google.id-ID-Chirp3-HD-Kore"), + GOOGLE_ID_ID_CHIRP3_HD_LEDA("Google.id-ID-Chirp3-HD-Leda"), + GOOGLE_ID_ID_CHIRP3_HD_ORUS("Google.id-ID-Chirp3-HD-Orus"), + GOOGLE_ID_ID_CHIRP3_HD_PUCK("Google.id-ID-Chirp3-HD-Puck"), + GOOGLE_ID_ID_CHIRP3_HD_ZEPHYR("Google.id-ID-Chirp3-HD-Zephyr"), GOOGLE_ID_ID_STANDARD_A("Google.id-ID-Standard-A"), GOOGLE_ID_ID_STANDARD_B("Google.id-ID-Standard-B"), GOOGLE_ID_ID_STANDARD_C("Google.id-ID-Standard-C"), @@ -255,14 +435,38 @@ public enum Voice { GOOGLE_ID_ID_WAVENET_C("Google.id-ID-Wavenet-C"), GOOGLE_ID_ID_WAVENET_D("Google.id-ID-Wavenet-D"), GOOGLE_IS_IS_STANDARD_A("Google.is-IS-Standard-A"), + GOOGLE_IS_IS_STANDARD_B("Google.is-IS-Standard-B"), + GOOGLE_IT_IT_CHIRP3_HD_AOEDE("Google.it-IT-Chirp3-HD-Aoede"), + GOOGLE_IT_IT_CHIRP3_HD_CHARON("Google.it-IT-Chirp3-HD-Charon"), + GOOGLE_IT_IT_CHIRP3_HD_FENRIR("Google.it-IT-Chirp3-HD-Fenrir"), + GOOGLE_IT_IT_CHIRP3_HD_KORE("Google.it-IT-Chirp3-HD-Kore"), + GOOGLE_IT_IT_CHIRP3_HD_LEDA("Google.it-IT-Chirp3-HD-Leda"), + GOOGLE_IT_IT_CHIRP3_HD_ORUS("Google.it-IT-Chirp3-HD-Orus"), + GOOGLE_IT_IT_CHIRP3_HD_PUCK("Google.it-IT-Chirp3-HD-Puck"), + GOOGLE_IT_IT_CHIRP3_HD_ZEPHYR("Google.it-IT-Chirp3-HD-Zephyr"), GOOGLE_IT_IT_NEURAL2_A("Google.it-IT-Neural2-A"), GOOGLE_IT_IT_NEURAL2_C("Google.it-IT-Neural2-C"), + GOOGLE_IT_IT_NEURAL2_F("Google.it-IT-Neural2-F"), + GOOGLE_IT_IT_STANDARD_A("Google.it-IT-Standard-A"), GOOGLE_IT_IT_STANDARD_B("Google.it-IT-Standard-B"), GOOGLE_IT_IT_STANDARD_C("Google.it-IT-Standard-C"), GOOGLE_IT_IT_STANDARD_D("Google.it-IT-Standard-D"), + GOOGLE_IT_IT_STANDARD_E("Google.it-IT-Standard-E"), + GOOGLE_IT_IT_STANDARD_F("Google.it-IT-Standard-F"), + GOOGLE_IT_IT_WAVENET_A("Google.it-IT-Wavenet-A"), GOOGLE_IT_IT_WAVENET_B("Google.it-IT-Wavenet-B"), GOOGLE_IT_IT_WAVENET_C("Google.it-IT-Wavenet-C"), GOOGLE_IT_IT_WAVENET_D("Google.it-IT-Wavenet-D"), + GOOGLE_IT_IT_WAVENET_E("Google.it-IT-Wavenet-E"), + GOOGLE_IT_IT_WAVENET_F("Google.it-IT-Wavenet-F"), + GOOGLE_JA_JP_CHIRP3_HD_AOEDE("Google.ja-JP-Chirp3-HD-Aoede"), + GOOGLE_JA_JP_CHIRP3_HD_CHARON("Google.ja-JP-Chirp3-HD-Charon"), + GOOGLE_JA_JP_CHIRP3_HD_FENRIR("Google.ja-JP-Chirp3-HD-Fenrir"), + GOOGLE_JA_JP_CHIRP3_HD_KORE("Google.ja-JP-Chirp3-HD-Kore"), + GOOGLE_JA_JP_CHIRP3_HD_LEDA("Google.ja-JP-Chirp3-HD-Leda"), + GOOGLE_JA_JP_CHIRP3_HD_ORUS("Google.ja-JP-Chirp3-HD-Orus"), + GOOGLE_JA_JP_CHIRP3_HD_PUCK("Google.ja-JP-Chirp3-HD-Puck"), + GOOGLE_JA_JP_CHIRP3_HD_ZEPHYR("Google.ja-JP-Chirp3-HD-Zephyr"), GOOGLE_JA_JP_NEURAL2_B("Google.ja-JP-Neural2-B"), GOOGLE_JA_JP_NEURAL2_C("Google.ja-JP-Neural2-C"), GOOGLE_JA_JP_NEURAL2_D("Google.ja-JP-Neural2-D"), @@ -274,10 +478,30 @@ public enum Voice { GOOGLE_JA_JP_WAVENET_B("Google.ja-JP-Wavenet-B"), GOOGLE_JA_JP_WAVENET_C("Google.ja-JP-Wavenet-C"), GOOGLE_JA_JP_WAVENET_D("Google.ja-JP-Wavenet-D"), + GOOGLE_KN_IN_CHIRP3_HD_AOEDE("Google.kn-IN-Chirp3-HD-Aoede"), + GOOGLE_KN_IN_CHIRP3_HD_CHARON("Google.kn-IN-Chirp3-HD-Charon"), + GOOGLE_KN_IN_CHIRP3_HD_FENRIR("Google.kn-IN-Chirp3-HD-Fenrir"), + GOOGLE_KN_IN_CHIRP3_HD_KORE("Google.kn-IN-Chirp3-HD-Kore"), + GOOGLE_KN_IN_CHIRP3_HD_LEDA("Google.kn-IN-Chirp3-HD-Leda"), + GOOGLE_KN_IN_CHIRP3_HD_ORUS("Google.kn-IN-Chirp3-HD-Orus"), + GOOGLE_KN_IN_CHIRP3_HD_PUCK("Google.kn-IN-Chirp3-HD-Puck"), + GOOGLE_KN_IN_CHIRP3_HD_ZEPHYR("Google.kn-IN-Chirp3-HD-Zephyr"), + GOOGLE_KN_IN_STANDARD_A("Google.kn-IN-Standard-A"), + GOOGLE_KN_IN_STANDARD_B("Google.kn-IN-Standard-B"), GOOGLE_KN_IN_STANDARD_C("Google.kn-IN-Standard-C"), GOOGLE_KN_IN_STANDARD_D("Google.kn-IN-Standard-D"), + GOOGLE_KN_IN_WAVENET_A("Google.kn-IN-Wavenet-A"), + GOOGLE_KN_IN_WAVENET_B("Google.kn-IN-Wavenet-B"), GOOGLE_KN_IN_WAVENET_C("Google.kn-IN-Wavenet-C"), GOOGLE_KN_IN_WAVENET_D("Google.kn-IN-Wavenet-D"), + GOOGLE_KO_KR_CHIRP3_HD_AOEDE("Google.ko-KR-Chirp3-HD-Aoede"), + GOOGLE_KO_KR_CHIRP3_HD_CHARON("Google.ko-KR-Chirp3-HD-Charon"), + GOOGLE_KO_KR_CHIRP3_HD_FENRIR("Google.ko-KR-Chirp3-HD-Fenrir"), + GOOGLE_KO_KR_CHIRP3_HD_KORE("Google.ko-KR-Chirp3-HD-Kore"), + GOOGLE_KO_KR_CHIRP3_HD_LEDA("Google.ko-KR-Chirp3-HD-Leda"), + GOOGLE_KO_KR_CHIRP3_HD_ORUS("Google.ko-KR-Chirp3-HD-Orus"), + GOOGLE_KO_KR_CHIRP3_HD_PUCK("Google.ko-KR-Chirp3-HD-Puck"), + GOOGLE_KO_KR_CHIRP3_HD_ZEPHYR("Google.ko-KR-Chirp3-HD-Zephyr"), GOOGLE_KO_KR_NEURAL2_A("Google.ko-KR-Neural2-A"), GOOGLE_KO_KR_NEURAL2_B("Google.ko-KR-Neural2-B"), GOOGLE_KO_KR_NEURAL2_C("Google.ko-KR-Neural2-C"), @@ -290,9 +514,33 @@ public enum Voice { GOOGLE_KO_KR_WAVENET_C("Google.ko-KR-Wavenet-C"), GOOGLE_KO_KR_WAVENET_D("Google.ko-KR-Wavenet-D"), GOOGLE_LT_LT_STANDARD_A("Google.lt-LT-Standard-A"), + GOOGLE_LT_LT_STANDARD_B("Google.lt-LT-Standard-B"), GOOGLE_LV_LV_STANDARD_A("Google.lv-LV-Standard-A"), + GOOGLE_LV_LV_STANDARD_B("Google.lv-LV-Standard-B"), + GOOGLE_ML_IN_CHIRP3_HD_AOEDE("Google.ml-IN-Chirp3-HD-Aoede"), + GOOGLE_ML_IN_CHIRP3_HD_CHARON("Google.ml-IN-Chirp3-HD-Charon"), + GOOGLE_ML_IN_CHIRP3_HD_FENRIR("Google.ml-IN-Chirp3-HD-Fenrir"), + GOOGLE_ML_IN_CHIRP3_HD_KORE("Google.ml-IN-Chirp3-HD-Kore"), + GOOGLE_ML_IN_CHIRP3_HD_LEDA("Google.ml-IN-Chirp3-HD-Leda"), + GOOGLE_ML_IN_CHIRP3_HD_ORUS("Google.ml-IN-Chirp3-HD-Orus"), + GOOGLE_ML_IN_CHIRP3_HD_PUCK("Google.ml-IN-Chirp3-HD-Puck"), + GOOGLE_ML_IN_CHIRP3_HD_ZEPHYR("Google.ml-IN-Chirp3-HD-Zephyr"), + GOOGLE_ML_IN_STANDARD_A("Google.ml-IN-Standard-A"), + GOOGLE_ML_IN_STANDARD_B("Google.ml-IN-Standard-B"), + GOOGLE_ML_IN_STANDARD_C("Google.ml-IN-Standard-C"), + GOOGLE_ML_IN_STANDARD_D("Google.ml-IN-Standard-D"), + GOOGLE_ML_IN_WAVENET_A("Google.ml-IN-Wavenet-A"), + GOOGLE_ML_IN_WAVENET_B("Google.ml-IN-Wavenet-B"), GOOGLE_ML_IN_WAVENET_C("Google.ml-IN-Wavenet-C"), GOOGLE_ML_IN_WAVENET_D("Google.ml-IN-Wavenet-D"), + GOOGLE_MR_IN_CHIRP3_HD_AOEDE("Google.mr-IN-Chirp3-HD-Aoede"), + GOOGLE_MR_IN_CHIRP3_HD_CHARON("Google.mr-IN-Chirp3-HD-Charon"), + GOOGLE_MR_IN_CHIRP3_HD_FENRIR("Google.mr-IN-Chirp3-HD-Fenrir"), + GOOGLE_MR_IN_CHIRP3_HD_KORE("Google.mr-IN-Chirp3-HD-Kore"), + GOOGLE_MR_IN_CHIRP3_HD_LEDA("Google.mr-IN-Chirp3-HD-Leda"), + GOOGLE_MR_IN_CHIRP3_HD_ORUS("Google.mr-IN-Chirp3-HD-Orus"), + GOOGLE_MR_IN_CHIRP3_HD_PUCK("Google.mr-IN-Chirp3-HD-Puck"), + GOOGLE_MR_IN_CHIRP3_HD_ZEPHYR("Google.mr-IN-Chirp3-HD-Zephyr"), GOOGLE_MR_IN_STANDARD_A("Google.mr-IN-Standard-A"), GOOGLE_MR_IN_STANDARD_B("Google.mr-IN-Standard-B"), GOOGLE_MR_IN_STANDARD_C("Google.mr-IN-Standard-C"), @@ -312,25 +560,45 @@ public enum Voice { GOOGLE_NB_NO_STANDARD_C("Google.nb-NO-Standard-C"), GOOGLE_NB_NO_STANDARD_D("Google.nb-NO-Standard-D"), GOOGLE_NB_NO_STANDARD_E("Google.nb-NO-Standard-E"), + GOOGLE_NB_NO_STANDARD_F("Google.nb-NO-Standard-F"), + GOOGLE_NB_NO_STANDARD_G("Google.nb-NO-Standard-G"), GOOGLE_NB_NO_WAVENET_A("Google.nb-NO-Wavenet-A"), GOOGLE_NB_NO_WAVENET_B("Google.nb-NO-Wavenet-B"), GOOGLE_NB_NO_WAVENET_C("Google.nb-NO-Wavenet-C"), GOOGLE_NB_NO_WAVENET_D("Google.nb-NO-Wavenet-D"), GOOGLE_NB_NO_WAVENET_E("Google.nb-NO-Wavenet-E"), + GOOGLE_NB_NO_WAVENET_F("Google.nb-NO-Wavenet-F"), + GOOGLE_NB_NO_WAVENET_G("Google.nb-NO-Wavenet-G"), GOOGLE_NL_BE_STANDARD_A("Google.nl-BE-Standard-A"), GOOGLE_NL_BE_STANDARD_B("Google.nl-BE-Standard-B"), + GOOGLE_NL_BE_STANDARD_C("Google.nl-BE-Standard-C"), + GOOGLE_NL_BE_STANDARD_D("Google.nl-BE-Standard-D"), GOOGLE_NL_BE_WAVENET_A("Google.nl-BE-Wavenet-A"), GOOGLE_NL_BE_WAVENET_B("Google.nl-BE-Wavenet-B"), + GOOGLE_NL_BE_WAVENET_C("Google.nl-BE-Wavenet-C"), + GOOGLE_NL_BE_WAVENET_D("Google.nl-BE-Wavenet-D"), + GOOGLE_NL_NL_CHIRP3_HD_AOEDE("Google.nl-NL-Chirp3-HD-Aoede"), + GOOGLE_NL_NL_CHIRP3_HD_CHARON("Google.nl-NL-Chirp3-HD-Charon"), + GOOGLE_NL_NL_CHIRP3_HD_FENRIR("Google.nl-NL-Chirp3-HD-Fenrir"), + GOOGLE_NL_NL_CHIRP3_HD_KORE("Google.nl-NL-Chirp3-HD-Kore"), + GOOGLE_NL_NL_CHIRP3_HD_LEDA("Google.nl-NL-Chirp3-HD-Leda"), + GOOGLE_NL_NL_CHIRP3_HD_ORUS("Google.nl-NL-Chirp3-HD-Orus"), + GOOGLE_NL_NL_CHIRP3_HD_PUCK("Google.nl-NL-Chirp3-HD-Puck"), + GOOGLE_NL_NL_CHIRP3_HD_ZEPHYR("Google.nl-NL-Chirp3-HD-Zephyr"), GOOGLE_NL_NL_STANDARD_A("Google.nl-NL-Standard-A"), GOOGLE_NL_NL_STANDARD_B("Google.nl-NL-Standard-B"), GOOGLE_NL_NL_STANDARD_C("Google.nl-NL-Standard-C"), GOOGLE_NL_NL_STANDARD_D("Google.nl-NL-Standard-D"), GOOGLE_NL_NL_STANDARD_E("Google.nl-NL-Standard-E"), + GOOGLE_NL_NL_STANDARD_F("Google.nl-NL-Standard-F"), + GOOGLE_NL_NL_STANDARD_G("Google.nl-NL-Standard-G"), GOOGLE_NL_NL_WAVENET_A("Google.nl-NL-Wavenet-A"), GOOGLE_NL_NL_WAVENET_B("Google.nl-NL-Wavenet-B"), GOOGLE_NL_NL_WAVENET_C("Google.nl-NL-Wavenet-C"), GOOGLE_NL_NL_WAVENET_D("Google.nl-NL-Wavenet-D"), GOOGLE_NL_NL_WAVENET_E("Google.nl-NL-Wavenet-E"), + GOOGLE_NL_NL_WAVENET_F("Google.nl-NL-Wavenet-F"), + GOOGLE_NL_NL_WAVENET_G("Google.nl-NL-Wavenet-G"), GOOGLE_PA_IN_STANDARD_A("Google.pa-IN-Standard-A"), GOOGLE_PA_IN_STANDARD_B("Google.pa-IN-Standard-B"), GOOGLE_PA_IN_STANDARD_C("Google.pa-IN-Standard-C"), @@ -339,35 +607,73 @@ public enum Voice { GOOGLE_PA_IN_WAVENET_B("Google.pa-IN-Wavenet-B"), GOOGLE_PA_IN_WAVENET_C("Google.pa-IN-Wavenet-C"), GOOGLE_PA_IN_WAVENET_D("Google.pa-IN-Wavenet-D"), + GOOGLE_PL_PL_CHIRP3_HD_AOEDE("Google.pl-PL-Chirp3-HD-Aoede"), + GOOGLE_PL_PL_CHIRP3_HD_CHARON("Google.pl-PL-Chirp3-HD-Charon"), + GOOGLE_PL_PL_CHIRP3_HD_FENRIR("Google.pl-PL-Chirp3-HD-Fenrir"), + GOOGLE_PL_PL_CHIRP3_HD_KORE("Google.pl-PL-Chirp3-HD-Kore"), + GOOGLE_PL_PL_CHIRP3_HD_LEDA("Google.pl-PL-Chirp3-HD-Leda"), + GOOGLE_PL_PL_CHIRP3_HD_ORUS("Google.pl-PL-Chirp3-HD-Orus"), + GOOGLE_PL_PL_CHIRP3_HD_PUCK("Google.pl-PL-Chirp3-HD-Puck"), + GOOGLE_PL_PL_CHIRP3_HD_ZEPHYR("Google.pl-PL-Chirp3-HD-Zephyr"), GOOGLE_PL_PL_STANDARD_A("Google.pl-PL-Standard-A"), GOOGLE_PL_PL_STANDARD_B("Google.pl-PL-Standard-B"), GOOGLE_PL_PL_STANDARD_C("Google.pl-PL-Standard-C"), GOOGLE_PL_PL_STANDARD_D("Google.pl-PL-Standard-D"), GOOGLE_PL_PL_STANDARD_E("Google.pl-PL-Standard-E"), + GOOGLE_PL_PL_STANDARD_F("Google.pl-PL-Standard-F"), + GOOGLE_PL_PL_STANDARD_G("Google.pl-PL-Standard-G"), GOOGLE_PL_PL_WAVENET_A("Google.pl-PL-Wavenet-A"), GOOGLE_PL_PL_WAVENET_B("Google.pl-PL-Wavenet-B"), GOOGLE_PL_PL_WAVENET_C("Google.pl-PL-Wavenet-C"), GOOGLE_PL_PL_WAVENET_D("Google.pl-PL-Wavenet-D"), GOOGLE_PL_PL_WAVENET_E("Google.pl-PL-Wavenet-E"), + GOOGLE_PL_PL_WAVENET_F("Google.pl-PL-Wavenet-F"), + GOOGLE_PL_PL_WAVENET_G("Google.pl-PL-Wavenet-G"), + GOOGLE_PT_BR_CHIRP3_HD_AOEDE("Google.pt-BR-Chirp3-HD-Aoede"), + GOOGLE_PT_BR_CHIRP3_HD_CHARON("Google.pt-BR-Chirp3-HD-Charon"), + GOOGLE_PT_BR_CHIRP3_HD_FENRIR("Google.pt-BR-Chirp3-HD-Fenrir"), + GOOGLE_PT_BR_CHIRP3_HD_KORE("Google.pt-BR-Chirp3-HD-Kore"), + GOOGLE_PT_BR_CHIRP3_HD_LEDA("Google.pt-BR-Chirp3-HD-Leda"), + GOOGLE_PT_BR_CHIRP3_HD_ORUS("Google.pt-BR-Chirp3-HD-Orus"), + GOOGLE_PT_BR_CHIRP3_HD_PUCK("Google.pt-BR-Chirp3-HD-Puck"), + GOOGLE_PT_BR_CHIRP3_HD_ZEPHYR("Google.pt-BR-Chirp3-HD-Zephyr"), GOOGLE_PT_BR_NEURAL2_A("Google.pt-BR-Neural2-A"), GOOGLE_PT_BR_NEURAL2_B("Google.pt-BR-Neural2-B"), GOOGLE_PT_BR_NEURAL2_C("Google.pt-BR-Neural2-C"), GOOGLE_PT_BR_STANDARD_A("Google.pt-BR-Standard-A"), GOOGLE_PT_BR_STANDARD_B("Google.pt-BR-Standard-B"), GOOGLE_PT_BR_STANDARD_C("Google.pt-BR-Standard-C"), + GOOGLE_PT_BR_STANDARD_D("Google.pt-BR-Standard-D"), + GOOGLE_PT_BR_STANDARD_E("Google.pt-BR-Standard-E"), GOOGLE_PT_BR_WAVENET_A("Google.pt-BR-Wavenet-A"), GOOGLE_PT_BR_WAVENET_B("Google.pt-BR-Wavenet-B"), GOOGLE_PT_BR_WAVENET_C("Google.pt-BR-Wavenet-C"), + GOOGLE_PT_BR_WAVENET_D("Google.pt-BR-Wavenet-D"), + GOOGLE_PT_BR_WAVENET_E("Google.pt-BR-Wavenet-E"), GOOGLE_PT_PT_STANDARD_A("Google.pt-PT-Standard-A"), GOOGLE_PT_PT_STANDARD_B("Google.pt-PT-Standard-B"), GOOGLE_PT_PT_STANDARD_C("Google.pt-PT-Standard-C"), GOOGLE_PT_PT_STANDARD_D("Google.pt-PT-Standard-D"), + GOOGLE_PT_PT_STANDARD_E("Google.pt-PT-Standard-E"), + GOOGLE_PT_PT_STANDARD_F("Google.pt-PT-Standard-F"), GOOGLE_PT_PT_WAVENET_A("Google.pt-PT-Wavenet-A"), GOOGLE_PT_PT_WAVENET_B("Google.pt-PT-Wavenet-B"), GOOGLE_PT_PT_WAVENET_C("Google.pt-PT-Wavenet-C"), GOOGLE_PT_PT_WAVENET_D("Google.pt-PT-Wavenet-D"), + GOOGLE_PT_PT_WAVENET_E("Google.pt-PT-Wavenet-E"), + GOOGLE_PT_PT_WAVENET_F("Google.pt-PT-Wavenet-F"), GOOGLE_RO_RO_STANDARD_A("Google.ro-RO-Standard-A"), + GOOGLE_RO_RO_STANDARD_B("Google.ro-RO-Standard-B"), GOOGLE_RO_RO_WAVENET_A("Google.ro-RO-Wavenet-A"), + GOOGLE_RO_RO_WAVENET_B("Google.ro-RO-Wavenet-B"), + GOOGLE_RU_RU_CHIRP3_HD_AOEDE("Google.ru-RU-Chirp3-HD-Aoede"), + GOOGLE_RU_RU_CHIRP3_HD_CHARON("Google.ru-RU-Chirp3-HD-Charon"), + GOOGLE_RU_RU_CHIRP3_HD_FENRIR("Google.ru-RU-Chirp3-HD-Fenrir"), + GOOGLE_RU_RU_CHIRP3_HD_KORE("Google.ru-RU-Chirp3-HD-Kore"), + GOOGLE_RU_RU_CHIRP3_HD_LEDA("Google.ru-RU-Chirp3-HD-Leda"), + GOOGLE_RU_RU_CHIRP3_HD_ORUS("Google.ru-RU-Chirp3-HD-Orus"), + GOOGLE_RU_RU_CHIRP3_HD_PUCK("Google.ru-RU-Chirp3-HD-Puck"), + GOOGLE_RU_RU_CHIRP3_HD_ZEPHYR("Google.ru-RU-Chirp3-HD-Zephyr"), GOOGLE_RU_RU_STANDARD_A("Google.ru-RU-Standard-A"), GOOGLE_RU_RU_STANDARD_B("Google.ru-RU-Standard-B"), GOOGLE_RU_RU_STANDARD_C("Google.ru-RU-Standard-C"), @@ -379,18 +685,32 @@ public enum Voice { GOOGLE_RU_RU_WAVENET_D("Google.ru-RU-Wavenet-D"), GOOGLE_RU_RU_WAVENET_E("Google.ru-RU-Wavenet-E"), GOOGLE_SK_SK_STANDARD_A("Google.sk-SK-Standard-A"), + GOOGLE_SK_SK_STANDARD_B("Google.sk-SK-Standard-B"), GOOGLE_SK_SK_WAVENET_A("Google.sk-SK-Wavenet-A"), + GOOGLE_SK_SK_WAVENET_B("Google.sk-SK-Wavenet-B"), GOOGLE_SR_RS_STANDARD_A("Google.sr-RS-Standard-A"), GOOGLE_SV_SE_STANDARD_A("Google.sv-SE-Standard-A"), GOOGLE_SV_SE_STANDARD_B("Google.sv-SE-Standard-B"), GOOGLE_SV_SE_STANDARD_C("Google.sv-SE-Standard-C"), GOOGLE_SV_SE_STANDARD_D("Google.sv-SE-Standard-D"), GOOGLE_SV_SE_STANDARD_E("Google.sv-SE-Standard-E"), + GOOGLE_SV_SE_STANDARD_F("Google.sv-SE-Standard-F"), + GOOGLE_SV_SE_STANDARD_G("Google.sv-SE-Standard-G"), GOOGLE_SV_SE_WAVENET_A("Google.sv-SE-Wavenet-A"), GOOGLE_SV_SE_WAVENET_B("Google.sv-SE-Wavenet-B"), GOOGLE_SV_SE_WAVENET_C("Google.sv-SE-Wavenet-C"), GOOGLE_SV_SE_WAVENET_D("Google.sv-SE-Wavenet-D"), GOOGLE_SV_SE_WAVENET_E("Google.sv-SE-Wavenet-E"), + GOOGLE_SV_SE_WAVENET_F("Google.sv-SE-Wavenet-F"), + GOOGLE_SV_SE_WAVENET_G("Google.sv-SE-Wavenet-G"), + GOOGLE_TA_IN_CHIRP3_HD_AOEDE("Google.ta-IN-Chirp3-HD-Aoede"), + GOOGLE_TA_IN_CHIRP3_HD_CHARON("Google.ta-IN-Chirp3-HD-Charon"), + GOOGLE_TA_IN_CHIRP3_HD_FENRIR("Google.ta-IN-Chirp3-HD-Fenrir"), + GOOGLE_TA_IN_CHIRP3_HD_KORE("Google.ta-IN-Chirp3-HD-Kore"), + GOOGLE_TA_IN_CHIRP3_HD_LEDA("Google.ta-IN-Chirp3-HD-Leda"), + GOOGLE_TA_IN_CHIRP3_HD_ORUS("Google.ta-IN-Chirp3-HD-Orus"), + GOOGLE_TA_IN_CHIRP3_HD_PUCK("Google.ta-IN-Chirp3-HD-Puck"), + GOOGLE_TA_IN_CHIRP3_HD_ZEPHYR("Google.ta-IN-Chirp3-HD-Zephyr"), GOOGLE_TA_IN_STANDARD_A("Google.ta-IN-Standard-A"), GOOGLE_TA_IN_STANDARD_B("Google.ta-IN-Standard-B"), GOOGLE_TA_IN_STANDARD_C("Google.ta-IN-Standard-C"), @@ -399,10 +719,36 @@ public enum Voice { GOOGLE_TA_IN_WAVENET_B("Google.ta-IN-Wavenet-B"), GOOGLE_TA_IN_WAVENET_C("Google.ta-IN-Wavenet-C"), GOOGLE_TA_IN_WAVENET_D("Google.ta-IN-Wavenet-D"), + GOOGLE_TE_IN_CHIRP3_HD_AOEDE("Google.te-IN-Chirp3-HD-Aoede"), + GOOGLE_TE_IN_CHIRP3_HD_CHARON("Google.te-IN-Chirp3-HD-Charon"), + GOOGLE_TE_IN_CHIRP3_HD_FENRIR("Google.te-IN-Chirp3-HD-Fenrir"), + GOOGLE_TE_IN_CHIRP3_HD_KORE("Google.te-IN-Chirp3-HD-Kore"), + GOOGLE_TE_IN_CHIRP3_HD_LEDA("Google.te-IN-Chirp3-HD-Leda"), + GOOGLE_TE_IN_CHIRP3_HD_ORUS("Google.te-IN-Chirp3-HD-Orus"), + GOOGLE_TE_IN_CHIRP3_HD_PUCK("Google.te-IN-Chirp3-HD-Puck"), + GOOGLE_TE_IN_CHIRP3_HD_ZEPHYR("Google.te-IN-Chirp3-HD-Zephyr"), GOOGLE_TE_IN_STANDARD_A("Google.te-IN-Standard-A"), GOOGLE_TE_IN_STANDARD_B("Google.te-IN-Standard-B"), + GOOGLE_TE_IN_STANDARD_C("Google.te-IN-Standard-C"), + GOOGLE_TE_IN_STANDARD_D("Google.te-IN-Standard-D"), + GOOGLE_TH_TH_CHIRP3_HD_AOEDE("Google.th-TH-Chirp3-HD-Aoede"), + GOOGLE_TH_TH_CHIRP3_HD_CHARON("Google.th-TH-Chirp3-HD-Charon"), + GOOGLE_TH_TH_CHIRP3_HD_FENRIR("Google.th-TH-Chirp3-HD-Fenrir"), + GOOGLE_TH_TH_CHIRP3_HD_KORE("Google.th-TH-Chirp3-HD-Kore"), + GOOGLE_TH_TH_CHIRP3_HD_LEDA("Google.th-TH-Chirp3-HD-Leda"), + GOOGLE_TH_TH_CHIRP3_HD_ORUS("Google.th-TH-Chirp3-HD-Orus"), + GOOGLE_TH_TH_CHIRP3_HD_PUCK("Google.th-TH-Chirp3-HD-Puck"), + GOOGLE_TH_TH_CHIRP3_HD_ZEPHYR("Google.th-TH-Chirp3-HD-Zephyr"), GOOGLE_TH_TH_NEURAL2_C("Google.th-TH-Neural2-C"), GOOGLE_TH_TH_STANDARD_A("Google.th-TH-Standard-A"), + GOOGLE_TR_TR_CHIRP3_HD_AOEDE("Google.tr-TR-Chirp3-HD-Aoede"), + GOOGLE_TR_TR_CHIRP3_HD_CHARON("Google.tr-TR-Chirp3-HD-Charon"), + GOOGLE_TR_TR_CHIRP3_HD_FENRIR("Google.tr-TR-Chirp3-HD-Fenrir"), + GOOGLE_TR_TR_CHIRP3_HD_KORE("Google.tr-TR-Chirp3-HD-Kore"), + GOOGLE_TR_TR_CHIRP3_HD_LEDA("Google.tr-TR-Chirp3-HD-Leda"), + GOOGLE_TR_TR_CHIRP3_HD_ORUS("Google.tr-TR-Chirp3-HD-Orus"), + GOOGLE_TR_TR_CHIRP3_HD_PUCK("Google.tr-TR-Chirp3-HD-Puck"), + GOOGLE_TR_TR_CHIRP3_HD_ZEPHYR("Google.tr-TR-Chirp3-HD-Zephyr"), GOOGLE_TR_TR_STANDARD_A("Google.tr-TR-Standard-A"), GOOGLE_TR_TR_STANDARD_B("Google.tr-TR-Standard-B"), GOOGLE_TR_TR_STANDARD_C("Google.tr-TR-Standard-C"), @@ -415,6 +761,14 @@ public enum Voice { GOOGLE_TR_TR_WAVENET_E("Google.tr-TR-Wavenet-E"), GOOGLE_UK_UA_STANDARD_A("Google.uk-UA-Standard-A"), GOOGLE_UK_UA_WAVENET_A("Google.uk-UA-Wavenet-A"), + GOOGLE_VI_VN_CHIRP3_HD_AOEDE("Google.vi-VN-Chirp3-HD-Aoede"), + GOOGLE_VI_VN_CHIRP3_HD_CHARON("Google.vi-VN-Chirp3-HD-Charon"), + GOOGLE_VI_VN_CHIRP3_HD_FENRIR("Google.vi-VN-Chirp3-HD-Fenrir"), + GOOGLE_VI_VN_CHIRP3_HD_KORE("Google.vi-VN-Chirp3-HD-Kore"), + GOOGLE_VI_VN_CHIRP3_HD_LEDA("Google.vi-VN-Chirp3-HD-Leda"), + GOOGLE_VI_VN_CHIRP3_HD_ORUS("Google.vi-VN-Chirp3-HD-Orus"), + GOOGLE_VI_VN_CHIRP3_HD_PUCK("Google.vi-VN-Chirp3-HD-Puck"), + GOOGLE_VI_VN_CHIRP3_HD_ZEPHYR("Google.vi-VN-Chirp3-HD-Zephyr"), GOOGLE_VI_VN_NEURAL2_A("Google.vi-VN-Neural2-A"), GOOGLE_VI_VN_NEURAL2_D("Google.vi-VN-Neural2-D"), GOOGLE_VI_VN_STANDARD_A("Google.vi-VN-Standard-A"), @@ -459,6 +813,7 @@ public enum Voice { POLLY_JUSTIN("Polly.Justin"), POLLY_KARL("Polly.Karl"), POLLY_KENDRA("Polly.Kendra"), + POLLY_KEVIN("Polly.Kevin"), POLLY_KIMBERLY("Polly.Kimberly"), POLLY_LEA("Polly.Lea"), POLLY_LIV("Polly.Liv"), @@ -498,6 +853,7 @@ public enum Voice { POLLY_AYANDA_NEURAL("Polly.Ayanda-Neural"), POLLY_BIANCA_NEURAL("Polly.Bianca-Neural"), POLLY_BRIAN_NEURAL("Polly.Brian-Neural"), + POLLY_BURCU_NEURAL("Polly.Burcu-Neural"), POLLY_CAMILA_NEURAL("Polly.Camila-Neural"), POLLY_DANIEL_NEURAL("Polly.Daniel-Neural"), POLLY_DANIELLE_NEURAL("Polly.Danielle-Neural"), @@ -541,12 +897,32 @@ public enum Voice { POLLY_STEPHEN_NEURAL("Polly.Stephen-Neural"), POLLY_SUVI_NEURAL("Polly.Suvi-Neural"), POLLY_TAKUMI_NEURAL("Polly.Takumi-Neural"), - POLLY_TOMOKO_NEURAL("Polly.Tomoko-Neural"), POLLY_THIAGO_NEURAL("Polly.Thiago-Neural"), + POLLY_TOMOKO_NEURAL("Polly.Tomoko-Neural"), POLLY_VICKI_NEURAL("Polly.Vicki-Neural"), POLLY_VITORIA_NEURAL("Polly.Vitoria-Neural"), POLLY_ZAYD_NEURAL("Polly.Zayd-Neural"), - POLLY_ZHIYU_NEURAL("Polly.Zhiyu-Neural"); + POLLY_ZHIYU_NEURAL("Polly.Zhiyu-Neural"), + POLLY_AMY_GENERATIVE("Polly.Amy-Generative"), + POLLY_ANDRES_GENERATIVE("Polly.Andres-Generative"), + POLLY_AYANDA_GENERATIVE("Polly.Ayanda-Generative"), + POLLY_BIANCA_GENERATIVE("Polly.Bianca-Generative"), + POLLY_DANIEL_GENERATIVE("Polly.Daniel-Generative"), + POLLY_DANIELLE_GENERATIVE("Polly.Danielle-Generative"), + POLLY_JOANNA_GENERATIVE("Polly.Joanna-Generative"), + POLLY_KAJAL_GENERATIVE("Polly.Kajal-Generative"), + POLLY_LEA_GENERATIVE("Polly.Lea-Generative"), + POLLY_LUCIA_GENERATIVE("Polly.Lucia-Generative"), + POLLY_LUPE_GENERATIVE("Polly.Lupe-Generative"), + POLLY_MATTHEW_GENERATIVE("Polly.Matthew-Generative"), + POLLY_MÍA_GENERATIVE("Polly.Mía-Generative"), + POLLY_OLIVIA_GENERATIVE("Polly.Olivia-Generative"), + POLLY_PEDRO_GENERATIVE("Polly.Pedro-Generative"), + POLLY_RÉMI_GENERATIVE("Polly.Rémi-Generative"), + POLLY_RUTH_GENERATIVE("Polly.Ruth-Generative"), + POLLY_SERGIO_GENERATIVE("Polly.Sergio-Generative"), + POLLY_STEPHEN_GENERATIVE("Polly.Stephen-Generative"), + POLLY_VICKI_GENERATIVE("Polly.Vicki-Generative"); private final String value; From 0810ce5429d193d71837748cecdb6f4091d23721 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 24 Jul 2025 08:02:13 +0000 Subject: [PATCH 10/12] Release 11.0.0-rc.3 --- pom.xml | 4 ++-- src/main/java/com/twilio/Twilio.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 6550cce867..317961afc9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ twilio jar twilio - 11.0.0-rc.2 + 11.0.0-rc.3 Twilio Java Helper Library https://www.twilio.com @@ -19,7 +19,7 @@ git@github.com:twilio/twilio-java.git scm:git:git@github.com:twilio/twilio-java.git scm:git:git@github.com:twilio/twilio-java.git - 11.0.0-rc.2 + 11.0.0-rc.3 diff --git a/src/main/java/com/twilio/Twilio.java b/src/main/java/com/twilio/Twilio.java index a41f0fa68b..3e33c76558 100644 --- a/src/main/java/com/twilio/Twilio.java +++ b/src/main/java/com/twilio/Twilio.java @@ -24,7 +24,7 @@ */ public class Twilio { - public static final String VERSION = "11.0.0-rc.2"; + public static final String VERSION = "11.0.0-rc.3"; public static final String JAVA_VERSION = System.getProperty("java.version"); public static final String OS_NAME = System.getProperty("os.name"); public static final String OS_ARCH = System.getProperty("os.arch"); From 2ae7c6b00adbec7391897333ea0a362f44f33c0b Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 6 Aug 2025 13:27:45 +0530 Subject: [PATCH 11/12] chore: Fix ResourceSet iterator to allow multiple iterations and reduce code duplication (#883) --- .../java/com/twilio/base/ResourceSet.java | 8 + .../twilio/base/bearertoken/ResourceSet.java | 8 + .../twilio/base/ResourceSetIterationTest.java | 148 ++++++++++++++++++ 3 files changed, 164 insertions(+) create mode 100644 src/test/java/com/twilio/base/ResourceSetIterationTest.java diff --git a/src/main/java/com/twilio/base/ResourceSet.java b/src/main/java/com/twilio/base/ResourceSet.java index 37fec6c969..6e5608adce 100644 --- a/src/main/java/com/twilio/base/ResourceSet.java +++ b/src/main/java/com/twilio/base/ResourceSet.java @@ -14,6 +14,7 @@ public class ResourceSet implements Iterable { private final Reader reader; private final TwilioRestClient client; + private final Page firstPage; // Store reference to first page to enable multiple iterations private boolean autoPaging; private long pages = 1; @@ -32,6 +33,7 @@ public class ResourceSet implements Iterable { public ResourceSet(final Reader reader, final TwilioRestClient client, final Page page) { this.reader = reader; this.client = client; + this.firstPage = page; // Save first page to allow resetting iterator state this.page = page; this.iterator = page.getRecords().iterator(); this.autoPaging = true; @@ -74,6 +76,12 @@ public long getPageLimit() { @Override public Iterator iterator() { + // Reset state to allow multiple iterations + this.processed = 0; + this.pages = 1; + this.page = this.firstPage; // Reset to first page for new iteration + this.iterator = this.firstPage.getRecords().iterator(); // Reset iterator to start of first page + return new ResourceSetIterator<>(this); } diff --git a/src/main/java/com/twilio/base/bearertoken/ResourceSet.java b/src/main/java/com/twilio/base/bearertoken/ResourceSet.java index 16bc369084..4cc09d8c2d 100644 --- a/src/main/java/com/twilio/base/bearertoken/ResourceSet.java +++ b/src/main/java/com/twilio/base/bearertoken/ResourceSet.java @@ -14,6 +14,7 @@ public class ResourceSet implements Iterable { private final Reader reader; private final BearerTokenTwilioRestClient client; + private final Page firstPage; // Store reference to first page to enable multiple iterations private boolean autoPaging; private long pages = 1; @@ -32,6 +33,7 @@ public class ResourceSet implements Iterable { public ResourceSet(final Reader reader, final BearerTokenTwilioRestClient client, final Page page) { this.reader = reader; this.client = client; + this.firstPage = page; // Save first page to allow resetting iterator state this.page = page; this.iterator = page.getRecords().iterator(); this.autoPaging = true; @@ -74,6 +76,12 @@ public long getPageLimit() { @Override public Iterator iterator() { + // Reset state to allow multiple iterations + this.processed = 0; + this.pages = 1; + this.page = this.firstPage; // Reset to first page for new iteration + this.iterator = this.firstPage.getRecords().iterator(); // Reset iterator to start of first page + return new ResourceSetIterator<>(this); } diff --git a/src/test/java/com/twilio/base/ResourceSetIterationTest.java b/src/test/java/com/twilio/base/ResourceSetIterationTest.java new file mode 100644 index 0000000000..7cc7a8b80f --- /dev/null +++ b/src/test/java/com/twilio/base/ResourceSetIterationTest.java @@ -0,0 +1,148 @@ +package com.twilio.base; + +import com.twilio.http.TwilioRestClient; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import static org.mockito.Mockito.when; + +// Simple test resource for testing ResourceSet iteration +class TestResource extends Resource { + private final String id; + + public TestResource(String id) { + this.id = id; + } + + public String getId() { + return id; + } +} + +// Simple test reader for testing ResourceSet iteration +class TestReader extends Reader { + @Override + public ResourceSet read(TwilioRestClient client) { + return null; // Not needed for our test + } + + @Override + public Page firstPage(TwilioRestClient client) { + return null; // Not needed for our test + } + + @Override + public Page previousPage(Page page, TwilioRestClient client) { + return null; // Not needed for our test + } + + @Override + public Page nextPage(Page page, TwilioRestClient client) { + return null; // Not needed for our test + } + + @Override + public Page getPage(String targetUrl, TwilioRestClient client) { + return null; // Not needed for our test + } +} + +public class ResourceSetIterationTest { + + @Mock + TwilioRestClient client; + + @Mock + Page page; + + @Before + public void init() { + MockitoAnnotations.initMocks(this); + } + + @Test + public void testResourceSetCanBeIteratedMultipleTimes() { + // Setup mock data with concrete objects + TestResource resource1 = new TestResource("resource1"); + TestResource resource2 = new TestResource("resource2"); + List resources = Arrays.asList(resource1, resource2); + + when(page.getRecords()).thenReturn(resources); + when(page.getPageSize()).thenReturn(2); + when(page.hasNextPage()).thenReturn(false); + + Reader reader = new TestReader().limit(2); + ResourceSet resourceSet = new ResourceSet<>(reader, client, page); + + // First iteration - should work + List firstIterationResults = new ArrayList<>(); + for (TestResource resource : resourceSet) { + firstIterationResults.add(resource.getId()); + } + Assert.assertEquals(2, firstIterationResults.size()); + Assert.assertEquals("resource1", firstIterationResults.get(0)); + Assert.assertEquals("resource2", firstIterationResults.get(1)); + + // Second iteration - should also work and return the same results + List secondIterationResults = new ArrayList<>(); + for (TestResource resource : resourceSet) { + secondIterationResults.add(resource.getId()); + } + Assert.assertEquals("Second iteration should return same number of elements", 2, secondIterationResults.size()); + Assert.assertEquals("resource1", secondIterationResults.get(0)); + Assert.assertEquals("resource2", secondIterationResults.get(1)); + + // Third iteration using explicit iterator - should also work + List thirdIterationResults = new ArrayList<>(); + for (Iterator it = resourceSet.iterator(); it.hasNext(); ) { + TestResource resource = it.next(); + thirdIterationResults.add(resource.getId()); + } + Assert.assertEquals("Third iteration should return same number of elements", 2, thirdIterationResults.size()); + Assert.assertEquals("resource1", thirdIterationResults.get(0)); + Assert.assertEquals("resource2", thirdIterationResults.get(1)); + } + + @Test + public void testResourceSetWithLimitCanBeIteratedMultipleTimes() { + // Setup mock data with more resources than the limit + TestResource resource1 = new TestResource("resource1"); + TestResource resource2 = new TestResource("resource2"); + TestResource resource3 = new TestResource("resource3"); + List resources = Arrays.asList(resource1, resource2, resource3); + + when(page.getRecords()).thenReturn(resources); + when(page.getPageSize()).thenReturn(3); + when(page.hasNextPage()).thenReturn(false); + + // Set limit to 2, so only first 2 should be returned + Reader reader = new TestReader().limit(2); + ResourceSet resourceSet = new ResourceSet<>(reader, client, page); + + // First iteration - should only return 2 elements due to limit + List firstIterationResults = new ArrayList<>(); + for (TestResource resource : resourceSet) { + firstIterationResults.add(resource.getId()); + } + Assert.assertEquals("First iteration should respect limit", 2, firstIterationResults.size()); + Assert.assertEquals("resource1", firstIterationResults.get(0)); + Assert.assertEquals("resource2", firstIterationResults.get(1)); + + // Second iteration - should also respect limit and return same results + List secondIterationResults = new ArrayList<>(); + for (TestResource resource : resourceSet) { + secondIterationResults.add(resource.getId()); + } + Assert.assertEquals("Second iteration should respect limit", 2, secondIterationResults.size()); + Assert.assertEquals("resource1", secondIterationResults.get(0)); + Assert.assertEquals("resource2", secondIterationResults.get(1)); + } +} \ No newline at end of file From 977e347dcc20c79cf6e3618d4fd755c45c547e3b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 Aug 2025 10:16:09 +0000 Subject: [PATCH 12/12] Initial plan