├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ └── config.yml └── workflows │ ├── pr-lint.yml │ └── test-and-deploy.yml ├── .gitignore ├── AUTHORS.md ├── CHANGES.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── ISSUE_TEMPLATE.md ├── LICENSE ├── Makefile ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── UPGRADE.md ├── VERSIONS.md ├── advanced-examples └── custom-http-client.md ├── checkstyle.xml ├── examples ├── BearerTokenAuthentication.md ├── Content.md ├── FetchMessageUsingOAuth.md ├── MultiRegionClient.md └── PreviewMessaging.md ├── pom.xml └── src ├── main └── java │ └── com │ └── twilio │ ├── Domains.java │ ├── Twilio.java │ ├── TwilioNoAuth.java │ ├── TwilioOrgsTokenAuth.java │ ├── annotations │ └── Beta.java │ ├── auth_strategy │ ├── AuthStrategy.java │ ├── BasicAuthStrategy.java │ ├── NoAuthStrategy.java │ └── TokenAuthStrategy.java │ ├── base │ ├── Creator.java │ ├── Deleter.java │ ├── Fetcher.java │ ├── Page.java │ ├── Reader.java │ ├── Resource.java │ ├── ResourceSet.java │ ├── Updater.java │ ├── bearertoken │ │ ├── Creator.java │ │ ├── Deleter.java │ │ ├── Fetcher.java │ │ ├── Page.java │ │ ├── Reader.java │ │ ├── Resource.java │ │ ├── ResourceSet.java │ │ └── Updater.java │ └── noauth │ │ ├── Creator.java │ │ ├── Deleter.java │ │ ├── Fetcher.java │ │ ├── Resource.java │ │ └── Updater.java │ ├── constant │ └── EnumConstants.java │ ├── converter │ ├── Converter.java │ ├── CurrencyDeserializer.java │ ├── DateConverter.java │ ├── PrefixedCollapsibleMap.java │ └── Promoter.java │ ├── credential │ ├── ClientCredentialProvider.java │ ├── CredentialProvider.java │ └── orgs │ │ └── OrgsClientCredentialProvider.java │ ├── example │ ├── AccessTokenExample.java │ ├── Example.java │ ├── TwiMLResponseExample.java │ ├── ValidationExample.java │ └── resource │ │ ├── CallCreatorExample.java │ │ ├── CallDeleterExample.java │ │ ├── CallFetcherExample.java │ │ ├── CallReaderExample.java │ │ └── CallUpdaterExample.java │ ├── exception │ ├── ApiConnectionException.java │ ├── ApiException.java │ ├── AuthenticationException.java │ ├── CertificateValidationException.java │ ├── InvalidRequestException.java │ ├── RestException.java │ └── TwilioException.java │ ├── http │ ├── HttpClient.java │ ├── HttpMethod.java │ ├── HttpUtility.java │ ├── IRequest.java │ ├── NetworkHttpClient.java │ ├── Request.java │ ├── Response.java │ ├── TwilioRestClient.java │ ├── ValidationClient.java │ ├── ValidationInterceptor.java │ ├── bearertoken │ │ ├── ApiTokenManager.java │ │ ├── BearerTokenHttpClient.java │ │ ├── BearerTokenNetworkHttpClient.java │ │ ├── BearerTokenRequest.java │ │ ├── BearerTokenTwilioRestClient.java │ │ ├── OrgsTokenManager.java │ │ └── TokenManager.java │ └── noauth │ │ ├── NoAuthHttpClient.java │ │ ├── NoAuthNetworkHttpClient.java │ │ ├── NoAuthRequest.java │ │ └── NoAuthTwilioRestClient.java │ ├── jwt │ ├── Jwt.java │ ├── JwtEncodingException.java │ ├── accesstoken │ │ ├── AccessToken.java │ │ ├── ChatGrant.java │ │ ├── Grant.java │ │ ├── PlaybackGrant.java │ │ ├── SyncGrant.java │ │ ├── TaskRouterGrant.java │ │ ├── VideoGrant.java │ │ └── VoiceGrant.java │ ├── client │ │ ├── ClientCapability.java │ │ ├── EventStreamScope.java │ │ ├── IncomingClientScope.java │ │ ├── OutgoingClientScope.java │ │ └── Scope.java │ ├── taskrouter │ │ ├── FilterRequirement.java │ │ ├── Policy.java │ │ ├── PolicyUtils.java │ │ ├── TaskRouterCapability.java │ │ └── UrlUtils.java │ └── validation │ │ ├── RequestCanonicalizer.java │ │ └── ValidationToken.java │ ├── rest │ ├── accounts │ │ └── v1 │ │ │ ├── AuthTokenPromotion.java │ │ │ ├── AuthTokenPromotionUpdater.java │ │ │ ├── BulkConsents.java │ │ │ ├── BulkConsentsCreator.java │ │ │ ├── BulkContacts.java │ │ │ ├── BulkContactsCreator.java │ │ │ ├── Safelist.java │ │ │ ├── SafelistCreator.java │ │ │ ├── SafelistDeleter.java │ │ │ ├── SafelistFetcher.java │ │ │ ├── SecondaryAuthToken.java │ │ │ ├── SecondaryAuthTokenCreator.java │ │ │ ├── SecondaryAuthTokenDeleter.java │ │ │ └── credential │ │ │ ├── Aws.java │ │ │ ├── AwsCreator.java │ │ │ ├── AwsDeleter.java │ │ │ ├── AwsFetcher.java │ │ │ ├── AwsReader.java │ │ │ ├── AwsUpdater.java │ │ │ ├── PublicKey.java │ │ │ ├── PublicKeyCreator.java │ │ │ ├── PublicKeyDeleter.java │ │ │ ├── PublicKeyFetcher.java │ │ │ ├── PublicKeyReader.java │ │ │ └── PublicKeyUpdater.java │ ├── api │ │ └── v2010 │ │ │ ├── Account.java │ │ │ ├── AccountCreator.java │ │ │ ├── AccountFetcher.java │ │ │ ├── AccountReader.java │ │ │ ├── AccountUpdater.java │ │ │ └── account │ │ │ ├── Address.java │ │ │ ├── AddressCreator.java │ │ │ ├── AddressDeleter.java │ │ │ ├── AddressFetcher.java │ │ │ ├── AddressReader.java │ │ │ ├── AddressUpdater.java │ │ │ ├── Application.java │ │ │ ├── ApplicationCreator.java │ │ │ ├── ApplicationDeleter.java │ │ │ ├── ApplicationFetcher.java │ │ │ ├── ApplicationReader.java │ │ │ ├── ApplicationUpdater.java │ │ │ ├── AuthorizedConnectApp.java │ │ │ ├── AuthorizedConnectAppFetcher.java │ │ │ ├── AuthorizedConnectAppReader.java │ │ │ ├── AvailablePhoneNumberCountry.java │ │ │ ├── AvailablePhoneNumberCountryFetcher.java │ │ │ ├── AvailablePhoneNumberCountryReader.java │ │ │ ├── Balance.java │ │ │ ├── BalanceFetcher.java │ │ │ ├── Call.java │ │ │ ├── CallCreator.java │ │ │ ├── CallDeleter.java │ │ │ ├── CallFetcher.java │ │ │ ├── CallReader.java │ │ │ ├── CallUpdater.java │ │ │ ├── Conference.java │ │ │ ├── ConferenceFetcher.java │ │ │ ├── ConferenceReader.java │ │ │ ├── ConferenceUpdater.java │ │ │ ├── ConnectApp.java │ │ │ ├── ConnectAppDeleter.java │ │ │ ├── ConnectAppFetcher.java │ │ │ ├── ConnectAppReader.java │ │ │ ├── ConnectAppUpdater.java │ │ │ ├── IncomingPhoneNumber.java │ │ │ ├── IncomingPhoneNumberCreator.java │ │ │ ├── IncomingPhoneNumberDeleter.java │ │ │ ├── IncomingPhoneNumberFetcher.java │ │ │ ├── IncomingPhoneNumberReader.java │ │ │ ├── IncomingPhoneNumberUpdater.java │ │ │ ├── Key.java │ │ │ ├── KeyDeleter.java │ │ │ ├── KeyFetcher.java │ │ │ ├── KeyReader.java │ │ │ ├── KeyUpdater.java │ │ │ ├── Message.java │ │ │ ├── MessageCreator.java │ │ │ ├── MessageDeleter.java │ │ │ ├── MessageFetcher.java │ │ │ ├── MessageReader.java │ │ │ ├── MessageUpdater.java │ │ │ ├── NewKey.java │ │ │ ├── NewKeyCreator.java │ │ │ ├── NewSigningKey.java │ │ │ ├── NewSigningKeyCreator.java │ │ │ ├── Notification.java │ │ │ ├── NotificationFetcher.java │ │ │ ├── NotificationReader.java │ │ │ ├── OutgoingCallerId.java │ │ │ ├── OutgoingCallerIdDeleter.java │ │ │ ├── OutgoingCallerIdFetcher.java │ │ │ ├── OutgoingCallerIdReader.java │ │ │ ├── OutgoingCallerIdUpdater.java │ │ │ ├── Queue.java │ │ │ ├── QueueCreator.java │ │ │ ├── QueueDeleter.java │ │ │ ├── QueueFetcher.java │ │ │ ├── QueueReader.java │ │ │ ├── QueueUpdater.java │ │ │ ├── Recording.java │ │ │ ├── RecordingDeleter.java │ │ │ ├── RecordingFetcher.java │ │ │ ├── RecordingReader.java │ │ │ ├── ShortCode.java │ │ │ ├── ShortCodeFetcher.java │ │ │ ├── ShortCodeReader.java │ │ │ ├── ShortCodeUpdater.java │ │ │ ├── SigningKey.java │ │ │ ├── SigningKeyDeleter.java │ │ │ ├── SigningKeyFetcher.java │ │ │ ├── SigningKeyReader.java │ │ │ ├── SigningKeyUpdater.java │ │ │ ├── Token.java │ │ │ ├── TokenCreator.java │ │ │ ├── Transcription.java │ │ │ ├── TranscriptionDeleter.java │ │ │ ├── TranscriptionFetcher.java │ │ │ ├── TranscriptionReader.java │ │ │ ├── ValidationRequest.java │ │ │ ├── ValidationRequestCreator.java │ │ │ ├── address │ │ │ ├── DependentPhoneNumber.java │ │ │ └── DependentPhoneNumberReader.java │ │ │ ├── availablephonenumbercountry │ │ │ ├── Local.java │ │ │ ├── LocalReader.java │ │ │ ├── MachineToMachine.java │ │ │ ├── MachineToMachineReader.java │ │ │ ├── Mobile.java │ │ │ ├── MobileReader.java │ │ │ ├── National.java │ │ │ ├── NationalReader.java │ │ │ ├── SharedCost.java │ │ │ ├── SharedCostReader.java │ │ │ ├── TollFree.java │ │ │ ├── TollFreeReader.java │ │ │ ├── Voip.java │ │ │ └── VoipReader.java │ │ │ ├── call │ │ │ ├── Event.java │ │ │ ├── EventReader.java │ │ │ ├── Notification.java │ │ │ ├── NotificationFetcher.java │ │ │ ├── NotificationReader.java │ │ │ ├── Payment.java │ │ │ ├── PaymentCreator.java │ │ │ ├── PaymentUpdater.java │ │ │ ├── Recording.java │ │ │ ├── RecordingCreator.java │ │ │ ├── RecordingDeleter.java │ │ │ ├── RecordingFetcher.java │ │ │ ├── RecordingReader.java │ │ │ ├── RecordingUpdater.java │ │ │ ├── Siprec.java │ │ │ ├── SiprecCreator.java │ │ │ ├── SiprecUpdater.java │ │ │ ├── Stream.java │ │ │ ├── StreamCreator.java │ │ │ ├── StreamUpdater.java │ │ │ ├── Transcription.java │ │ │ ├── TranscriptionCreator.java │ │ │ ├── TranscriptionUpdater.java │ │ │ ├── UserDefinedMessage.java │ │ │ ├── UserDefinedMessageCreator.java │ │ │ ├── UserDefinedMessageSubscription.java │ │ │ ├── UserDefinedMessageSubscriptionCreator.java │ │ │ └── UserDefinedMessageSubscriptionDeleter.java │ │ │ ├── conference │ │ │ ├── Participant.java │ │ │ ├── ParticipantCreator.java │ │ │ ├── ParticipantDeleter.java │ │ │ ├── ParticipantFetcher.java │ │ │ ├── ParticipantReader.java │ │ │ ├── ParticipantUpdater.java │ │ │ ├── Recording.java │ │ │ ├── RecordingDeleter.java │ │ │ ├── RecordingFetcher.java │ │ │ ├── RecordingReader.java │ │ │ └── RecordingUpdater.java │ │ │ ├── incomingphonenumber │ │ │ ├── AssignedAddOn.java │ │ │ ├── AssignedAddOnCreator.java │ │ │ ├── AssignedAddOnDeleter.java │ │ │ ├── AssignedAddOnFetcher.java │ │ │ ├── AssignedAddOnReader.java │ │ │ ├── Local.java │ │ │ ├── LocalCreator.java │ │ │ ├── LocalReader.java │ │ │ ├── Mobile.java │ │ │ ├── MobileCreator.java │ │ │ ├── MobileReader.java │ │ │ ├── TollFree.java │ │ │ ├── TollFreeCreator.java │ │ │ ├── TollFreeReader.java │ │ │ └── assignedaddon │ │ │ │ ├── AssignedAddOnExtension.java │ │ │ │ ├── AssignedAddOnExtensionFetcher.java │ │ │ │ └── AssignedAddOnExtensionReader.java │ │ │ ├── message │ │ │ ├── Feedback.java │ │ │ ├── FeedbackCreator.java │ │ │ ├── Media.java │ │ │ ├── MediaDeleter.java │ │ │ ├── MediaFetcher.java │ │ │ └── MediaReader.java │ │ │ ├── queue │ │ │ ├── Member.java │ │ │ ├── MemberFetcher.java │ │ │ ├── MemberReader.java │ │ │ └── MemberUpdater.java │ │ │ ├── recording │ │ │ ├── AddOnResult.java │ │ │ ├── AddOnResultDeleter.java │ │ │ ├── AddOnResultFetcher.java │ │ │ ├── AddOnResultReader.java │ │ │ ├── Transcription.java │ │ │ ├── TranscriptionDeleter.java │ │ │ ├── TranscriptionFetcher.java │ │ │ ├── TranscriptionReader.java │ │ │ └── addonresult │ │ │ │ ├── Payload.java │ │ │ │ ├── PayloadDeleter.java │ │ │ │ ├── PayloadFetcher.java │ │ │ │ ├── PayloadReader.java │ │ │ │ └── payload │ │ │ │ ├── Data.java │ │ │ │ └── DataFetcher.java │ │ │ ├── sip │ │ │ ├── CredentialList.java │ │ │ ├── CredentialListCreator.java │ │ │ ├── CredentialListDeleter.java │ │ │ ├── CredentialListFetcher.java │ │ │ ├── CredentialListReader.java │ │ │ ├── CredentialListUpdater.java │ │ │ ├── Domain.java │ │ │ ├── DomainCreator.java │ │ │ ├── DomainDeleter.java │ │ │ ├── DomainFetcher.java │ │ │ ├── DomainReader.java │ │ │ ├── DomainUpdater.java │ │ │ ├── IpAccessControlList.java │ │ │ ├── IpAccessControlListCreator.java │ │ │ ├── IpAccessControlListDeleter.java │ │ │ ├── IpAccessControlListFetcher.java │ │ │ ├── IpAccessControlListReader.java │ │ │ ├── IpAccessControlListUpdater.java │ │ │ ├── credentiallist │ │ │ │ ├── Credential.java │ │ │ │ ├── CredentialCreator.java │ │ │ │ ├── CredentialDeleter.java │ │ │ │ ├── CredentialFetcher.java │ │ │ │ ├── CredentialReader.java │ │ │ │ └── CredentialUpdater.java │ │ │ ├── domain │ │ │ │ ├── CredentialListMapping.java │ │ │ │ ├── CredentialListMappingCreator.java │ │ │ │ ├── CredentialListMappingDeleter.java │ │ │ │ ├── CredentialListMappingFetcher.java │ │ │ │ ├── CredentialListMappingReader.java │ │ │ │ ├── IpAccessControlListMapping.java │ │ │ │ ├── IpAccessControlListMappingCreator.java │ │ │ │ ├── IpAccessControlListMappingDeleter.java │ │ │ │ ├── IpAccessControlListMappingFetcher.java │ │ │ │ ├── IpAccessControlListMappingReader.java │ │ │ │ └── authtypes │ │ │ │ │ ├── authtypecalls │ │ │ │ │ ├── AuthCallsCredentialListMapping.java │ │ │ │ │ ├── AuthCallsCredentialListMappingCreator.java │ │ │ │ │ ├── AuthCallsCredentialListMappingDeleter.java │ │ │ │ │ ├── AuthCallsCredentialListMappingFetcher.java │ │ │ │ │ ├── AuthCallsCredentialListMappingReader.java │ │ │ │ │ ├── AuthCallsIpAccessControlListMapping.java │ │ │ │ │ ├── AuthCallsIpAccessControlListMappingCreator.java │ │ │ │ │ ├── AuthCallsIpAccessControlListMappingDeleter.java │ │ │ │ │ ├── AuthCallsIpAccessControlListMappingFetcher.java │ │ │ │ │ └── AuthCallsIpAccessControlListMappingReader.java │ │ │ │ │ └── authtyperegistrations │ │ │ │ │ ├── AuthRegistrationsCredentialListMapping.java │ │ │ │ │ ├── AuthRegistrationsCredentialListMappingCreator.java │ │ │ │ │ ├── AuthRegistrationsCredentialListMappingDeleter.java │ │ │ │ │ ├── AuthRegistrationsCredentialListMappingFetcher.java │ │ │ │ │ └── AuthRegistrationsCredentialListMappingReader.java │ │ │ └── ipaccesscontrollist │ │ │ │ ├── IpAddress.java │ │ │ │ ├── IpAddressCreator.java │ │ │ │ ├── IpAddressDeleter.java │ │ │ │ ├── IpAddressFetcher.java │ │ │ │ ├── IpAddressReader.java │ │ │ │ └── IpAddressUpdater.java │ │ │ └── usage │ │ │ ├── Record.java │ │ │ ├── RecordReader.java │ │ │ ├── Trigger.java │ │ │ ├── TriggerCreator.java │ │ │ ├── TriggerDeleter.java │ │ │ ├── TriggerFetcher.java │ │ │ ├── TriggerReader.java │ │ │ ├── TriggerUpdater.java │ │ │ └── record │ │ │ ├── AllTime.java │ │ │ ├── AllTimeReader.java │ │ │ ├── Daily.java │ │ │ ├── DailyReader.java │ │ │ ├── LastMonth.java │ │ │ ├── LastMonthReader.java │ │ │ ├── Monthly.java │ │ │ ├── MonthlyReader.java │ │ │ ├── ThisMonth.java │ │ │ ├── ThisMonthReader.java │ │ │ ├── Today.java │ │ │ ├── TodayReader.java │ │ │ ├── Yearly.java │ │ │ ├── YearlyReader.java │ │ │ ├── Yesterday.java │ │ │ └── YesterdayReader.java │ ├── assistants │ │ └── v1 │ │ │ ├── Assistant.java │ │ │ ├── AssistantCreator.java │ │ │ ├── AssistantDeleter.java │ │ │ ├── AssistantFetcher.java │ │ │ ├── AssistantReader.java │ │ │ ├── AssistantUpdater.java │ │ │ ├── Knowledge.java │ │ │ ├── KnowledgeCreator.java │ │ │ ├── KnowledgeDeleter.java │ │ │ ├── KnowledgeFetcher.java │ │ │ ├── KnowledgeReader.java │ │ │ ├── KnowledgeUpdater.java │ │ │ ├── Policy.java │ │ │ ├── PolicyReader.java │ │ │ ├── Session.java │ │ │ ├── SessionFetcher.java │ │ │ ├── SessionReader.java │ │ │ ├── Tool.java │ │ │ ├── ToolCreator.java │ │ │ ├── ToolDeleter.java │ │ │ ├── ToolFetcher.java │ │ │ ├── ToolReader.java │ │ │ ├── ToolUpdater.java │ │ │ ├── assistant │ │ │ ├── AssistantsKnowledge.java │ │ │ ├── AssistantsKnowledgeCreator.java │ │ │ ├── AssistantsKnowledgeDeleter.java │ │ │ ├── AssistantsKnowledgeReader.java │ │ │ ├── AssistantsTool.java │ │ │ ├── AssistantsToolCreator.java │ │ │ ├── AssistantsToolDeleter.java │ │ │ ├── AssistantsToolReader.java │ │ │ ├── Feedback.java │ │ │ ├── FeedbackCreator.java │ │ │ ├── FeedbackReader.java │ │ │ ├── Message.java │ │ │ └── MessageCreator.java │ │ │ ├── knowledge │ │ │ ├── Chunk.java │ │ │ ├── ChunkReader.java │ │ │ ├── KnowledgeStatus.java │ │ │ └── KnowledgeStatusFetcher.java │ │ │ └── session │ │ │ ├── Message.java │ │ │ └── MessageReader.java │ ├── bulkexports │ │ └── v1 │ │ │ ├── Export.java │ │ │ ├── ExportConfiguration.java │ │ │ ├── ExportConfigurationFetcher.java │ │ │ ├── ExportConfigurationUpdater.java │ │ │ ├── ExportFetcher.java │ │ │ └── export │ │ │ ├── Day.java │ │ │ ├── DayFetcher.java │ │ │ ├── DayReader.java │ │ │ ├── ExportCustomJob.java │ │ │ ├── ExportCustomJobCreator.java │ │ │ ├── ExportCustomJobReader.java │ │ │ ├── Job.java │ │ │ ├── JobDeleter.java │ │ │ └── JobFetcher.java │ ├── chat │ │ ├── v1 │ │ │ ├── Credential.java │ │ │ ├── CredentialCreator.java │ │ │ ├── CredentialDeleter.java │ │ │ ├── CredentialFetcher.java │ │ │ ├── CredentialReader.java │ │ │ ├── CredentialUpdater.java │ │ │ ├── Service.java │ │ │ ├── ServiceCreator.java │ │ │ ├── ServiceDeleter.java │ │ │ ├── ServiceFetcher.java │ │ │ ├── ServiceReader.java │ │ │ ├── ServiceUpdater.java │ │ │ └── service │ │ │ │ ├── Channel.java │ │ │ │ ├── ChannelCreator.java │ │ │ │ ├── ChannelDeleter.java │ │ │ │ ├── ChannelFetcher.java │ │ │ │ ├── ChannelReader.java │ │ │ │ ├── ChannelUpdater.java │ │ │ │ ├── Role.java │ │ │ │ ├── RoleCreator.java │ │ │ │ ├── RoleDeleter.java │ │ │ │ ├── RoleFetcher.java │ │ │ │ ├── RoleReader.java │ │ │ │ ├── RoleUpdater.java │ │ │ │ ├── User.java │ │ │ │ ├── UserCreator.java │ │ │ │ ├── UserDeleter.java │ │ │ │ ├── UserFetcher.java │ │ │ │ ├── UserReader.java │ │ │ │ ├── UserUpdater.java │ │ │ │ ├── channel │ │ │ │ ├── Invite.java │ │ │ │ ├── InviteCreator.java │ │ │ │ ├── InviteDeleter.java │ │ │ │ ├── InviteFetcher.java │ │ │ │ ├── InviteReader.java │ │ │ │ ├── Member.java │ │ │ │ ├── MemberCreator.java │ │ │ │ ├── MemberDeleter.java │ │ │ │ ├── MemberFetcher.java │ │ │ │ ├── MemberReader.java │ │ │ │ ├── MemberUpdater.java │ │ │ │ ├── Message.java │ │ │ │ ├── MessageCreator.java │ │ │ │ ├── MessageDeleter.java │ │ │ │ ├── MessageFetcher.java │ │ │ │ ├── MessageReader.java │ │ │ │ └── MessageUpdater.java │ │ │ │ └── user │ │ │ │ ├── UserChannel.java │ │ │ │ └── UserChannelReader.java │ │ ├── v2 │ │ │ ├── Credential.java │ │ │ ├── CredentialCreator.java │ │ │ ├── CredentialDeleter.java │ │ │ ├── CredentialFetcher.java │ │ │ ├── CredentialReader.java │ │ │ ├── CredentialUpdater.java │ │ │ ├── Service.java │ │ │ ├── ServiceCreator.java │ │ │ ├── ServiceDeleter.java │ │ │ ├── ServiceFetcher.java │ │ │ ├── ServiceReader.java │ │ │ ├── ServiceUpdater.java │ │ │ └── service │ │ │ │ ├── Binding.java │ │ │ │ ├── BindingDeleter.java │ │ │ │ ├── BindingFetcher.java │ │ │ │ ├── BindingReader.java │ │ │ │ ├── Channel.java │ │ │ │ ├── ChannelCreator.java │ │ │ │ ├── ChannelDeleter.java │ │ │ │ ├── ChannelFetcher.java │ │ │ │ ├── ChannelReader.java │ │ │ │ ├── ChannelUpdater.java │ │ │ │ ├── Role.java │ │ │ │ ├── RoleCreator.java │ │ │ │ ├── RoleDeleter.java │ │ │ │ ├── RoleFetcher.java │ │ │ │ ├── RoleReader.java │ │ │ │ ├── RoleUpdater.java │ │ │ │ ├── User.java │ │ │ │ ├── UserCreator.java │ │ │ │ ├── UserDeleter.java │ │ │ │ ├── UserFetcher.java │ │ │ │ ├── UserReader.java │ │ │ │ ├── UserUpdater.java │ │ │ │ ├── channel │ │ │ │ ├── Invite.java │ │ │ │ ├── InviteCreator.java │ │ │ │ ├── InviteDeleter.java │ │ │ │ ├── InviteFetcher.java │ │ │ │ ├── InviteReader.java │ │ │ │ ├── Member.java │ │ │ │ ├── MemberCreator.java │ │ │ │ ├── MemberDeleter.java │ │ │ │ ├── MemberFetcher.java │ │ │ │ ├── MemberReader.java │ │ │ │ ├── MemberUpdater.java │ │ │ │ ├── Message.java │ │ │ │ ├── MessageCreator.java │ │ │ │ ├── MessageDeleter.java │ │ │ │ ├── MessageFetcher.java │ │ │ │ ├── MessageReader.java │ │ │ │ ├── MessageUpdater.java │ │ │ │ ├── Webhook.java │ │ │ │ ├── WebhookCreator.java │ │ │ │ ├── WebhookDeleter.java │ │ │ │ ├── WebhookFetcher.java │ │ │ │ ├── WebhookReader.java │ │ │ │ └── WebhookUpdater.java │ │ │ │ └── user │ │ │ │ ├── UserBinding.java │ │ │ │ ├── UserBindingDeleter.java │ │ │ │ ├── UserBindingFetcher.java │ │ │ │ ├── UserBindingReader.java │ │ │ │ ├── UserChannel.java │ │ │ │ ├── UserChannelDeleter.java │ │ │ │ ├── UserChannelFetcher.java │ │ │ │ ├── UserChannelReader.java │ │ │ │ └── UserChannelUpdater.java │ │ └── v3 │ │ │ ├── Channel.java │ │ │ └── ChannelUpdater.java │ ├── content │ │ ├── v1 │ │ │ ├── Content.java │ │ │ ├── ContentAndApprovals.java │ │ │ ├── ContentAndApprovalsReader.java │ │ │ ├── ContentCreator.java │ │ │ ├── ContentDeleter.java │ │ │ ├── ContentFetcher.java │ │ │ ├── ContentReader.java │ │ │ ├── LegacyContent.java │ │ │ ├── LegacyContentReader.java │ │ │ └── content │ │ │ │ ├── ApprovalCreate.java │ │ │ │ ├── ApprovalCreateCreator.java │ │ │ │ ├── ApprovalFetch.java │ │ │ │ └── ApprovalFetchFetcher.java │ │ └── v2 │ │ │ ├── Content.java │ │ │ ├── ContentAndApprovals.java │ │ │ ├── ContentAndApprovalsReader.java │ │ │ └── ContentReader.java │ ├── conversations │ │ └── v1 │ │ │ ├── AddressConfiguration.java │ │ │ ├── AddressConfigurationCreator.java │ │ │ ├── AddressConfigurationDeleter.java │ │ │ ├── AddressConfigurationFetcher.java │ │ │ ├── AddressConfigurationReader.java │ │ │ ├── AddressConfigurationUpdater.java │ │ │ ├── Configuration.java │ │ │ ├── ConfigurationFetcher.java │ │ │ ├── ConfigurationUpdater.java │ │ │ ├── Conversation.java │ │ │ ├── ConversationCreator.java │ │ │ ├── ConversationDeleter.java │ │ │ ├── ConversationFetcher.java │ │ │ ├── ConversationReader.java │ │ │ ├── ConversationUpdater.java │ │ │ ├── ConversationWithParticipants.java │ │ │ ├── ConversationWithParticipantsCreator.java │ │ │ ├── Credential.java │ │ │ ├── CredentialCreator.java │ │ │ ├── CredentialDeleter.java │ │ │ ├── CredentialFetcher.java │ │ │ ├── CredentialReader.java │ │ │ ├── CredentialUpdater.java │ │ │ ├── ParticipantConversation.java │ │ │ ├── ParticipantConversationReader.java │ │ │ ├── Role.java │ │ │ ├── RoleCreator.java │ │ │ ├── RoleDeleter.java │ │ │ ├── RoleFetcher.java │ │ │ ├── RoleReader.java │ │ │ ├── RoleUpdater.java │ │ │ ├── Service.java │ │ │ ├── ServiceCreator.java │ │ │ ├── ServiceDeleter.java │ │ │ ├── ServiceFetcher.java │ │ │ ├── ServiceReader.java │ │ │ ├── User.java │ │ │ ├── UserCreator.java │ │ │ ├── UserDeleter.java │ │ │ ├── UserFetcher.java │ │ │ ├── UserReader.java │ │ │ ├── UserUpdater.java │ │ │ ├── configuration │ │ │ ├── Webhook.java │ │ │ ├── WebhookFetcher.java │ │ │ └── WebhookUpdater.java │ │ │ ├── conversation │ │ │ ├── Message.java │ │ │ ├── MessageCreator.java │ │ │ ├── MessageDeleter.java │ │ │ ├── MessageFetcher.java │ │ │ ├── MessageReader.java │ │ │ ├── MessageUpdater.java │ │ │ ├── Participant.java │ │ │ ├── ParticipantCreator.java │ │ │ ├── ParticipantDeleter.java │ │ │ ├── ParticipantFetcher.java │ │ │ ├── ParticipantReader.java │ │ │ ├── ParticipantUpdater.java │ │ │ ├── Webhook.java │ │ │ ├── WebhookCreator.java │ │ │ ├── WebhookDeleter.java │ │ │ ├── WebhookFetcher.java │ │ │ ├── WebhookReader.java │ │ │ ├── WebhookUpdater.java │ │ │ └── message │ │ │ │ ├── DeliveryReceipt.java │ │ │ │ ├── DeliveryReceiptFetcher.java │ │ │ │ └── DeliveryReceiptReader.java │ │ │ ├── service │ │ │ ├── Binding.java │ │ │ ├── BindingDeleter.java │ │ │ ├── BindingFetcher.java │ │ │ ├── BindingReader.java │ │ │ ├── Configuration.java │ │ │ ├── ConfigurationFetcher.java │ │ │ ├── ConfigurationUpdater.java │ │ │ ├── Conversation.java │ │ │ ├── ConversationCreator.java │ │ │ ├── ConversationDeleter.java │ │ │ ├── ConversationFetcher.java │ │ │ ├── ConversationReader.java │ │ │ ├── ConversationUpdater.java │ │ │ ├── ConversationWithParticipants.java │ │ │ ├── ConversationWithParticipantsCreator.java │ │ │ ├── ParticipantConversation.java │ │ │ ├── ParticipantConversationReader.java │ │ │ ├── Role.java │ │ │ ├── RoleCreator.java │ │ │ ├── RoleDeleter.java │ │ │ ├── RoleFetcher.java │ │ │ ├── RoleReader.java │ │ │ ├── RoleUpdater.java │ │ │ ├── User.java │ │ │ ├── UserCreator.java │ │ │ ├── UserDeleter.java │ │ │ ├── UserFetcher.java │ │ │ ├── UserReader.java │ │ │ ├── UserUpdater.java │ │ │ ├── configuration │ │ │ │ ├── Notification.java │ │ │ │ ├── NotificationFetcher.java │ │ │ │ ├── NotificationUpdater.java │ │ │ │ ├── Webhook.java │ │ │ │ ├── WebhookFetcher.java │ │ │ │ └── WebhookUpdater.java │ │ │ ├── conversation │ │ │ │ ├── Message.java │ │ │ │ ├── MessageCreator.java │ │ │ │ ├── MessageDeleter.java │ │ │ │ ├── MessageFetcher.java │ │ │ │ ├── MessageReader.java │ │ │ │ ├── MessageUpdater.java │ │ │ │ ├── Participant.java │ │ │ │ ├── ParticipantCreator.java │ │ │ │ ├── ParticipantDeleter.java │ │ │ │ ├── ParticipantFetcher.java │ │ │ │ ├── ParticipantReader.java │ │ │ │ ├── ParticipantUpdater.java │ │ │ │ ├── Webhook.java │ │ │ │ ├── WebhookCreator.java │ │ │ │ ├── WebhookDeleter.java │ │ │ │ ├── WebhookFetcher.java │ │ │ │ ├── WebhookReader.java │ │ │ │ ├── WebhookUpdater.java │ │ │ │ └── message │ │ │ │ │ ├── DeliveryReceipt.java │ │ │ │ │ ├── DeliveryReceiptFetcher.java │ │ │ │ │ └── DeliveryReceiptReader.java │ │ │ └── user │ │ │ │ ├── UserConversation.java │ │ │ │ ├── UserConversationDeleter.java │ │ │ │ ├── UserConversationFetcher.java │ │ │ │ ├── UserConversationReader.java │ │ │ │ └── UserConversationUpdater.java │ │ │ └── user │ │ │ ├── UserConversation.java │ │ │ ├── UserConversationDeleter.java │ │ │ ├── UserConversationFetcher.java │ │ │ ├── UserConversationReader.java │ │ │ └── UserConversationUpdater.java │ ├── events │ │ └── v1 │ │ │ ├── EventType.java │ │ │ ├── EventTypeFetcher.java │ │ │ ├── EventTypeReader.java │ │ │ ├── Schema.java │ │ │ ├── SchemaFetcher.java │ │ │ ├── Sink.java │ │ │ ├── SinkCreator.java │ │ │ ├── SinkDeleter.java │ │ │ ├── SinkFetcher.java │ │ │ ├── SinkReader.java │ │ │ ├── SinkUpdater.java │ │ │ ├── Subscription.java │ │ │ ├── SubscriptionCreator.java │ │ │ ├── SubscriptionDeleter.java │ │ │ ├── SubscriptionFetcher.java │ │ │ ├── SubscriptionReader.java │ │ │ ├── SubscriptionUpdater.java │ │ │ ├── schema │ │ │ ├── SchemaVersion.java │ │ │ ├── SchemaVersionFetcher.java │ │ │ └── SchemaVersionReader.java │ │ │ ├── sink │ │ │ ├── SinkTest.java │ │ │ ├── SinkTestCreator.java │ │ │ ├── SinkValidate.java │ │ │ └── SinkValidateCreator.java │ │ │ └── subscription │ │ │ ├── SubscribedEvent.java │ │ │ ├── SubscribedEventCreator.java │ │ │ ├── SubscribedEventDeleter.java │ │ │ ├── SubscribedEventFetcher.java │ │ │ ├── SubscribedEventReader.java │ │ │ └── SubscribedEventUpdater.java │ ├── flexapi │ │ ├── v1 │ │ │ ├── Assessments.java │ │ │ ├── AssessmentsCreator.java │ │ │ ├── AssessmentsReader.java │ │ │ ├── AssessmentsUpdater.java │ │ │ ├── Channel.java │ │ │ ├── ChannelCreator.java │ │ │ ├── ChannelDeleter.java │ │ │ ├── ChannelFetcher.java │ │ │ ├── ChannelReader.java │ │ │ ├── Configuration.java │ │ │ ├── ConfigurationFetcher.java │ │ │ ├── ConfigurationUpdater.java │ │ │ ├── FlexFlow.java │ │ │ ├── FlexFlowCreator.java │ │ │ ├── FlexFlowDeleter.java │ │ │ ├── FlexFlowFetcher.java │ │ │ ├── FlexFlowReader.java │ │ │ ├── FlexFlowUpdater.java │ │ │ ├── InsightsAssessmentsComment.java │ │ │ ├── InsightsAssessmentsCommentCreator.java │ │ │ ├── InsightsAssessmentsCommentReader.java │ │ │ ├── InsightsConversations.java │ │ │ ├── InsightsConversationsReader.java │ │ │ ├── InsightsQuestionnaires.java │ │ │ ├── InsightsQuestionnairesCategory.java │ │ │ ├── InsightsQuestionnairesCategoryCreator.java │ │ │ ├── InsightsQuestionnairesCategoryDeleter.java │ │ │ ├── InsightsQuestionnairesCategoryReader.java │ │ │ ├── InsightsQuestionnairesCategoryUpdater.java │ │ │ ├── InsightsQuestionnairesCreator.java │ │ │ ├── InsightsQuestionnairesDeleter.java │ │ │ ├── InsightsQuestionnairesFetcher.java │ │ │ ├── InsightsQuestionnairesQuestion.java │ │ │ ├── InsightsQuestionnairesQuestionCreator.java │ │ │ ├── InsightsQuestionnairesQuestionDeleter.java │ │ │ ├── InsightsQuestionnairesQuestionReader.java │ │ │ ├── InsightsQuestionnairesQuestionUpdater.java │ │ │ ├── InsightsQuestionnairesReader.java │ │ │ ├── InsightsQuestionnairesUpdater.java │ │ │ ├── InsightsSegments.java │ │ │ ├── InsightsSegmentsReader.java │ │ │ ├── InsightsSession.java │ │ │ ├── InsightsSessionCreator.java │ │ │ ├── InsightsSettingsAnswerSets.java │ │ │ ├── InsightsSettingsAnswerSetsFetcher.java │ │ │ ├── InsightsSettingsComment.java │ │ │ ├── InsightsSettingsCommentFetcher.java │ │ │ ├── InsightsUserRoles.java │ │ │ ├── InsightsUserRolesFetcher.java │ │ │ ├── Interaction.java │ │ │ ├── InteractionCreator.java │ │ │ ├── InteractionFetcher.java │ │ │ ├── InteractionUpdater.java │ │ │ ├── Plugin.java │ │ │ ├── PluginArchive.java │ │ │ ├── PluginArchiveUpdater.java │ │ │ ├── PluginConfiguration.java │ │ │ ├── PluginConfigurationArchive.java │ │ │ ├── PluginConfigurationArchiveUpdater.java │ │ │ ├── PluginConfigurationCreator.java │ │ │ ├── PluginConfigurationFetcher.java │ │ │ ├── PluginConfigurationReader.java │ │ │ ├── PluginCreator.java │ │ │ ├── PluginFetcher.java │ │ │ ├── PluginReader.java │ │ │ ├── PluginRelease.java │ │ │ ├── PluginReleaseCreator.java │ │ │ ├── PluginReleaseFetcher.java │ │ │ ├── PluginReleaseReader.java │ │ │ ├── PluginUpdater.java │ │ │ ├── PluginVersionArchive.java │ │ │ ├── PluginVersionArchiveUpdater.java │ │ │ ├── ProvisioningStatus.java │ │ │ ├── ProvisioningStatusFetcher.java │ │ │ ├── WebChannel.java │ │ │ ├── WebChannelCreator.java │ │ │ ├── WebChannelDeleter.java │ │ │ ├── WebChannelFetcher.java │ │ │ ├── WebChannelReader.java │ │ │ ├── WebChannelUpdater.java │ │ │ ├── interaction │ │ │ │ ├── InteractionChannel.java │ │ │ │ ├── InteractionChannelFetcher.java │ │ │ │ ├── InteractionChannelReader.java │ │ │ │ ├── InteractionChannelUpdater.java │ │ │ │ └── interactionchannel │ │ │ │ │ ├── InteractionChannelInvite.java │ │ │ │ │ ├── InteractionChannelInviteCreator.java │ │ │ │ │ ├── InteractionChannelInviteReader.java │ │ │ │ │ ├── InteractionChannelParticipant.java │ │ │ │ │ ├── InteractionChannelParticipantCreator.java │ │ │ │ │ ├── InteractionChannelParticipantReader.java │ │ │ │ │ ├── InteractionChannelParticipantUpdater.java │ │ │ │ │ ├── InteractionTransfer.java │ │ │ │ │ ├── InteractionTransferCreator.java │ │ │ │ │ ├── InteractionTransferFetcher.java │ │ │ │ │ └── InteractionTransferUpdater.java │ │ │ ├── plugin │ │ │ │ ├── PluginVersions.java │ │ │ │ ├── PluginVersionsCreator.java │ │ │ │ ├── PluginVersionsFetcher.java │ │ │ │ └── PluginVersionsReader.java │ │ │ └── pluginconfiguration │ │ │ │ ├── ConfiguredPlugin.java │ │ │ │ ├── ConfiguredPluginFetcher.java │ │ │ │ └── ConfiguredPluginReader.java │ │ └── v2 │ │ │ ├── FlexUser.java │ │ │ ├── FlexUserFetcher.java │ │ │ ├── FlexUserUpdater.java │ │ │ ├── WebChannels.java │ │ │ └── WebChannelsCreator.java │ ├── frontlineapi │ │ └── v1 │ │ │ ├── User.java │ │ │ ├── UserFetcher.java │ │ │ └── UserUpdater.java │ ├── iam │ │ └── v1 │ │ │ ├── ApiKey.java │ │ │ ├── ApiKeyDeleter.java │ │ │ ├── ApiKeyFetcher.java │ │ │ ├── ApiKeyUpdater.java │ │ │ ├── GetApiKeys.java │ │ │ ├── GetApiKeysReader.java │ │ │ ├── NewApiKey.java │ │ │ ├── NewApiKeyCreator.java │ │ │ ├── Token.java │ │ │ └── TokenCreator.java │ ├── insights │ │ └── v1 │ │ │ ├── Call.java │ │ │ ├── CallFetcher.java │ │ │ ├── CallSummaries.java │ │ │ ├── CallSummariesReader.java │ │ │ ├── Conference.java │ │ │ ├── ConferenceFetcher.java │ │ │ ├── ConferenceReader.java │ │ │ ├── Room.java │ │ │ ├── RoomFetcher.java │ │ │ ├── RoomReader.java │ │ │ ├── Setting.java │ │ │ ├── SettingFetcher.java │ │ │ ├── SettingUpdater.java │ │ │ ├── call │ │ │ ├── Annotation.java │ │ │ ├── AnnotationFetcher.java │ │ │ ├── AnnotationUpdater.java │ │ │ ├── CallSummary.java │ │ │ ├── CallSummaryFetcher.java │ │ │ ├── Event.java │ │ │ ├── EventReader.java │ │ │ ├── Metric.java │ │ │ └── MetricReader.java │ │ │ ├── conference │ │ │ ├── ConferenceParticipant.java │ │ │ ├── ConferenceParticipantFetcher.java │ │ │ └── ConferenceParticipantReader.java │ │ │ └── room │ │ │ ├── Participant.java │ │ │ ├── ParticipantFetcher.java │ │ │ └── ParticipantReader.java │ ├── intelligence │ │ └── v2 │ │ │ ├── CustomOperator.java │ │ │ ├── CustomOperatorCreator.java │ │ │ ├── CustomOperatorDeleter.java │ │ │ ├── CustomOperatorFetcher.java │ │ │ ├── CustomOperatorReader.java │ │ │ ├── CustomOperatorUpdater.java │ │ │ ├── Operator.java │ │ │ ├── OperatorAttachment.java │ │ │ ├── OperatorAttachmentCreator.java │ │ │ ├── OperatorAttachmentDeleter.java │ │ │ ├── OperatorAttachments.java │ │ │ ├── OperatorAttachmentsFetcher.java │ │ │ ├── OperatorFetcher.java │ │ │ ├── OperatorReader.java │ │ │ ├── OperatorType.java │ │ │ ├── OperatorTypeFetcher.java │ │ │ ├── OperatorTypeReader.java │ │ │ ├── PrebuiltOperator.java │ │ │ ├── PrebuiltOperatorFetcher.java │ │ │ ├── PrebuiltOperatorReader.java │ │ │ ├── Service.java │ │ │ ├── ServiceCreator.java │ │ │ ├── ServiceDeleter.java │ │ │ ├── ServiceFetcher.java │ │ │ ├── ServiceReader.java │ │ │ ├── ServiceUpdater.java │ │ │ ├── Transcript.java │ │ │ ├── TranscriptCreator.java │ │ │ ├── TranscriptDeleter.java │ │ │ ├── TranscriptFetcher.java │ │ │ ├── TranscriptReader.java │ │ │ └── transcript │ │ │ ├── Media.java │ │ │ ├── MediaFetcher.java │ │ │ ├── OperatorResult.java │ │ │ ├── OperatorResultFetcher.java │ │ │ ├── OperatorResultReader.java │ │ │ ├── Sentence.java │ │ │ └── SentenceReader.java │ ├── ipmessaging │ │ ├── v1 │ │ │ ├── Credential.java │ │ │ ├── CredentialCreator.java │ │ │ ├── CredentialDeleter.java │ │ │ ├── CredentialFetcher.java │ │ │ ├── CredentialReader.java │ │ │ ├── CredentialUpdater.java │ │ │ ├── Service.java │ │ │ ├── ServiceCreator.java │ │ │ ├── ServiceDeleter.java │ │ │ ├── ServiceFetcher.java │ │ │ ├── ServiceReader.java │ │ │ ├── ServiceUpdater.java │ │ │ └── service │ │ │ │ ├── Channel.java │ │ │ │ ├── ChannelCreator.java │ │ │ │ ├── ChannelDeleter.java │ │ │ │ ├── ChannelFetcher.java │ │ │ │ ├── ChannelReader.java │ │ │ │ ├── ChannelUpdater.java │ │ │ │ ├── Role.java │ │ │ │ ├── RoleCreator.java │ │ │ │ ├── RoleDeleter.java │ │ │ │ ├── RoleFetcher.java │ │ │ │ ├── RoleReader.java │ │ │ │ ├── RoleUpdater.java │ │ │ │ ├── User.java │ │ │ │ ├── UserCreator.java │ │ │ │ ├── UserDeleter.java │ │ │ │ ├── UserFetcher.java │ │ │ │ ├── UserReader.java │ │ │ │ ├── UserUpdater.java │ │ │ │ ├── channel │ │ │ │ ├── Invite.java │ │ │ │ ├── InviteCreator.java │ │ │ │ ├── InviteDeleter.java │ │ │ │ ├── InviteFetcher.java │ │ │ │ ├── InviteReader.java │ │ │ │ ├── Member.java │ │ │ │ ├── MemberCreator.java │ │ │ │ ├── MemberDeleter.java │ │ │ │ ├── MemberFetcher.java │ │ │ │ ├── MemberReader.java │ │ │ │ ├── MemberUpdater.java │ │ │ │ ├── Message.java │ │ │ │ ├── MessageCreator.java │ │ │ │ ├── MessageDeleter.java │ │ │ │ ├── MessageFetcher.java │ │ │ │ ├── MessageReader.java │ │ │ │ └── MessageUpdater.java │ │ │ │ └── user │ │ │ │ ├── UserChannel.java │ │ │ │ └── UserChannelReader.java │ │ └── v2 │ │ │ ├── Credential.java │ │ │ ├── CredentialCreator.java │ │ │ ├── CredentialDeleter.java │ │ │ ├── CredentialFetcher.java │ │ │ ├── CredentialReader.java │ │ │ ├── CredentialUpdater.java │ │ │ ├── Service.java │ │ │ ├── ServiceCreator.java │ │ │ ├── ServiceDeleter.java │ │ │ ├── ServiceFetcher.java │ │ │ ├── ServiceReader.java │ │ │ ├── ServiceUpdater.java │ │ │ └── service │ │ │ ├── Binding.java │ │ │ ├── BindingDeleter.java │ │ │ ├── BindingFetcher.java │ │ │ ├── BindingReader.java │ │ │ ├── Channel.java │ │ │ ├── ChannelCreator.java │ │ │ ├── ChannelDeleter.java │ │ │ ├── ChannelFetcher.java │ │ │ ├── ChannelReader.java │ │ │ ├── ChannelUpdater.java │ │ │ ├── Role.java │ │ │ ├── RoleCreator.java │ │ │ ├── RoleDeleter.java │ │ │ ├── RoleFetcher.java │ │ │ ├── RoleReader.java │ │ │ ├── RoleUpdater.java │ │ │ ├── User.java │ │ │ ├── UserCreator.java │ │ │ ├── UserDeleter.java │ │ │ ├── UserFetcher.java │ │ │ ├── UserReader.java │ │ │ ├── UserUpdater.java │ │ │ ├── channel │ │ │ ├── Invite.java │ │ │ ├── InviteCreator.java │ │ │ ├── InviteDeleter.java │ │ │ ├── InviteFetcher.java │ │ │ ├── InviteReader.java │ │ │ ├── Member.java │ │ │ ├── MemberCreator.java │ │ │ ├── MemberDeleter.java │ │ │ ├── MemberFetcher.java │ │ │ ├── MemberReader.java │ │ │ ├── MemberUpdater.java │ │ │ ├── Message.java │ │ │ ├── MessageCreator.java │ │ │ ├── MessageDeleter.java │ │ │ ├── MessageFetcher.java │ │ │ ├── MessageReader.java │ │ │ ├── MessageUpdater.java │ │ │ ├── Webhook.java │ │ │ ├── WebhookCreator.java │ │ │ ├── WebhookDeleter.java │ │ │ ├── WebhookFetcher.java │ │ │ ├── WebhookReader.java │ │ │ └── WebhookUpdater.java │ │ │ └── user │ │ │ ├── UserBinding.java │ │ │ ├── UserBindingDeleter.java │ │ │ ├── UserBindingFetcher.java │ │ │ ├── UserBindingReader.java │ │ │ ├── UserChannel.java │ │ │ ├── UserChannelDeleter.java │ │ │ ├── UserChannelFetcher.java │ │ │ ├── UserChannelReader.java │ │ │ └── UserChannelUpdater.java │ ├── knowledge │ │ └── v1 │ │ │ ├── Knowledge.java │ │ │ ├── KnowledgeCreator.java │ │ │ ├── KnowledgeDeleter.java │ │ │ ├── KnowledgeFetcher.java │ │ │ ├── KnowledgeReader.java │ │ │ ├── KnowledgeUpdater.java │ │ │ └── knowledge │ │ │ ├── Chunk.java │ │ │ ├── ChunkReader.java │ │ │ ├── KnowledgeStatus.java │ │ │ └── KnowledgeStatusFetcher.java │ ├── lookups │ │ ├── v1 │ │ │ ├── PhoneNumber.java │ │ │ └── PhoneNumberFetcher.java │ │ └── v2 │ │ │ ├── PhoneNumber.java │ │ │ └── PhoneNumberFetcher.java │ ├── marketplace │ │ └── v1 │ │ │ ├── AvailableAddOn.java │ │ │ ├── AvailableAddOnFetcher.java │ │ │ ├── AvailableAddOnReader.java │ │ │ ├── InstalledAddOn.java │ │ │ ├── InstalledAddOnCreator.java │ │ │ ├── InstalledAddOnDeleter.java │ │ │ ├── InstalledAddOnFetcher.java │ │ │ ├── InstalledAddOnReader.java │ │ │ ├── InstalledAddOnUpdater.java │ │ │ ├── ModuleData.java │ │ │ ├── ModuleDataCreator.java │ │ │ ├── ModuleDataFetcher.java │ │ │ ├── ModuleDataManagement.java │ │ │ ├── ModuleDataManagementFetcher.java │ │ │ ├── ModuleDataManagementUpdater.java │ │ │ ├── ReferralConversion.java │ │ │ ├── ReferralConversionCreator.java │ │ │ ├── availableaddon │ │ │ ├── AvailableAddOnExtension.java │ │ │ ├── AvailableAddOnExtensionFetcher.java │ │ │ └── AvailableAddOnExtensionReader.java │ │ │ └── installedaddon │ │ │ ├── InstalledAddOnExtension.java │ │ │ ├── InstalledAddOnExtensionFetcher.java │ │ │ ├── InstalledAddOnExtensionReader.java │ │ │ ├── InstalledAddOnExtensionUpdater.java │ │ │ ├── InstalledAddOnUsage.java │ │ │ └── InstalledAddOnUsageCreator.java │ ├── messaging │ │ ├── v1 │ │ │ ├── BrandRegistration.java │ │ │ ├── BrandRegistrationCreator.java │ │ │ ├── BrandRegistrationFetcher.java │ │ │ ├── BrandRegistrationReader.java │ │ │ ├── BrandRegistrationUpdater.java │ │ │ ├── Deactivations.java │ │ │ ├── DeactivationsFetcher.java │ │ │ ├── DomainCerts.java │ │ │ ├── DomainCertsDeleter.java │ │ │ ├── DomainCertsFetcher.java │ │ │ ├── DomainCertsUpdater.java │ │ │ ├── DomainConfig.java │ │ │ ├── DomainConfigFetcher.java │ │ │ ├── DomainConfigMessagingService.java │ │ │ ├── DomainConfigMessagingServiceFetcher.java │ │ │ ├── DomainConfigUpdater.java │ │ │ ├── ExternalCampaign.java │ │ │ ├── ExternalCampaignCreator.java │ │ │ ├── LinkshorteningMessagingService.java │ │ │ ├── LinkshorteningMessagingServiceCreator.java │ │ │ ├── LinkshorteningMessagingServiceDeleter.java │ │ │ ├── LinkshorteningMessagingServiceDomainAssociation.java │ │ │ ├── LinkshorteningMessagingServiceDomainAssociationFetcher.java │ │ │ ├── RequestManagedCert.java │ │ │ ├── RequestManagedCertUpdater.java │ │ │ ├── Service.java │ │ │ ├── ServiceCreator.java │ │ │ ├── ServiceDeleter.java │ │ │ ├── ServiceFetcher.java │ │ │ ├── ServiceReader.java │ │ │ ├── ServiceUpdater.java │ │ │ ├── TollfreeVerification.java │ │ │ ├── TollfreeVerificationCreator.java │ │ │ ├── TollfreeVerificationDeleter.java │ │ │ ├── TollfreeVerificationFetcher.java │ │ │ ├── TollfreeVerificationReader.java │ │ │ ├── TollfreeVerificationUpdater.java │ │ │ ├── Usecase.java │ │ │ ├── UsecaseFetcher.java │ │ │ ├── brandregistration │ │ │ │ ├── BrandRegistrationOtp.java │ │ │ │ ├── BrandRegistrationOtpCreator.java │ │ │ │ ├── BrandVetting.java │ │ │ │ ├── BrandVettingCreator.java │ │ │ │ ├── BrandVettingFetcher.java │ │ │ │ └── BrandVettingReader.java │ │ │ └── service │ │ │ │ ├── AlphaSender.java │ │ │ │ ├── AlphaSenderCreator.java │ │ │ │ ├── AlphaSenderDeleter.java │ │ │ │ ├── AlphaSenderFetcher.java │ │ │ │ ├── AlphaSenderReader.java │ │ │ │ ├── ChannelSender.java │ │ │ │ ├── ChannelSenderCreator.java │ │ │ │ ├── ChannelSenderDeleter.java │ │ │ │ ├── ChannelSenderFetcher.java │ │ │ │ ├── ChannelSenderReader.java │ │ │ │ ├── DestinationAlphaSender.java │ │ │ │ ├── DestinationAlphaSenderCreator.java │ │ │ │ ├── DestinationAlphaSenderDeleter.java │ │ │ │ ├── DestinationAlphaSenderFetcher.java │ │ │ │ ├── DestinationAlphaSenderReader.java │ │ │ │ ├── PhoneNumber.java │ │ │ │ ├── PhoneNumberCreator.java │ │ │ │ ├── PhoneNumberDeleter.java │ │ │ │ ├── PhoneNumberFetcher.java │ │ │ │ ├── PhoneNumberReader.java │ │ │ │ ├── ShortCode.java │ │ │ │ ├── ShortCodeCreator.java │ │ │ │ ├── ShortCodeDeleter.java │ │ │ │ ├── ShortCodeFetcher.java │ │ │ │ ├── ShortCodeReader.java │ │ │ │ ├── UsAppToPerson.java │ │ │ │ ├── UsAppToPersonCreator.java │ │ │ │ ├── UsAppToPersonDeleter.java │ │ │ │ ├── UsAppToPersonFetcher.java │ │ │ │ ├── UsAppToPersonReader.java │ │ │ │ ├── UsAppToPersonUpdater.java │ │ │ │ ├── UsAppToPersonUsecase.java │ │ │ │ └── UsAppToPersonUsecaseFetcher.java │ │ └── v2 │ │ │ ├── ChannelsSender.java │ │ │ ├── ChannelsSenderCreator.java │ │ │ ├── ChannelsSenderDeleter.java │ │ │ ├── ChannelsSenderFetcher.java │ │ │ ├── ChannelsSenderReader.java │ │ │ └── ChannelsSenderUpdater.java │ ├── microvisor │ │ └── v1 │ │ │ ├── AccountConfig.java │ │ │ ├── AccountConfigCreator.java │ │ │ ├── AccountConfigDeleter.java │ │ │ ├── AccountConfigFetcher.java │ │ │ ├── AccountConfigReader.java │ │ │ ├── AccountConfigUpdater.java │ │ │ ├── AccountSecret.java │ │ │ ├── AccountSecretCreator.java │ │ │ ├── AccountSecretDeleter.java │ │ │ ├── AccountSecretFetcher.java │ │ │ ├── AccountSecretReader.java │ │ │ ├── AccountSecretUpdater.java │ │ │ ├── App.java │ │ │ ├── AppDeleter.java │ │ │ ├── AppFetcher.java │ │ │ ├── AppReader.java │ │ │ ├── Device.java │ │ │ ├── DeviceFetcher.java │ │ │ ├── DeviceReader.java │ │ │ ├── DeviceUpdater.java │ │ │ ├── app │ │ │ ├── AppManifest.java │ │ │ └── AppManifestFetcher.java │ │ │ └── device │ │ │ ├── DeviceConfig.java │ │ │ ├── DeviceConfigCreator.java │ │ │ ├── DeviceConfigDeleter.java │ │ │ ├── DeviceConfigFetcher.java │ │ │ ├── DeviceConfigReader.java │ │ │ ├── DeviceConfigUpdater.java │ │ │ ├── DeviceSecret.java │ │ │ ├── DeviceSecretCreator.java │ │ │ ├── DeviceSecretDeleter.java │ │ │ ├── DeviceSecretFetcher.java │ │ │ ├── DeviceSecretReader.java │ │ │ └── DeviceSecretUpdater.java │ ├── monitor │ │ └── v1 │ │ │ ├── Alert.java │ │ │ ├── AlertFetcher.java │ │ │ ├── AlertReader.java │ │ │ ├── Event.java │ │ │ ├── EventFetcher.java │ │ │ └── EventReader.java │ ├── notify │ │ └── v1 │ │ │ ├── Credential.java │ │ │ ├── CredentialCreator.java │ │ │ ├── CredentialDeleter.java │ │ │ ├── CredentialFetcher.java │ │ │ ├── CredentialReader.java │ │ │ ├── CredentialUpdater.java │ │ │ ├── Service.java │ │ │ ├── ServiceCreator.java │ │ │ ├── ServiceDeleter.java │ │ │ ├── ServiceFetcher.java │ │ │ ├── ServiceReader.java │ │ │ ├── ServiceUpdater.java │ │ │ └── service │ │ │ ├── Binding.java │ │ │ ├── BindingCreator.java │ │ │ ├── BindingDeleter.java │ │ │ ├── BindingFetcher.java │ │ │ ├── BindingReader.java │ │ │ ├── Notification.java │ │ │ └── NotificationCreator.java │ ├── numbers │ │ ├── v1 │ │ │ ├── BulkEligibility.java │ │ │ ├── BulkEligibilityCreator.java │ │ │ ├── BulkEligibilityFetcher.java │ │ │ ├── Eligibility.java │ │ │ ├── EligibilityCreator.java │ │ │ ├── PortingPortIn.java │ │ │ ├── PortingPortInCreator.java │ │ │ ├── PortingPortInDeleter.java │ │ │ ├── PortingPortInFetcher.java │ │ │ ├── PortingPortInPhoneNumber.java │ │ │ ├── PortingPortInPhoneNumberDeleter.java │ │ │ ├── PortingPortInPhoneNumberFetcher.java │ │ │ ├── PortingPortability.java │ │ │ ├── PortingPortabilityFetcher.java │ │ │ ├── PortingWebhookConfiguration.java │ │ │ ├── PortingWebhookConfigurationCreator.java │ │ │ ├── PortingWebhookConfigurationDelete.java │ │ │ ├── PortingWebhookConfigurationDeleteDeleter.java │ │ │ ├── SigningRequestConfiguration.java │ │ │ ├── SigningRequestConfigurationCreator.java │ │ │ ├── SigningRequestConfigurationReader.java │ │ │ ├── Webhook.java │ │ │ └── WebhookFetcher.java │ │ └── v2 │ │ │ ├── AuthorizationDocument.java │ │ │ ├── AuthorizationDocumentCreator.java │ │ │ ├── AuthorizationDocumentDeleter.java │ │ │ ├── AuthorizationDocumentFetcher.java │ │ │ ├── AuthorizationDocumentReader.java │ │ │ ├── BulkHostedNumberOrder.java │ │ │ ├── BulkHostedNumberOrderCreator.java │ │ │ ├── BulkHostedNumberOrderFetcher.java │ │ │ ├── BundleClone.java │ │ │ ├── BundleCloneCreator.java │ │ │ ├── HostedNumberOrder.java │ │ │ ├── HostedNumberOrderCreator.java │ │ │ ├── HostedNumberOrderDeleter.java │ │ │ ├── HostedNumberOrderFetcher.java │ │ │ ├── HostedNumberOrderReader.java │ │ │ ├── HostedNumberOrderUpdater.java │ │ │ ├── authorizationdocument │ │ │ ├── DependentHostedNumberOrder.java │ │ │ └── DependentHostedNumberOrderReader.java │ │ │ └── regulatorycompliance │ │ │ ├── Bundle.java │ │ │ ├── BundleCreator.java │ │ │ ├── BundleDeleter.java │ │ │ ├── BundleFetcher.java │ │ │ ├── BundleReader.java │ │ │ ├── BundleUpdater.java │ │ │ ├── EndUser.java │ │ │ ├── EndUserCreator.java │ │ │ ├── EndUserDeleter.java │ │ │ ├── EndUserFetcher.java │ │ │ ├── EndUserReader.java │ │ │ ├── EndUserType.java │ │ │ ├── EndUserTypeFetcher.java │ │ │ ├── EndUserTypeReader.java │ │ │ ├── EndUserUpdater.java │ │ │ ├── Regulation.java │ │ │ ├── RegulationFetcher.java │ │ │ ├── RegulationReader.java │ │ │ ├── SupportingDocument.java │ │ │ ├── SupportingDocumentCreator.java │ │ │ ├── SupportingDocumentDeleter.java │ │ │ ├── SupportingDocumentFetcher.java │ │ │ ├── SupportingDocumentReader.java │ │ │ ├── SupportingDocumentType.java │ │ │ ├── SupportingDocumentTypeFetcher.java │ │ │ ├── SupportingDocumentTypeReader.java │ │ │ ├── SupportingDocumentUpdater.java │ │ │ └── bundle │ │ │ ├── BundleCopy.java │ │ │ ├── BundleCopyCreator.java │ │ │ ├── BundleCopyReader.java │ │ │ ├── Evaluation.java │ │ │ ├── EvaluationCreator.java │ │ │ ├── EvaluationFetcher.java │ │ │ ├── EvaluationReader.java │ │ │ ├── ItemAssignment.java │ │ │ ├── ItemAssignmentCreator.java │ │ │ ├── ItemAssignmentDeleter.java │ │ │ ├── ItemAssignmentFetcher.java │ │ │ ├── ItemAssignmentReader.java │ │ │ ├── ReplaceItems.java │ │ │ └── ReplaceItemsCreator.java │ ├── oauth │ │ └── v1 │ │ │ ├── Authorize.java │ │ │ ├── AuthorizeFetcher.java │ │ │ ├── Token.java │ │ │ └── TokenCreator.java │ ├── preview │ │ ├── hostedNumbers │ │ │ ├── AuthorizationDocument.java │ │ │ ├── AuthorizationDocumentCreator.java │ │ │ ├── AuthorizationDocumentFetcher.java │ │ │ ├── AuthorizationDocumentReader.java │ │ │ ├── AuthorizationDocumentUpdater.java │ │ │ ├── HostedNumberOrder.java │ │ │ ├── HostedNumberOrderCreator.java │ │ │ ├── HostedNumberOrderDeleter.java │ │ │ ├── HostedNumberOrderFetcher.java │ │ │ ├── HostedNumberOrderReader.java │ │ │ ├── HostedNumberOrderUpdater.java │ │ │ └── authorizationdocument │ │ │ │ ├── DependentHostedNumberOrder.java │ │ │ │ └── DependentHostedNumberOrderReader.java │ │ ├── marketplace │ │ │ ├── AvailableAddOn.java │ │ │ ├── AvailableAddOnFetcher.java │ │ │ ├── AvailableAddOnReader.java │ │ │ ├── InstalledAddOn.java │ │ │ ├── InstalledAddOnCreator.java │ │ │ ├── InstalledAddOnDeleter.java │ │ │ ├── InstalledAddOnFetcher.java │ │ │ ├── InstalledAddOnReader.java │ │ │ ├── InstalledAddOnUpdater.java │ │ │ ├── availableaddon │ │ │ │ ├── AvailableAddOnExtension.java │ │ │ │ ├── AvailableAddOnExtensionFetcher.java │ │ │ │ └── AvailableAddOnExtensionReader.java │ │ │ └── installedaddon │ │ │ │ ├── InstalledAddOnExtension.java │ │ │ │ ├── InstalledAddOnExtensionFetcher.java │ │ │ │ ├── InstalledAddOnExtensionReader.java │ │ │ │ └── InstalledAddOnExtensionUpdater.java │ │ └── wireless │ │ │ ├── Command.java │ │ │ ├── CommandCreator.java │ │ │ ├── CommandFetcher.java │ │ │ ├── CommandReader.java │ │ │ ├── RatePlan.java │ │ │ ├── RatePlanCreator.java │ │ │ ├── RatePlanDeleter.java │ │ │ ├── RatePlanFetcher.java │ │ │ ├── RatePlanReader.java │ │ │ ├── RatePlanUpdater.java │ │ │ ├── Sim.java │ │ │ ├── SimFetcher.java │ │ │ ├── SimReader.java │ │ │ ├── SimUpdater.java │ │ │ └── sim │ │ │ ├── Usage.java │ │ │ └── UsageFetcher.java │ ├── previewiam │ │ ├── organizations │ │ │ ├── Account.java │ │ │ ├── AccountFetcher.java │ │ │ ├── AccountReader.java │ │ │ ├── RoleAssignment.java │ │ │ ├── RoleAssignmentCreator.java │ │ │ ├── RoleAssignmentDeleter.java │ │ │ ├── RoleAssignmentReader.java │ │ │ ├── User.java │ │ │ ├── UserCreator.java │ │ │ ├── UserDeleter.java │ │ │ ├── UserFetcher.java │ │ │ ├── UserReader.java │ │ │ └── UserUpdater.java │ │ └── v1 │ │ │ ├── Authorize.java │ │ │ ├── AuthorizeFetcher.java │ │ │ ├── Token.java │ │ │ └── TokenCreator.java │ ├── pricing │ │ ├── v1 │ │ │ ├── messaging │ │ │ │ ├── Country.java │ │ │ │ ├── CountryFetcher.java │ │ │ │ └── CountryReader.java │ │ │ ├── phonenumber │ │ │ │ ├── Country.java │ │ │ │ ├── CountryFetcher.java │ │ │ │ └── CountryReader.java │ │ │ └── voice │ │ │ │ ├── Country.java │ │ │ │ ├── CountryFetcher.java │ │ │ │ ├── CountryReader.java │ │ │ │ ├── Number.java │ │ │ │ └── NumberFetcher.java │ │ └── v2 │ │ │ ├── Country.java │ │ │ ├── CountryFetcher.java │ │ │ ├── CountryReader.java │ │ │ ├── Number.java │ │ │ ├── NumberFetcher.java │ │ │ └── voice │ │ │ ├── Country.java │ │ │ ├── CountryFetcher.java │ │ │ ├── CountryReader.java │ │ │ ├── Number.java │ │ │ └── NumberFetcher.java │ ├── proxy │ │ └── v1 │ │ │ ├── Service.java │ │ │ ├── ServiceCreator.java │ │ │ ├── ServiceDeleter.java │ │ │ ├── ServiceFetcher.java │ │ │ ├── ServiceReader.java │ │ │ ├── ServiceUpdater.java │ │ │ └── service │ │ │ ├── PhoneNumber.java │ │ │ ├── PhoneNumberCreator.java │ │ │ ├── PhoneNumberDeleter.java │ │ │ ├── PhoneNumberFetcher.java │ │ │ ├── PhoneNumberReader.java │ │ │ ├── PhoneNumberUpdater.java │ │ │ ├── Session.java │ │ │ ├── SessionCreator.java │ │ │ ├── SessionDeleter.java │ │ │ ├── SessionFetcher.java │ │ │ ├── SessionReader.java │ │ │ ├── SessionUpdater.java │ │ │ ├── ShortCode.java │ │ │ ├── ShortCodeCreator.java │ │ │ ├── ShortCodeDeleter.java │ │ │ ├── ShortCodeFetcher.java │ │ │ ├── ShortCodeReader.java │ │ │ ├── ShortCodeUpdater.java │ │ │ └── session │ │ │ ├── Interaction.java │ │ │ ├── InteractionDeleter.java │ │ │ ├── InteractionFetcher.java │ │ │ ├── InteractionReader.java │ │ │ ├── Participant.java │ │ │ ├── ParticipantCreator.java │ │ │ ├── ParticipantDeleter.java │ │ │ ├── ParticipantFetcher.java │ │ │ ├── ParticipantReader.java │ │ │ └── participant │ │ │ ├── MessageInteraction.java │ │ │ ├── MessageInteractionCreator.java │ │ │ ├── MessageInteractionFetcher.java │ │ │ └── MessageInteractionReader.java │ ├── routes │ │ └── v2 │ │ │ ├── PhoneNumber.java │ │ │ ├── PhoneNumberFetcher.java │ │ │ ├── PhoneNumberUpdater.java │ │ │ ├── SipDomain.java │ │ │ ├── SipDomainFetcher.java │ │ │ ├── SipDomainUpdater.java │ │ │ ├── Trunk.java │ │ │ ├── TrunkFetcher.java │ │ │ └── TrunkUpdater.java │ ├── serverless │ │ └── v1 │ │ │ ├── Service.java │ │ │ ├── ServiceCreator.java │ │ │ ├── ServiceDeleter.java │ │ │ ├── ServiceFetcher.java │ │ │ ├── ServiceReader.java │ │ │ ├── ServiceUpdater.java │ │ │ └── service │ │ │ ├── Asset.java │ │ │ ├── AssetCreator.java │ │ │ ├── AssetDeleter.java │ │ │ ├── AssetFetcher.java │ │ │ ├── AssetReader.java │ │ │ ├── AssetUpdater.java │ │ │ ├── Build.java │ │ │ ├── BuildCreator.java │ │ │ ├── BuildDeleter.java │ │ │ ├── BuildFetcher.java │ │ │ ├── BuildReader.java │ │ │ ├── Environment.java │ │ │ ├── EnvironmentCreator.java │ │ │ ├── EnvironmentDeleter.java │ │ │ ├── EnvironmentFetcher.java │ │ │ ├── EnvironmentReader.java │ │ │ ├── Function.java │ │ │ ├── FunctionCreator.java │ │ │ ├── FunctionDeleter.java │ │ │ ├── FunctionFetcher.java │ │ │ ├── FunctionReader.java │ │ │ ├── FunctionUpdater.java │ │ │ ├── asset │ │ │ ├── AssetVersion.java │ │ │ ├── AssetVersionFetcher.java │ │ │ └── AssetVersionReader.java │ │ │ ├── build │ │ │ ├── BuildStatus.java │ │ │ └── BuildStatusFetcher.java │ │ │ ├── environment │ │ │ ├── Deployment.java │ │ │ ├── DeploymentCreator.java │ │ │ ├── DeploymentFetcher.java │ │ │ ├── DeploymentReader.java │ │ │ ├── Log.java │ │ │ ├── LogFetcher.java │ │ │ ├── LogReader.java │ │ │ ├── Variable.java │ │ │ ├── VariableCreator.java │ │ │ ├── VariableDeleter.java │ │ │ ├── VariableFetcher.java │ │ │ ├── VariableReader.java │ │ │ └── VariableUpdater.java │ │ │ └── function │ │ │ ├── FunctionVersion.java │ │ │ ├── FunctionVersionFetcher.java │ │ │ ├── FunctionVersionReader.java │ │ │ └── functionversion │ │ │ ├── FunctionVersionContent.java │ │ │ └── FunctionVersionContentFetcher.java │ ├── studio │ │ ├── v1 │ │ │ ├── Flow.java │ │ │ ├── FlowDeleter.java │ │ │ ├── FlowFetcher.java │ │ │ ├── FlowReader.java │ │ │ └── flow │ │ │ │ ├── Engagement.java │ │ │ │ ├── EngagementCreator.java │ │ │ │ ├── EngagementDeleter.java │ │ │ │ ├── EngagementFetcher.java │ │ │ │ ├── EngagementReader.java │ │ │ │ ├── Execution.java │ │ │ │ ├── ExecutionCreator.java │ │ │ │ ├── ExecutionDeleter.java │ │ │ │ ├── ExecutionFetcher.java │ │ │ │ ├── ExecutionReader.java │ │ │ │ ├── ExecutionUpdater.java │ │ │ │ ├── engagement │ │ │ │ ├── EngagementContext.java │ │ │ │ ├── EngagementContextFetcher.java │ │ │ │ ├── Step.java │ │ │ │ ├── StepFetcher.java │ │ │ │ ├── StepReader.java │ │ │ │ └── step │ │ │ │ │ ├── StepContext.java │ │ │ │ │ └── StepContextFetcher.java │ │ │ │ └── execution │ │ │ │ ├── ExecutionContext.java │ │ │ │ ├── ExecutionContextFetcher.java │ │ │ │ ├── ExecutionStep.java │ │ │ │ ├── ExecutionStepFetcher.java │ │ │ │ ├── ExecutionStepReader.java │ │ │ │ └── executionstep │ │ │ │ ├── ExecutionStepContext.java │ │ │ │ └── ExecutionStepContextFetcher.java │ │ └── v2 │ │ │ ├── Flow.java │ │ │ ├── FlowCreator.java │ │ │ ├── FlowDeleter.java │ │ │ ├── FlowFetcher.java │ │ │ ├── FlowReader.java │ │ │ ├── FlowUpdater.java │ │ │ ├── FlowValidate.java │ │ │ ├── FlowValidateUpdater.java │ │ │ └── flow │ │ │ ├── Execution.java │ │ │ ├── ExecutionCreator.java │ │ │ ├── ExecutionDeleter.java │ │ │ ├── ExecutionFetcher.java │ │ │ ├── ExecutionReader.java │ │ │ ├── ExecutionUpdater.java │ │ │ ├── FlowRevision.java │ │ │ ├── FlowRevisionFetcher.java │ │ │ ├── FlowRevisionReader.java │ │ │ ├── FlowTestUser.java │ │ │ ├── FlowTestUserFetcher.java │ │ │ ├── FlowTestUserUpdater.java │ │ │ └── execution │ │ │ ├── ExecutionContext.java │ │ │ ├── ExecutionContextFetcher.java │ │ │ ├── ExecutionStep.java │ │ │ ├── ExecutionStepFetcher.java │ │ │ ├── ExecutionStepReader.java │ │ │ └── executionstep │ │ │ ├── ExecutionStepContext.java │ │ │ └── ExecutionStepContextFetcher.java │ ├── supersim │ │ └── v1 │ │ │ ├── EsimProfile.java │ │ │ ├── EsimProfileCreator.java │ │ │ ├── EsimProfileFetcher.java │ │ │ ├── EsimProfileReader.java │ │ │ ├── Fleet.java │ │ │ ├── FleetCreator.java │ │ │ ├── FleetFetcher.java │ │ │ ├── FleetReader.java │ │ │ ├── FleetUpdater.java │ │ │ ├── IpCommand.java │ │ │ ├── IpCommandCreator.java │ │ │ ├── IpCommandFetcher.java │ │ │ ├── IpCommandReader.java │ │ │ ├── Network.java │ │ │ ├── NetworkAccessProfile.java │ │ │ ├── NetworkAccessProfileCreator.java │ │ │ ├── NetworkAccessProfileFetcher.java │ │ │ ├── NetworkAccessProfileReader.java │ │ │ ├── NetworkAccessProfileUpdater.java │ │ │ ├── NetworkFetcher.java │ │ │ ├── NetworkReader.java │ │ │ ├── SettingsUpdate.java │ │ │ ├── SettingsUpdateReader.java │ │ │ ├── Sim.java │ │ │ ├── SimCreator.java │ │ │ ├── SimFetcher.java │ │ │ ├── SimReader.java │ │ │ ├── SimUpdater.java │ │ │ ├── SmsCommand.java │ │ │ ├── SmsCommandCreator.java │ │ │ ├── SmsCommandFetcher.java │ │ │ ├── SmsCommandReader.java │ │ │ ├── UsageRecord.java │ │ │ ├── UsageRecordReader.java │ │ │ ├── networkaccessprofile │ │ │ ├── NetworkAccessProfileNetwork.java │ │ │ ├── NetworkAccessProfileNetworkCreator.java │ │ │ ├── NetworkAccessProfileNetworkDeleter.java │ │ │ ├── NetworkAccessProfileNetworkFetcher.java │ │ │ └── NetworkAccessProfileNetworkReader.java │ │ │ └── sim │ │ │ ├── BillingPeriod.java │ │ │ ├── BillingPeriodReader.java │ │ │ ├── SimIpAddress.java │ │ │ └── SimIpAddressReader.java │ ├── sync │ │ └── v1 │ │ │ ├── Service.java │ │ │ ├── ServiceCreator.java │ │ │ ├── ServiceDeleter.java │ │ │ ├── ServiceFetcher.java │ │ │ ├── ServiceReader.java │ │ │ ├── ServiceUpdater.java │ │ │ └── service │ │ │ ├── Document.java │ │ │ ├── DocumentCreator.java │ │ │ ├── DocumentDeleter.java │ │ │ ├── DocumentFetcher.java │ │ │ ├── DocumentReader.java │ │ │ ├── DocumentUpdater.java │ │ │ ├── SyncList.java │ │ │ ├── SyncListCreator.java │ │ │ ├── SyncListDeleter.java │ │ │ ├── SyncListFetcher.java │ │ │ ├── SyncListReader.java │ │ │ ├── SyncListUpdater.java │ │ │ ├── SyncMap.java │ │ │ ├── SyncMapCreator.java │ │ │ ├── SyncMapDeleter.java │ │ │ ├── SyncMapFetcher.java │ │ │ ├── SyncMapReader.java │ │ │ ├── SyncMapUpdater.java │ │ │ ├── SyncStream.java │ │ │ ├── SyncStreamCreator.java │ │ │ ├── SyncStreamDeleter.java │ │ │ ├── SyncStreamFetcher.java │ │ │ ├── SyncStreamReader.java │ │ │ ├── SyncStreamUpdater.java │ │ │ ├── document │ │ │ ├── DocumentPermission.java │ │ │ ├── DocumentPermissionDeleter.java │ │ │ ├── DocumentPermissionFetcher.java │ │ │ ├── DocumentPermissionReader.java │ │ │ └── DocumentPermissionUpdater.java │ │ │ ├── synclist │ │ │ ├── SyncListItem.java │ │ │ ├── SyncListItemCreator.java │ │ │ ├── SyncListItemDeleter.java │ │ │ ├── SyncListItemFetcher.java │ │ │ ├── SyncListItemReader.java │ │ │ ├── SyncListItemUpdater.java │ │ │ ├── SyncListPermission.java │ │ │ ├── SyncListPermissionDeleter.java │ │ │ ├── SyncListPermissionFetcher.java │ │ │ ├── SyncListPermissionReader.java │ │ │ └── SyncListPermissionUpdater.java │ │ │ ├── syncmap │ │ │ ├── SyncMapItem.java │ │ │ ├── SyncMapItemCreator.java │ │ │ ├── SyncMapItemDeleter.java │ │ │ ├── SyncMapItemFetcher.java │ │ │ ├── SyncMapItemReader.java │ │ │ ├── SyncMapItemUpdater.java │ │ │ ├── SyncMapPermission.java │ │ │ ├── SyncMapPermissionDeleter.java │ │ │ ├── SyncMapPermissionFetcher.java │ │ │ ├── SyncMapPermissionReader.java │ │ │ └── SyncMapPermissionUpdater.java │ │ │ └── syncstream │ │ │ ├── StreamMessage.java │ │ │ └── StreamMessageCreator.java │ ├── taskrouter │ │ └── v1 │ │ │ ├── Workspace.java │ │ │ ├── WorkspaceCreator.java │ │ │ ├── WorkspaceDeleter.java │ │ │ ├── WorkspaceFetcher.java │ │ │ ├── WorkspaceReader.java │ │ │ ├── WorkspaceUpdater.java │ │ │ └── workspace │ │ │ ├── Activity.java │ │ │ ├── ActivityCreator.java │ │ │ ├── ActivityDeleter.java │ │ │ ├── ActivityFetcher.java │ │ │ ├── ActivityReader.java │ │ │ ├── ActivityUpdater.java │ │ │ ├── Event.java │ │ │ ├── EventFetcher.java │ │ │ ├── EventReader.java │ │ │ ├── Task.java │ │ │ ├── TaskChannel.java │ │ │ ├── TaskChannelCreator.java │ │ │ ├── TaskChannelDeleter.java │ │ │ ├── TaskChannelFetcher.java │ │ │ ├── TaskChannelReader.java │ │ │ ├── TaskChannelUpdater.java │ │ │ ├── TaskCreator.java │ │ │ ├── TaskDeleter.java │ │ │ ├── TaskFetcher.java │ │ │ ├── TaskQueue.java │ │ │ ├── TaskQueueCreator.java │ │ │ ├── TaskQueueDeleter.java │ │ │ ├── TaskQueueFetcher.java │ │ │ ├── TaskQueueReader.java │ │ │ ├── TaskQueueUpdater.java │ │ │ ├── TaskReader.java │ │ │ ├── TaskUpdater.java │ │ │ ├── Worker.java │ │ │ ├── WorkerCreator.java │ │ │ ├── WorkerDeleter.java │ │ │ ├── WorkerFetcher.java │ │ │ ├── WorkerReader.java │ │ │ ├── WorkerUpdater.java │ │ │ ├── Workflow.java │ │ │ ├── WorkflowCreator.java │ │ │ ├── WorkflowDeleter.java │ │ │ ├── WorkflowFetcher.java │ │ │ ├── WorkflowReader.java │ │ │ ├── WorkflowUpdater.java │ │ │ ├── WorkspaceCumulativeStatistics.java │ │ │ ├── WorkspaceCumulativeStatisticsFetcher.java │ │ │ ├── WorkspaceRealTimeStatistics.java │ │ │ ├── WorkspaceRealTimeStatisticsFetcher.java │ │ │ ├── WorkspaceStatistics.java │ │ │ ├── WorkspaceStatisticsFetcher.java │ │ │ ├── task │ │ │ ├── Reservation.java │ │ │ ├── ReservationFetcher.java │ │ │ ├── ReservationReader.java │ │ │ └── ReservationUpdater.java │ │ │ ├── taskqueue │ │ │ ├── TaskQueueBulkRealTimeStatistics.java │ │ │ ├── TaskQueueBulkRealTimeStatisticsCreator.java │ │ │ ├── TaskQueueCumulativeStatistics.java │ │ │ ├── TaskQueueCumulativeStatisticsFetcher.java │ │ │ ├── TaskQueueRealTimeStatistics.java │ │ │ ├── TaskQueueRealTimeStatisticsFetcher.java │ │ │ ├── TaskQueueStatistics.java │ │ │ ├── TaskQueueStatisticsFetcher.java │ │ │ ├── TaskQueuesStatistics.java │ │ │ └── TaskQueuesStatisticsReader.java │ │ │ ├── worker │ │ │ ├── Reservation.java │ │ │ ├── ReservationFetcher.java │ │ │ ├── ReservationReader.java │ │ │ ├── ReservationUpdater.java │ │ │ ├── WorkerChannel.java │ │ │ ├── WorkerChannelFetcher.java │ │ │ ├── WorkerChannelReader.java │ │ │ ├── WorkerChannelUpdater.java │ │ │ ├── WorkerStatistics.java │ │ │ ├── WorkerStatisticsFetcher.java │ │ │ ├── WorkersCumulativeStatistics.java │ │ │ ├── WorkersCumulativeStatisticsFetcher.java │ │ │ ├── WorkersRealTimeStatistics.java │ │ │ ├── WorkersRealTimeStatisticsFetcher.java │ │ │ ├── WorkersStatistics.java │ │ │ └── WorkersStatisticsFetcher.java │ │ │ └── workflow │ │ │ ├── WorkflowCumulativeStatistics.java │ │ │ ├── WorkflowCumulativeStatisticsFetcher.java │ │ │ ├── WorkflowRealTimeStatistics.java │ │ │ ├── WorkflowRealTimeStatisticsFetcher.java │ │ │ ├── WorkflowStatistics.java │ │ │ └── WorkflowStatisticsFetcher.java │ ├── trunking │ │ └── v1 │ │ │ ├── Trunk.java │ │ │ ├── TrunkCreator.java │ │ │ ├── TrunkDeleter.java │ │ │ ├── TrunkFetcher.java │ │ │ ├── TrunkReader.java │ │ │ ├── TrunkUpdater.java │ │ │ └── trunk │ │ │ ├── CredentialList.java │ │ │ ├── CredentialListCreator.java │ │ │ ├── CredentialListDeleter.java │ │ │ ├── CredentialListFetcher.java │ │ │ ├── CredentialListReader.java │ │ │ ├── IpAccessControlList.java │ │ │ ├── IpAccessControlListCreator.java │ │ │ ├── IpAccessControlListDeleter.java │ │ │ ├── IpAccessControlListFetcher.java │ │ │ ├── IpAccessControlListReader.java │ │ │ ├── OriginationUrl.java │ │ │ ├── OriginationUrlCreator.java │ │ │ ├── OriginationUrlDeleter.java │ │ │ ├── OriginationUrlFetcher.java │ │ │ ├── OriginationUrlReader.java │ │ │ ├── OriginationUrlUpdater.java │ │ │ ├── PhoneNumber.java │ │ │ ├── PhoneNumberCreator.java │ │ │ ├── PhoneNumberDeleter.java │ │ │ ├── PhoneNumberFetcher.java │ │ │ ├── PhoneNumberReader.java │ │ │ ├── Recording.java │ │ │ ├── RecordingFetcher.java │ │ │ └── RecordingUpdater.java │ ├── trusthub │ │ └── v1 │ │ │ ├── ComplianceInquiries.java │ │ │ ├── ComplianceInquiriesCreator.java │ │ │ ├── ComplianceInquiriesUpdater.java │ │ │ ├── ComplianceRegistrationInquiries.java │ │ │ ├── ComplianceRegistrationInquiriesCreator.java │ │ │ ├── ComplianceRegistrationInquiriesUpdater.java │ │ │ ├── ComplianceTollfreeInquiries.java │ │ │ ├── ComplianceTollfreeInquiriesCreator.java │ │ │ ├── CustomerProfiles.java │ │ │ ├── CustomerProfilesCreator.java │ │ │ ├── CustomerProfilesDeleter.java │ │ │ ├── CustomerProfilesFetcher.java │ │ │ ├── CustomerProfilesReader.java │ │ │ ├── CustomerProfilesUpdater.java │ │ │ ├── EndUser.java │ │ │ ├── EndUserCreator.java │ │ │ ├── EndUserDeleter.java │ │ │ ├── EndUserFetcher.java │ │ │ ├── EndUserReader.java │ │ │ ├── EndUserType.java │ │ │ ├── EndUserTypeFetcher.java │ │ │ ├── EndUserTypeReader.java │ │ │ ├── EndUserUpdater.java │ │ │ ├── Policies.java │ │ │ ├── PoliciesFetcher.java │ │ │ ├── PoliciesReader.java │ │ │ ├── SupportingDocument.java │ │ │ ├── SupportingDocumentCreator.java │ │ │ ├── SupportingDocumentDeleter.java │ │ │ ├── SupportingDocumentFetcher.java │ │ │ ├── SupportingDocumentReader.java │ │ │ ├── SupportingDocumentType.java │ │ │ ├── SupportingDocumentTypeFetcher.java │ │ │ ├── SupportingDocumentTypeReader.java │ │ │ ├── SupportingDocumentUpdater.java │ │ │ ├── TrustProducts.java │ │ │ ├── TrustProductsCreator.java │ │ │ ├── TrustProductsDeleter.java │ │ │ ├── TrustProductsFetcher.java │ │ │ ├── TrustProductsReader.java │ │ │ ├── TrustProductsUpdater.java │ │ │ ├── customerprofiles │ │ │ ├── CustomerProfilesChannelEndpointAssignment.java │ │ │ ├── CustomerProfilesChannelEndpointAssignmentCreator.java │ │ │ ├── CustomerProfilesChannelEndpointAssignmentDeleter.java │ │ │ ├── CustomerProfilesChannelEndpointAssignmentFetcher.java │ │ │ ├── CustomerProfilesChannelEndpointAssignmentReader.java │ │ │ ├── CustomerProfilesEntityAssignments.java │ │ │ ├── CustomerProfilesEntityAssignmentsCreator.java │ │ │ ├── CustomerProfilesEntityAssignmentsDeleter.java │ │ │ ├── CustomerProfilesEntityAssignmentsFetcher.java │ │ │ ├── CustomerProfilesEntityAssignmentsReader.java │ │ │ ├── CustomerProfilesEvaluations.java │ │ │ ├── CustomerProfilesEvaluationsCreator.java │ │ │ ├── CustomerProfilesEvaluationsFetcher.java │ │ │ └── CustomerProfilesEvaluationsReader.java │ │ │ └── trustproducts │ │ │ ├── TrustProductsChannelEndpointAssignment.java │ │ │ ├── TrustProductsChannelEndpointAssignmentCreator.java │ │ │ ├── TrustProductsChannelEndpointAssignmentDeleter.java │ │ │ ├── TrustProductsChannelEndpointAssignmentFetcher.java │ │ │ ├── TrustProductsChannelEndpointAssignmentReader.java │ │ │ ├── TrustProductsEntityAssignments.java │ │ │ ├── TrustProductsEntityAssignmentsCreator.java │ │ │ ├── TrustProductsEntityAssignmentsDeleter.java │ │ │ ├── TrustProductsEntityAssignmentsFetcher.java │ │ │ ├── TrustProductsEntityAssignmentsReader.java │ │ │ ├── TrustProductsEvaluations.java │ │ │ ├── TrustProductsEvaluationsCreator.java │ │ │ ├── TrustProductsEvaluationsFetcher.java │ │ │ └── TrustProductsEvaluationsReader.java │ ├── verify │ │ └── v2 │ │ │ ├── Form.java │ │ │ ├── FormFetcher.java │ │ │ ├── Safelist.java │ │ │ ├── SafelistCreator.java │ │ │ ├── SafelistDeleter.java │ │ │ ├── SafelistFetcher.java │ │ │ ├── Service.java │ │ │ ├── ServiceCreator.java │ │ │ ├── ServiceDeleter.java │ │ │ ├── ServiceFetcher.java │ │ │ ├── ServiceReader.java │ │ │ ├── ServiceUpdater.java │ │ │ ├── Template.java │ │ │ ├── TemplateReader.java │ │ │ ├── VerificationAttempt.java │ │ │ ├── VerificationAttemptFetcher.java │ │ │ ├── VerificationAttemptReader.java │ │ │ ├── VerificationAttemptsSummary.java │ │ │ ├── VerificationAttemptsSummaryFetcher.java │ │ │ └── service │ │ │ ├── AccessToken.java │ │ │ ├── AccessTokenCreator.java │ │ │ ├── AccessTokenFetcher.java │ │ │ ├── Entity.java │ │ │ ├── EntityCreator.java │ │ │ ├── EntityDeleter.java │ │ │ ├── EntityFetcher.java │ │ │ ├── EntityReader.java │ │ │ ├── MessagingConfiguration.java │ │ │ ├── MessagingConfigurationCreator.java │ │ │ ├── MessagingConfigurationDeleter.java │ │ │ ├── MessagingConfigurationFetcher.java │ │ │ ├── MessagingConfigurationReader.java │ │ │ ├── MessagingConfigurationUpdater.java │ │ │ ├── RateLimit.java │ │ │ ├── RateLimitCreator.java │ │ │ ├── RateLimitDeleter.java │ │ │ ├── RateLimitFetcher.java │ │ │ ├── RateLimitReader.java │ │ │ ├── RateLimitUpdater.java │ │ │ ├── Verification.java │ │ │ ├── VerificationCheck.java │ │ │ ├── VerificationCheckCreator.java │ │ │ ├── VerificationCreator.java │ │ │ ├── VerificationFetcher.java │ │ │ ├── VerificationUpdater.java │ │ │ ├── Webhook.java │ │ │ ├── WebhookCreator.java │ │ │ ├── WebhookDeleter.java │ │ │ ├── WebhookFetcher.java │ │ │ ├── WebhookReader.java │ │ │ ├── WebhookUpdater.java │ │ │ ├── entity │ │ │ ├── Challenge.java │ │ │ ├── ChallengeCreator.java │ │ │ ├── ChallengeFetcher.java │ │ │ ├── ChallengeReader.java │ │ │ ├── ChallengeUpdater.java │ │ │ ├── Factor.java │ │ │ ├── FactorDeleter.java │ │ │ ├── FactorFetcher.java │ │ │ ├── FactorReader.java │ │ │ ├── FactorUpdater.java │ │ │ ├── NewFactor.java │ │ │ ├── NewFactorCreator.java │ │ │ └── challenge │ │ │ │ ├── Notification.java │ │ │ │ └── NotificationCreator.java │ │ │ └── ratelimit │ │ │ ├── Bucket.java │ │ │ ├── BucketCreator.java │ │ │ ├── BucketDeleter.java │ │ │ ├── BucketFetcher.java │ │ │ ├── BucketReader.java │ │ │ └── BucketUpdater.java │ ├── video │ │ └── v1 │ │ │ ├── Composition.java │ │ │ ├── CompositionCreator.java │ │ │ ├── CompositionDeleter.java │ │ │ ├── CompositionFetcher.java │ │ │ ├── CompositionHook.java │ │ │ ├── CompositionHookCreator.java │ │ │ ├── CompositionHookDeleter.java │ │ │ ├── CompositionHookFetcher.java │ │ │ ├── CompositionHookReader.java │ │ │ ├── CompositionHookUpdater.java │ │ │ ├── CompositionReader.java │ │ │ ├── CompositionSettings.java │ │ │ ├── CompositionSettingsCreator.java │ │ │ ├── CompositionSettingsFetcher.java │ │ │ ├── Recording.java │ │ │ ├── RecordingDeleter.java │ │ │ ├── RecordingFetcher.java │ │ │ ├── RecordingReader.java │ │ │ ├── RecordingSettings.java │ │ │ ├── RecordingSettingsCreator.java │ │ │ ├── RecordingSettingsFetcher.java │ │ │ ├── Room.java │ │ │ ├── RoomCreator.java │ │ │ ├── RoomFetcher.java │ │ │ ├── RoomReader.java │ │ │ ├── RoomUpdater.java │ │ │ └── room │ │ │ ├── Participant.java │ │ │ ├── ParticipantFetcher.java │ │ │ ├── ParticipantReader.java │ │ │ ├── ParticipantUpdater.java │ │ │ ├── RecordingRules.java │ │ │ ├── RecordingRulesFetcher.java │ │ │ ├── RecordingRulesUpdater.java │ │ │ ├── RoomRecording.java │ │ │ ├── RoomRecordingDeleter.java │ │ │ ├── RoomRecordingFetcher.java │ │ │ ├── RoomRecordingReader.java │ │ │ └── participant │ │ │ ├── Anonymize.java │ │ │ ├── AnonymizeUpdater.java │ │ │ ├── PublishedTrack.java │ │ │ ├── PublishedTrackFetcher.java │ │ │ ├── PublishedTrackReader.java │ │ │ ├── SubscribeRules.java │ │ │ ├── SubscribeRulesFetcher.java │ │ │ ├── SubscribeRulesUpdater.java │ │ │ ├── SubscribedTrack.java │ │ │ ├── SubscribedTrackFetcher.java │ │ │ └── SubscribedTrackReader.java │ ├── voice │ │ └── v1 │ │ │ ├── ArchivedCall.java │ │ │ ├── ArchivedCallDeleter.java │ │ │ ├── ByocTrunk.java │ │ │ ├── ByocTrunkCreator.java │ │ │ ├── ByocTrunkDeleter.java │ │ │ ├── ByocTrunkFetcher.java │ │ │ ├── ByocTrunkReader.java │ │ │ ├── ByocTrunkUpdater.java │ │ │ ├── ConnectionPolicy.java │ │ │ ├── ConnectionPolicyCreator.java │ │ │ ├── ConnectionPolicyDeleter.java │ │ │ ├── ConnectionPolicyFetcher.java │ │ │ ├── ConnectionPolicyReader.java │ │ │ ├── ConnectionPolicyUpdater.java │ │ │ ├── IpRecord.java │ │ │ ├── IpRecordCreator.java │ │ │ ├── IpRecordDeleter.java │ │ │ ├── IpRecordFetcher.java │ │ │ ├── IpRecordReader.java │ │ │ ├── IpRecordUpdater.java │ │ │ ├── SourceIpMapping.java │ │ │ ├── SourceIpMappingCreator.java │ │ │ ├── SourceIpMappingDeleter.java │ │ │ ├── SourceIpMappingFetcher.java │ │ │ ├── SourceIpMappingReader.java │ │ │ ├── SourceIpMappingUpdater.java │ │ │ ├── connectionpolicy │ │ │ ├── ConnectionPolicyTarget.java │ │ │ ├── ConnectionPolicyTargetCreator.java │ │ │ ├── ConnectionPolicyTargetDeleter.java │ │ │ ├── ConnectionPolicyTargetFetcher.java │ │ │ ├── ConnectionPolicyTargetReader.java │ │ │ └── ConnectionPolicyTargetUpdater.java │ │ │ └── dialingpermissions │ │ │ ├── BulkCountryUpdate.java │ │ │ ├── BulkCountryUpdateCreator.java │ │ │ ├── Country.java │ │ │ ├── CountryFetcher.java │ │ │ ├── CountryReader.java │ │ │ ├── Settings.java │ │ │ ├── SettingsFetcher.java │ │ │ ├── SettingsUpdater.java │ │ │ └── country │ │ │ ├── HighriskSpecialPrefix.java │ │ │ └── HighriskSpecialPrefixReader.java │ └── wireless │ │ └── v1 │ │ ├── Command.java │ │ ├── CommandCreator.java │ │ ├── CommandDeleter.java │ │ ├── CommandFetcher.java │ │ ├── CommandReader.java │ │ ├── RatePlan.java │ │ ├── RatePlanCreator.java │ │ ├── RatePlanDeleter.java │ │ ├── RatePlanFetcher.java │ │ ├── RatePlanReader.java │ │ ├── RatePlanUpdater.java │ │ ├── Sim.java │ │ ├── SimDeleter.java │ │ ├── SimFetcher.java │ │ ├── SimReader.java │ │ ├── SimUpdater.java │ │ ├── UsageRecord.java │ │ ├── UsageRecordReader.java │ │ └── sim │ │ ├── DataSession.java │ │ ├── DataSessionReader.java │ │ ├── UsageRecord.java │ │ └── UsageRecordReader.java │ ├── security │ └── RequestValidator.java │ ├── taskrouter │ ├── TaskRouterResource.java │ ├── TaskRouting.java │ ├── Workflow.java │ ├── WorkflowRule.java │ └── WorkflowRuleTarget.java │ ├── twiml │ ├── FaxResponse.java │ ├── GenericNode.java │ ├── MessagingResponse.java │ ├── Text.java │ ├── TwiML.java │ ├── TwiMLException.java │ ├── VoiceResponse.java │ ├── fax │ │ └── Receive.java │ ├── messaging │ │ ├── Body.java │ │ ├── Media.java │ │ ├── Message.java │ │ └── Redirect.java │ ├── video │ │ └── Room.java │ └── voice │ │ ├── Application.java │ │ ├── ApplicationSid.java │ │ ├── Assistant.java │ │ ├── Autopilot.java │ │ ├── Client.java │ │ ├── Conference.java │ │ ├── Config.java │ │ ├── Connect.java │ │ ├── Conversation.java │ │ ├── ConversationRelay.java │ │ ├── Dial.java │ │ ├── Echo.java │ │ ├── Enqueue.java │ │ ├── Gather.java │ │ ├── Hangup.java │ │ ├── Identity.java │ │ ├── Language.java │ │ ├── Leave.java │ │ ├── Number.java │ │ ├── Parameter.java │ │ ├── Pause.java │ │ ├── Pay.java │ │ ├── Play.java │ │ ├── Prompt.java │ │ ├── Queue.java │ │ ├── Record.java │ │ ├── Redirect.java │ │ ├── Refer.java │ │ ├── ReferSip.java │ │ ├── Reject.java │ │ ├── Room.java │ │ ├── Say.java │ │ ├── Sim.java │ │ ├── Sip.java │ │ ├── Siprec.java │ │ ├── Sms.java │ │ ├── SsmlBreak.java │ │ ├── SsmlEmphasis.java │ │ ├── SsmlLang.java │ │ ├── SsmlP.java │ │ ├── SsmlPhoneme.java │ │ ├── SsmlProsody.java │ │ ├── SsmlS.java │ │ ├── SsmlSayAs.java │ │ ├── SsmlSub.java │ │ ├── SsmlW.java │ │ ├── Start.java │ │ ├── Stop.java │ │ ├── Stream.java │ │ ├── Task.java │ │ ├── Transcription.java │ │ └── VirtualAgent.java │ └── type │ ├── Client.java │ ├── Endpoint.java │ ├── FeedbackIssue.java │ ├── IceServer.java │ ├── InboundCallPrice.java │ ├── InboundSmsPrice.java │ ├── OutboundCallPrice.java │ ├── OutboundCallPriceWithOrigin.java │ ├── OutboundPrefixPrice.java │ ├── OutboundPrefixPriceWithOrigin.java │ ├── OutboundSmsPrice.java │ ├── PhoneNumber.java │ ├── PhoneNumberCapabilities.java │ ├── PhoneNumberPrice.java │ ├── RecordingRule.java │ ├── RecordingRulesUpdate.java │ ├── Rule.java │ ├── Sip.java │ ├── SubscribeRule.java │ ├── SubscribeRulesUpdate.java │ └── Twiml.java └── test ├── java └── com │ └── twilio │ ├── Assert.java │ ├── ClusterTest.java │ ├── TwilioTest.java │ ├── base │ └── ReaderTest.java │ ├── compliance │ └── ComplianceTest.java │ ├── converter │ ├── CurrencyDeserializerTest.java │ ├── DateConverterTest.java │ ├── PrefixedCollapsibleMapTest.java │ └── PromoterTest.java │ ├── exception │ └── ApiExceptionTest.java │ ├── http │ ├── CustomHttpClient.java │ ├── HttpUtilityTest.java │ ├── NetworkHttpClientTest.java │ ├── RequestTest.java │ ├── ResponseTest.java │ ├── TwilioRestClientTest.java │ └── ValidationClientTest.java │ ├── jwt │ ├── accesstoken │ │ └── AccessTokenTest.java │ ├── client │ │ ├── ClientCapabilityTest.java │ │ ├── EventStreamScopeTest.java │ │ ├── IncomingClientScopeTest.java │ │ └── OutgoingClientScopeTest.java │ ├── taskrouter │ │ ├── PolicyTest.java │ │ ├── PolicyUtilsTest.java │ │ ├── TaskRouterCapabilityTest.java │ │ └── UrlUtilsTest.java │ └── validation │ │ ├── RequestCanonicalizerTest.java │ │ └── ValidationTokenTest.java │ ├── security │ └── RequestValidatorTest.java │ ├── taskrouter │ ├── WorkflowRuleTargetTest.java │ └── WorkflowTest.java │ ├── twiml │ ├── FaxResponseTest.java │ ├── MessagingResponseTest.java │ ├── VoiceResponseTest.java │ ├── fax │ │ └── ReceiveTest.java │ ├── messaging │ │ ├── BodyTest.java │ │ ├── MediaTest.java │ │ ├── MessageTest.java │ │ └── RedirectTest.java │ └── voice │ │ ├── ApplicationSidTest.java │ │ ├── ApplicationTest.java │ │ ├── AssistantTest.java │ │ ├── AutopilotTest.java │ │ ├── ClientTest.java │ │ ├── ConferenceTest.java │ │ ├── ConfigTest.java │ │ ├── ConnectTest.java │ │ ├── ConversationRelayTest.java │ │ ├── ConversationTest.java │ │ ├── DialTest.java │ │ ├── EchoTest.java │ │ ├── EnqueueTest.java │ │ ├── GatherTest.java │ │ ├── HangupTest.java │ │ ├── IdentityTest.java │ │ ├── LanguageTest.java │ │ ├── LeaveTest.java │ │ ├── NumberTest.java │ │ ├── ParameterTest.java │ │ ├── PauseTest.java │ │ ├── PayTest.java │ │ ├── PlayTest.java │ │ ├── PromptTest.java │ │ ├── QueueTest.java │ │ ├── RecordTest.java │ │ ├── RedirectTest.java │ │ ├── ReferSipTest.java │ │ ├── ReferTest.java │ │ ├── RejectTest.java │ │ ├── RoomTest.java │ │ ├── SayTest.java │ │ ├── SimTest.java │ │ ├── SipTest.java │ │ ├── SiprecTest.java │ │ ├── SmsTest.java │ │ ├── SsmlBreakTest.java │ │ ├── SsmlEmphasisTest.java │ │ ├── SsmlLangTest.java │ │ ├── SsmlPTest.java │ │ ├── SsmlPhonemeTest.java │ │ ├── SsmlProsodyTest.java │ │ ├── SsmlSTest.java │ │ ├── SsmlSayAsTest.java │ │ ├── SsmlSubTest.java │ │ ├── SsmlWTest.java │ │ ├── StartTest.java │ │ ├── StopTest.java │ │ ├── StreamTest.java │ │ ├── TaskTest.java │ │ ├── TranscriptionTest.java │ │ └── VirtualAgentTest.java │ └── type │ ├── ClientTest.java │ ├── FeedbackIssueTest.java │ ├── IceServerTest.java │ ├── InboundCallPriceTest.java │ ├── InboundSmsPriceTest.java │ ├── OutboundCallPriceTest.java │ ├── OutboundPrefixPriceTest.java │ ├── OutboundSmsPriceTest.java │ ├── PhoneNumberCapabilitiesTest.java │ ├── PhoneNumberPriceTest.java │ ├── RecordingRuleTest.java │ ├── SubscribeRuleTest.java │ └── TypeTest.java └── resources └── log4j2.xml /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug report 2 | description: Report a bug with the twilio-java helper library. 3 | title: "[BUG] Describe the issue briefly" 4 | labels: "type: bug" 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thank you for reporting a bug in the twilio-java helper library. Please provide the details below to help us investigate and resolve the issue. 10 | 11 | - type: textarea 12 | attributes: 13 | label: Describe the bug 14 | description: Provide a clear and concise description of the issue. 15 | placeholder: A clear and concise description of the bug. 16 | validations: 17 | required: true 18 | 19 | - type: textarea 20 | attributes: 21 | label: Code snippet 22 | description: Provide the code snippet that reproduces the issue. 23 | placeholder: "```\n// Code snippet here\n```" 24 | validations: 25 | required: true 26 | 27 | - type: textarea 28 | attributes: 29 | label: Actual behavior 30 | description: Describe what actually happened. 31 | placeholder: A description of the actual behavior. 32 | validations: 33 | required: true 34 | 35 | - type: textarea 36 | attributes: 37 | label: Expected behavior 38 | description: Describe what you expected to happen. 39 | placeholder: A description of the expected outcome. 40 | validations: 41 | required: true 42 | 43 | - type: input 44 | attributes: 45 | label: twilio-java version 46 | description: Specify the version of the twilio-java helper library you are using. 47 | placeholder: e.g., 10.5.1 48 | validations: 49 | required: true 50 | 51 | - type: input 52 | attributes: 53 | label: Java version 54 | description: Specify the version of Java you are using. 55 | placeholder: e.g., OpenJDK 11.0.16 56 | validations: 57 | required: true 58 | 59 | - type: textarea 60 | attributes: 61 | label: Logs or error messages 62 | description: Provide relevant logs or error messages (if any). 63 | placeholder: "Error: Something went wrong..." 64 | 65 | - type: textarea 66 | attributes: 67 | label: Additional context 68 | description: Add any other context about the problem here. 69 | placeholder: Any additional 70 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Twilio Support 3 | url: https://twilio.com/help/contact 4 | about: Get Support 5 | - name: Stack Overflow 6 | url: https://stackoverflow.com/questions/tagged/twilio-java+or+twilio+java 7 | about: Ask questions on Stack Overflow 8 | - name: Documentation 9 | url: https://www.twilio.com/docs/libraries/reference/twilio-java 10 | about: View Reference Documentation 11 | -------------------------------------------------------------------------------- /.github/workflows/pr-lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint PR 2 | on: 3 | pull_request_target: 4 | types: [ opened, edited, synchronize, reopened ] 5 | 6 | jobs: 7 | validate: 8 | name: Validate title 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: amannn/action-semantic-pull-request@v5 12 | with: 13 | types: | 14 | chore 15 | docs 16 | fix 17 | feat 18 | misc 19 | test 20 | env: 21 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | 3 | .idea/ 4 | out/ 5 | target/ 6 | docs/ 7 | src/main/java/com/twilio/Twilio.java.bak 8 | secret.key 9 | pom.xml.releaseBackup 10 | release.properties 11 | .classpath 12 | .project 13 | .settings/ 14 | settings.json 15 | **/.openapi-generator* 16 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | Authors 2 | ======= 3 | 4 | A huge thanks to all of our contributors: 5 | 6 | 7 | - Adam Ballai 8 | - Adam Rich 9 | - Adam Richeimer 10 | - Akshar Prabhu Desai 11 | - Alexandre Payment 12 | - Alexey Palazhchenko 13 | - Ameya Lokare 14 | - Andrew Benton 15 | - Beans0063 16 | - Brett Gerry 17 | - Brian J. Tarricone 18 | - Brian Levine 19 | - Carlos Diaz-Padron 20 | - Christer Fahlgren 21 | - Christopher C. Merris 22 | - Cody Lerum 23 | - D Keith Casey Jr 24 | - Doug Black 25 | - Eric Anderle 26 | - Evan Fossier 27 | - Frank 28 | - Frank Stratton 29 | - Girish Bharadwaj 30 | - Guillaume BINET 31 | - Jancsi Farkas 32 | - Jason Li 33 | - Jeroen Wesbeek 34 | - Jingming Niu 35 | - John A. Tamplin 36 | - Jon Plax 37 | - Justin Witz 38 | - Karthik H 39 | - Kevin Burke 40 | - Kevin Whinnery 41 | - Kyle Conroy 42 | - Marek Radonsky 43 | - Mario Niebla 44 | - Matt Nowack 45 | - Phani 46 | - RonaldWentworth 47 | - Sam Kimbrel 48 | - Sean C. Sullivan 49 | - Sunil Veluvali 50 | - Takuji Shimokawa 51 | - Thomas Wilsher 52 | - Thomas Connors 53 | - Vincent Pizzo 54 | - olivier bourgain 55 | - rschiffert@twilio.com 56 | - Mitchell Friedman 57 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8 2 | 3 | RUN mkdir /twilio 4 | WORKDIR /twilio 5 | 6 | COPY src ./src 7 | COPY pom.xml . 8 | 9 | RUN apt-get update && apt-get install maven -y 10 | RUN mvn clean install -Dmaven.test.skip=true 11 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | ### Issue Summary 10 | A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, or code examples. 11 | 12 | ### Steps to Reproduce 13 | 1. This is the first step 14 | 2. This is the second step 15 | 3. Further steps, etc. 16 | 17 | ### Code Snippet 18 | ```java 19 | # paste code here 20 | ``` 21 | 22 | ### Exception/Log 23 | ``` 24 | # paste exception/log here 25 | ``` 26 | 27 | ### Technical details: 28 | * twilio-java version: 29 | * java version: 30 | 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (C) 2023, Twilio, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: install analysis test test-docker docs 2 | 3 | install: 4 | @java -version || (echo "Java is not installed, please install Java >= 7"; exit 1); 5 | mvn clean install 6 | mvn dependency:resolve-plugins 7 | 8 | analysis: 9 | mvn checkstyle:check 10 | 11 | test: 12 | mvn test 13 | 14 | test-docker: 15 | docker build -t twilio/twilio-java . 16 | docker run twilio/twilio-java mvn test 17 | 18 | docs: 19 | rm -rf docs 20 | mvn javadoc:javadoc 21 | 22 | API_DEFINITIONS_SHA=$(shell git log --oneline | grep Regenerated | head -n1 | cut -d ' ' -f 5) 23 | CURRENT_TAG=$(shell expr "${GITHUB_TAG}" : ".*-rc.*" >/dev/null && echo "rc" || echo "latest") 24 | docker-build: 25 | docker build -t twilio/twilio-java . 26 | docker tag twilio/twilio-java twilio/twilio-java:${GITHUB_TAG} 27 | docker tag twilio/twilio-java twilio/twilio-java:apidefs-${API_DEFINITIONS_SHA} 28 | docker tag twilio/twilio-java twilio/twilio-java:${CURRENT_TAG} 29 | 30 | docker-push: 31 | docker push twilio/twilio-java:${GITHUB_TAG} 32 | docker push twilio/twilio-java:apidefs-${API_DEFINITIONS_SHA} 33 | docker push twilio/twilio-java:${CURRENT_TAG} 34 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 16 | 17 | # Fixes # 18 | 19 | A short description of what this PR does. 20 | 21 | ### Checklist 22 | - [x] I acknowledge that all my contributions will be made under the project's license 23 | - [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) 24 | - [ ] I have read the [Contribution Guidelines](https://github.com/twilio/twilio-java/blob/main/CONTRIBUTING.md) and my PR follows them 25 | - [ ] I have titled the PR appropriately 26 | - [ ] I have updated my branch with the main branch 27 | - [ ] I have added tests that prove my fix is effective or that my feature works 28 | - [ ] I have added the necessary documentation about the functionality in the appropriate .md file 29 | - [ ] I have added inline documentation to the code I modified 30 | 31 | If you have questions, please file a [support ticket](https://twilio.com/help/contact), or create a GitHub Issue in this repository. 32 | -------------------------------------------------------------------------------- /VERSIONS.md: -------------------------------------------------------------------------------- 1 | # Versioning Strategy 2 | 3 | `twilio-java` uses a modified version of [Semantic Versioning][semver] for 4 | all changes to the helper library. It is strongly encouraged that you pin at 5 | least the major version and potentially the minor version to avoid pulling in 6 | breaking changes. 7 | 8 | Semantic Versions take the form of `MAJOR.MINOR.PATCH` 9 | 10 | When bugs are fixed in the library in a backwards-compatible way, the `PATCH` 11 | level will be incremented by one. When new features are added to the library 12 | in a backwards-compatible way, the `PATCH` level will be incremented by one. 13 | `PATCH` changes should _not_ break your code and are generally safe for upgrade. 14 | 15 | When a new large feature set comes online or a small breaking change is 16 | introduced, the `MINOR` version will be incremented by one and the `PATCH` 17 | version reset to zero. `MINOR` changes _may_ require some amount of manual code 18 | change for upgrade. These backwards-incompatible changes will generally be 19 | limited to a small number of function signature changes. 20 | 21 | The `MAJOR` version is used to indicate the family of technology represented by 22 | the helper library. Breaking changes that require extensive reworking of code 23 | will cause the `MAJOR` version to be incremented by one, and the `MINOR` and 24 | `PATCH` versions will be reset to zero. Twilio understands that this can be very 25 | disruptive, so we will only introduce this type of breaking change when 26 | absolutely necessary. New `MAJOR` versions will be communicated in advance with 27 | `Release Candidates` and a schedule. 28 | 29 | ## Supported Versions 30 | 31 | Only the current `MAJOR` version of `twilio-java` is supported. New 32 | features, functionality, bug fixes, and security updates will only be added to 33 | the current `MAJOR` version. 34 | 35 | [semver]: https://semver.org -------------------------------------------------------------------------------- /examples/BearerTokenAuthentication.md: -------------------------------------------------------------------------------- 1 | class BearerTokenAuthenticationExamples { 2 | public static void main { 3 | 4 | private static final String GRANT_TYPE = "grant_type_to_be_used"; 5 | private static final String CLIENT_SID = 6 | "client_id_of_the_organization"; 7 | private static final String CLIENT_SECRET = "client_secret_of_organization"; 8 | private static final String ORGANISATION_ID = "id_of_the_organization"; 9 | 10 | //Getting access token - Method #1 11 | TwilioOrgsTokenAuth.init(GRANT_TYPE, CLIENT_ID, CLIENT_SECRET); 12 | 13 | //Getting access token - Method #2 14 | //To provide custom token manager implementation 15 | //Need not call init method if customer token manager is passed 16 | //TwilioOrgsTokenAuth.setTokenManager(new CustomTokenManagerImpl(GRANT_TYPE, CLIENT_ID, CLIENT_SECRET)); 17 | 18 | fetchAccountDetails(); 19 | } 20 | 21 | private static void fetchAccountDetails() { 22 | ResourceSet accountSet = Account.reader(ORGANISATION_ID).read(); 23 | String accountSid = accountSet.iterator().next().getAccountSid(); 24 | System.out.println(accountSid); 25 | } 26 | } -------------------------------------------------------------------------------- /examples/Content.md: -------------------------------------------------------------------------------- 1 | public class ContentExamples { 2 | public static void main { 3 | Twilio.init(ACCOUNT_SID, AUTH_TOKEN); 4 | createTwilioText(); 5 | } 6 | 7 | public static void createTwilioText() { 8 | Content.ContentCreateRequest createRequest = new Content.ContentCreateRequest("es", types); 9 | 10 | Content.TwilioText twilioText = new Content.TwilioText(); 11 | twilioText.setBody("text body"); 12 | 13 | Content.Types types = new Content.Types(); 14 | types.setTwilioText(twilioText); 15 | 16 | Map variables = new HashMap<>(); 17 | variables.put("var1", "val1"); 18 | 19 | createRequest.setVariables(variables); 20 | createRequest.setFriendlyName("name"); 21 | 22 | Content newContent = Content.creator(createRequest).create(); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /examples/FetchMessageUsingOAuth.md: -------------------------------------------------------------------------------- 1 | ``` 2 | import com.twilio.Twilio; 3 | import com.twilio.credential.ClientCredentialProvider; 4 | import com.twilio.rest.api.v2010.account.Message; 5 | 6 | public class FetchMessageUsingOAuth { 7 | public static void main(String[] args) { 8 | String clientId = "YOUR_CLIENT_ID"; 9 | String clientSecret = "YOUR_CLIENT_SECRET"; 10 | String accountSid = "YOUR_ACCOUNT_SID"; 11 | Twilio.init(new ClientCredentialProvider(clientId, clientSecret), accountSid); 12 | /* 13 | Or use the following if accountSid is not required as a path parameter for an API or when setting accountSid in the API. 14 | Twilio.init(new ClientCredentialProvider(clientId, clientSecret)); 15 | */ 16 | String messageSid = "YOUR_MESSAGE_SID"; 17 | Message message = Message.fetcher(messageSid).fetch(); 18 | } 19 | } 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /examples/MultiRegionClient.md: -------------------------------------------------------------------------------- 1 | ```java 2 | package com.twilio.example; 3 | 4 | import com.twilio.http.TwilioRestClient; 5 | import com.twilio.rest.api.v2010.account.Message; 6 | import com.twilio.type.PhoneNumber; 7 | 8 | public class MultiRegionExample { 9 | public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID"); 10 | public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN"); 11 | 12 | public static void main(String[] args) { 13 | 14 | TwilioRestClient client = new TwilioRestClient.Builder(ACCOUNT_SID, AUTH_TOKEN).region("us1").build(); 15 | 16 | Message message = Message 17 | .creator( 18 | new PhoneNumber("+1XXXXXXXXXX"), 19 | new PhoneNumber("+1XXXXXXXXXX"), 20 | "This is the ship that made the Kessel Run in fourteen parsecs?" 21 | ) 22 | .create(client); 23 | 24 | System.out.println(message.getSid()); 25 | 26 | TwilioRestClient client2 = new TwilioRestClient.Builder(ACCOUNT_SID, AUTH_TOKEN).region("au1").build(); 27 | 28 | Message message2 = Message 29 | .creator( 30 | new PhoneNumber("+1XXXXXXXXXX"), 31 | new PhoneNumber("+1XXXXXXXXXX"), 32 | "This is the ship that made the Kessel Run in fourteen parsecs?" 33 | ) 34 | .create(client2); 35 | 36 | System.out.println(message2.getSid()); 37 | } 38 | } 39 | 40 | 41 | ``` 42 | -------------------------------------------------------------------------------- /examples/PreviewMessaging.md: -------------------------------------------------------------------------------- 1 | class PreviewMessagingExamples { 2 | public static void main { 3 | Twilio.init(ACCOUNT_SID, AUTH_TOKEN); 4 | sendBulkMessages(); 5 | } 6 | 7 | private static void sendBulkMessages() { 8 | Message.CreateMessagesRequest createMessagesRequest = new Message.CreateMessagesRequest(); 9 | List toNumbers; // recipients numbers 10 | 11 | // Set from number 12 | PhoneNumber fromNumber; 13 | 14 | // Set list of number where you want to send bulk message. 15 | List phoneList = new ArrayList<>(); 16 | for (String to: toNumbers) { 17 | Message.MessagingV1Message phone = new Message.MessagingV1Message(); 18 | phone.setTo(new PhoneNumber(to)); 19 | phoneList.add(phone); 20 | } 21 | 22 | createMessagesRequest.setFrom(fromNumber); 23 | createMessagesRequest.setBody("Bulk message to send"); 24 | createMessagesRequest.setMessages(phoneList); 25 | Message message = Message.creator(createMessagesRequest).create(); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /src/main/java/com/twilio/Domains.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * NOTE: This class is auto generated by OpenAPI Generator. 8 | * https://openapi-generator.tech 9 | * Do not edit the class manually. 10 | */ 11 | package com.twilio.rest; 12 | 13 | public enum Domains { 14 | ACCOUNTS("accounts"), 15 | API("api"), 16 | ASSISTANTS("assistants"), 17 | BULKEXPORTS("bulkexports"), 18 | CHAT("chat"), 19 | CONTENT("content"), 20 | CONVERSATIONS("conversations"), 21 | EVENTS("events"), 22 | FLEXAPI("flex-api"), 23 | FRONTLINEAPI("frontline-api"), 24 | PREVIEWIAM("preview-iam"), 25 | IAM("iam"), 26 | INSIGHTS("insights"), 27 | INTELLIGENCE("intelligence"), 28 | IPMESSAGING("ip-messaging"), 29 | KNOWLEDGE("knowledge"), 30 | LOOKUPS("lookups"), 31 | MARKETPLACE("marketplace"), 32 | MESSAGING("messaging"), 33 | MICROVISOR("microvisor"), 34 | MONITOR("monitor"), 35 | NOTIFY("notify"), 36 | NUMBERS("numbers"), 37 | OAUTH("oauth"), 38 | PREVIEW("preview"), 39 | PRICING("pricing"), 40 | PROXY("proxy"), 41 | ROUTES("routes"), 42 | SERVERLESS("serverless"), 43 | STUDIO("studio"), 44 | SUPERSIM("supersim"), 45 | SYNC("sync"), 46 | TASKROUTER("taskrouter"), 47 | TRUNKING("trunking"), 48 | TRUSTHUB("trusthub"), 49 | VERIFY("verify"), 50 | VIDEO("video"), 51 | VOICE("voice"), 52 | WIRELESS("wireless"); 53 | 54 | private final String value; 55 | 56 | private Domains(final String value) { 57 | this.value = value; 58 | } 59 | 60 | public String toString() { 61 | return value; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/TwilioNoAuth.java: -------------------------------------------------------------------------------- 1 | package com.twilio; 2 | 3 | import com.twilio.annotations.Beta; 4 | import com.twilio.http.noauth.NoAuthTwilioRestClient; 5 | import lombok.Getter; 6 | 7 | import java.util.List; 8 | import com.twilio.exception.AuthenticationException; 9 | 10 | @Beta 11 | public class TwilioNoAuth { 12 | @Getter 13 | private static List userAgentExtensions; 14 | private static String region = System.getenv("TWILIO_REGION"); 15 | private static String edge = System.getenv("TWILIO_EDGE"); 16 | 17 | private static volatile NoAuthTwilioRestClient noAuthTwilioRestClient; 18 | 19 | private TwilioNoAuth() { 20 | } 21 | 22 | public static NoAuthTwilioRestClient getRestClient() { 23 | if (TwilioNoAuth.noAuthTwilioRestClient == null) { 24 | synchronized (TwilioNoAuth.class) { 25 | if (TwilioNoAuth.noAuthTwilioRestClient == null) { 26 | TwilioNoAuth.noAuthTwilioRestClient = buildOAuthRestClient(); 27 | } 28 | } 29 | } 30 | return TwilioNoAuth.noAuthTwilioRestClient; 31 | } 32 | 33 | private static NoAuthTwilioRestClient buildOAuthRestClient() { 34 | 35 | NoAuthTwilioRestClient.Builder builder = new NoAuthTwilioRestClient.Builder(); 36 | 37 | if (userAgentExtensions != null) { 38 | builder.userAgentExtensions(TwilioNoAuth.userAgentExtensions); 39 | } 40 | 41 | builder.region(TwilioNoAuth.region); 42 | builder.edge(TwilioNoAuth.edge); 43 | 44 | return builder.build(); 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/annotations/Beta.java: -------------------------------------------------------------------------------- 1 | package com.twilio.annotations; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Retention(RetentionPolicy.RUNTIME) 6 | @Target({ElementType.TYPE, ElementType.METHOD}) 7 | public @interface Beta { 8 | String value() default "This class/method is under beta and is subjected to change. Use with caution."; 9 | } -------------------------------------------------------------------------------- /src/main/java/com/twilio/auth_strategy/AuthStrategy.java: -------------------------------------------------------------------------------- 1 | package com.twilio.auth_strategy; 2 | 3 | import com.twilio.constant.EnumConstants; 4 | import lombok.Getter; 5 | 6 | public abstract class AuthStrategy { 7 | @Getter 8 | private EnumConstants.AuthType authType; 9 | 10 | public AuthStrategy(EnumConstants.AuthType authType) { 11 | this.authType = authType; 12 | } 13 | public abstract String getAuthString(); 14 | 15 | public abstract boolean requiresAuthentication(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/auth_strategy/BasicAuthStrategy.java: -------------------------------------------------------------------------------- 1 | package com.twilio.auth_strategy; 2 | 3 | import com.twilio.constant.EnumConstants; 4 | 5 | import java.nio.charset.StandardCharsets; 6 | import java.util.Base64; 7 | import java.util.Objects; 8 | 9 | public class BasicAuthStrategy extends AuthStrategy { 10 | private String username; 11 | private String password; 12 | 13 | public BasicAuthStrategy(String username, String password) { 14 | super(EnumConstants.AuthType.BASIC); 15 | this.username = username; 16 | this.password = password; 17 | } 18 | 19 | @Override 20 | public String getAuthString() { 21 | String credentials = username + ":" + password; 22 | String encoded = Base64.getEncoder().encodeToString(credentials.getBytes(StandardCharsets.US_ASCII)); 23 | return "Basic " + encoded; 24 | } 25 | 26 | @Override 27 | public boolean requiresAuthentication() { 28 | return true; 29 | } 30 | 31 | @Override 32 | public boolean equals(Object o) { 33 | if (this == o) return true; 34 | if (o == null || getClass() != o.getClass()) return false; 35 | BasicAuthStrategy that = (BasicAuthStrategy) o; 36 | return Objects.equals(username, that.username) && 37 | Objects.equals(password, that.password); 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | return Objects.hash(username, password); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/auth_strategy/NoAuthStrategy.java: -------------------------------------------------------------------------------- 1 | package com.twilio.auth_strategy; 2 | 3 | import com.twilio.constant.EnumConstants; 4 | 5 | public class NoAuthStrategy extends AuthStrategy { 6 | 7 | public NoAuthStrategy(String token) { 8 | super(EnumConstants.AuthType.NO_AUTH); 9 | } 10 | 11 | @Override 12 | public String getAuthString() { 13 | return ""; 14 | } 15 | 16 | @Override 17 | public boolean requiresAuthentication() { 18 | return false; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/auth_strategy/TokenAuthStrategy.java: -------------------------------------------------------------------------------- 1 | package com.twilio.auth_strategy; 2 | 3 | import com.auth0.jwt.JWT; 4 | import com.auth0.jwt.interfaces.DecodedJWT; 5 | import com.twilio.constant.EnumConstants; 6 | import com.twilio.http.bearertoken.TokenManager; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | import java.util.Date; 11 | import java.util.Objects; 12 | 13 | public class TokenAuthStrategy extends AuthStrategy { 14 | private String token; 15 | private TokenManager tokenManager; 16 | private static final Logger logger = LoggerFactory.getLogger(TokenAuthStrategy.class); 17 | public TokenAuthStrategy(TokenManager tokenManager) { 18 | super(EnumConstants.AuthType.TOKEN); 19 | this.tokenManager = tokenManager; 20 | } 21 | 22 | @Override 23 | public String getAuthString() { 24 | fetchToken(); 25 | return "Bearer " + token; 26 | } 27 | 28 | @Override 29 | public boolean requiresAuthentication() { 30 | return true; 31 | } 32 | 33 | // Token-specific refresh logic 34 | public void fetchToken() { 35 | if (this.token == null || this.token.isEmpty() || isTokenExpired(this.token)) { 36 | synchronized (TokenAuthStrategy.class){ 37 | if (this.token == null || this.token.isEmpty() || isTokenExpired(this.token)) { 38 | logger.info("Fetching new token for Apis"); 39 | this.token = tokenManager.fetchAccessToken(); 40 | } 41 | } 42 | } 43 | } 44 | 45 | @Override 46 | public boolean equals(Object o) { 47 | if (this == o) return true; 48 | if (o == null || getClass() != o.getClass()) return false; 49 | TokenAuthStrategy that = (TokenAuthStrategy) o; 50 | return Objects.equals(token, that.token) && 51 | Objects.equals(tokenManager, that.tokenManager); 52 | } 53 | @Override 54 | public int hashCode() { 55 | return Objects.hash(token, tokenManager); 56 | } 57 | 58 | public boolean isTokenExpired(final String token) { 59 | DecodedJWT jwt = JWT.decode(token); 60 | Date expiresAt = jwt.getExpiresAt(); 61 | // Add a buffer of 30 seconds 62 | long bufferMilliseconds = 30 * 1000; 63 | Date bufferExpiresAt = new Date(expiresAt.getTime() - bufferMilliseconds); 64 | return bufferExpiresAt.before(new Date()); 65 | } 66 | } -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/Creator.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base; 2 | 3 | import com.twilio.Twilio; 4 | import com.twilio.http.TwilioRestClient; 5 | 6 | import java.util.concurrent.CompletableFuture; 7 | 8 | /** 9 | * Executor for creation of a resource. 10 | * 11 | * @param type of the resource 12 | */ 13 | public abstract class Creator { 14 | 15 | /** 16 | * Execute an async request using default client. 17 | * 18 | * @return future that resolves to requested object 19 | */ 20 | public CompletableFuture createAsync() { 21 | return createAsync(Twilio.getRestClient()); 22 | } 23 | 24 | /** 25 | * Execute an async request using specified client. 26 | * 27 | * @param client client used to make request 28 | * @return future that resolves to requested object 29 | */ 30 | public CompletableFuture createAsync(final TwilioRestClient client) { 31 | return CompletableFuture.supplyAsync(() -> create(client), Twilio.getExecutorService()); 32 | } 33 | 34 | /** 35 | * Execute a request using default client. 36 | * 37 | * @return Requested object 38 | */ 39 | public T create() { 40 | return create(Twilio.getRestClient()); 41 | } 42 | 43 | /** 44 | * Execute a request using specified client. 45 | * 46 | * @param client client used to make request 47 | * @return Requested object 48 | */ 49 | public abstract T create(final TwilioRestClient client); 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/Deleter.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base; 2 | 3 | import com.twilio.Twilio; 4 | import com.twilio.http.TwilioRestClient; 5 | 6 | import java.util.concurrent.CompletableFuture; 7 | 8 | /** 9 | * Executor for deletes of a resource. 10 | * 11 | * @param type of the resource 12 | */ 13 | public abstract class Deleter { 14 | 15 | /** 16 | * Execute an async request using default client. 17 | * 18 | * @return future that resolves to true if the object was deleted 19 | */ 20 | public CompletableFuture deleteAsync() { 21 | return deleteAsync(Twilio.getRestClient()); 22 | } 23 | 24 | /** 25 | * Execute an async request using specified client. 26 | * 27 | * @param client client used to make request 28 | * @return future that resolves to true if the object was deleted 29 | */ 30 | public CompletableFuture deleteAsync(final TwilioRestClient client) { 31 | return CompletableFuture.supplyAsync(() -> delete(client), Twilio.getExecutorService()); 32 | } 33 | 34 | /** 35 | * Execute a request using default client. 36 | * 37 | * @return true if the object was deleted 38 | */ 39 | public boolean delete() { 40 | return delete(Twilio.getRestClient()); 41 | } 42 | 43 | /** 44 | * Execute a request using specified client. 45 | * 46 | * @param client client used to make request 47 | * @return true if the object was deleted 48 | */ 49 | public abstract boolean delete(final TwilioRestClient client); 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/Fetcher.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base; 2 | 3 | import com.twilio.Twilio; 4 | import com.twilio.http.TwilioRestClient; 5 | 6 | import java.util.concurrent.CompletableFuture; 7 | 8 | /** 9 | * Executor for fetches of a resource. 10 | * 11 | * @param type of the resource 12 | */ 13 | public abstract class Fetcher { 14 | 15 | /** 16 | * Execute an async request using default client. 17 | * 18 | * @return future that resolves to requested object 19 | */ 20 | public CompletableFuture fetchAsync() { 21 | return fetchAsync(Twilio.getRestClient()); 22 | } 23 | 24 | /** 25 | * Execute an async request using specified client. 26 | * 27 | * @param client client used to make request 28 | * @return future that resolves to requested object 29 | */ 30 | public CompletableFuture fetchAsync(final TwilioRestClient client) { 31 | return CompletableFuture.supplyAsync(() -> fetch(client), Twilio.getExecutorService()); 32 | } 33 | 34 | /** 35 | * Execute a request using default client. 36 | * 37 | * @return Requested object 38 | */ 39 | public T fetch() { 40 | return fetch(Twilio.getRestClient()); 41 | } 42 | 43 | /** 44 | * Execute a request using specified client. 45 | * 46 | * @param client client used to make request 47 | * @return Requested object 48 | */ 49 | public abstract T fetch(final TwilioRestClient client); 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/Resource.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base; 2 | 3 | import java.io.Serializable; 4 | 5 | public abstract class Resource implements Serializable { 6 | 7 | private static final long serialVersionUID = -5898012691404059595L; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/Updater.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base; 2 | 3 | import com.twilio.Twilio; 4 | import com.twilio.http.TwilioRestClient; 5 | 6 | import java.util.concurrent.CompletableFuture; 7 | 8 | /** 9 | * Executor for updates of a resource. 10 | * 11 | * @param type of the resource 12 | */ 13 | public abstract class Updater { 14 | 15 | /** 16 | * Execute an async request using default client. 17 | * 18 | * @return future that resolves to requested object 19 | */ 20 | public CompletableFuture updateAsync() { 21 | return updateAsync(Twilio.getRestClient()); 22 | } 23 | 24 | /** 25 | * Execute an async request using specified client. 26 | * 27 | * @param client client used to make request 28 | * @return future that resolves to requested object 29 | */ 30 | public CompletableFuture updateAsync(final TwilioRestClient client) { 31 | return CompletableFuture.supplyAsync(() -> update(client), Twilio.getExecutorService()); 32 | } 33 | 34 | /** 35 | * Execute a request using default client. 36 | * 37 | * @return Requested object 38 | */ 39 | public T update() { 40 | return update(Twilio.getRestClient()); 41 | } 42 | 43 | /** 44 | * Execute a request using specified client. 45 | * 46 | * @param client client used to make request 47 | * @return Requested object 48 | */ 49 | public abstract T update(final TwilioRestClient client); 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/bearertoken/Creator.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base.bearertoken; 2 | 3 | import com.twilio.TwilioOrgsTokenAuth; 4 | import com.twilio.http.bearertoken.BearerTokenTwilioRestClient; 5 | 6 | import java.util.concurrent.CompletableFuture; 7 | 8 | /** 9 | * Executor for creation of a resource. 10 | * 11 | * @param type of the resource 12 | */ 13 | public abstract class Creator { 14 | 15 | /** 16 | * Execute an async request using default client. 17 | * 18 | * @return future that resolves to requested object 19 | */ 20 | public CompletableFuture createAsync() { 21 | return createAsync(TwilioOrgsTokenAuth.getRestClient()); 22 | } 23 | 24 | /** 25 | * Execute an async request using specified client. 26 | * 27 | * @param client client used to make request 28 | * @return future that resolves to requested object 29 | */ 30 | public CompletableFuture createAsync(final BearerTokenTwilioRestClient client) { 31 | return CompletableFuture.supplyAsync(() -> create(client), TwilioOrgsTokenAuth.getExecutorService()); 32 | } 33 | 34 | /** 35 | * Execute a request using default client. 36 | * 37 | * @return Requested object 38 | */ 39 | public T create() { 40 | return create(TwilioOrgsTokenAuth.getRestClient()); 41 | } 42 | 43 | /** 44 | * Execute a request using specified client. 45 | * 46 | * @param client client used to make request 47 | * @return Requested object 48 | */ 49 | public abstract T create(final BearerTokenTwilioRestClient client); 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/bearertoken/Deleter.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base.bearertoken; 2 | 3 | import com.twilio.Twilio; 4 | import com.twilio.TwilioOrgsTokenAuth; 5 | import com.twilio.http.bearertoken.BearerTokenTwilioRestClient; 6 | 7 | import java.util.concurrent.CompletableFuture; 8 | 9 | /** 10 | * Executor for deletes of a resource. 11 | * 12 | * @param type of the resource 13 | */ 14 | public abstract class Deleter { 15 | 16 | /** 17 | * Execute an async request using default client. 18 | * 19 | * @return future that resolves to true if the object was deleted 20 | */ 21 | public CompletableFuture deleteAsync() { 22 | return deleteAsync(TwilioOrgsTokenAuth.getRestClient()); 23 | } 24 | 25 | /** 26 | * Execute an async request using specified client. 27 | * 28 | * @param client client used to make request 29 | * @return future that resolves to true if the object was deleted 30 | */ 31 | public CompletableFuture deleteAsync(final BearerTokenTwilioRestClient client) { 32 | return CompletableFuture.supplyAsync(() -> delete(client), Twilio.getExecutorService()); 33 | } 34 | 35 | /** 36 | * Execute a request using default client. 37 | * 38 | * @return true if the object was deleted 39 | */ 40 | public boolean delete() { 41 | return delete(TwilioOrgsTokenAuth.getRestClient()); 42 | } 43 | 44 | /** 45 | * Execute a request using specified client. 46 | * 47 | * @param client client used to make request 48 | * @return true if the object was deleted 49 | */ 50 | public abstract boolean delete(final BearerTokenTwilioRestClient client); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/bearertoken/Fetcher.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base.bearertoken; 2 | 3 | import com.twilio.TwilioOrgsTokenAuth; 4 | import com.twilio.http.bearertoken.BearerTokenTwilioRestClient; 5 | 6 | import java.util.concurrent.CompletableFuture; 7 | 8 | /** 9 | * Executor for fetches of a resource. 10 | * 11 | * @param type of the resource 12 | */ 13 | public abstract class Fetcher { 14 | 15 | /** 16 | * Execute an async request using default client. 17 | * 18 | * @return future that resolves to requested object 19 | */ 20 | public CompletableFuture fetchAsync() { 21 | return fetchAsync(TwilioOrgsTokenAuth.getRestClient()); 22 | } 23 | 24 | /** 25 | * Execute an async request using specified client. 26 | * 27 | * @param client client used to make request 28 | * @return future that resolves to requested object 29 | */ 30 | public CompletableFuture fetchAsync(final BearerTokenTwilioRestClient client) { 31 | return CompletableFuture.supplyAsync(() -> fetch(client), TwilioOrgsTokenAuth.getExecutorService()); 32 | } 33 | 34 | /** 35 | * Execute a request using default client. 36 | * 37 | * @return Requested object 38 | */ 39 | public T fetch() { 40 | return fetch(TwilioOrgsTokenAuth.getRestClient()); 41 | } 42 | 43 | /** 44 | * Execute a request using specified client. 45 | * 46 | * @param client client used to make request 47 | * @return Requested object 48 | */ 49 | public abstract T fetch(final BearerTokenTwilioRestClient client); 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/bearertoken/Resource.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base.bearertoken; 2 | 3 | import java.io.Serializable; 4 | 5 | public abstract class Resource implements Serializable { 6 | 7 | private static final long serialVersionUID = -5898012691404059591L; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/bearertoken/Updater.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base.bearertoken; 2 | 3 | import com.twilio.TwilioOrgsTokenAuth; 4 | import com.twilio.http.bearertoken.BearerTokenTwilioRestClient; 5 | 6 | import java.util.concurrent.CompletableFuture; 7 | 8 | /** 9 | * Executor for updates of a resource. 10 | * 11 | * @param type of the resource 12 | */ 13 | public abstract class Updater { 14 | 15 | /** 16 | * Execute an async request using default client. 17 | * 18 | * @return future that resolves to requested object 19 | */ 20 | public CompletableFuture updateAsync() { 21 | return updateAsync(TwilioOrgsTokenAuth.getRestClient()); 22 | } 23 | 24 | /** 25 | * Execute an async request using specified client. 26 | * 27 | * @param client client used to make request 28 | * @return future that resolves to requested object 29 | */ 30 | public CompletableFuture updateAsync(final BearerTokenTwilioRestClient client) { 31 | return CompletableFuture.supplyAsync(() -> update(client), TwilioOrgsTokenAuth.getExecutorService()); 32 | } 33 | 34 | /** 35 | * Execute a request using default client. 36 | * 37 | * @return Requested object 38 | */ 39 | public T update() { 40 | return update(TwilioOrgsTokenAuth.getRestClient()); 41 | } 42 | 43 | /** 44 | * Execute a request using specified client. 45 | * 46 | * @param client client used to make request 47 | * @return Requested object 48 | */ 49 | public abstract T update(final BearerTokenTwilioRestClient client); 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/noauth/Creator.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base.noauth; 2 | 3 | import com.twilio.Twilio; 4 | import com.twilio.TwilioNoAuth; 5 | import com.twilio.http.noauth.NoAuthTwilioRestClient; 6 | 7 | import java.util.concurrent.CompletableFuture; 8 | 9 | /** 10 | * Executor for creation of a resource. 11 | * 12 | * @param type of the resource 13 | */ 14 | public abstract class Creator { 15 | 16 | /** 17 | * Execute an async request using default client. 18 | * 19 | * @return future that resolves to requested object 20 | */ 21 | public CompletableFuture createAsync() { 22 | return createAsync(TwilioNoAuth.getRestClient()); 23 | } 24 | 25 | /** 26 | * Execute an async request using specified client. 27 | * 28 | * @param client client used to make request 29 | * @return future that resolves to requested object 30 | */ 31 | public CompletableFuture createAsync(final NoAuthTwilioRestClient client) { 32 | return CompletableFuture.supplyAsync(() -> create(client), Twilio.getExecutorService()); 33 | } 34 | 35 | /** 36 | * Execute a request using default client. 37 | * 38 | * @return Requested object 39 | */ 40 | public T create() { 41 | return create(TwilioNoAuth.getRestClient()); 42 | } 43 | 44 | /** 45 | * Execute a request using specified client. 46 | * 47 | * @param client client used to make request 48 | * @return Requested object 49 | */ 50 | public abstract T create(final NoAuthTwilioRestClient client); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/noauth/Deleter.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base.noauth; 2 | 3 | import com.twilio.Twilio; 4 | import com.twilio.TwilioNoAuth; 5 | import com.twilio.http.noauth.NoAuthTwilioRestClient; 6 | 7 | import java.util.concurrent.CompletableFuture; 8 | 9 | /** 10 | * Executor for deletes of a resource. 11 | * 12 | * @param type of the resource 13 | */ 14 | public abstract class Deleter { 15 | 16 | /** 17 | * Execute an async request using default client. 18 | * 19 | * @return future that resolves to true if the object was deleted 20 | */ 21 | public CompletableFuture deleteAsync() { 22 | return deleteAsync(TwilioNoAuth.getRestClient()); 23 | } 24 | 25 | /** 26 | * Execute an async request using specified client. 27 | * 28 | * @param client client used to make request 29 | * @return future that resolves to true if the object was deleted 30 | */ 31 | public CompletableFuture deleteAsync(final NoAuthTwilioRestClient client) { 32 | return CompletableFuture.supplyAsync(() -> delete(client), Twilio.getExecutorService()); 33 | } 34 | 35 | /** 36 | * Execute a request using default client. 37 | * 38 | * @return true if the object was deleted 39 | */ 40 | public boolean delete() { 41 | return delete(TwilioNoAuth.getRestClient()); 42 | } 43 | 44 | /** 45 | * Execute a request using specified client. 46 | * 47 | * @param client client used to make request 48 | * @return true if the object was deleted 49 | */ 50 | public abstract boolean delete(final NoAuthTwilioRestClient client); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/noauth/Fetcher.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base.noauth; 2 | 3 | import com.twilio.Twilio; 4 | 5 | import com.twilio.TwilioNoAuth; 6 | import com.twilio.http.noauth.NoAuthTwilioRestClient; 7 | 8 | import java.util.concurrent.CompletableFuture; 9 | 10 | /** 11 | * Executor for fetches of a resource. 12 | * 13 | * @param type of the resource 14 | */ 15 | public abstract class Fetcher { 16 | 17 | /** 18 | * Execute an async request using default client. 19 | * 20 | * @return future that resolves to requested object 21 | */ 22 | public CompletableFuture fetchAsync() { 23 | return fetchAsync(TwilioNoAuth.getRestClient()); 24 | } 25 | 26 | /** 27 | * Execute an async request using specified client. 28 | * 29 | * @param client client used to make request 30 | * @return future that resolves to requested object 31 | */ 32 | public CompletableFuture fetchAsync(final NoAuthTwilioRestClient client) { 33 | return CompletableFuture.supplyAsync(() -> fetch(client), Twilio.getExecutorService()); 34 | } 35 | 36 | /** 37 | * Execute a request using default client. 38 | * 39 | * @return Requested object 40 | */ 41 | public T fetch() { 42 | return fetch(TwilioNoAuth.getRestClient()); 43 | } 44 | 45 | /** 46 | * Execute a request using specified client. 47 | * 48 | * @param client client used to make request 49 | * @return Requested object 50 | */ 51 | public abstract T fetch(final NoAuthTwilioRestClient client); 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/noauth/Resource.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base.noauth; 2 | 3 | import java.io.Serializable; 4 | 5 | public abstract class Resource implements Serializable { 6 | 7 | private static final long serialVersionUID = -5898012691404059592L; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/base/noauth/Updater.java: -------------------------------------------------------------------------------- 1 | package com.twilio.base.noauth; 2 | 3 | import com.twilio.Twilio; 4 | import com.twilio.TwilioNoAuth; 5 | import com.twilio.http.noauth.NoAuthTwilioRestClient; 6 | 7 | import java.util.concurrent.CompletableFuture; 8 | 9 | /** 10 | * Executor for updates of a resource. 11 | * 12 | * @param type of the resource 13 | */ 14 | public abstract class Updater { 15 | 16 | /** 17 | * Execute an async request using default client. 18 | * 19 | * @return future that resolves to requested object 20 | */ 21 | public CompletableFuture updateAsync() { 22 | return updateAsync(TwilioNoAuth.getRestClient()); 23 | } 24 | 25 | /** 26 | * Execute an async request using specified client. 27 | * 28 | * @param client client used to make request 29 | * @return future that resolves to requested object 30 | */ 31 | public CompletableFuture updateAsync(final NoAuthTwilioRestClient client) { 32 | return CompletableFuture.supplyAsync(() -> update(client), Twilio.getExecutorService()); 33 | } 34 | 35 | /** 36 | * Execute a request using default client. 37 | * 38 | * @return Requested object 39 | */ 40 | public T update() { 41 | return update(TwilioNoAuth.getRestClient()); 42 | } 43 | 44 | /** 45 | * Execute a request using specified client. 46 | * 47 | * @param client client used to make request 48 | * @return Requested object 49 | */ 50 | public abstract T update(final NoAuthTwilioRestClient client); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/constant/EnumConstants.java: -------------------------------------------------------------------------------- 1 | package com.twilio.constant; 2 | 3 | import lombok.Getter; 4 | import lombok.RequiredArgsConstructor; 5 | 6 | public class EnumConstants { 7 | 8 | @Getter 9 | @RequiredArgsConstructor 10 | public enum ContentType { 11 | JSON("application/json"), 12 | FORM_URLENCODED("application/x-www-form-urlencoded"), 13 | MULTIPART_FORM_DATA("multipart/form-data"); 14 | 15 | private final String value; 16 | } 17 | 18 | @Getter 19 | @RequiredArgsConstructor 20 | public enum AuthType { 21 | NO_AUTH("noauth"), 22 | BASIC("basic"), 23 | TOKEN("token"), 24 | API_KEY("api_key"), 25 | CLIENT_CREDENTIALS("client_credentials"); 26 | 27 | private final String value; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/converter/Converter.java: -------------------------------------------------------------------------------- 1 | package com.twilio.converter; 2 | 3 | 4 | import com.fasterxml.jackson.core.JsonProcessingException; 5 | import com.fasterxml.jackson.databind.ObjectMapper; 6 | 7 | import java.io.IOException; 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | 11 | public class Converter { 12 | 13 | private static final ObjectMapper MAPPER = new ObjectMapper(); 14 | 15 | /** 16 | * Convert a map to a JSON String. 17 | * 18 | * @param map map to convert 19 | * @return converted JSON string 20 | */ 21 | public static String mapToJson(final Map map) { 22 | try { 23 | return MAPPER.writeValueAsString(map); 24 | } catch (JsonProcessingException e) { 25 | return null; 26 | } 27 | } 28 | 29 | /** 30 | * Convert a JSON String to a map. 31 | * 32 | * @param json string representing the json hash map 33 | * @return HashMap read 34 | */ 35 | public static Map jsonToMap(final String json) { 36 | try { 37 | return MAPPER.readValue(json, HashMap.class); 38 | } catch (IOException e) { 39 | return null; 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/converter/CurrencyDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.twilio.converter; 2 | 3 | import com.fasterxml.jackson.core.JsonParser; 4 | import com.fasterxml.jackson.databind.DeserializationContext; 5 | import com.fasterxml.jackson.databind.JsonDeserializer; 6 | 7 | import java.io.IOException; 8 | import java.util.Currency; 9 | 10 | public class CurrencyDeserializer extends JsonDeserializer { 11 | 12 | @Override 13 | public Currency deserialize(JsonParser jsonParser, 14 | DeserializationContext deserializationContext) throws IOException { 15 | 16 | String currencyCode = jsonParser.readValueAs(String.class); 17 | return Currency.getInstance(currencyCode.toUpperCase()); 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/converter/PrefixedCollapsibleMap.java: -------------------------------------------------------------------------------- 1 | package com.twilio.converter; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collections; 5 | import java.util.HashMap; 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | public class PrefixedCollapsibleMap { 10 | 11 | private static Map flatten( 12 | Map map, 13 | Map result, 14 | List previous 15 | ) { 16 | for (Map.Entry entry : map.entrySet()) { 17 | List next = new ArrayList<>(previous); 18 | next.add(entry.getKey()); 19 | 20 | if (entry.getValue() instanceof Map) { 21 | flatten((Map) entry.getValue(), result, next); 22 | } else { 23 | result.put(String.join(".", next), entry.getValue().toString()); 24 | } 25 | } 26 | 27 | return result; 28 | } 29 | 30 | /** 31 | * Flatten a Map of String, Object into a Map of String, String where keys are '.' separated 32 | * and prepends a key. 33 | * 34 | * @param map map to transform 35 | * @param prefix key to prepend 36 | * @return flattened map 37 | */ 38 | public static Map serialize(Map map, String prefix) { 39 | if (map == null || map.isEmpty()) { 40 | return Collections.emptyMap(); 41 | } 42 | 43 | Map flattened = flatten(map, new HashMap(), new ArrayList()); 44 | 45 | Map result = new HashMap<>(); 46 | for (Map.Entry entry : flattened.entrySet()) { 47 | result.put(prefix + "." + entry.getKey(), entry.getValue()); 48 | } 49 | 50 | return result; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/converter/Promoter.java: -------------------------------------------------------------------------------- 1 | package com.twilio.converter; 2 | 3 | import com.twilio.type.PhoneNumber; 4 | import com.twilio.type.Twiml; 5 | 6 | import java.net.URI; 7 | import java.net.URISyntaxException; 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | public class Promoter { 12 | 13 | /** 14 | * Create a @see java.net.URI from a string 15 | * 16 | * @param url url to convert 17 | * @return built @see java.net.URI 18 | */ 19 | public static URI uriFromString(final String url) { 20 | try { 21 | return new URI(url); 22 | } catch (URISyntaxException | NullPointerException e) { 23 | return null; 24 | } 25 | } 26 | 27 | /** 28 | * Create a @see com.twilio.types.PhoneNumber from a string 29 | * 30 | * @param pn PhoneNumber to convert 31 | * @return built @see com.twilio.types.PhoneNumber 32 | */ 33 | public static PhoneNumber phoneNumberFromString(final String pn) { 34 | return new PhoneNumber(pn); 35 | } 36 | 37 | /** 38 | * Create a @see com.twilio.types.Twiml from a string 39 | * 40 | * @param twiml Twiml to convert 41 | * @return built @see com.twilio.types.Twiml 42 | */ 43 | public static Twiml twimlFromString(final String twiml) { 44 | return new Twiml(twiml); 45 | } 46 | 47 | 48 | 49 | /** 50 | * Create a list from a single element. 51 | * 52 | * @param one the single element 53 | * @param type of the element 54 | * @return List containing the single element 55 | */ 56 | public static List listOfOne(final T one) { 57 | List list = new ArrayList<>(); 58 | list.add(one); 59 | return list; 60 | } 61 | 62 | /** 63 | * Convert a string to a enum type. 64 | * 65 | * @param value string value 66 | * @param values enum values 67 | * @param enum type 68 | * @return converted enum if able to convert; null otherwise 69 | */ 70 | public static > T enumFromString(final String value, final T[] values) { 71 | if (value == null) { 72 | return null; 73 | } 74 | 75 | for (T v : values) { 76 | if (v.toString().equalsIgnoreCase(value)) { 77 | return v; 78 | } 79 | } 80 | 81 | return null; 82 | } 83 | 84 | 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/credential/CredentialProvider.java: -------------------------------------------------------------------------------- 1 | package com.twilio.credential; 2 | 3 | import com.twilio.auth_strategy.AuthStrategy; 4 | import com.twilio.auth_strategy.TokenAuthStrategy; 5 | import com.twilio.constant.EnumConstants; 6 | import com.twilio.http.Request; 7 | import lombok.Getter; 8 | 9 | public abstract class CredentialProvider { 10 | @Getter 11 | private EnumConstants.AuthType authType; 12 | 13 | public CredentialProvider(EnumConstants.AuthType authType) { 14 | this.authType = authType; 15 | } 16 | 17 | public abstract AuthStrategy toAuthStrategy(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/credential/orgs/OrgsClientCredentialProvider.java: -------------------------------------------------------------------------------- 1 | package com.twilio.credential.orgs; 2 | 3 | public class OrgsClientCredentialProvider { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/example/AccessTokenExample.java: -------------------------------------------------------------------------------- 1 | package com.twilio.example; 2 | 3 | import com.twilio.jwt.accesstoken.AccessToken; 4 | import com.twilio.jwt.accesstoken.VoiceGrant; 5 | import java.util.HashMap; 6 | import com.google.gson.Gson; 7 | 8 | public class AccessTokenExample { 9 | public static void main(String args[]){ 10 | String acctSid = System.getenv("TWILIO_ACCOUNT_SID"); 11 | String applicationSid = System.getenv("TWILIO_TWIML_APP_SID"); 12 | String apiKey = System.getenv("API_KEY"); 13 | String apiSecret = System.getenv("API_SECRET"); 14 | // Create Voice grant 15 | VoiceGrant grant = new VoiceGrant(); 16 | grant.setOutgoingApplicationSid(applicationSid); 17 | 18 | // Optional: add to allow incoming calls 19 | grant.setIncomingAllow(true); 20 | 21 | String randomIdentity = "random-identity"; 22 | // Create access token 23 | AccessToken accessToken = new AccessToken.Builder(acctSid, apiKey, apiSecret.getBytes()) 24 | .identity(randomIdentity) 25 | .grant(grant) 26 | .build(); 27 | 28 | String token = accessToken.toJwt(); 29 | 30 | // create JSON response payload 31 | HashMap json = new HashMap<>(); 32 | json.put("identity", randomIdentity); 33 | json.put("token", token); 34 | 35 | Gson gson = new Gson(); 36 | System.out.println(gson.toJson(json)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/example/TwiMLResponseExample.java: -------------------------------------------------------------------------------- 1 | package com.twilio.example; 2 | 3 | import com.twilio.twiml.voice.Conference; 4 | import com.twilio.twiml.voice.Dial; 5 | import com.twilio.twiml.voice.Gather; 6 | import com.twilio.twiml.voice.Redirect; 7 | import com.twilio.twiml.voice.Say; 8 | import com.twilio.twiml.TwiMLException; 9 | import com.twilio.twiml.VoiceResponse; 10 | 11 | import java.net.URI; 12 | import java.net.URISyntaxException; 13 | 14 | /** 15 | * The Class TwiMLResponseExample. 16 | */ 17 | @SuppressWarnings("checkstyle:abbreviationaswordinname") 18 | public class TwiMLResponseExample { 19 | 20 | /** 21 | * TwiML example usage. 22 | * 23 | * @param args command line args 24 | * @throws TwiMLException if cannot generate TwiML 25 | */ 26 | public static void main(final String[] args) throws TwiMLException, URISyntaxException { 27 | // Say 28 | Say say = new Say.Builder("Hello World!") 29 | .voice(Say.Voice.MAN) 30 | .loop(5) 31 | .build(); 32 | 33 | VoiceResponse response = new VoiceResponse.Builder() 34 | .say(say) 35 | .build(); 36 | 37 | System.out.println(response.toXml()); 38 | 39 | // Gather, Redirect 40 | Gather gather = new Gather.Builder() 41 | .numDigits(10) 42 | .say(new Say.Builder("Press 1").build()) 43 | .build(); 44 | 45 | Redirect redirect = new Redirect.Builder(new URI("https://example.com")).build(); 46 | 47 | response = new VoiceResponse.Builder() 48 | .gather(gather) 49 | .redirect(redirect) 50 | .build(); 51 | 52 | System.out.println(response.toXml()); 53 | 54 | // Conference 55 | Conference conference = new Conference.Builder("my room") 56 | .beep(Conference.Beep.TRUE) 57 | .build(); 58 | 59 | Dial dial = new Dial.Builder() 60 | .callerId("+1 (555) 555-5555") 61 | .action(new URI("https:///example.com")) 62 | .hangupOnStar(true) 63 | .conference(conference) 64 | .build(); 65 | 66 | response = new VoiceResponse.Builder() 67 | .dial(dial) 68 | .build(); 69 | 70 | System.out.println(response.toXml()); 71 | } 72 | } -------------------------------------------------------------------------------- /src/main/java/com/twilio/example/resource/CallCreatorExample.java: -------------------------------------------------------------------------------- 1 | package com.twilio.example.resource; 2 | 3 | 4 | import com.twilio.Twilio; 5 | import com.twilio.rest.api.v2010.account.Call; 6 | import com.twilio.rest.api.v2010.account.CallCreator; 7 | import com.twilio.exception.ApiException; 8 | import com.twilio.type.PhoneNumber; 9 | 10 | import java.net.URI; 11 | import java.net.URISyntaxException; 12 | 13 | /** 14 | * Example for making a call. 15 | */ 16 | public class CallCreatorExample { 17 | 18 | @SuppressWarnings("checkstyle:javadocmethod") 19 | public static void main(final String[] args) { 20 | Twilio.init("AC123", "AUTH TOKEN"); 21 | 22 | try { 23 | 24 | CallCreator creator = 25 | Call.creator( 26 | "AC123", 27 | new PhoneNumber("+14156085895"), 28 | new PhoneNumber("+14154888928"), 29 | new URI("http://twimlbin.com/4397e62f") 30 | ); 31 | 32 | Call call = creator.create(); 33 | 34 | System.out.println(call.getSid()); 35 | System.out.println(call.getStatus().toString()); 36 | 37 | } catch (URISyntaxException | ApiException e) { 38 | System.err.println("womp womp"); 39 | System.exit(1); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/example/resource/CallDeleterExample.java: -------------------------------------------------------------------------------- 1 | package com.twilio.example.resource; 2 | 3 | 4 | import com.twilio.Twilio; 5 | import com.twilio.rest.api.v2010.account.Call; 6 | import com.twilio.rest.api.v2010.account.CallDeleter; 7 | import com.twilio.exception.ApiException; 8 | 9 | /** 10 | * Call Deletion example. 11 | */ 12 | public class CallDeleterExample { 13 | 14 | @SuppressWarnings("checkstyle:javadocmethod") 15 | public static void main(final String[] args) { 16 | Twilio.init("AC123", "AUTH TOKEN"); 17 | 18 | try { 19 | 20 | CallDeleter deleter = Call.deleter("AC123", "CA123"); 21 | deleter.delete(); 22 | 23 | } catch (ApiException e) { 24 | 25 | System.err.println("womp womp"); 26 | System.exit(1); 27 | 28 | } 29 | 30 | System.out.println("Deleted"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/example/resource/CallFetcherExample.java: -------------------------------------------------------------------------------- 1 | package com.twilio.example.resource; 2 | 3 | import com.twilio.Twilio; 4 | import com.twilio.exception.ApiException; 5 | import com.twilio.rest.api.v2010.account.CallFetcher; 6 | import com.twilio.rest.api.v2010.account.Call; 7 | 8 | /** 9 | * Fetch a call. 10 | */ 11 | public class CallFetcherExample { 12 | 13 | @SuppressWarnings("checkstyle:javadocmethod") 14 | public static void main(String[] args) { 15 | Twilio.init("AC123", "AUTH TOKEN"); 16 | 17 | try { 18 | 19 | CallFetcher fetcher = Call.fetcher("AC123", "CA123"); 20 | Call call = fetcher.fetch(); 21 | 22 | System.out.print(call.getSid()); 23 | 24 | } catch (ApiException e) { 25 | 26 | System.err.println("womp womp"); 27 | System.exit(1); 28 | 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/example/resource/CallReaderExample.java: -------------------------------------------------------------------------------- 1 | package com.twilio.example.resource; 2 | 3 | import com.twilio.Twilio; 4 | import com.twilio.exception.ApiException; 5 | import com.twilio.rest.api.v2010.account.Call; 6 | import com.twilio.rest.api.v2010.account.CallReader; 7 | import com.twilio.base.ResourceSet; 8 | 9 | /** 10 | * Fetch a list of calls. 11 | */ 12 | public class CallReaderExample { 13 | 14 | @SuppressWarnings("checkstyle:javadocmethod") 15 | public static void main(final String[] args) { 16 | Twilio.init("AC123", "AUTH TOKEN"); 17 | 18 | try { 19 | 20 | CallReader reader = Call.reader("AC123"); 21 | ResourceSet calls = reader.read(); 22 | 23 | int idx = 1; 24 | for (Call call : calls) { 25 | System.out.println(idx + ": " + call.getSid()); 26 | idx++; 27 | } 28 | 29 | System.out.println("All Done"); 30 | 31 | } catch (ApiException e) { 32 | System.err.println("womp womp"); 33 | System.exit(1); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/example/resource/CallUpdaterExample.java: -------------------------------------------------------------------------------- 1 | package com.twilio.example.resource; 2 | 3 | import com.twilio.Twilio; 4 | import com.twilio.exception.ApiException; 5 | import com.twilio.rest.api.v2010.account.CallCreator; 6 | import com.twilio.rest.api.v2010.account.Call; 7 | import com.twilio.rest.api.v2010.account.CallUpdater; 8 | import com.twilio.type.PhoneNumber; 9 | 10 | import java.io.IOException; 11 | import java.net.URI; 12 | import java.net.URISyntaxException; 13 | 14 | /** 15 | * Update a call. 16 | */ 17 | public class CallUpdaterExample { 18 | 19 | @SuppressWarnings("checkstyle:javadocmethod") 20 | public static void main(final String[] args) { 21 | Twilio.init("AC123", "AUTH TOKEN"); 22 | 23 | try { 24 | 25 | CallCreator creator = Call.creator( 26 | "AC123", 27 | new PhoneNumber("+14156085895"), 28 | new PhoneNumber("+14154888928"), 29 | new URI("http://twimlbin.com/cc413d9d") 30 | ); 31 | Call call = creator.create(); 32 | 33 | System.out.println(call.getSid()); 34 | System.out.println(call.getStatus()); 35 | 36 | System.out.println("press enter once call is accepted"); 37 | try { 38 | System.in.read(); 39 | } catch (final IOException e) { 40 | System.out.println("whoops"); 41 | } 42 | 43 | CallUpdater updater = Call.updater( 44 | "AC123", 45 | call.getSid() 46 | ).setUrl(new URI("http://twimlbin.com/4397e62f")); 47 | Call updated = updater.update(); 48 | 49 | System.out.println(updated.getSid()); 50 | System.out.println(updated.getStatus()); 51 | 52 | } catch (URISyntaxException | ApiException e) { 53 | 54 | System.err.println("womp womp"); 55 | System.exit(1); 56 | 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/exception/ApiConnectionException.java: -------------------------------------------------------------------------------- 1 | package com.twilio.exception; 2 | 3 | public class ApiConnectionException extends TwilioException { 4 | 5 | private static final long serialVersionUID = 6354388724599793830L; 6 | 7 | public ApiConnectionException(final String message) { 8 | super(message); 9 | } 10 | 11 | public ApiConnectionException(final String message, final Throwable cause) { 12 | super(message, cause); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/exception/AuthenticationException.java: -------------------------------------------------------------------------------- 1 | package com.twilio.exception; 2 | 3 | public class AuthenticationException extends TwilioException { 4 | 5 | private static final long serialVersionUID = -7779574072471080781L; 6 | 7 | public AuthenticationException(final String message) { 8 | super(message); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/exception/CertificateValidationException.java: -------------------------------------------------------------------------------- 1 | package com.twilio.exception; 2 | 3 | import com.twilio.http.Request; 4 | import com.twilio.http.Response; 5 | 6 | public class CertificateValidationException extends TwilioException { 7 | 8 | private final Request request; 9 | private final Response response; 10 | 11 | public CertificateValidationException(final String message, final Request request, final Response response) { 12 | super(message); 13 | 14 | this.request = request; 15 | this.response = response; 16 | } 17 | 18 | public CertificateValidationException(final String message, final Request request) { 19 | this(message, request, null); 20 | } 21 | 22 | public Request getRequest() { return this.request; } 23 | public Response getResponse() { return this.response; } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/exception/InvalidRequestException.java: -------------------------------------------------------------------------------- 1 | package com.twilio.exception; 2 | 3 | public class InvalidRequestException extends TwilioException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | private final String param; 8 | 9 | public InvalidRequestException(final String message) { 10 | super(message, null); 11 | this.param = null; 12 | } 13 | 14 | public InvalidRequestException(final String message, final String param) { 15 | super(message, null); 16 | this.param = param; 17 | } 18 | 19 | public InvalidRequestException(final String message, final String param, final Throwable cause) { 20 | super(message, cause); 21 | this.param = param; 22 | } 23 | 24 | public String getParam() { 25 | return param; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/exception/TwilioException.java: -------------------------------------------------------------------------------- 1 | package com.twilio.exception; 2 | 3 | public abstract class TwilioException extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 2516935680980388130L; 6 | 7 | public TwilioException(final String message) { 8 | this(message, null); 9 | } 10 | 11 | public TwilioException(final String message, final Throwable cause) { 12 | super(message, cause); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/http/HttpMethod.java: -------------------------------------------------------------------------------- 1 | package com.twilio.http; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.twilio.converter.Promoter; 5 | 6 | public enum HttpMethod { 7 | GET("GET"), 8 | POST("POST"), 9 | PUT("PUT"), 10 | PATCH("PATCH"), 11 | DELETE("DELETE"), 12 | HEAD("HEAD"), 13 | OPTIONS("OPTIONS"); 14 | 15 | private final String method; 16 | 17 | HttpMethod(final String method) { 18 | this.method = method; 19 | } 20 | 21 | public String toString() { 22 | return method; 23 | } 24 | 25 | @JsonCreator 26 | public static HttpMethod forValue(final String value) { 27 | return Promoter.enumFromString(value, HttpMethod.values()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/http/HttpUtility.java: -------------------------------------------------------------------------------- 1 | package com.twilio.http; 2 | 3 | import com.twilio.Twilio; 4 | import lombok.experimental.UtilityClass; 5 | 6 | import java.util.List; 7 | 8 | @UtilityClass 9 | public class HttpUtility { 10 | public String getUserAgentString(final List userAgentExtensions) { 11 | StringBuilder userAgentString = new StringBuilder(); 12 | userAgentString.append("twilio-java/") 13 | .append(Twilio.VERSION) 14 | .append(" (") 15 | .append(Twilio.OS_NAME) 16 | .append(" ") 17 | .append(Twilio.OS_ARCH) 18 | .append(") ") 19 | .append("java/") 20 | .append(Twilio.JAVA_VERSION); 21 | 22 | if (userAgentExtensions != null && !userAgentExtensions.isEmpty()) { 23 | userAgentExtensions.stream().forEach(userAgentExtension -> { 24 | userAgentString.append(" "); 25 | userAgentString.append(userAgentExtension); 26 | }); 27 | } 28 | 29 | return userAgentString.toString(); 30 | } 31 | 32 | public String getUserAgentString(final List userAgentExtensions, final boolean isCustomClient) { 33 | return isCustomClient ? getUserAgentString(userAgentExtensions) + " custom" 34 | : getUserAgentString(userAgentExtensions); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/http/bearertoken/BearerTokenRequest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.http.bearertoken; 2 | 3 | import com.twilio.http.HttpMethod; 4 | import com.twilio.http.IRequest; 5 | 6 | public class BearerTokenRequest extends IRequest { 7 | 8 | private String accessToken; 9 | 10 | public BearerTokenRequest(HttpMethod method, String url) { 11 | super(method, url); 12 | } 13 | 14 | public BearerTokenRequest(HttpMethod method, String domain, String uri) { 15 | super(method, domain, uri); 16 | } 17 | 18 | public BearerTokenRequest(HttpMethod method, String domain, String uri, String region) { 19 | super(method, domain, uri, region); 20 | } 21 | 22 | /** 23 | * Create auth string from accessToken. 24 | * 25 | * @return basic authentication string 26 | */ 27 | public String getAuthString() { 28 | return "Bearer " + accessToken; 29 | } 30 | 31 | public boolean requiresAuthentication() { 32 | return accessToken != null; 33 | } 34 | 35 | public void setAuth(String accessToken) { 36 | this.accessToken = accessToken; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/http/bearertoken/OrgsTokenManager.java: -------------------------------------------------------------------------------- 1 | package com.twilio.http.bearertoken; 2 | 3 | import com.twilio.annotations.Beta; 4 | import com.twilio.exception.ApiException; 5 | import com.twilio.rest.iam.v1.Token; 6 | import com.twilio.rest.iam.v1.TokenCreator; 7 | @Beta 8 | public class OrgsTokenManager implements TokenManager{ 9 | 10 | private final String grantType; 11 | private final String clientId; 12 | private final String clientSecret; 13 | private String code; 14 | private String redirectUri; 15 | private String audience; 16 | private String refreshToken; 17 | private String scope; 18 | 19 | public OrgsTokenManager(String grantType, String clientId, String clientSecret){ 20 | this.grantType = grantType; 21 | this.clientId = clientId; 22 | this.clientSecret = clientSecret; 23 | } 24 | 25 | public OrgsTokenManager(String grantType, String clientId, String clientSecret, String code, String redirectUri, String audience, String refreshToken, String scope){ 26 | this.grantType = grantType; 27 | this.clientId = clientId; 28 | this.clientSecret = clientSecret; 29 | this.code = code; 30 | this.redirectUri = redirectUri; 31 | this.audience = audience; 32 | this.refreshToken = refreshToken; 33 | this.scope = scope; 34 | } 35 | 36 | public synchronized String fetchAccessToken(){ 37 | TokenCreator tokenCreator = Token.creator(grantType, clientId).setClientSecret(clientSecret); 38 | if (this.code != null) tokenCreator.setCode(code); 39 | if (this.redirectUri != null) tokenCreator.setRedirectUri(redirectUri); 40 | if (this.audience != null) tokenCreator.setAudience(audience); 41 | if (this.refreshToken != null) tokenCreator.setRefreshToken(refreshToken); 42 | if (this.scope != null) tokenCreator.setScope(scope); 43 | Token token; 44 | try { 45 | token = tokenCreator.create(); 46 | if(token == null || token.getAccessToken() == null){ 47 | throw new ApiException("Token creation failed"); 48 | } 49 | } catch(Exception e){ 50 | throw new ApiException("Token creation failed"); 51 | } 52 | return token.getAccessToken(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/http/bearertoken/TokenManager.java: -------------------------------------------------------------------------------- 1 | package com.twilio.http.bearertoken; 2 | 3 | public interface TokenManager { 4 | String fetchAccessToken(); 5 | } -------------------------------------------------------------------------------- /src/main/java/com/twilio/http/noauth/NoAuthRequest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.http.noauth; 2 | 3 | import com.twilio.http.HttpMethod; 4 | import com.twilio.http.IRequest; 5 | 6 | public class NoAuthRequest extends IRequest { 7 | 8 | public NoAuthRequest(HttpMethod method, String url) { 9 | super(method, url); 10 | } 11 | 12 | public NoAuthRequest(HttpMethod method, String domain, String uri) { 13 | super(method, domain, uri, null); 14 | } 15 | 16 | public NoAuthRequest(HttpMethod method, String domain, String uri, String region) { 17 | super(method, domain, uri, region); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/jwt/JwtEncodingException.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt; 2 | 3 | /** 4 | * Exception to throw when a JWT cannot be encoded. 5 | */ 6 | public class JwtEncodingException extends RuntimeException { 7 | public JwtEncodingException(Exception e) { 8 | super(e); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/jwt/accesstoken/Grant.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.accesstoken; 2 | 3 | public interface Grant { 4 | 5 | /** 6 | * The key for the grant. 7 | * 8 | * @return The key for the grant. 9 | */ 10 | public String getGrantKey(); 11 | 12 | /** 13 | * The payload for this grant. 14 | * 15 | *

The payload allows us to decouple the user API from how the grant is structured.

16 | * 17 | * @return The payload for this grant. 18 | */ 19 | public Object getPayload(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/jwt/accesstoken/PlaybackGrant.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.accesstoken; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * Grant used to access Twilio Live. 7 | * 8 | *

9 | * For more information see: 10 | * 11 | * https://www.twilio.com/docs/api/rest/access-tokens 12 | * 13 | *

14 | */ 15 | public class PlaybackGrant implements Grant { 16 | 17 | private Map grant; 18 | 19 | /** 20 | * Get the grant payload configured in this grant. 21 | * @return The grant payload or null if not set. 22 | */ 23 | public Map getGrant() { 24 | return this.grant; 25 | } 26 | 27 | /** 28 | * Set the playback grant 29 | * @param grant the playback grant 30 | * @return updated PlaybackGrant instance 31 | */ 32 | public PlaybackGrant setGrant(final Map grant) { 33 | this.grant = grant; 34 | return this; 35 | } 36 | 37 | public String getGrantKey() { 38 | return "player"; 39 | } 40 | 41 | public Object getPayload() { 42 | return this.grant; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/jwt/accesstoken/SyncGrant.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.accesstoken; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | 5 | /** 6 | * Grant used to access Twilio Sync. 7 | * 8 | *

9 | * For more information see: 10 | * 11 | * https://www.twilio.com/docs/api/rest/access-tokens 12 | * 13 | *

14 | */ 15 | public class SyncGrant implements Grant { 16 | 17 | private String serviceSid; 18 | private String endpointId; 19 | 20 | public String getServiceSid() { 21 | return serviceSid; 22 | } 23 | 24 | public SyncGrant setServiceSid(String serviceSid) { 25 | this.serviceSid = serviceSid; 26 | return this; 27 | } 28 | 29 | public String getEndpointId() { 30 | return endpointId; 31 | } 32 | 33 | public SyncGrant setEndpointId(String endpointId) { 34 | this.endpointId = endpointId; 35 | return this; 36 | } 37 | 38 | @Override 39 | public String getGrantKey() { 40 | return "data_sync"; 41 | } 42 | 43 | @Override 44 | public Object getPayload() { 45 | return new SyncGrant.Payload(this); 46 | } 47 | 48 | @SuppressWarnings("checkstyle:membername") 49 | @JsonInclude(JsonInclude.Include.NON_NULL) 50 | public class Payload { 51 | public final String service_sid; 52 | public final String endpoint_id; 53 | 54 | /** 55 | * Create the grant payload. 56 | * 57 | * @param grant Sync grant 58 | */ 59 | public Payload(SyncGrant grant) { 60 | this.service_sid = grant.serviceSid; 61 | this.endpoint_id = grant.endpointId; 62 | } 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/jwt/accesstoken/TaskRouterGrant.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.accesstoken; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | 5 | /** 6 | * Grant used to access Twilio TaskRouter. 7 | * 8 | *

9 | * For more information see: 10 | * 11 | * https://www.twilio.com/docs/api/rest/access-tokens 12 | * 13 | *

14 | */ 15 | public class TaskRouterGrant implements Grant { 16 | 17 | private String workspaceSid; 18 | private String workerSid; 19 | private String role; 20 | 21 | public String getWorkspaceSid() { 22 | return workspaceSid; 23 | } 24 | 25 | public TaskRouterGrant setWorkspaceSid(String workspaceSid) { 26 | this.workspaceSid = workspaceSid; 27 | return this; 28 | } 29 | 30 | public String getWorkerSid() { 31 | return workerSid; 32 | } 33 | 34 | public TaskRouterGrant setWorkerSid(String workerSid) { 35 | this.workerSid = workerSid; 36 | return this; 37 | } 38 | 39 | public String getRole() { 40 | return role; 41 | } 42 | 43 | public TaskRouterGrant setRole(String role) { 44 | this.role = role; 45 | return this; 46 | } 47 | 48 | @Override 49 | public String getGrantKey() { 50 | return "task_router"; 51 | } 52 | 53 | @Override 54 | public Object getPayload() { 55 | return new TaskRouterGrant.Payload(this); 56 | } 57 | 58 | @SuppressWarnings("checkstyle:membername") 59 | @JsonInclude(JsonInclude.Include.NON_NULL) 60 | public class Payload { 61 | public final String workspace_sid; 62 | public final String worker_sid; 63 | public final String role; 64 | 65 | /** 66 | * Create the grant payload. 67 | * 68 | * @param grant TaskRouter grant 69 | */ 70 | public Payload(TaskRouterGrant grant) { 71 | this.workspace_sid = grant.workspaceSid; 72 | this.worker_sid = grant.workerSid; 73 | this.role = grant.role; 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/jwt/accesstoken/VideoGrant.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.accesstoken; 2 | 3 | import com.fasterxml.jackson.annotation.JsonInclude; 4 | 5 | /** 6 | * Grant used to access Twilio Video. 7 | * 8 | *

9 | * For more information see: 10 | * 11 | * https://www.twilio.com/docs/api/rest/access-tokens 12 | * 13 | *

14 | */ 15 | public class VideoGrant implements Grant { 16 | 17 | private String room; 18 | 19 | /** 20 | * Get the room configured in this grant. 21 | * @return The room name or sid or null if not set. 22 | */ 23 | public String getRoom() { 24 | return this.room; 25 | } 26 | 27 | /** 28 | * Set the room to grant access to 29 | * @param roomSidOrName a room sid or name 30 | * @return updated VideoGrant instance 31 | */ 32 | public VideoGrant setRoom(final String roomSidOrName) { 33 | this.room = roomSidOrName; 34 | return this; 35 | } 36 | 37 | public String getGrantKey() { 38 | return "video"; 39 | } 40 | 41 | public Object getPayload() { 42 | return new Payload(this); 43 | } 44 | 45 | 46 | @SuppressWarnings("checkstyle:membername") 47 | @JsonInclude(JsonInclude.Include.NON_NULL) 48 | public class Payload { 49 | public final String room; 50 | 51 | public Payload(VideoGrant grant) { 52 | this.room = grant.room; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/jwt/client/EventStreamScope.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.client; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | import java.net.URLEncoder; 5 | import java.util.ArrayList; 6 | import java.util.HashMap; 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | * Scope token for Event Streams. 12 | */ 13 | public class EventStreamScope implements Scope { 14 | 15 | private static final String SCOPE = String.join(":", "scope", "stream", "subscribe"); 16 | 17 | private final Map filters; 18 | 19 | private EventStreamScope(Builder b) { 20 | this.filters = b.filters; 21 | } 22 | 23 | @Override 24 | public String getPayload() throws UnsupportedEncodingException { 25 | List queryArgs = new ArrayList<>(); 26 | queryArgs.add("path=/2010-04-01/Events"); 27 | 28 | if (!this.filters.isEmpty()) { 29 | queryArgs.add(String.join("=", 30 | URLEncoder.encode("appParams", "UTF-8"), 31 | URLEncoder.encode(this.getFilterParams(), "UTF-8") 32 | )); 33 | } 34 | 35 | String queryString = String.join("&", queryArgs); 36 | return String.join("?", SCOPE, queryString); 37 | } 38 | 39 | private String getFilterParams() throws UnsupportedEncodingException { 40 | List queryParams = new ArrayList<>(); 41 | for (Map.Entry param : filters.entrySet()) { 42 | queryParams.add(String.join("=", 43 | URLEncoder.encode(param.getKey(), "UTF-8"), 44 | URLEncoder.encode(param.getValue(), "UTF-8") 45 | )); 46 | } 47 | return String.join("&", queryParams); 48 | } 49 | 50 | public static class Builder { 51 | private Map filters = new HashMap<>(); 52 | 53 | public Builder filters(Map filters) { 54 | this.filters.putAll(filters); 55 | return this; 56 | } 57 | 58 | public EventStreamScope build() { 59 | return new EventStreamScope(this); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/jwt/client/IncomingClientScope.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.client; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | 5 | /** 6 | * Scope token for Incoming Clients. 7 | */ 8 | public class IncomingClientScope implements Scope { 9 | 10 | private static final String SCOPE = String.join(":", "scope", "client", "incoming"); 11 | 12 | private final String clientName; 13 | 14 | public IncomingClientScope(String clientName) { 15 | this.clientName = clientName; 16 | } 17 | 18 | @Override 19 | public String getPayload() throws UnsupportedEncodingException { 20 | String query = String.join("=", "clientName", this.clientName); 21 | return String.join("?", SCOPE, query); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/jwt/client/Scope.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.client; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | 5 | /** 6 | * Token to access features of Twilio Client. 7 | */ 8 | public interface Scope { 9 | 10 | public String getPayload() throws UnsupportedEncodingException; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/jwt/taskrouter/FilterRequirement.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.taskrouter; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | 5 | @JsonFormat(shape = JsonFormat.Shape.OBJECT) 6 | public enum FilterRequirement { 7 | REQUIRED(true), 8 | OPTIONAL(false); 9 | 10 | public final boolean required; 11 | 12 | FilterRequirement(boolean required) { 13 | this.required = required; 14 | } 15 | 16 | public boolean value() { 17 | return this.required; 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/jwt/taskrouter/PolicyUtils.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.taskrouter; 2 | 3 | import com.twilio.http.HttpMethod; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | public class PolicyUtils { 9 | 10 | private static final String TASKROUTER_EVENT_URL = "https://event-bridge.twilio.com/v1/wschannels"; 11 | 12 | private PolicyUtils() {} 13 | 14 | /** 15 | * Build the default Polices for a Worker. 16 | * 17 | * @param workspaceSid Workspace sid of the worker 18 | * @param workerSid Worker sid 19 | * @return generated Policies 20 | */ 21 | public static List defaultWorkerPolicies(String workspaceSid, String workerSid) { 22 | final List policies = new ArrayList<>(); 23 | 24 | policies.add(new Policy.Builder() 25 | .url(UrlUtils.activities(workspaceSid)) 26 | .method(HttpMethod.GET) 27 | .allowed(true) 28 | .build()); 29 | 30 | policies.add(new Policy.Builder() 31 | .url(UrlUtils.allTasks(workspaceSid)) 32 | .method(HttpMethod.GET) 33 | .allowed(true) 34 | .build()); 35 | 36 | policies.add(new Policy.Builder() 37 | .url(UrlUtils.allReservations(workspaceSid, workerSid)) 38 | .method(HttpMethod.GET) 39 | .allowed(true) 40 | .build()); 41 | 42 | policies.add(new Policy.Builder() 43 | .url(UrlUtils.worker(workspaceSid, workerSid)) 44 | .method(HttpMethod.GET) 45 | .allowed(true) 46 | .build()); 47 | 48 | return policies; 49 | } 50 | 51 | /** 52 | * Build the default Event Bridge Policies. 53 | * 54 | * @param accountSid account sid 55 | * @param channelId channel id 56 | * @return generated Policies 57 | */ 58 | public static List defaultEventBridgePolicies(String accountSid, String channelId) { 59 | final List policies = new ArrayList<>(); 60 | 61 | String url = String.join("/", TASKROUTER_EVENT_URL, accountSid, channelId); 62 | 63 | policies.add(new Policy.Builder().url(url).method(HttpMethod.GET).allowed(true).build()); 64 | policies.add(new Policy.Builder().url(url).method(HttpMethod.POST).allowed(true).build()); 65 | 66 | return policies; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/accounts/v1/AuthTokenPromotionUpdater.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Accounts 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.accounts.v1; 16 | 17 | import com.twilio.base.Updater; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class AuthTokenPromotionUpdater extends Updater { 29 | 30 | public AuthTokenPromotionUpdater() {} 31 | 32 | @Override 33 | public AuthTokenPromotion update(final TwilioRestClient client) { 34 | String path = "/v1/AuthTokens/Promote"; 35 | 36 | Request request = new Request( 37 | HttpMethod.POST, 38 | Domains.ACCOUNTS.toString(), 39 | path 40 | ); 41 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 42 | Response response = client.request(request); 43 | if (response == null) { 44 | throw new ApiConnectionException( 45 | "AuthTokenPromotion update failed: Unable to connect to server" 46 | ); 47 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 48 | RestException restException = RestException.fromJson( 49 | response.getStream(), 50 | client.getObjectMapper() 51 | ); 52 | if (restException == null) { 53 | throw new ApiException( 54 | "Server Error, no content", 55 | response.getStatusCode() 56 | ); 57 | } 58 | throw new ApiException(restException); 59 | } 60 | 61 | return AuthTokenPromotion.fromJson( 62 | response.getStream(), 63 | client.getObjectMapper() 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/accounts/v1/SecondaryAuthTokenCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Accounts 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.accounts.v1; 16 | 17 | import com.twilio.base.Creator; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class SecondaryAuthTokenCreator extends Creator { 29 | 30 | public SecondaryAuthTokenCreator() {} 31 | 32 | @Override 33 | public SecondaryAuthToken create(final TwilioRestClient client) { 34 | String path = "/v1/AuthTokens/Secondary"; 35 | 36 | Request request = new Request( 37 | HttpMethod.POST, 38 | Domains.ACCOUNTS.toString(), 39 | path 40 | ); 41 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 42 | Response response = client.request(request); 43 | if (response == null) { 44 | throw new ApiConnectionException( 45 | "SecondaryAuthToken creation failed: Unable to connect to server" 46 | ); 47 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 48 | RestException restException = RestException.fromJson( 49 | response.getStream(), 50 | client.getObjectMapper() 51 | ); 52 | if (restException == null) { 53 | throw new ApiException( 54 | "Server Error, no content", 55 | response.getStatusCode() 56 | ); 57 | } 58 | throw new ApiException(restException); 59 | } 60 | 61 | return SecondaryAuthToken.fromJson( 62 | response.getStream(), 63 | client.getObjectMapper() 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/accounts/v1/SecondaryAuthTokenDeleter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Accounts 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.accounts.v1; 16 | 17 | import com.twilio.base.Deleter; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class SecondaryAuthTokenDeleter extends Deleter { 29 | 30 | public SecondaryAuthTokenDeleter() {} 31 | 32 | @Override 33 | public boolean delete(final TwilioRestClient client) { 34 | String path = "/v1/AuthTokens/Secondary"; 35 | 36 | Request request = new Request( 37 | HttpMethod.DELETE, 38 | Domains.ACCOUNTS.toString(), 39 | path 40 | ); 41 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 42 | Response response = client.request(request); 43 | 44 | if (response == null) { 45 | throw new ApiConnectionException( 46 | "SecondaryAuthToken delete failed: Unable to connect to server" 47 | ); 48 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 49 | RestException restException = RestException.fromJson( 50 | response.getStream(), 51 | client.getObjectMapper() 52 | ); 53 | if (restException == null) { 54 | throw new ApiException( 55 | "Server Error, no content", 56 | response.getStatusCode() 57 | ); 58 | } 59 | throw new ApiException(restException); 60 | } 61 | return response.getStatusCode() == 204; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/conversations/v1/ConfigurationFetcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Conversations 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.conversations.v1; 16 | 17 | import com.twilio.base.Fetcher; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class ConfigurationFetcher extends Fetcher { 29 | 30 | public ConfigurationFetcher() {} 31 | 32 | @Override 33 | public Configuration fetch(final TwilioRestClient client) { 34 | String path = "/v1/Configuration"; 35 | 36 | Request request = new Request( 37 | HttpMethod.GET, 38 | Domains.CONVERSATIONS.toString(), 39 | path 40 | ); 41 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 42 | Response response = client.request(request); 43 | 44 | if (response == null) { 45 | throw new ApiConnectionException( 46 | "Configuration fetch failed: Unable to connect to server" 47 | ); 48 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 49 | RestException restException = RestException.fromJson( 50 | response.getStream(), 51 | client.getObjectMapper() 52 | ); 53 | if (restException == null) { 54 | throw new ApiException( 55 | "Server Error, no content", 56 | response.getStatusCode() 57 | ); 58 | } 59 | throw new ApiException(restException); 60 | } 61 | 62 | return Configuration.fromJson( 63 | response.getStream(), 64 | client.getObjectMapper() 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/conversations/v1/configuration/WebhookFetcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Conversations 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.conversations.v1.configuration; 16 | 17 | import com.twilio.base.Fetcher; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class WebhookFetcher extends Fetcher { 29 | 30 | public WebhookFetcher() {} 31 | 32 | @Override 33 | public Webhook fetch(final TwilioRestClient client) { 34 | String path = "/v1/Configuration/Webhooks"; 35 | 36 | Request request = new Request( 37 | HttpMethod.GET, 38 | Domains.CONVERSATIONS.toString(), 39 | path 40 | ); 41 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 42 | Response response = client.request(request); 43 | 44 | if (response == null) { 45 | throw new ApiConnectionException( 46 | "Webhook fetch failed: Unable to connect to server" 47 | ); 48 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 49 | RestException restException = RestException.fromJson( 50 | response.getStream(), 51 | client.getObjectMapper() 52 | ); 53 | if (restException == null) { 54 | throw new ApiException( 55 | "Server Error, no content", 56 | response.getStatusCode() 57 | ); 58 | } 59 | throw new ApiException(restException); 60 | } 61 | 62 | return Webhook.fromJson(response.getStream(), client.getObjectMapper()); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/events/v1/SinkDeleter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Events 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.events.v1; 16 | 17 | import com.twilio.base.Deleter; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class SinkDeleter extends Deleter { 29 | 30 | private String pathSid; 31 | 32 | public SinkDeleter(final String pathSid) { 33 | this.pathSid = pathSid; 34 | } 35 | 36 | @Override 37 | public boolean delete(final TwilioRestClient client) { 38 | String path = "/v1/Sinks/{Sid}"; 39 | 40 | path = path.replace("{" + "Sid" + "}", this.pathSid.toString()); 41 | 42 | Request request = new Request( 43 | HttpMethod.DELETE, 44 | Domains.EVENTS.toString(), 45 | path 46 | ); 47 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 48 | Response response = client.request(request); 49 | 50 | if (response == null) { 51 | throw new ApiConnectionException( 52 | "Sink delete failed: Unable to connect to server" 53 | ); 54 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 55 | RestException restException = RestException.fromJson( 56 | response.getStream(), 57 | client.getObjectMapper() 58 | ); 59 | if (restException == null) { 60 | throw new ApiException( 61 | "Server Error, no content", 62 | response.getStatusCode() 63 | ); 64 | } 65 | throw new ApiException(restException); 66 | } 67 | return response.getStatusCode() == 204; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/flexapi/v1/ProvisioningStatusFetcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Flex 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.flexapi.v1; 16 | 17 | import com.twilio.base.Fetcher; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class ProvisioningStatusFetcher extends Fetcher { 29 | 30 | public ProvisioningStatusFetcher() {} 31 | 32 | @Override 33 | public ProvisioningStatus fetch(final TwilioRestClient client) { 34 | String path = "/v1/account/provision/status"; 35 | 36 | Request request = new Request( 37 | HttpMethod.GET, 38 | Domains.FLEXAPI.toString(), 39 | path 40 | ); 41 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 42 | Response response = client.request(request); 43 | 44 | if (response == null) { 45 | throw new ApiConnectionException( 46 | "ProvisioningStatus fetch failed: Unable to connect to server" 47 | ); 48 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 49 | RestException restException = RestException.fromJson( 50 | response.getStream(), 51 | client.getObjectMapper() 52 | ); 53 | if (restException == null) { 54 | throw new ApiException( 55 | "Server Error, no content", 56 | response.getStatusCode() 57 | ); 58 | } 59 | throw new ApiException(restException); 60 | } 61 | 62 | return ProvisioningStatus.fromJson( 63 | response.getStream(), 64 | client.getObjectMapper() 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/iam/v1/ApiKeyDeleter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Iam 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.iam.v1; 16 | 17 | import com.twilio.base.Deleter; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class ApiKeyDeleter extends Deleter { 29 | 30 | private String pathSid; 31 | 32 | public ApiKeyDeleter(final String pathSid) { 33 | this.pathSid = pathSid; 34 | } 35 | 36 | @Override 37 | public boolean delete(final TwilioRestClient client) { 38 | String path = "/v1/Keys/{Sid}"; 39 | 40 | path = path.replace("{" + "Sid" + "}", this.pathSid.toString()); 41 | 42 | Request request = new Request( 43 | HttpMethod.DELETE, 44 | Domains.IAM.toString(), 45 | path 46 | ); 47 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 48 | Response response = client.request(request); 49 | 50 | if (response == null) { 51 | throw new ApiConnectionException( 52 | "ApiKey delete failed: Unable to connect to server" 53 | ); 54 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 55 | RestException restException = RestException.fromJson( 56 | response.getStream(), 57 | client.getObjectMapper() 58 | ); 59 | if (restException == null) { 60 | throw new ApiException( 61 | "Server Error, no content", 62 | response.getStatusCode() 63 | ); 64 | } 65 | throw new ApiException(restException); 66 | } 67 | return response.getStatusCode() == 204; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/marketplace/v1/ModuleDataFetcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Marketplace 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.marketplace.v1; 16 | 17 | import com.twilio.base.Fetcher; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class ModuleDataFetcher extends Fetcher { 29 | 30 | public ModuleDataFetcher() {} 31 | 32 | @Override 33 | public ModuleData fetch(final TwilioRestClient client) { 34 | String path = "/v1/Listings"; 35 | 36 | Request request = new Request( 37 | HttpMethod.GET, 38 | Domains.MARKETPLACE.toString(), 39 | path 40 | ); 41 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 42 | Response response = client.request(request); 43 | 44 | if (response == null) { 45 | throw new ApiConnectionException( 46 | "ModuleData fetch failed: Unable to connect to server" 47 | ); 48 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 49 | RestException restException = RestException.fromJson( 50 | response.getStream(), 51 | client.getObjectMapper() 52 | ); 53 | if (restException == null) { 54 | throw new ApiException( 55 | "Server Error, no content", 56 | response.getStatusCode() 57 | ); 58 | } 59 | throw new ApiException(restException); 60 | } 61 | 62 | return ModuleData.fromJson( 63 | response.getStream(), 64 | client.getObjectMapper() 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/messaging/v1/UsecaseFetcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Messaging 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.messaging.v1; 16 | 17 | import com.twilio.base.Fetcher; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class UsecaseFetcher extends Fetcher { 29 | 30 | public UsecaseFetcher() {} 31 | 32 | @Override 33 | public Usecase fetch(final TwilioRestClient client) { 34 | String path = "/v1/Services/Usecases"; 35 | 36 | Request request = new Request( 37 | HttpMethod.GET, 38 | Domains.MESSAGING.toString(), 39 | path 40 | ); 41 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 42 | Response response = client.request(request); 43 | 44 | if (response == null) { 45 | throw new ApiConnectionException( 46 | "Usecase fetch failed: Unable to connect to server" 47 | ); 48 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 49 | RestException restException = RestException.fromJson( 50 | response.getStream(), 51 | client.getObjectMapper() 52 | ); 53 | if (restException == null) { 54 | throw new ApiException( 55 | "Server Error, no content", 56 | response.getStatusCode() 57 | ); 58 | } 59 | throw new ApiException(restException); 60 | } 61 | 62 | return Usecase.fromJson(response.getStream(), client.getObjectMapper()); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/numbers/v1/WebhookFetcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Numbers 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.numbers.v1; 16 | 17 | import com.twilio.base.Fetcher; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class WebhookFetcher extends Fetcher { 29 | 30 | public WebhookFetcher() {} 31 | 32 | @Override 33 | public Webhook fetch(final TwilioRestClient client) { 34 | String path = "/v1/Porting/Configuration/Webhook"; 35 | 36 | Request request = new Request( 37 | HttpMethod.GET, 38 | Domains.NUMBERS.toString(), 39 | path 40 | ); 41 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 42 | Response response = client.request(request); 43 | 44 | if (response == null) { 45 | throw new ApiConnectionException( 46 | "Webhook fetch failed: Unable to connect to server" 47 | ); 48 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 49 | RestException restException = RestException.fromJson( 50 | response.getStream(), 51 | client.getObjectMapper() 52 | ); 53 | if (restException == null) { 54 | throw new ApiException( 55 | "Server Error, no content", 56 | response.getStatusCode() 57 | ); 58 | } 59 | throw new ApiException(restException); 60 | } 61 | 62 | return Webhook.fromJson(response.getStream(), client.getObjectMapper()); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/studio/v1/FlowDeleter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Studio 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.studio.v1; 16 | 17 | import com.twilio.base.Deleter; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class FlowDeleter extends Deleter { 29 | 30 | private String pathSid; 31 | 32 | public FlowDeleter(final String pathSid) { 33 | this.pathSid = pathSid; 34 | } 35 | 36 | @Override 37 | public boolean delete(final TwilioRestClient client) { 38 | String path = "/v1/Flows/{Sid}"; 39 | 40 | path = path.replace("{" + "Sid" + "}", this.pathSid.toString()); 41 | 42 | Request request = new Request( 43 | HttpMethod.DELETE, 44 | Domains.STUDIO.toString(), 45 | path 46 | ); 47 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 48 | Response response = client.request(request); 49 | 50 | if (response == null) { 51 | throw new ApiConnectionException( 52 | "Flow delete failed: Unable to connect to server" 53 | ); 54 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 55 | RestException restException = RestException.fromJson( 56 | response.getStream(), 57 | client.getObjectMapper() 58 | ); 59 | if (restException == null) { 60 | throw new ApiException( 61 | "Server Error, no content", 62 | response.getStatusCode() 63 | ); 64 | } 65 | throw new ApiException(restException); 66 | } 67 | return response.getStatusCode() == 204; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/video/v1/RecordingSettingsFetcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Video 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.video.v1; 16 | 17 | import com.twilio.base.Fetcher; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class RecordingSettingsFetcher extends Fetcher { 29 | 30 | public RecordingSettingsFetcher() {} 31 | 32 | @Override 33 | public RecordingSettings fetch(final TwilioRestClient client) { 34 | String path = "/v1/RecordingSettings/Default"; 35 | 36 | Request request = new Request( 37 | HttpMethod.GET, 38 | Domains.VIDEO.toString(), 39 | path 40 | ); 41 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 42 | Response response = client.request(request); 43 | 44 | if (response == null) { 45 | throw new ApiConnectionException( 46 | "RecordingSettings fetch failed: Unable to connect to server" 47 | ); 48 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 49 | RestException restException = RestException.fromJson( 50 | response.getStream(), 51 | client.getObjectMapper() 52 | ); 53 | if (restException == null) { 54 | throw new ApiException( 55 | "Server Error, no content", 56 | response.getStatusCode() 57 | ); 58 | } 59 | throw new ApiException(restException); 60 | } 61 | 62 | return RecordingSettings.fromJson( 63 | response.getStream(), 64 | client.getObjectMapper() 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/rest/voice/v1/dialingpermissions/SettingsFetcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code was generated by 3 | * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 | * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 | * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 | * 7 | * Twilio - Voice 8 | * This is the public Twilio REST API. 9 | * 10 | * NOTE: This class is auto generated by OpenAPI Generator. 11 | * https://openapi-generator.tech 12 | * Do not edit the class manually. 13 | */ 14 | 15 | package com.twilio.rest.voice.v1.dialingpermissions; 16 | 17 | import com.twilio.base.Fetcher; 18 | import com.twilio.constant.EnumConstants; 19 | import com.twilio.exception.ApiConnectionException; 20 | import com.twilio.exception.ApiException; 21 | import com.twilio.exception.RestException; 22 | import com.twilio.http.HttpMethod; 23 | import com.twilio.http.Request; 24 | import com.twilio.http.Response; 25 | import com.twilio.http.TwilioRestClient; 26 | import com.twilio.rest.Domains; 27 | 28 | public class SettingsFetcher extends Fetcher { 29 | 30 | public SettingsFetcher() {} 31 | 32 | @Override 33 | public Settings fetch(final TwilioRestClient client) { 34 | String path = "/v1/Settings"; 35 | 36 | Request request = new Request( 37 | HttpMethod.GET, 38 | Domains.VOICE.toString(), 39 | path 40 | ); 41 | request.setContentType(EnumConstants.ContentType.FORM_URLENCODED); 42 | Response response = client.request(request); 43 | 44 | if (response == null) { 45 | throw new ApiConnectionException( 46 | "Settings fetch failed: Unable to connect to server" 47 | ); 48 | } else if (!TwilioRestClient.SUCCESS.test(response.getStatusCode())) { 49 | RestException restException = RestException.fromJson( 50 | response.getStream(), 51 | client.getObjectMapper() 52 | ); 53 | if (restException == null) { 54 | throw new ApiException( 55 | "Server Error, no content", 56 | response.getStatusCode() 57 | ); 58 | } 59 | throw new ApiException(restException); 60 | } 61 | 62 | return Settings.fromJson( 63 | response.getStream(), 64 | client.getObjectMapper() 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/taskrouter/TaskRouterResource.java: -------------------------------------------------------------------------------- 1 | package com.twilio.taskrouter; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | 5 | import java.io.ByteArrayOutputStream; 6 | import java.io.IOException; 7 | 8 | public abstract class TaskRouterResource { 9 | 10 | /** 11 | * Converts a resource to JSON. 12 | * 13 | * @return JSON representation of the resource 14 | * @throws IOException if unable to transform to JSON 15 | */ 16 | public String toJson() throws IOException { 17 | ObjectMapper mapper = new ObjectMapper(); 18 | ByteArrayOutputStream out = new ByteArrayOutputStream(); 19 | 20 | mapper.writeValue(out, this); 21 | return out.toString(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/taskrouter/TaskRouting.java: -------------------------------------------------------------------------------- 1 | package com.twilio.taskrouter; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonCreator; 5 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 6 | import com.fasterxml.jackson.annotation.JsonInclude; 7 | import com.fasterxml.jackson.annotation.JsonProperty; 8 | import com.fasterxml.jackson.databind.ObjectMapper; 9 | import lombok.ToString; 10 | 11 | import java.io.IOException; 12 | import java.util.List; 13 | 14 | @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) 15 | @JsonInclude(JsonInclude.Include.NON_NULL) 16 | @JsonIgnoreProperties(ignoreUnknown = true) 17 | @ToString 18 | public class TaskRouting extends TaskRouterResource { 19 | 20 | @JsonProperty("filters") 21 | private final List workflowRules; 22 | 23 | @JsonProperty("default_filter") 24 | private final WorkflowRuleTarget defaultTarget; 25 | 26 | /** 27 | * Constructor for creating based on json.. 28 | * 29 | * @param workflowRules Workflow Rule configuration 30 | * @param defaultTarget Default Rule target 31 | */ 32 | @JsonCreator 33 | public TaskRouting( 34 | @JsonProperty("filters") List workflowRules, 35 | @JsonProperty("default_filter") WorkflowRuleTarget defaultTarget 36 | ) { 37 | this.workflowRules = workflowRules; 38 | this.defaultTarget = defaultTarget; 39 | } 40 | 41 | /** 42 | * Get the workflow rules for the workflow. 43 | * 44 | * @return the list of workflow rules 45 | */ 46 | public List getWorkflowRules() { 47 | return workflowRules; 48 | } 49 | 50 | /** 51 | * Get the default filter for the workflow. 52 | * 53 | * @return the default filter 54 | */ 55 | public WorkflowRuleTarget getDefaultTarget() { 56 | return defaultTarget; 57 | } 58 | 59 | /** 60 | * Converts a JSON workflow configuration to a workflow rule object. 61 | * 62 | * @param json JSON for workflow rule 63 | * @return a workflow rule target object 64 | * @throws IOException if unable to create object 65 | */ 66 | public static TaskRouting fromJson(String json) throws IOException { 67 | ObjectMapper mapper = new ObjectMapper(); 68 | return mapper.readValue(json, TaskRouting.class); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/taskrouter/Workflow.java: -------------------------------------------------------------------------------- 1 | package com.twilio.taskrouter; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonCreator; 5 | import com.fasterxml.jackson.annotation.JsonIgnore; 6 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonProperty; 9 | import com.fasterxml.jackson.databind.ObjectMapper; 10 | import lombok.ToString; 11 | 12 | import java.io.IOException; 13 | import java.util.List; 14 | 15 | 16 | @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) 17 | @JsonInclude(JsonInclude.Include.NON_NULL) 18 | @JsonIgnoreProperties(ignoreUnknown = true) 19 | @ToString 20 | public class Workflow extends TaskRouterResource { 21 | 22 | @JsonProperty("task_routing") 23 | private final TaskRouting taskRouting; 24 | 25 | /** 26 | * Define a workflow. 27 | * 28 | * @param workflowRules list of workflow rules (in order they will be processed) 29 | * @param defaultTarget default filter 30 | */ 31 | public Workflow(List workflowRules, WorkflowRuleTarget defaultTarget) { 32 | taskRouting = new TaskRouting(workflowRules, defaultTarget); 33 | } 34 | 35 | /** 36 | * Constructor for creating based on json. 37 | * 38 | * @param taskRouting Task Routing Configuration 39 | */ 40 | @JsonCreator 41 | private Workflow(@JsonProperty("task_routing") TaskRouting taskRouting) { 42 | this.taskRouting = taskRouting; 43 | } 44 | 45 | @JsonIgnore 46 | public List getWorkflowRules() { 47 | return taskRouting.getWorkflowRules(); 48 | } 49 | 50 | @JsonIgnore 51 | public WorkflowRuleTarget getDefaultTarget() { 52 | return taskRouting.getDefaultTarget(); 53 | } 54 | 55 | /** 56 | * Converts a JSON workflow configuration to a workflow object. 57 | * 58 | * @param json JSON for workflow 59 | * @return a workflow rule target object 60 | * @throws IOException if unable to create object 61 | */ 62 | public static Workflow fromJson(String json) throws IOException { 63 | ObjectMapper mapper = new ObjectMapper(); 64 | return mapper.readValue(json, Workflow.class); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/twiml/FaxResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml; 9 | 10 | import com.fasterxml.jackson.core.JsonProcessingException; 11 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 12 | import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; 13 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; 14 | import com.twilio.twiml.TwiMLException; 15 | import com.twilio.twiml.fax.Receive; 16 | 17 | /** 18 | * TwiML wrapper for {@code } 19 | */ 20 | @JsonDeserialize(builder = FaxResponse.Builder.class) 21 | public class FaxResponse extends TwiML { 22 | /** 23 | * For XML Serialization/Deserialization 24 | */ 25 | private FaxResponse() { 26 | this(new Builder()); 27 | } 28 | 29 | /** 30 | * Create a new {@code } element 31 | */ 32 | private FaxResponse(Builder b) { 33 | super("Response", b); 34 | } 35 | 36 | /** 37 | * Create a new {@code } element 38 | */ 39 | @JsonPOJOBuilder(withPrefix = "") 40 | public static class Builder extends TwiML.Builder { 41 | /** 42 | * Create and return a {@code } from an XML string 43 | */ 44 | public static Builder fromXml(final String xml) throws TwiMLException { 45 | try { 46 | return OBJECT_MAPPER.readValue(xml, Builder.class); 47 | } catch (final JsonProcessingException jpe) { 48 | throw new TwiMLException( 49 | "Failed to deserialize a FaxResponse.Builder from the provided XML string: " + jpe.getMessage()); 50 | } catch (final Exception e) { 51 | throw new TwiMLException("Unhandled exception: " + e.getMessage()); 52 | } 53 | } 54 | 55 | /** 56 | * Add a child {@code } element 57 | */ 58 | @JacksonXmlProperty(isAttribute = false, localName = "Receive") 59 | public Builder receive(Receive receive) { 60 | this.children.add(receive); 61 | return this; 62 | } 63 | 64 | /** 65 | * Create and return resulting {@code } element 66 | */ 67 | public FaxResponse build() { 68 | return new FaxResponse(this); 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /src/main/java/com/twilio/twiml/GenericNode.java: -------------------------------------------------------------------------------- 1 | package com.twilio.twiml; 2 | 3 | 4 | public class GenericNode extends TwiML { 5 | protected GenericNode(Builder builder) { 6 | super(builder.tag, builder); 7 | } 8 | 9 | public static class Builder extends TwiML.Builder { 10 | private String tag; 11 | 12 | public Builder(String tag) { 13 | this.tag = tag; 14 | } 15 | 16 | /** 17 | * Create and return resulting {@code } element 18 | */ 19 | public GenericNode build() { 20 | return new GenericNode(this); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/twiml/Text.java: -------------------------------------------------------------------------------- 1 | package com.twilio.twiml; 2 | 3 | import org.w3c.dom.Document; 4 | import org.w3c.dom.Node; 5 | 6 | public class Text extends TwiML { 7 | private final String text; 8 | 9 | protected Text(final String text) { 10 | super(null, null); 11 | this.text = text; 12 | } 13 | 14 | @Override 15 | protected Node buildXmlElement(final Document parentDoc) { 16 | return parentDoc.createTextNode(this.text); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/twiml/TwiMLException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml; 9 | 10 | import com.twilio.exception.TwilioException; 11 | 12 | @SuppressWarnings("checkstyle:abbreviationaswordinname") 13 | public class TwiMLException extends TwilioException { 14 | private static final long serialVersionUID = -2688644569829574015L; 15 | 16 | /** 17 | * Instantiates a new TwiMLException. 18 | * 19 | * @param arg0 Exception message 20 | */ 21 | public TwiMLException(final String arg0) { 22 | super(arg0); 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/twilio/twiml/video/Room.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.video; 9 | 10 | import com.twilio.twiml.TwiML; 11 | 12 | /** 13 | * TwiML wrapper for {@code } 14 | */ 15 | public class Room extends TwiML { 16 | private final String name; 17 | 18 | /** 19 | * For XML Serialization/Deserialization 20 | */ 21 | private Room() { 22 | this(new Builder((String) null)); 23 | } 24 | 25 | /** 26 | * Create a new {@code } element 27 | */ 28 | private Room(Builder b) { 29 | super("Room", b); 30 | this.name = b.name; 31 | } 32 | 33 | /** 34 | * The body of the TwiML element 35 | * 36 | * @return Element body as a string if present else null 37 | */ 38 | protected String getElementBody() { 39 | return this.getName() == null ? null : this.getName(); 40 | } 41 | 42 | /** 43 | * Room name 44 | * 45 | * @return Room name 46 | */ 47 | public String getName() { 48 | return name; 49 | } 50 | 51 | /** 52 | * Create a new {@code } element 53 | */ 54 | public static class Builder extends TwiML.Builder { 55 | private String name; 56 | 57 | /** 58 | * Create a {@code } with name 59 | */ 60 | public Builder(String name) { 61 | this.name = name; 62 | } 63 | 64 | /** 65 | * Create and return resulting {@code } element 66 | */ 67 | public Room build() { 68 | return new Room(this); 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /src/main/java/com/twilio/twiml/voice/Echo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import com.fasterxml.jackson.core.JsonProcessingException; 11 | import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; 12 | import com.twilio.twiml.TwiML; 13 | import com.twilio.twiml.TwiMLException; 14 | 15 | /** 16 | * TwiML wrapper for {@code } 17 | */ 18 | public class Echo extends TwiML { 19 | /** 20 | * For XML Serialization/Deserialization 21 | */ 22 | private Echo() { 23 | this(new Builder()); 24 | } 25 | 26 | /** 27 | * Create a new {@code } element 28 | */ 29 | private Echo(Builder b) { 30 | super("Echo", b); 31 | } 32 | 33 | /** 34 | * Create a new {@code } element 35 | */ 36 | @JsonPOJOBuilder(withPrefix = "") 37 | public static class Builder extends TwiML.Builder { 38 | /** 39 | * Create and return a {@code } from an XML string 40 | */ 41 | public static Builder fromXml(final String xml) throws TwiMLException { 42 | try { 43 | return OBJECT_MAPPER.readValue(xml, Builder.class); 44 | } catch (final JsonProcessingException jpe) { 45 | throw new TwiMLException( 46 | "Failed to deserialize a Echo.Builder from the provided XML string: " + jpe.getMessage()); 47 | } catch (final Exception e) { 48 | throw new TwiMLException("Unhandled exception: " + e.getMessage()); 49 | } 50 | } 51 | 52 | /** 53 | * Create and return resulting {@code } element 54 | */ 55 | public Echo build() { 56 | return new Echo(this); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/java/com/twilio/twiml/voice/Hangup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import com.fasterxml.jackson.core.JsonProcessingException; 11 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 12 | import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; 13 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; 14 | import com.twilio.twiml.TwiML; 15 | import com.twilio.twiml.TwiMLException; 16 | 17 | /** 18 | * TwiML wrapper for {@code } 19 | */ 20 | @JsonDeserialize(builder = Hangup.Builder.class) 21 | public class Hangup extends TwiML { 22 | /** 23 | * For XML Serialization/Deserialization 24 | */ 25 | private Hangup() { 26 | this(new Builder()); 27 | } 28 | 29 | /** 30 | * Create a new {@code } element 31 | */ 32 | private Hangup(Builder b) { 33 | super("Hangup", b); 34 | } 35 | 36 | /** 37 | * Create a new {@code } element 38 | */ 39 | @JsonPOJOBuilder(withPrefix = "") 40 | public static class Builder extends TwiML.Builder { 41 | /** 42 | * Create and return a {@code } from an XML string 43 | */ 44 | public static Builder fromXml(final String xml) throws TwiMLException { 45 | try { 46 | return OBJECT_MAPPER.readValue(xml, Builder.class); 47 | } catch (final JsonProcessingException jpe) { 48 | throw new TwiMLException( 49 | "Failed to deserialize a Hangup.Builder from the provided XML string: " + jpe.getMessage()); 50 | } catch (final Exception e) { 51 | throw new TwiMLException("Unhandled exception: " + e.getMessage()); 52 | } 53 | } 54 | 55 | /** 56 | * Add a child {@code } element 57 | */ 58 | @JacksonXmlProperty(isAttribute = false, localName = "Parameter") 59 | public Builder parameter(Parameter parameter) { 60 | this.children.add(parameter); 61 | return this; 62 | } 63 | 64 | /** 65 | * Create and return resulting {@code } element 66 | */ 67 | public Hangup build() { 68 | return new Hangup(this); 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /src/main/java/com/twilio/twiml/voice/Leave.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import com.fasterxml.jackson.core.JsonProcessingException; 11 | import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; 12 | import com.twilio.twiml.TwiML; 13 | import com.twilio.twiml.TwiMLException; 14 | 15 | /** 16 | * TwiML wrapper for {@code } 17 | */ 18 | public class Leave extends TwiML { 19 | /** 20 | * For XML Serialization/Deserialization 21 | */ 22 | private Leave() { 23 | this(new Builder()); 24 | } 25 | 26 | /** 27 | * Create a new {@code } element 28 | */ 29 | private Leave(Builder b) { 30 | super("Leave", b); 31 | } 32 | 33 | /** 34 | * Create a new {@code } element 35 | */ 36 | @JsonPOJOBuilder(withPrefix = "") 37 | public static class Builder extends TwiML.Builder { 38 | /** 39 | * Create and return a {@code } from an XML string 40 | */ 41 | public static Builder fromXml(final String xml) throws TwiMLException { 42 | try { 43 | return OBJECT_MAPPER.readValue(xml, Builder.class); 44 | } catch (final JsonProcessingException jpe) { 45 | throw new TwiMLException( 46 | "Failed to deserialize a Leave.Builder from the provided XML string: " + jpe.getMessage()); 47 | } catch (final Exception e) { 48 | throw new TwiMLException("Unhandled exception: " + e.getMessage()); 49 | } 50 | } 51 | 52 | /** 53 | * Create and return resulting {@code } element 54 | */ 55 | public Leave build() { 56 | return new Leave(this); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/Client.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import java.util.Objects; 4 | 5 | public class Client implements Endpoint { 6 | 7 | public static final String PREFIX = "client:"; 8 | 9 | private final String client; 10 | 11 | public Client(String client) { 12 | if (!client.toLowerCase().startsWith(PREFIX)) { 13 | client = PREFIX + client; 14 | } 15 | 16 | this.client = client; 17 | } 18 | 19 | @Override 20 | public String getEndpoint() { 21 | return this.client; 22 | } 23 | 24 | @Override 25 | public boolean equals(Object o) { 26 | if (this == o) { 27 | return true; 28 | } 29 | if (o == null || getClass() != o.getClass()) { 30 | return false; 31 | } 32 | 33 | Client other = (Client) o; 34 | return Objects.equals(this.client, other.client); 35 | } 36 | 37 | @Override 38 | public int hashCode() { 39 | return Objects.hash(this.client); 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return this.client; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/Endpoint.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | public interface Endpoint { 4 | 5 | /** 6 | * Returns endpoint to call. 7 | * 8 | * @return endpoint to call 9 | */ 10 | public String getEndpoint(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/FeedbackIssue.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import lombok.ToString; 7 | 8 | import java.util.Objects; 9 | 10 | /** 11 | * Representation of a Feedback Issue. 12 | * 13 | *

14 | * For more information see: 15 | * Feedback docs 16 | *

17 | */ 18 | @JsonIgnoreProperties(ignoreUnknown = true) 19 | @ToString 20 | public class FeedbackIssue { 21 | private final int count; 22 | private final String description; 23 | private final String percentageOfTotalCalls; 24 | 25 | /** 26 | * Initialize a FeedbackIssue. 27 | * 28 | * @param count number of times reported 29 | * @param description description of issue 30 | * @param percentageOfTotalCalls percentage of affected calls 31 | */ 32 | @JsonCreator 33 | public FeedbackIssue(@JsonProperty("count") final int count, 34 | @JsonProperty("description") final String description, 35 | @JsonProperty("percentage_of_total_calls") final String percentageOfTotalCalls) { 36 | this.count = count; 37 | this.description = description; 38 | this.percentageOfTotalCalls = percentageOfTotalCalls; 39 | } 40 | 41 | public int getCount() { 42 | return count; 43 | } 44 | 45 | public String getDescription() { 46 | return description; 47 | } 48 | 49 | public String getPercentageOfTotalCalls() { 50 | return percentageOfTotalCalls; 51 | } 52 | 53 | @Override 54 | public boolean equals(final Object o) { 55 | if (this == o) { 56 | return true; 57 | } 58 | 59 | if (o == null || getClass() != o.getClass()) { 60 | return false; 61 | } 62 | 63 | FeedbackIssue other = (FeedbackIssue) o; 64 | return Objects.equals(this.count, other.count) && 65 | Objects.equals(this.description, other.description) && 66 | Objects.equals(this.percentageOfTotalCalls, other.getPercentageOfTotalCalls()); 67 | } 68 | 69 | @Override 70 | public int hashCode() { 71 | return Objects.hash(this.count, this.description, this.percentageOfTotalCalls); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/IceServer.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import lombok.Data; 7 | 8 | /** 9 | * POJO representation of a Twilio ICE server. 10 | */ 11 | @Data 12 | @JsonIgnoreProperties(ignoreUnknown = true) 13 | public class IceServer { 14 | private final String credential; 15 | private final String username; 16 | private final String url; 17 | private final String urls; 18 | 19 | 20 | /** 21 | * Initialize an IceServer. 22 | * 23 | * @param credential credentials for the server 24 | * @param username user account name 25 | * @param url url of server 26 | * @param urls url of server 27 | */ 28 | @JsonCreator 29 | public IceServer(@JsonProperty("credential") final String credential, 30 | @JsonProperty("username") final String username, 31 | @JsonProperty("url") final String url, 32 | @JsonProperty("urls") final String urls) { 33 | this.credential = credential; 34 | this.username = username; 35 | this.url = url; 36 | this.urls = urls; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/OutboundCallPrice.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import lombok.ToString; 7 | 8 | import java.util.Objects; 9 | 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | @ToString 12 | public class OutboundCallPrice { 13 | private final double basePrice; 14 | private final double currentPrice; 15 | 16 | @JsonCreator 17 | public OutboundCallPrice(@JsonProperty("base_price") final double basePrice, 18 | @JsonProperty("current_price") final double currentPrice) { 19 | this.basePrice = basePrice; 20 | this.currentPrice = currentPrice; 21 | } 22 | 23 | public double getBasePrice() { 24 | return basePrice; 25 | } 26 | 27 | public double getCurrentPrice() { 28 | return currentPrice; 29 | } 30 | 31 | @Override 32 | public boolean equals(Object o) { 33 | if (this == o) { 34 | return true; 35 | } 36 | if (o == null || getClass() != o.getClass()) { 37 | return false; 38 | } 39 | 40 | OutboundCallPrice that = (OutboundCallPrice) o; 41 | return Objects.equals(this.basePrice, that.basePrice) && 42 | Objects.equals(this.currentPrice, that.currentPrice); 43 | } 44 | 45 | @Override 46 | public int hashCode() { 47 | return Objects.hash(this.basePrice, this.currentPrice); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/OutboundCallPriceWithOrigin.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import lombok.ToString; 7 | 8 | import java.util.List; 9 | import java.util.Objects; 10 | 11 | @JsonIgnoreProperties(ignoreUnknown = true) 12 | @ToString 13 | public class OutboundCallPriceWithOrigin { 14 | private final double basePrice; 15 | private final double currentPrice; 16 | private final List originationPrefixes; 17 | 18 | @JsonCreator 19 | public OutboundCallPriceWithOrigin(@JsonProperty("base_price") final double basePrice, 20 | @JsonProperty("current_price") final double currentPrice, 21 | @JsonProperty("origination_prefixes") final List originationPrefixes) { 22 | this.basePrice = basePrice; 23 | this.currentPrice = currentPrice; 24 | this.originationPrefixes = originationPrefixes; 25 | } 26 | 27 | public double getBasePrice() { 28 | return basePrice; 29 | } 30 | 31 | public double getCurrentPrice() { 32 | return currentPrice; 33 | } 34 | 35 | public List getOriginationPrefixes() { 36 | return originationPrefixes; 37 | } 38 | 39 | @Override 40 | public boolean equals(Object o) { 41 | if (this == o) { 42 | return true; 43 | } 44 | 45 | if (o == null || getClass() != o.getClass()) { 46 | return false; 47 | } 48 | 49 | OutboundCallPriceWithOrigin other = (OutboundCallPriceWithOrigin) o; 50 | return Objects.equals(this.basePrice, other.basePrice) && 51 | Objects.equals(this.currentPrice, other.currentPrice) && 52 | Objects.equals(this.originationPrefixes, other.originationPrefixes); 53 | } 54 | 55 | @Override 56 | public int hashCode() { 57 | return Objects.hash(this.basePrice, this.currentPrice, this.originationPrefixes); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/OutboundSmsPrice.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import lombok.ToString; 7 | 8 | import java.util.List; 9 | import java.util.Objects; 10 | 11 | /** 12 | * Pricing details per sms. 13 | * 14 | *

15 | * For more information see: 16 | * Message Pricing Docs 17 | *

18 | */ 19 | @JsonIgnoreProperties(ignoreUnknown = true) 20 | @ToString 21 | public class OutboundSmsPrice { 22 | private final String mcc; 23 | private final String mnc; 24 | private final String carrier; 25 | private final List prices; 26 | 27 | /** 28 | * Initialize a OutboundSmsPrice. 29 | * 30 | * @param mcc mcc identifier 31 | * @param mnc mnc identifier 32 | * @param carrier carrier name 33 | * @param prices prices for incoming sms 34 | */ 35 | @JsonCreator 36 | public OutboundSmsPrice(@JsonProperty("mcc") final String mcc, 37 | @JsonProperty("mnc") final String mnc, 38 | @JsonProperty("carrier") final String carrier, 39 | @JsonProperty("prices") final List prices) { 40 | this.mcc = mcc; 41 | this.mnc = mnc; 42 | this.carrier = carrier; 43 | this.prices = prices; 44 | } 45 | 46 | public String getMcc() { 47 | return mcc; 48 | } 49 | 50 | public String getMnc() { 51 | return mnc; 52 | } 53 | 54 | public String getCarrier() { 55 | return carrier; 56 | } 57 | 58 | public List getPrices() { 59 | return prices; 60 | } 61 | 62 | @Override 63 | public boolean equals(Object o) { 64 | if (this == o) { 65 | return true; 66 | } 67 | if (o == null || getClass() != o.getClass()) { 68 | return false; 69 | } 70 | 71 | OutboundSmsPrice other = (OutboundSmsPrice) o; 72 | return Objects.equals(this.mcc, other.mcc) && 73 | Objects.equals(this.mnc, other.mnc) && 74 | Objects.equals(this.carrier, other.carrier) && 75 | Objects.equals(this.prices, other.prices); 76 | } 77 | 78 | @Override 79 | public int hashCode() { 80 | return Objects.hash(this.mcc, this.mnc, this.carrier, this.prices); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/PhoneNumber.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import java.util.Objects; 4 | import java.net.URLEncoder; 5 | 6 | public class PhoneNumber implements Endpoint { 7 | private final String rawNumber; 8 | 9 | public PhoneNumber(String number) { 10 | this.rawNumber = number; 11 | } 12 | 13 | @Override 14 | public String getEndpoint() { 15 | return this.rawNumber; 16 | } 17 | 18 | @Override 19 | public boolean equals(Object o) { 20 | if (this == o) { 21 | return true; 22 | } 23 | if (o == null || getClass() != o.getClass()) { 24 | return false; 25 | } 26 | 27 | PhoneNumber other = (PhoneNumber) o; 28 | return Objects.equals(this.rawNumber, other.rawNumber); 29 | } 30 | 31 | @Override 32 | public int hashCode() { 33 | return Objects.hash(this.rawNumber); 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return this.rawNumber; 39 | } 40 | 41 | public String encode(String enc) { 42 | try { 43 | return URLEncoder.encode(this.rawNumber, enc); 44 | } 45 | catch (Exception e) { 46 | return this.rawNumber; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/PhoneNumberCapabilities.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import lombok.ToString; 7 | 8 | import java.util.Objects; 9 | 10 | /** 11 | * Capabilities of a Phone Number. 12 | * 13 | *

14 | * For more information see: 15 | * Phone Number Docs 16 | *

17 | */ 18 | @JsonIgnoreProperties(ignoreUnknown = true) 19 | @ToString 20 | public class PhoneNumberCapabilities { 21 | private final boolean mms; 22 | private final boolean sms; 23 | private final boolean voice; 24 | private final boolean fax; 25 | 26 | /** 27 | * Initialize a PhoneNumberCapability. 28 | * 29 | * @param mms mms enabled 30 | * @param sms sms enabled 31 | * @param voice voice enabled 32 | * @param fax fax enabled 33 | */ 34 | @JsonCreator 35 | public PhoneNumberCapabilities(@JsonProperty("MMS") final boolean mms, 36 | @JsonProperty("SMS") final boolean sms, 37 | @JsonProperty("voice") final boolean voice, 38 | @JsonProperty("fax") final boolean fax) { 39 | this.mms = mms; 40 | this.sms = sms; 41 | this.voice = voice; 42 | this.fax = fax; 43 | } 44 | 45 | public boolean getMms() { 46 | return this.mms; 47 | } 48 | 49 | public boolean getSms() { 50 | return this.sms; 51 | } 52 | 53 | public boolean getVoice() { 54 | return this.voice; 55 | } 56 | 57 | public boolean getFax() { 58 | return this.fax; 59 | } 60 | 61 | @Override 62 | public boolean equals(final Object o) { 63 | if (this == o) { 64 | return true; 65 | } 66 | 67 | if (o == null || getClass() != o.getClass()) { 68 | return false; 69 | } 70 | 71 | PhoneNumberCapabilities other = (PhoneNumberCapabilities) o; 72 | return Objects.equals(this.mms, other.mms) && 73 | Objects.equals(this.sms, other.sms) && 74 | Objects.equals(this.voice, other.voice) && 75 | Objects.equals(this.fax, other.fax); 76 | } 77 | 78 | @Override 79 | public int hashCode() { 80 | return Objects.hash(this.mms, this.sms, this.voice, this.fax); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/RecordingRulesUpdate.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.ToString; 6 | 7 | import java.util.List; 8 | import java.util.Objects; 9 | 10 | /** 11 | * Recording Rule Update - Used to update the list of Recording Rules 12 | * 13 | *

14 | * For more information see: 15 | * Specifying Recording Rules 16 | *

17 | */ 18 | @JsonIgnoreProperties(ignoreUnknown = true) 19 | @ToString 20 | public class RecordingRulesUpdate { 21 | 22 | @JsonProperty("rules") 23 | private final List rules; 24 | 25 | public RecordingRulesUpdate(@JsonProperty("rules") final List rules) { 26 | this.rules = rules; 27 | } 28 | 29 | public List getRules() { 30 | return rules; 31 | } 32 | 33 | @Override 34 | public boolean equals(final Object o) { 35 | if (this == o) return true; 36 | if (o == null || getClass() != o.getClass()) return false; 37 | final com.twilio.type.RecordingRulesUpdate that = (com.twilio.type.RecordingRulesUpdate) o; 38 | return Objects.equals(getRules(), that.getRules()); 39 | } 40 | 41 | @Override 42 | public int hashCode() { 43 | return Objects.hash(getRules()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/Rule.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonValue; 5 | import com.twilio.converter.Promoter; 6 | 7 | public interface Rule { 8 | 9 | Type getType(); 10 | 11 | Boolean getAll(); 12 | 13 | String getPublisher(); 14 | 15 | String getTrack(); 16 | 17 | Kind getKind(); 18 | 19 | enum Type { 20 | INCLUDE("include"), 21 | EXCLUDE("exclude"); 22 | 23 | private final String value; 24 | 25 | Type(final String value) { 26 | this.value = value; 27 | } 28 | 29 | @JsonCreator 30 | public static Type forValue(final String value) { 31 | return Promoter.enumFromString(value, Rule.Type.values()); 32 | } 33 | 34 | @JsonValue 35 | public String value() { 36 | return this.value; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return value; 42 | } 43 | } 44 | 45 | enum Kind { 46 | AUDIO("audio"), 47 | DATA("data"), 48 | VIDEO("video"); 49 | 50 | private final String value; 51 | 52 | Kind(final String value) { 53 | this.value = value; 54 | } 55 | 56 | @JsonCreator 57 | public static Kind forValue(final String value) { 58 | return Promoter.enumFromString(value, Rule.Kind.values()); 59 | } 60 | 61 | @JsonValue 62 | public String value() { 63 | return this.value; 64 | } 65 | 66 | @Override 67 | public String toString() { 68 | return value; 69 | } 70 | } 71 | 72 | enum Priority { 73 | LOW("low"), 74 | STANDARD("standard"), 75 | HIGH("high"); 76 | 77 | private final String value; 78 | 79 | Priority(final String value) { 80 | this.value = value; 81 | } 82 | 83 | @JsonCreator 84 | public static Priority forValue(final String value) { 85 | return Promoter.enumFromString(value, Priority.values()); 86 | } 87 | 88 | @JsonValue 89 | public String value() { 90 | return this.value; 91 | } 92 | 93 | @Override 94 | public String toString() { 95 | return value; 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/Sip.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | 4 | import java.util.Objects; 5 | 6 | public class Sip implements Endpoint { 7 | 8 | private final String sip; 9 | 10 | public Sip(String sip) { 11 | this.sip = sip; 12 | } 13 | 14 | @Override 15 | public String getEndpoint() { 16 | return sip; 17 | } 18 | 19 | @Override 20 | public boolean equals(Object o) { 21 | if (this == o) { 22 | return true; 23 | } 24 | 25 | if (o == null || getClass() != o.getClass()) { 26 | return false; 27 | } 28 | 29 | Sip other = (Sip) o; 30 | return Objects.equals(sip, other.sip); 31 | } 32 | 33 | @Override 34 | public int hashCode() { 35 | return Objects.hashCode(sip); 36 | } 37 | 38 | @Override 39 | public String toString() { 40 | return this.sip; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/SubscribeRulesUpdate.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.ToString; 6 | 7 | import java.util.List; 8 | import java.util.Objects; 9 | 10 | /** 11 | * Subscribe Rule Update - Used to update the list of Subscribe Rules 12 | * 13 | *

14 | * For more information see: 15 | * Specifying Subscribe Rules 16 | *

17 | */ 18 | @JsonIgnoreProperties(ignoreUnknown = true) 19 | @ToString 20 | public class SubscribeRulesUpdate { 21 | @JsonProperty("rules") 22 | private final List rules; 23 | 24 | public SubscribeRulesUpdate(@JsonProperty("rules") final List rules) { 25 | this.rules = rules; 26 | } 27 | 28 | public List getRules() { 29 | return rules; 30 | } 31 | 32 | @Override 33 | public boolean equals(final Object o) { 34 | if (this == o) return true; 35 | if (o == null || getClass() != o.getClass()) return false; 36 | final SubscribeRulesUpdate that = (SubscribeRulesUpdate) o; 37 | return Objects.equals(getRules(), that.getRules()); 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | return Objects.hash(getRules()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/twilio/type/Twiml.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import java.util.Objects; 4 | 5 | public class Twiml { 6 | private final String rawTwiml; 7 | 8 | public Twiml(String twiml) { 9 | this.rawTwiml = twiml; 10 | } 11 | 12 | @Override 13 | public boolean equals(Object o) { 14 | if (this == o) { 15 | return true; 16 | } 17 | if (o == null || getClass() != o.getClass()) { 18 | return false; 19 | } 20 | 21 | Twiml other = (Twiml) o; 22 | return Objects.equals(this.rawTwiml, other.rawTwiml); 23 | } 24 | 25 | @Override 26 | public int hashCode() { 27 | return Objects.hash(this.rawTwiml); 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return this.rawTwiml; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/converter/CurrencyDeserializerTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.converter; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.JsonMappingException; 5 | import com.fasterxml.jackson.databind.ObjectMapper; 6 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | 10 | import java.io.IOException; 11 | import java.util.Currency; 12 | 13 | /** 14 | * Test class for {@link CurrencyDeserializer}. 15 | */ 16 | public class CurrencyDeserializerTest { 17 | 18 | @Test 19 | public void testDeserialize() throws IOException { 20 | String json = "{ \"currency\": \"usd\" }"; 21 | ObjectMapper mapper = new ObjectMapper(); 22 | 23 | Container c = Container.fromJson(json, mapper); 24 | Assert.assertEquals("USD", c.currency.getCurrencyCode()); 25 | } 26 | 27 | @Test(expected = JsonMappingException.class) 28 | public void testInvalidCurrency() throws IOException { 29 | String json = "{ \"currency\": \"poo\" }"; 30 | ObjectMapper mapper = new ObjectMapper(); 31 | 32 | Container.fromJson(json, mapper); 33 | } 34 | 35 | private static class Container { 36 | private final Currency currency; 37 | 38 | public Container( 39 | @JsonProperty("currency") 40 | @JsonDeserialize(using = CurrencyDeserializer.class) 41 | Currency currency 42 | ) { 43 | this.currency = currency; 44 | } 45 | 46 | public static Container fromJson(String json, ObjectMapper mapper) throws IOException { 47 | return mapper.readValue(json, Container.class); 48 | } 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/converter/PrefixedCollapsibleMapTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.converter; 2 | 3 | 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | import java.util.Collections; 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | 11 | /** 12 | * Test class for {@link PrefixedCollapsibleMap}. 13 | */ 14 | public class PrefixedCollapsibleMapTest { 15 | 16 | @Test 17 | public void testNull() { 18 | Map actual = PrefixedCollapsibleMap.serialize(null, "Prefix"); 19 | Assert.assertEquals(Collections.emptyMap(), actual); 20 | } 21 | 22 | @Test 23 | public void testSingleKey() { 24 | Map input = new HashMap<>(); 25 | input.put("foo", "bar"); 26 | 27 | Map actual = PrefixedCollapsibleMap.serialize(input, "Prefix"); 28 | 29 | Map expected = new HashMap<>(); 30 | expected.put("Prefix.foo", "bar"); 31 | 32 | Assert.assertEquals(expected, actual); 33 | } 34 | 35 | @Test 36 | public void testNestedKeys() { 37 | Map input = new HashMap<>(); 38 | Map nested = new HashMap<>(); 39 | nested.put("bar", "baz"); 40 | input.put("foo", nested); 41 | 42 | Map actual = PrefixedCollapsibleMap.serialize(input, "Prefix"); 43 | 44 | Map expected = new HashMap<>(); 45 | expected.put("Prefix.foo.bar", "baz"); 46 | 47 | Assert.assertEquals(expected, actual); 48 | } 49 | 50 | @Test 51 | public void testMultipleKeys() { 52 | Map input = new HashMap<>(); 53 | Map nested = new HashMap<>(); 54 | nested.put("bar", "baz"); 55 | 56 | Map watson = new HashMap<>(); 57 | watson.put("language", "en"); 58 | watson.put("alice", "bob"); 59 | 60 | input.put("foo", nested); 61 | input.put("watson", watson); 62 | 63 | Map actual = PrefixedCollapsibleMap.serialize(input, "Prefix"); 64 | 65 | Map expected = new HashMap<>(); 66 | expected.put("Prefix.foo.bar", "baz"); 67 | expected.put("Prefix.watson.language", "en"); 68 | expected.put("Prefix.watson.alice", "bob"); 69 | 70 | Assert.assertEquals(expected, actual); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/converter/PromoterTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.converter; 2 | 3 | import com.twilio.type.PhoneNumber; 4 | import com.twilio.type.Twiml; 5 | import org.junit.Assert; 6 | import org.junit.Test; 7 | 8 | import java.net.URI; 9 | import java.util.Collections; 10 | 11 | /** 12 | * Test class for {@link Promoter} 13 | */ 14 | public class PromoterTest { 15 | 16 | @Test 17 | public void testPromoteUri() { 18 | URI uri = Promoter.uriFromString("https://trunking.twilio.com/v1/Trunks/TK123/OriginationUrls"); 19 | Assert.assertEquals( 20 | "https://trunking.twilio.com/v1/Trunks/TK123/OriginationUrls", 21 | uri.toString() 22 | ); 23 | } 24 | 25 | @Test 26 | public void testPhoneNumberFromString() { 27 | PhoneNumber pn = Promoter.phoneNumberFromString("+12345678910"); 28 | Assert.assertEquals(new PhoneNumber("+12345678910"), pn); 29 | } 30 | 31 | @Test 32 | public void testTwimlFromString() { 33 | Twiml twiml = Promoter.twimlFromString("Ahoy!"); 34 | Assert.assertEquals(new Twiml("Ahoy!"), twiml); 35 | } 36 | 37 | @Test 38 | public void testPromoteList() { 39 | String s = "hi"; 40 | Assert.assertEquals( 41 | Collections.singletonList(s), 42 | Promoter.listOfOne(s) 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/http/HttpUtilityTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.http; 2 | 3 | import org.junit.Test; 4 | 5 | import java.util.ArrayList; 6 | import java.util.Arrays; 7 | import java.util.List; 8 | 9 | import static org.junit.Assert.assertFalse; 10 | import static org.junit.Assert.assertTrue; 11 | 12 | public class HttpUtilityTest { 13 | private List userAgentExtensionsEmpty = new ArrayList<>(); 14 | private List userAgentExtensions = Arrays.asList("ce-appointment-reminders/1.0.0", "code-exchange"); 15 | 16 | @Test 17 | public void getUserAgentStringTest() { 18 | String userAgentString = HttpUtility.getUserAgentString(userAgentExtensions); 19 | assertTrue(userAgentString.endsWith("ce-appointment-reminders/1.0.0 code-exchange")); 20 | } 21 | 22 | @Test 23 | public void getUserAgentStringEmptyTest() { 24 | String userAgentString = HttpUtility.getUserAgentString(userAgentExtensionsEmpty); 25 | assertFalse(userAgentString.contains("ce-appointment-reminders/1.0.0 code-exchange")); 26 | } 27 | 28 | @Test 29 | public void getUserAgentStringCustomTest() { 30 | String userAgentString = HttpUtility.getUserAgentString(userAgentExtensions, true); 31 | assertTrue(userAgentString.endsWith("ce-appointment-reminders/1.0.0 code-exchange custom")); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/http/ResponseTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.http; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.mockito.Mock; 6 | import org.mockito.runners.MockitoJUnitRunner; 7 | 8 | import java.io.InputStream; 9 | 10 | import static org.junit.Assert.assertEquals; 11 | 12 | @RunWith(MockitoJUnitRunner.class) 13 | public class ResponseTest { 14 | 15 | @Mock 16 | private InputStream stream; 17 | 18 | @Test 19 | public void testGetContentInputStream() { 20 | String testValue = "Test"; 21 | TestInputStream stream = new TestInputStream(testValue); 22 | Response response = new Response(stream, TwilioRestClient.HTTP_STATUS_CODE_OK); 23 | 24 | assertEquals(testValue, response.getContent()); 25 | } 26 | 27 | 28 | @Test 29 | public void testRepeatedCallGetContent() { 30 | String testValue = "TestRepeatedCalls"; 31 | TestInputStream stream = new TestInputStream(testValue); 32 | Response response = new Response(stream, TwilioRestClient.HTTP_STATUS_CODE_OK); 33 | 34 | assertEquals(testValue, response.getContent()); 35 | assertEquals(testValue, response.getContent()); 36 | } 37 | 38 | @Test 39 | public void testGetContentString() { 40 | Response response = new Response("Test", TwilioRestClient.HTTP_STATUS_CODE_OK); 41 | assertEquals("Test", response.getContent()); 42 | } 43 | 44 | @Test 45 | public void testGetStream() { 46 | Response response = new Response(stream, TwilioRestClient.HTTP_STATUS_CODE_OK); 47 | assertEquals(stream, response.getStream()); 48 | } 49 | } 50 | 51 | class TestInputStream extends InputStream { 52 | private byte[] string; 53 | private int count = 0; 54 | 55 | TestInputStream(String testValue) { 56 | this.string = testValue.getBytes(); 57 | } 58 | 59 | @Override 60 | public int read() { 61 | try { 62 | Thread.sleep(1L); // Sleep so available() can return 0 but there is still more data 63 | } catch (Exception ignore) { } 64 | 65 | return count++ > string.length - 1 ? -1 : string[count-1]; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/jwt/client/EventStreamScopeTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.client; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import java.io.UnsupportedEncodingException; 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | /** 11 | * Test class for {@link EventStreamScope}. 12 | */ 13 | public class EventStreamScopeTest { 14 | 15 | @Test 16 | public void testGenerate() throws UnsupportedEncodingException { 17 | Map filters = new HashMap<>(); 18 | filters.put("foo", "bar"); 19 | 20 | Scope scope = new EventStreamScope.Builder() 21 | .filters(filters) 22 | .build(); 23 | 24 | Assert.assertEquals( 25 | "scope:stream:subscribe?path=/2010-04-01/Events&appParams=foo%3Dbar", 26 | scope.getPayload() 27 | ); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/jwt/client/IncomingClientScopeTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.client; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import java.io.UnsupportedEncodingException; 7 | 8 | /** 9 | * Test class for {@link IncomingClientScope}. 10 | */ 11 | public class IncomingClientScopeTest { 12 | 13 | @Test 14 | public void testGenerate() throws UnsupportedEncodingException { 15 | Scope scope = new IncomingClientScope("foobar"); 16 | Assert.assertEquals( 17 | "scope:client:incoming?clientName=foobar", 18 | scope.getPayload() 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/jwt/client/OutgoingClientScopeTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.client; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import java.io.UnsupportedEncodingException; 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | /** 11 | * Test class for {@link OutgoingClientScope}. 12 | */ 13 | public class OutgoingClientScopeTest { 14 | 15 | @Test 16 | public void testGenerate() throws UnsupportedEncodingException { 17 | Map params = new HashMap<>(); 18 | params.put("foo", "bar"); 19 | 20 | Scope scope = new OutgoingClientScope.Builder("AP123") 21 | .clientName("CL123") 22 | .params(params) 23 | .build(); 24 | 25 | Assert.assertEquals( 26 | "scope:client:outgoing?appSid=AP123&clientName=CL123&appParams=foo%3Dbar", 27 | scope.getPayload() 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/jwt/taskrouter/PolicyTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.taskrouter; 2 | 3 | import com.twilio.http.HttpMethod; 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | import java.io.IOException; 8 | import java.util.Collections; 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | 12 | /** 13 | * Test class for {@link Policy}. 14 | */ 15 | public class PolicyTest { 16 | 17 | @Test 18 | public void testToJson() throws IOException { 19 | Map filter = new HashMap<>(); 20 | filter.put("foo", FilterRequirement.REQUIRED); 21 | 22 | Policy p = new Policy.Builder() 23 | .url("http://localhost") 24 | .method(HttpMethod.GET) 25 | .postFilter(Collections.emptyMap()) 26 | .queryFilter(filter) 27 | .build(); 28 | 29 | Assert.assertEquals( 30 | "{\"allow\":true,\"method\":\"GET\",\"post_filter\":{},\"query_filter\":{\"foo\":{\"required\":true}},\"url\":\"http://localhost\"}", 31 | p.toJson()); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/jwt/taskrouter/PolicyUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.jwt.taskrouter; 2 | 3 | import com.twilio.http.HttpMethod; 4 | import org.junit.Assert; 5 | import org.junit.Test; 6 | 7 | import java.util.Arrays; 8 | import java.util.List; 9 | 10 | /** 11 | * Test class for {@link PolicyUtils}. 12 | */ 13 | public class PolicyUtilsTest { 14 | 15 | @Test 16 | public void testDefaultWorkerPolicies() { 17 | String workspaceSid = "WS123"; 18 | String workerSid = "WK123"; 19 | 20 | Policy activities = new Policy.Builder() 21 | .url(UrlUtils.activities(workspaceSid)) 22 | .method(HttpMethod.GET) 23 | .allowed(true) 24 | .build(); 25 | 26 | Policy tasks = new Policy.Builder() 27 | .url(UrlUtils.allTasks(workspaceSid)) 28 | .method(HttpMethod.GET) 29 | .allowed(true) 30 | .build(); 31 | 32 | Policy reservations = new Policy.Builder() 33 | .url(UrlUtils.allReservations(workspaceSid, workerSid)) 34 | .method(HttpMethod.GET) 35 | .allowed(true) 36 | .build(); 37 | 38 | Policy workerFetch = new Policy.Builder() 39 | .url(UrlUtils.worker(workspaceSid, workerSid)) 40 | .method(HttpMethod.GET) 41 | .allowed(true) 42 | .build(); 43 | 44 | List policies = Arrays.asList(activities, tasks, reservations, workerFetch); 45 | Assert.assertEquals( 46 | policies, 47 | PolicyUtils.defaultWorkerPolicies(workspaceSid, workerSid) 48 | ); 49 | } 50 | 51 | @Test 52 | public void testDefaultEventBridgePolicies() { 53 | String accountSid = "AC123"; 54 | String channelId = "CH123"; 55 | String url = String.join("/", "https://event-bridge.twilio.com/v1/wschannels", accountSid, channelId); 56 | 57 | Policy get = new Policy.Builder().url(url).method(HttpMethod.GET).allowed(true).build(); 58 | Policy post = new Policy.Builder().url(url).method(HttpMethod.POST).allowed(true).build(); 59 | List policies = Arrays.asList(get, post); 60 | 61 | Assert.assertEquals( 62 | policies, 63 | PolicyUtils.defaultEventBridgePolicies(accountSid, channelId) 64 | ); 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/taskrouter/WorkflowRuleTargetTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.taskrouter; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * Test class for {@link WorkflowRuleTarget} 10 | */ 11 | public class WorkflowRuleTargetTest { 12 | 13 | @Test 14 | public void testToJson() throws IOException { 15 | WorkflowRuleTarget target = new WorkflowRuleTarget.Builder("QS123") 16 | .expression("1==1") 17 | .priority(5) 18 | .timeout(30) 19 | .orderBy("worker.english_level ASC") 20 | .skipIf("workers.available == 0") 21 | .knownWorkerSid("task.requested_agent_id") 22 | .knownWorkerFriendlyName("task.requested_agent") 23 | .build(); 24 | 25 | Assert.assertEquals( 26 | "{\"queue\":\"QS123\",\"expression\":\"1==1\",\"priority\":5,\"timeout\":30,\"order_by\":\"worker.english_level ASC\",\"skip_if\":\"workers.available == 0\",\"known_worker_sid\":\"task.requested_agent_id\",\"known_worker_friendly_name\":\"task.requested_agent\"}", 27 | target.toJson() 28 | ); 29 | } 30 | 31 | @Test 32 | public void testFromJson() throws IOException { 33 | WorkflowRuleTarget target = 34 | WorkflowRuleTarget.fromJson("{\"queue\":\"QS123\",\"expression\":\"1==1\",\"priority\":5,\"timeout\":30,\"order_by\":\"worker.english_level ASC\",\"skip_if\":\"workers.available == 0\",\"known_worker_friendly_name\":\"task.requested_agent\",\"known_worker_sid\":\"task.requested_agent_id\"}"); 35 | 36 | Assert.assertEquals("QS123", target.getQueue()); 37 | Assert.assertEquals("1==1", target.getExpression()); 38 | Assert.assertEquals(5, (int)target.getPriority()); 39 | Assert.assertEquals(30, (int)target.getTimeout()); 40 | Assert.assertEquals("worker.english_level ASC", target.getOrderBy()); 41 | Assert.assertEquals("workers.available == 0", target.getSkipIf()); 42 | Assert.assertEquals("task.requested_agent", target.getKnownWorkerFriendlyName()); 43 | Assert.assertEquals("task.requested_agent_id", target.getKnownWorkerSid()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/messaging/BodyTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.messaging; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | /** 14 | * Test class for {@link Body} 15 | */ 16 | public class BodyTest { 17 | @Test 18 | public void testElementWithParams() { 19 | Body elem = new Body.Builder("message").build(); 20 | 21 | Assert.assertEquals( 22 | "" + 23 | "message", 24 | elem.toXml() 25 | ); 26 | } 27 | 28 | @Test 29 | public void testXmlAttributesDeserialization() { 30 | final Body elem = new Body.Builder("message").build(); 31 | 32 | Assert.assertEquals( 33 | Body.Builder.fromXml("message").build().toXml(), 34 | elem.toXml() 35 | ); 36 | } 37 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/messaging/MediaTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.messaging; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | import java.net.URI; 14 | 15 | /** 16 | * Test class for {@link Media} 17 | */ 18 | public class MediaTest { 19 | @Test 20 | public void testElementWithParams() { 21 | Media elem = new Media.Builder(URI.create("https://example.com")).build(); 22 | 23 | Assert.assertEquals( 24 | "" + 25 | "https://example.com", 26 | elem.toXml() 27 | ); 28 | } 29 | 30 | @Test 31 | public void testXmlAttributesDeserialization() { 32 | final Media elem = new Media.Builder(URI.create("https://example.com")).build(); 33 | 34 | Assert.assertEquals( 35 | Media.Builder.fromXml("https://example.com").build().toXml(), 36 | elem.toXml() 37 | ); 38 | } 39 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/messaging/RedirectTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.messaging; 9 | 10 | import com.twilio.http.HttpMethod; 11 | import org.junit.Assert; 12 | import org.junit.Test; 13 | 14 | import java.net.URI; 15 | 16 | /** 17 | * Test class for {@link Redirect} 18 | */ 19 | public class RedirectTest { 20 | @Test 21 | public void testElementWithParams() { 22 | Redirect elem = new Redirect.Builder(URI.create("https://example.com")).method(HttpMethod.GET).build(); 23 | 24 | Assert.assertEquals( 25 | "" + 26 | "https://example.com", 27 | elem.toXml() 28 | ); 29 | } 30 | 31 | @Test 32 | public void testXmlAttributesDeserialization() { 33 | final Redirect elem = new Redirect.Builder(URI.create("https://example.com")).method(HttpMethod.GET).build(); 34 | 35 | Assert.assertEquals( 36 | Redirect.Builder.fromXml("https://example.com").build().toXml(), 37 | elem.toXml() 38 | ); 39 | } 40 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/ApplicationSidTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | /** 14 | * Test class for {@link ApplicationSid} 15 | */ 16 | public class ApplicationSidTest { 17 | @Test 18 | public void testElementWithParams() { 19 | ApplicationSid elem = new ApplicationSid.Builder("sid").build(); 20 | 21 | Assert.assertEquals( 22 | "" + 23 | "sid", 24 | elem.toXml() 25 | ); 26 | } 27 | 28 | @Test 29 | public void testXmlAttributesDeserialization() { 30 | final ApplicationSid elem = new ApplicationSid.Builder("sid").build(); 31 | 32 | Assert.assertEquals( 33 | ApplicationSid.Builder.fromXml("sid").build().toXml(), 34 | elem.toXml() 35 | ); 36 | } 37 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/AutopilotTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | /** 14 | * Test class for {@link Autopilot} 15 | */ 16 | public class AutopilotTest { 17 | @Test 18 | public void testElementWithParams() { 19 | Autopilot elem = new Autopilot.Builder("name").build(); 20 | 21 | Assert.assertEquals( 22 | "" + 23 | "name", 24 | elem.toXml() 25 | ); 26 | } 27 | 28 | @Test 29 | public void testXmlAttributesDeserialization() { 30 | final Autopilot elem = new Autopilot.Builder("name").build(); 31 | 32 | Assert.assertEquals( 33 | Autopilot.Builder.fromXml("name").build().toXml(), 34 | elem.toXml() 35 | ); 36 | } 37 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/IdentityTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | /** 14 | * Test class for {@link Identity} 15 | */ 16 | public class IdentityTest { 17 | @Test 18 | public void testElementWithParams() { 19 | Identity elem = new Identity.Builder("client_identity").build(); 20 | 21 | Assert.assertEquals( 22 | "" + 23 | "client_identity", 24 | elem.toXml() 25 | ); 26 | } 27 | 28 | @Test 29 | public void testXmlAttributesDeserialization() { 30 | final Identity elem = new Identity.Builder("client_identity").build(); 31 | 32 | Assert.assertEquals( 33 | Identity.Builder.fromXml("client_identity").build().toXml(), 34 | elem.toXml() 35 | ); 36 | } 37 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/PlayTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | import java.net.URI; 14 | 15 | /** 16 | * Test class for {@link Play} 17 | */ 18 | public class PlayTest { 19 | @Test 20 | public void testElementWithParams() { 21 | Play elem = new Play.Builder(URI.create("https://example.com")).loop(1).digits("digits").build(); 22 | 23 | Assert.assertEquals( 24 | "" + 25 | "https://example.com", 26 | elem.toXml() 27 | ); 28 | } 29 | 30 | @Test 31 | public void testXmlAttributesDeserialization() { 32 | final Play elem = new Play.Builder(URI.create("https://example.com")).loop(1).digits("digits").build(); 33 | 34 | Assert.assertEquals( 35 | Play.Builder.fromXml("https://example.com").build().toXml(), 36 | elem.toXml() 37 | ); 38 | } 39 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/QueueTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import com.twilio.http.HttpMethod; 11 | import org.junit.Assert; 12 | import org.junit.Test; 13 | 14 | import java.net.URI; 15 | 16 | /** 17 | * Test class for {@link Queue} 18 | */ 19 | public class QueueTest { 20 | @Test 21 | public void testElementWithParams() { 22 | Queue elem = new Queue.Builder("name") 23 | .url(URI.create("https://example.com")) 24 | .method(HttpMethod.GET) 25 | .reservationSid("reservation_sid") 26 | .postWorkActivitySid("post_work_activity_sid") 27 | .build(); 28 | 29 | Assert.assertEquals( 30 | "" + 31 | "name", 32 | elem.toXml() 33 | ); 34 | } 35 | 36 | @Test 37 | public void testXmlAttributesDeserialization() { 38 | final Queue elem = new Queue.Builder("name") 39 | .url(URI.create("https://example.com")) 40 | .method(HttpMethod.GET) 41 | .reservationSid("reservation_sid") 42 | .postWorkActivitySid("post_work_activity_sid") 43 | .build(); 44 | 45 | Assert.assertEquals( 46 | Queue.Builder.fromXml("name").build().toXml(), 47 | elem.toXml() 48 | ); 49 | } 50 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/RedirectTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import com.twilio.http.HttpMethod; 11 | import org.junit.Assert; 12 | import org.junit.Test; 13 | 14 | import java.net.URI; 15 | 16 | /** 17 | * Test class for {@link Redirect} 18 | */ 19 | public class RedirectTest { 20 | @Test 21 | public void testElementWithParams() { 22 | Redirect elem = new Redirect.Builder(URI.create("https://example.com")).method(HttpMethod.GET).build(); 23 | 24 | Assert.assertEquals( 25 | "" + 26 | "https://example.com", 27 | elem.toXml() 28 | ); 29 | } 30 | 31 | @Test 32 | public void testXmlAttributesDeserialization() { 33 | final Redirect elem = new Redirect.Builder(URI.create("https://example.com")).method(HttpMethod.GET).build(); 34 | 35 | Assert.assertEquals( 36 | Redirect.Builder.fromXml("https://example.com").build().toXml(), 37 | elem.toXml() 38 | ); 39 | } 40 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/ReferSipTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | import java.net.URI; 14 | 15 | /** 16 | * Test class for {@link ReferSip} 17 | */ 18 | public class ReferSipTest { 19 | @Test 20 | public void testElementWithParams() { 21 | ReferSip elem = new ReferSip.Builder(URI.create("https://example.com")).build(); 22 | 23 | Assert.assertEquals( 24 | "" + 25 | "https://example.com", 26 | elem.toXml() 27 | ); 28 | } 29 | 30 | @Test 31 | public void testXmlAttributesDeserialization() { 32 | final ReferSip elem = new ReferSip.Builder(URI.create("https://example.com")).build(); 33 | 34 | Assert.assertEquals( 35 | ReferSip.Builder.fromXml("https://example.com").build().toXml(), 36 | elem.toXml() 37 | ); 38 | } 39 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/RoomTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | /** 14 | * Test class for {@link Room} 15 | */ 16 | public class RoomTest { 17 | @Test 18 | public void testElementWithParams() { 19 | Room elem = new Room.Builder("name").participantIdentity("participant_identity").build(); 20 | 21 | Assert.assertEquals( 22 | "" + 23 | "name", 24 | elem.toXml() 25 | ); 26 | } 27 | 28 | @Test 29 | public void testXmlAttributesDeserialization() { 30 | final Room elem = new Room.Builder("name").participantIdentity("participant_identity").build(); 31 | 32 | Assert.assertEquals( 33 | Room.Builder.fromXml("name").build().toXml(), 34 | elem.toXml() 35 | ); 36 | } 37 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/SimTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | /** 14 | * Test class for {@link Sim} 15 | */ 16 | public class SimTest { 17 | @Test 18 | public void testElementWithParams() { 19 | Sim elem = new Sim.Builder("DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").build(); 20 | 21 | Assert.assertEquals( 22 | "" + 23 | "DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 24 | elem.toXml() 25 | ); 26 | } 27 | 28 | @Test 29 | public void testXmlAttributesDeserialization() { 30 | final Sim elem = new Sim.Builder("DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").build(); 31 | 32 | Assert.assertEquals( 33 | Sim.Builder.fromXml("DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").build().toXml(), 34 | elem.toXml() 35 | ); 36 | } 37 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/SmsTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import com.twilio.http.HttpMethod; 11 | import org.junit.Assert; 12 | import org.junit.Test; 13 | 14 | import java.net.URI; 15 | 16 | /** 17 | * Test class for {@link Sms} 18 | */ 19 | public class SmsTest { 20 | @Test 21 | public void testElementWithParams() { 22 | Sms elem = new Sms.Builder("message") 23 | .to(new com.twilio.type.PhoneNumber("+15558675310")) 24 | .from(new com.twilio.type.PhoneNumber("+15017122661")) 25 | .action(URI.create("https://example.com")) 26 | .method(HttpMethod.GET) 27 | .statusCallback(URI.create("https://example.com")) 28 | .build(); 29 | 30 | Assert.assertEquals( 31 | "" + 32 | "message", 33 | elem.toXml() 34 | ); 35 | } 36 | 37 | @Test 38 | public void testXmlAttributesDeserialization() { 39 | final Sms elem = new Sms.Builder("message") 40 | .to(new com.twilio.type.PhoneNumber("+15558675310")) 41 | .from(new com.twilio.type.PhoneNumber("+15017122661")) 42 | .action(URI.create("https://example.com")) 43 | .method(HttpMethod.GET) 44 | .statusCallback(URI.create("https://example.com")) 45 | .build(); 46 | 47 | Assert.assertEquals( 48 | Sms.Builder.fromXml("message").build().toXml(), 49 | elem.toXml() 50 | ); 51 | } 52 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/SsmlPhonemeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | /** 14 | * Test class for {@link SsmlPhoneme} 15 | */ 16 | public class SsmlPhonemeTest { 17 | @Test 18 | public void testElementWithParams() { 19 | SsmlPhoneme elem = new SsmlPhoneme.Builder("words").alphabet(SsmlPhoneme.Alphabet.IPA).ph("ph").build(); 20 | 21 | Assert.assertEquals( 22 | "" + 23 | "words", 24 | elem.toXml() 25 | ); 26 | } 27 | 28 | @Test 29 | public void testXmlAttributesDeserialization() { 30 | final SsmlPhoneme elem = new SsmlPhoneme.Builder("words").alphabet(SsmlPhoneme.Alphabet.IPA).ph("ph").build(); 31 | 32 | Assert.assertEquals( 33 | SsmlPhoneme.Builder.fromXml("words").build().toXml(), 34 | elem.toXml() 35 | ); 36 | } 37 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/SsmlSayAsTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | /** 14 | * Test class for {@link SsmlSayAs} 15 | */ 16 | public class SsmlSayAsTest { 17 | @Test 18 | public void testElementWithParams() { 19 | SsmlSayAs elem = new SsmlSayAs.Builder("words") 20 | .interpretAs(SsmlSayAs.InterpretAs.CHARACTERS) 21 | .format(SsmlSayAs.Format.MDY) 22 | .build(); 23 | 24 | Assert.assertEquals( 25 | "" + 26 | "words", 27 | elem.toXml() 28 | ); 29 | } 30 | 31 | @Test 32 | public void testXmlAttributesDeserialization() { 33 | final SsmlSayAs elem = new SsmlSayAs.Builder("words") 34 | .interpretAs(SsmlSayAs.InterpretAs.CHARACTERS) 35 | .format(SsmlSayAs.Format.MDY) 36 | .build(); 37 | 38 | Assert.assertEquals( 39 | SsmlSayAs.Builder.fromXml("words").build().toXml(), 40 | elem.toXml() 41 | ); 42 | } 43 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/SsmlSubTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | /** 14 | * Test class for {@link SsmlSub} 15 | */ 16 | public class SsmlSubTest { 17 | @Test 18 | public void testElementWithParams() { 19 | SsmlSub elem = new SsmlSub.Builder("words").alias("alias").build(); 20 | 21 | Assert.assertEquals( 22 | "" + 23 | "words", 24 | elem.toXml() 25 | ); 26 | } 27 | 28 | @Test 29 | public void testXmlAttributesDeserialization() { 30 | final SsmlSub elem = new SsmlSub.Builder("words").alias("alias").build(); 31 | 32 | Assert.assertEquals( 33 | SsmlSub.Builder.fromXml("words").build().toXml(), 34 | elem.toXml() 35 | ); 36 | } 37 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/twiml/voice/TaskTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was generated by 3 | * \ / _ _ _| _ _ 4 | * | (_)\/(_)(_|\/| |(/_ v1.0.0 5 | * / / 6 | */ 7 | 8 | package com.twilio.twiml.voice; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | /** 14 | * Test class for {@link Task} 15 | */ 16 | public class TaskTest { 17 | @Test 18 | public void testElementWithParams() { 19 | Task elem = new Task.Builder("body").priority(1).timeout(1).build(); 20 | 21 | Assert.assertEquals( 22 | "" + 23 | "body", 24 | elem.toXml() 25 | ); 26 | } 27 | 28 | @Test 29 | public void testXmlAttributesDeserialization() { 30 | final Task elem = new Task.Builder("body").priority(1).timeout(1).build(); 31 | 32 | Assert.assertEquals( 33 | Task.Builder.fromXml("body").build().toXml(), 34 | elem.toXml() 35 | ); 36 | } 37 | } -------------------------------------------------------------------------------- /src/test/java/com/twilio/type/ClientTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | public class ClientTest { 7 | 8 | @Test 9 | public void testGetEndpoint() { 10 | Assert.assertEquals("client:me", new Client("me").getEndpoint()); 11 | Assert.assertEquals("client:YOU", new Client("YOU").getEndpoint()); 12 | Assert.assertEquals("CLIENT:HIM", new Client("CLIENT:HIM").getEndpoint()); 13 | Assert.assertEquals("cLiEnT:her", new Client("cLiEnT:her").getEndpoint()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/type/FeedbackIssueTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * Test class for {@link FeedbackIssue}. 10 | */ 11 | public class FeedbackIssueTest extends TypeTest { 12 | 13 | @Test 14 | public void testFromJson() throws IOException { 15 | String json = "{\n" + 16 | " \"count\": 5,\n" + 17 | " \"description\": \"issue\",\n" + 18 | " \"percentage_of_total_calls\": \"99.9\"\n" + 19 | "}"; 20 | 21 | FeedbackIssue issue = fromJson(json, FeedbackIssue.class); 22 | Assert.assertEquals(5, issue.getCount()); 23 | Assert.assertEquals("issue", issue.getDescription()); 24 | Assert.assertEquals("99.9", issue.getPercentageOfTotalCalls()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/type/IceServerTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * Test class for {@link IceServer}. 10 | */ 11 | public class IceServerTest extends TypeTest { 12 | 13 | @Test 14 | public void testFromJson() throws IOException { 15 | String json = "{\n" + 16 | " \"credential\": \"apn\",\n" + 17 | " \"username\": \"twilio\",\n" + 18 | " \"url\": \"https://www.twilio.ca\",\n" + 19 | " \"urls\": \"https://www.twilio.ca\"\n" + 20 | "}"; 21 | 22 | IceServer is = fromJson(json, IceServer.class); 23 | Assert.assertEquals("https://www.twilio.ca", is.getUrl()); 24 | Assert.assertEquals("https://www.twilio.ca", is.getUrls()); 25 | Assert.assertEquals(is.getUrls(), is.getUrl()); 26 | Assert.assertEquals("apn", is.getCredential()); 27 | Assert.assertEquals("twilio", is.getUsername()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/type/InboundCallPriceTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * Test class for {@link InboundCallPrice}. 10 | */ 11 | public class InboundCallPriceTest extends TypeTest { 12 | 13 | @Test 14 | public void testFromJson() throws IOException { 15 | String json = "{\n" + 16 | " \"base_price\": 1.00,\n" + 17 | " \"current_price\": 2.00,\n" + 18 | " \"type\": \"mobile\"\n" + 19 | "}"; 20 | 21 | InboundCallPrice icp = fromJson(json, InboundCallPrice.class); 22 | Assert.assertEquals(1.00, icp.getBasePrice(), 0.00); 23 | Assert.assertEquals(2.00, icp.getCurrentPrice(), 0.00); 24 | Assert.assertEquals(InboundCallPrice.Type.MOBILE, icp.getType()); 25 | } 26 | 27 | @Test 28 | public void testFromJsonTollFree() throws IOException { 29 | String json = "{\n" + 30 | " \"base_price\": 1.00,\n" + 31 | " \"current_price\": 2.00,\n" + 32 | " \"type\": \"toll free\"\n" + 33 | "}"; 34 | 35 | InboundCallPrice icp = fromJson(json, InboundCallPrice.class); 36 | Assert.assertEquals(1.00, icp.getBasePrice(), 0.00); 37 | Assert.assertEquals(2.00, icp.getCurrentPrice(), 0.00); 38 | Assert.assertEquals(InboundCallPrice.Type.TOLLFREE, icp.getType()); 39 | } 40 | 41 | @Test 42 | public void testFromJsonExtraField() throws IOException { 43 | String json = "{\n" + 44 | " \"base_price\": 1.00,\n" + 45 | " \"current_price\": 2.00,\n" + 46 | " \"type\": \"toll free\",\n" + 47 | " \"foo\": \"bar\"\n" + 48 | "}"; 49 | 50 | InboundCallPrice icp = fromJson(json, InboundCallPrice.class); 51 | Assert.assertEquals(1.00, icp.getBasePrice(), 0.00); 52 | Assert.assertEquals(2.00, icp.getCurrentPrice(), 0.00); 53 | Assert.assertEquals(InboundCallPrice.Type.TOLLFREE, icp.getType()); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/type/InboundSmsPriceTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * Test class for {@link InboundSmsPrice}. 10 | */ 11 | public class InboundSmsPriceTest extends TypeTest { 12 | 13 | @Test 14 | public void testFromJson() throws IOException { 15 | String json = "{\n" + 16 | " \"base_price\": 1.00,\n" + 17 | " \"current_price\": 2.00,\n" + 18 | " \"number_type\": \"mobile\"\n" + 19 | "}"; 20 | 21 | InboundSmsPrice icp = fromJson(json, InboundSmsPrice.class); 22 | Assert.assertEquals(1.00, icp.getBasePrice(), 0.00); 23 | Assert.assertEquals(2.00, icp.getCurrentPrice(), 0.00); 24 | Assert.assertEquals(InboundSmsPrice.Type.MOBILE, icp.getType()); 25 | } 26 | 27 | @Test 28 | public void testFromJsonTollFree() throws IOException { 29 | String json = "{\n" + 30 | " \"base_price\": 1.00,\n" + 31 | " \"current_price\": 2.00,\n" + 32 | " \"number_type\": \"toll free\"\n" + 33 | "}"; 34 | 35 | InboundSmsPrice icp = fromJson(json, InboundSmsPrice.class); 36 | Assert.assertEquals(1.00, icp.getBasePrice(), 0.00); 37 | Assert.assertEquals(2.00, icp.getCurrentPrice(), 0.00); 38 | Assert.assertEquals(InboundSmsPrice.Type.TOLLFREE, icp.getType()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/type/OutboundCallPriceTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * Test class for {@link OutboundCallPrice}. 10 | */ 11 | public class OutboundCallPriceTest extends TypeTest { 12 | 13 | @Test 14 | public void testFromJson() throws IOException { 15 | String json = "{\n" + 16 | " \"base_price\": 1.00,\n" + 17 | " \"current_price\": 2.00\n" + 18 | "}"; 19 | 20 | OutboundCallPrice ocp = fromJson(json, OutboundCallPrice.class); 21 | Assert.assertEquals(1.00, ocp.getBasePrice(), 0.00); 22 | Assert.assertEquals(2.00, ocp.getCurrentPrice(), 0.00); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/type/OutboundPrefixPriceTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | import java.util.Arrays; 8 | 9 | /** 10 | * Test class for {@link OutboundPrefixPrice}. 11 | */ 12 | public class OutboundPrefixPriceTest extends TypeTest { 13 | 14 | @Test 15 | public void testFromJson() throws IOException { 16 | String json = "{\n" + 17 | " \"prefixes\": [\n" + 18 | " \"abc\",\n" + 19 | " \"xyz\"\n" + 20 | " ],\n" + 21 | " \"friendly_name\": \"name\",\n" + 22 | " \"base_price\": 1.00,\n" + 23 | " \"current_price\": 2.00\n" + 24 | "}"; 25 | 26 | OutboundPrefixPrice opp = fromJson(json, OutboundPrefixPrice.class); 27 | Assert.assertEquals(Arrays.asList("abc", "xyz"), opp.getPrefixes()); 28 | Assert.assertEquals("name", opp.getFriendlyName()); 29 | Assert.assertEquals(1.00, opp.getBasePrice(), 0.00); 30 | Assert.assertEquals(2.00, opp.getCurrentPrice(), 0.00); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/type/OutboundSmsPriceTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | import java.util.Collections; 8 | 9 | /** 10 | * Test class for {@link OutboundSmsPrice}. 11 | */ 12 | public class OutboundSmsPriceTest extends TypeTest { 13 | 14 | @Test 15 | public void testFromJson() throws IOException { 16 | String json = "{\n" + 17 | " \"mcc\": \"mcc\",\n" + 18 | " \"mnc\": \"mnc\",\n" + 19 | " \"carrier\": \"att\",\n" + 20 | " \"prices\": [{\n" + 21 | " \"type\": \"local\",\n" + 22 | " \"base_price\": 1.00,\n" + 23 | " \"current_price\": 2.00\n" + 24 | " }]\n" + 25 | "}"; 26 | 27 | OutboundSmsPrice osp = fromJson(json, OutboundSmsPrice.class); 28 | Assert.assertEquals("mcc", osp.getMcc()); 29 | Assert.assertEquals("mnc", osp.getMnc()); 30 | Assert.assertEquals("att", osp.getCarrier()); 31 | Assert.assertEquals(Collections.singletonList( 32 | new InboundSmsPrice(1.00, 2.00, InboundSmsPrice.Type.LOCAL) 33 | ), osp.getPrices()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/type/PhoneNumberCapabilitiesTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * Test class for {@link PhoneNumberCapabilities}. 10 | */ 11 | public class PhoneNumberCapabilitiesTest extends TypeTest { 12 | 13 | @Test 14 | public void testFromJson() throws IOException { 15 | String json = "{\n" + 16 | " \"MMS\": true,\n" + 17 | " \"SMS\": false,\n" + 18 | " \"voice\": true\n" + 19 | "}"; 20 | 21 | PhoneNumberCapabilities pnc = fromJson(json, PhoneNumberCapabilities.class); 22 | Assert.assertTrue(pnc.getMms()); 23 | Assert.assertTrue(pnc.getVoice()); 24 | Assert.assertFalse(pnc.getSms()); 25 | } 26 | 27 | @Test 28 | public void testFromJsonExtraField() throws IOException { 29 | String json = "{\n" + 30 | " \"MMS\": true,\n" + 31 | " \"SMS\": false,\n" + 32 | " \"voice\": true,\n" + 33 | " \"foo\": true\n" + 34 | "}"; 35 | 36 | PhoneNumberCapabilities pnc = fromJson(json, PhoneNumberCapabilities.class); 37 | Assert.assertTrue(pnc.getMms()); 38 | Assert.assertTrue(pnc.getVoice()); 39 | Assert.assertFalse(pnc.getSms()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/type/PhoneNumberPriceTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * Test class for {@link PhoneNumberPrice}. 10 | */ 11 | public class PhoneNumberPriceTest extends TypeTest { 12 | 13 | @Test 14 | public void testFromJson() throws IOException { 15 | String json = "{\n" + 16 | " \"base_price\": 1.00,\n" + 17 | " \"current_price\": 2.00,\n" + 18 | " \"number_type\": \"mobile\"\n" + 19 | "}"; 20 | 21 | PhoneNumberPrice pnp = fromJson(json, PhoneNumberPrice.class); 22 | Assert.assertEquals(1.00, pnp.getBasePrice(), 0.00); 23 | Assert.assertEquals(2.00, pnp.getCurrentPrice(), 0.00); 24 | Assert.assertEquals(PhoneNumberPrice.Type.MOBILE, pnp.getType()); 25 | } 26 | 27 | @Test 28 | public void testFromJsonTollFreeType() throws IOException { 29 | String json = "{\n" + 30 | " \"base_price\": 1.00,\n" + 31 | " \"current_price\": 2.00,\n" + 32 | " \"number_type\": \"toll free\"\n" + 33 | "}"; 34 | 35 | PhoneNumberPrice pnp = fromJson(json, PhoneNumberPrice.class); 36 | Assert.assertEquals(1.00, pnp.getBasePrice(), 0.00); 37 | Assert.assertEquals(2.00, pnp.getCurrentPrice(), 0.00); 38 | Assert.assertEquals(PhoneNumberPrice.Type.TOLLFREE, pnp.getType()); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/com/twilio/type/TypeTest.java: -------------------------------------------------------------------------------- 1 | package com.twilio.type; 2 | 3 | 4 | import com.fasterxml.jackson.core.JsonProcessingException; 5 | import com.fasterxml.jackson.databind.ObjectMapper; 6 | 7 | import java.io.IOException; 8 | 9 | public abstract class TypeTest { 10 | final ObjectMapper mapper = new ObjectMapper(); 11 | 12 | public T fromJson(String json, Class clazz) throws IOException { 13 | return mapper.readValue(json, clazz); 14 | } 15 | 16 | public String toJson(Object object) throws JsonProcessingException { 17 | return mapper.writeValueAsString(object); 18 | } 19 | 20 | public boolean convertsToAndFromJson(Object o, Class clazz) throws IOException { 21 | final String json = toJson(o); 22 | return fromJson(json, clazz).equals(o); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | --------------------------------------------------------------------------------