├── .gitallowed ├── .gitattributes ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ └── bug_report.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml ├── renovate.json └── workflows │ ├── build.yml │ ├── codeql.yml │ ├── publish.yml │ └── scorecard.yml ├── .gitignore ├── .whitesource ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CONTRIBUTORS.md ├── LICENSE.txt ├── README.md ├── SECURITY.md ├── bumpversion.sh ├── pom.xml └── src ├── main └── java │ └── com │ └── vonage │ └── client │ ├── AbstractMethod.java │ ├── AbstractQueryParamsRequest.java │ ├── ApiRegion.java │ ├── BinaryRequest.java │ ├── CustomClient.java │ ├── DynamicEndpoint.java │ ├── HttpConfig.java │ ├── HttpWrapper.java │ ├── Jsonable.java │ ├── JsonableBaseObject.java │ ├── QueryParamsRequest.java │ ├── RestEndpoint.java │ ├── VonageApiResponseException.java │ ├── VonageClient.java │ ├── VonageClientCreationException.java │ ├── VonageClientException.java │ ├── VonageMethodFailedException.java │ ├── VonageResponseParseException.java │ ├── VonageUnableToReadPrivateKeyException.java │ ├── VonageUnexpectedException.java │ ├── account │ ├── AccountClient.java │ ├── AccountResponseException.java │ ├── BalanceResponse.java │ ├── CreateSecretRequest.java │ ├── ListSecretsResponse.java │ ├── SecretRequest.java │ ├── SecretResponse.java │ ├── SettingsRequest.java │ ├── SettingsResponse.java │ ├── TopUpRequest.java │ └── package-info.java │ ├── application │ ├── Application.java │ ├── ApplicationClient.java │ ├── ApplicationList.java │ ├── ApplicationResponseException.java │ ├── ListApplicationRequest.java │ ├── capabilities │ │ ├── Capability.java │ │ ├── Messages.java │ │ ├── NetworkApis.java │ │ ├── Region.java │ │ ├── Rtc.java │ │ ├── Vbc.java │ │ ├── Verify.java │ │ ├── Voice.java │ │ └── Webhook.java │ └── package-info.java │ ├── auth │ ├── AbstractApiKeyQueryParamsAuthMethod.java │ ├── AbstractAuthMethod.java │ ├── ApiKeyAuthMethod.java │ ├── ApiKeyHeaderAuthMethod.java │ ├── ApiKeyQueryParamsAuthMethod.java │ ├── AuthCollection.java │ ├── AuthMethod.java │ ├── BasicAuthMethod.java │ ├── BearerAuthMethod.java │ ├── HeaderAuthMethod.java │ ├── JWTAuthMethod.java │ ├── NoAuthMethod.java │ ├── QueryParamsAuthMethod.java │ ├── RequestQueryParams.java │ ├── RequestSigning.java │ ├── SignatureAuthMethod.java │ ├── VonageAuthException.java │ ├── VonageUnacceptableAuthException.java │ ├── camara │ │ ├── AuthRequest.java │ │ ├── BackendAuthRequest.java │ │ ├── BackendAuthResponse.java │ │ ├── FraudPreventionDetectionScope.java │ │ ├── FrontendAuthRequest.java │ │ ├── NetworkAuthClient.java │ │ ├── NetworkAuthMethod.java │ │ ├── NetworkAuthResponseException.java │ │ ├── TokenRequest.java │ │ ├── TokenResponse.java │ │ └── package-info.java │ ├── hashutils │ │ ├── AbstractHasher.java │ │ ├── HashType.java │ │ ├── HashUtil.java │ │ ├── HmacMd5Hasher.java │ │ ├── HmacSha1Hasher.java │ │ ├── HmacSha256Hasher.java │ │ ├── HmacSha512Hasher.java │ │ ├── Md5Hasher.java │ │ └── package-info.java │ └── package-info.java │ ├── camara │ ├── CamaraResponseException.java │ ├── NetworkApiClient.java │ ├── numberverification │ │ ├── NumberVerificationClient.java │ │ ├── VerifyNumberRequest.java │ │ ├── VerifyNumberResponse.java │ │ └── package-info.java │ ├── package-info.java │ └── simswap │ │ ├── CheckSimSwapResponse.java │ │ ├── SimSwapClient.java │ │ ├── SimSwapDateResponse.java │ │ ├── SimSwapRequest.java │ │ └── package-info.java │ ├── common │ ├── ChannelType.java │ ├── E164.java │ ├── HalFilterRequest.java │ ├── HalLinks.java │ ├── HalPageResponse.java │ ├── HttpMethod.java │ ├── MessageType.java │ ├── SortOrder.java │ ├── UrlContainer.java │ └── package-info.java │ ├── conversations │ ├── AbstractAudioSpeakingEvent.java │ ├── AbstractCallEvent.java │ ├── AbstractChannelEvent.java │ ├── AbstractConversationsFilterRequest.java │ ├── AbstractHangupEvent.java │ ├── AbstractListUserRequest.java │ ├── AbstractMemberStateEvent.java │ ├── AbstractSipMachineEvent.java │ ├── AudioDtmfEvent.java │ ├── AudioDtmfEventBody.java │ ├── AudioEarmuffOffEvent.java │ ├── AudioEarmuffOnEvent.java │ ├── AudioMuteOffEvent.java │ ├── AudioMuteOnEvent.java │ ├── AudioOutEvent.java │ ├── AudioPlayDoneEvent.java │ ├── AudioPlayEvent.java │ ├── AudioPlayEventBody.java │ ├── AudioPlayStatusEvent.java │ ├── AudioPlayStopEvent.java │ ├── AudioRecordDoneEvent.java │ ├── AudioRecordEvent.java │ ├── AudioRecordEventBody.java │ ├── AudioRecordStopEvent.java │ ├── AudioRtcEvent.java │ ├── AudioSayDoneEvent.java │ ├── AudioSayEvent.java │ ├── AudioSayEventBody.java │ ├── AudioSayStatusEvent.java │ ├── AudioSayStopEvent.java │ ├── AudioSpeakingOffEvent.java │ ├── AudioSpeakingOnEvent.java │ ├── BaseConversation.java │ ├── BaseConversationWithState.java │ ├── BaseMember.java │ ├── Callback.java │ ├── Conversation.java │ ├── ConversationProperties.java │ ├── ConversationResourceRequestWrapper.java │ ├── ConversationStatus.java │ ├── ConversationTimestamp.java │ ├── ConversationUpdatedEvent.java │ ├── ConversationsClient.java │ ├── ConversationsResponseException.java │ ├── CustomEvent.java │ ├── EphemeralEvent.java │ ├── Event.java │ ├── EventDeleteEvent.java │ ├── EventType.java │ ├── EventWithBody.java │ ├── GenericEvent.java │ ├── HangupBandwidth.java │ ├── HangupQuality.java │ ├── HangupReason.java │ ├── ListConversationsRequest.java │ ├── ListConversationsResponse.java │ ├── ListEventsRequest.java │ ├── ListEventsResponse.java │ ├── ListMembersRequest.java │ ├── ListMembersResponse.java │ ├── ListUserConversationsRequest.java │ ├── ListUserConversationsResponse.java │ ├── Location.java │ ├── MediaAudioSettings.java │ ├── Member.java │ ├── MemberChannel.java │ ├── MemberInitiator.java │ ├── MemberInvitedEvent.java │ ├── MemberInvitedEventBody.java │ ├── MemberJoinedEvent.java │ ├── MemberLeftEvent.java │ ├── MemberMedia.java │ ├── MemberMediaEvent.java │ ├── MemberState.java │ ├── MemberTimestamp.java │ ├── MessageDeliveredEvent.java │ ├── MessageEvent.java │ ├── MessageEventBody.java │ ├── MessageRejectedEvent.java │ ├── MessageSeenEvent.java │ ├── MessageStatusEvent.java │ ├── MessageSubmittedEvent.java │ ├── MessageUndeliverableEvent.java │ ├── OrderBy.java │ ├── RtcAnswerEvent.java │ ├── RtcAnsweredEvent.java │ ├── RtcHangupEvent.java │ ├── RtcRingingEvent.java │ ├── RtcStatusEvent.java │ ├── RtcTransferEvent.java │ ├── SipAmdMachineEvent.java │ ├── SipAnsweredEvent.java │ ├── SipHangupEvent.java │ ├── SipMachineEvent.java │ ├── SipRingingEvent.java │ ├── UpdateMemberRequest.java │ ├── UserConversation.java │ ├── WhatsappTemplate.java │ └── package-info.java │ ├── conversion │ ├── ConversionClient.java │ ├── ConversionRequest.java │ ├── Type.java │ └── package-info.java │ ├── insight │ ├── AdvancedAsyncInsightResponse.java │ ├── AdvancedInsightAsyncRequest.java │ ├── AdvancedInsightRequest.java │ ├── AdvancedInsightResponse.java │ ├── BaseInsightRequest.java │ ├── BasicInsightRequest.java │ ├── BasicInsightResponse.java │ ├── CallerIdentity.java │ ├── CallerType.java │ ├── CarrierDetails.java │ ├── InsightClient.java │ ├── InsightStatus.java │ ├── LookupOutcome.java │ ├── NetworkType.java │ ├── PortedStatus.java │ ├── Reachability.java │ ├── RoamingDeserializer.java │ ├── RoamingDetails.java │ ├── RoamingStatus.java │ ├── StandardInsightRequest.java │ ├── StandardInsightResponse.java │ ├── Validity.java │ └── package-info.java │ ├── messages │ ├── Button.java │ ├── CaptionMediaMessageRequest.java │ ├── Channel.java │ ├── InboundMessage.java │ ├── MediaMessageRequest.java │ ├── MessageRequest.java │ ├── MessageResponse.java │ ├── MessageResponseException.java │ ├── MessageStatus.java │ ├── MessagesClient.java │ ├── MessagesVersion.java │ ├── TextMessageRequest.java │ ├── UpdateStatusRequest.java │ ├── internal │ │ └── MessagePayload.java │ ├── messenger │ │ ├── Category.java │ │ ├── Messenger.java │ │ ├── MessengerAudioRequest.java │ │ ├── MessengerFileRequest.java │ │ ├── MessengerImageRequest.java │ │ ├── MessengerRequest.java │ │ ├── MessengerTextRequest.java │ │ ├── MessengerVideoRequest.java │ │ └── Tag.java │ ├── mms │ │ ├── Content.java │ │ ├── MmsAudioRequest.java │ │ ├── MmsContentRequest.java │ │ ├── MmsFileRequest.java │ │ ├── MmsImageRequest.java │ │ ├── MmsRequest.java │ │ ├── MmsTextRequest.java │ │ ├── MmsVcardRequest.java │ │ └── MmsVideoRequest.java │ ├── package-info.java │ ├── rcs │ │ ├── RcsCustomRequest.java │ │ ├── RcsFileRequest.java │ │ ├── RcsImageRequest.java │ │ ├── RcsRequest.java │ │ ├── RcsTextRequest.java │ │ └── RcsVideoRequest.java │ ├── sms │ │ ├── EncodingType.java │ │ ├── OutboundSettings.java │ │ ├── SmsInboundMetadata.java │ │ └── SmsTextRequest.java │ ├── viber │ │ ├── Action.java │ │ ├── Category.java │ │ ├── ViberFileRequest.java │ │ ├── ViberImageRequest.java │ │ ├── ViberRequest.java │ │ ├── ViberService.java │ │ ├── ViberTextRequest.java │ │ ├── ViberVideoRequest.java │ │ └── Video.java │ └── whatsapp │ │ ├── Context.java │ │ ├── ContextStatus.java │ │ ├── ConversationType.java │ │ ├── Locale.java │ │ ├── Location.java │ │ ├── Order.java │ │ ├── Policy.java │ │ ├── ProductItem.java │ │ ├── ProductSection.java │ │ ├── Profile.java │ │ ├── Reaction.java │ │ ├── Referral.java │ │ ├── ReferredProduct.java │ │ ├── Reply.java │ │ ├── Sticker.java │ │ ├── Template.java │ │ ├── Whatsapp.java │ │ ├── WhatsappAudioRequest.java │ │ ├── WhatsappCustomRequest.java │ │ ├── WhatsappFileRequest.java │ │ ├── WhatsappImageRequest.java │ │ ├── WhatsappLocationRequest.java │ │ ├── WhatsappMultiProductRequest.java │ │ ├── WhatsappReactionRequest.java │ │ ├── WhatsappRequest.java │ │ ├── WhatsappSingleProductRequest.java │ │ ├── WhatsappStickerRequest.java │ │ ├── WhatsappTemplateRequest.java │ │ ├── WhatsappTextRequest.java │ │ └── WhatsappVideoRequest.java │ ├── numbers │ ├── AvailableNumber.java │ ├── BaseNumberRequest.java │ ├── BaseNumbersFilter.java │ ├── BuyCancelNumberRequest.java │ ├── CallbackType.java │ ├── Feature.java │ ├── JsonableNumber.java │ ├── ListNumbersFilter.java │ ├── ListNumbersResponse.java │ ├── NumbersClient.java │ ├── NumbersResponseException.java │ ├── OwnedNumber.java │ ├── SearchNumbersFilter.java │ ├── SearchNumbersResponse.java │ ├── SearchPattern.java │ ├── Type.java │ ├── UpdateNumberRequest.java │ └── package-info.java │ ├── package-info.java │ ├── redact │ ├── Product.java │ ├── RedactClient.java │ ├── RedactRequest.java │ ├── RedactResponseException.java │ ├── Type.java │ └── package-info.java │ ├── sms │ ├── MessageEvent.java │ ├── MessageStatus.java │ ├── MessageType.java │ ├── SmsClient.java │ ├── SmsSubmissionResponse.java │ ├── SmsSubmissionResponseMessage.java │ ├── messages │ │ ├── BinaryMessage.java │ │ ├── Message.java │ │ ├── MessageClass.java │ │ ├── MessageType.java │ │ └── TextMessage.java │ └── package-info.java │ ├── subaccounts │ ├── AbstractTransfer.java │ ├── Account.java │ ├── CreateSubaccountRequest.java │ ├── ListSubaccountsResponse.java │ ├── ListTransfersFilter.java │ ├── ListTransfersResponseWrapper.java │ ├── MoneyTransfer.java │ ├── NumberTransfer.java │ ├── SubaccountsClient.java │ ├── SubaccountsResponseException.java │ ├── UpdateSubaccountRequest.java │ └── package-info.java │ ├── users │ ├── BaseUser.java │ ├── ListUsersRequest.java │ ├── ListUsersResponse.java │ ├── User.java │ ├── UsersClient.java │ ├── UsersResponseException.java │ ├── channels │ │ ├── Channel.java │ │ ├── Channels.java │ │ ├── Messenger.java │ │ ├── Mms.java │ │ ├── NumberChannel.java │ │ ├── Pstn.java │ │ ├── Sip.java │ │ ├── Sms.java │ │ ├── Vbc.java │ │ ├── Viber.java │ │ ├── Websocket.java │ │ ├── Whatsapp.java │ │ └── WhatsappVoice.java │ └── package-info.java │ ├── verify │ ├── BaseRequest.java │ ├── CheckRequest.java │ ├── CheckResponse.java │ ├── ControlRequest.java │ ├── ControlResponse.java │ ├── Psd2Request.java │ ├── SearchRequest.java │ ├── SearchVerifyResponse.java │ ├── SearchVerifyResponseDeserializer.java │ ├── VerifyCheck.java │ ├── VerifyClient.java │ ├── VerifyControlCommand.java │ ├── VerifyDetails.java │ ├── VerifyException.java │ ├── VerifyRequest.java │ ├── VerifyResponse.java │ ├── VerifyStatus.java │ ├── VerifyStatusDeserializer.java │ ├── Workflow.java │ └── package-info.java │ ├── verify2 │ ├── AbstractNumberWorkflow.java │ ├── AbstractWhatsappWorkflow.java │ ├── CallbackType.java │ ├── Channel.java │ ├── EmailWorkflow.java │ ├── FragmentChannel.java │ ├── ListTemplateFragmentsResponse.java │ ├── ListTemplatesRequest.java │ ├── ListTemplatesResponse.java │ ├── SilentAuthWorkflow.java │ ├── SmsWorkflow.java │ ├── Template.java │ ├── TemplateFragment.java │ ├── TemplateFragmentRequestWrapper.java │ ├── VerificationCallback.java │ ├── VerificationRequest.java │ ├── VerificationResponse.java │ ├── VerificationStatus.java │ ├── Verify2Client.java │ ├── VerifyCodeRequestWrapper.java │ ├── VerifyCodeResponse.java │ ├── VerifyResponseException.java │ ├── VoiceWorkflow.java │ ├── WhatsappWorkflow.java │ ├── Workflow.java │ ├── WorkflowStatus.java │ └── package-info.java │ ├── video │ ├── AbstractSessionTokenRequest.java │ ├── Archive.java │ ├── ArchiveMode.java │ ├── ArchiveStatus.java │ ├── Broadcast.java │ ├── BroadcastStatus.java │ ├── BroadcastUrls.java │ ├── CaptionsRequest.java │ ├── CaptionsResponse.java │ ├── ConnectRequest.java │ ├── ConnectResponse.java │ ├── CreateSessionRequest.java │ ├── CreateSessionResponse.java │ ├── GetStreamResponse.java │ ├── Hls.java │ ├── Language.java │ ├── ListArchivesResponse.java │ ├── ListBroadcastsResponse.java │ ├── ListRendersResponse.java │ ├── ListResourceResponse.java │ ├── ListStreamCompositionsRequest.java │ ├── ListStreamsResponse.java │ ├── MediaMode.java │ ├── MuteSessionRequest.java │ ├── OutputMode.java │ ├── PatchComposedStreamsRequest.java │ ├── ProjectDetails.java │ ├── ProjectEnvironment.java │ ├── ProjectStatus.java │ ├── RenderRequest.java │ ├── RenderResponse.java │ ├── RenderStatus.java │ ├── Resolution.java │ ├── Role.java │ ├── Rtmp.java │ ├── RtmpStatus.java │ ├── ScreenLayoutType.java │ ├── SendDtmfRequest.java │ ├── SessionResourceRequestWrapper.java │ ├── SessionStream.java │ ├── SetStreamLayoutRequest.java │ ├── SignalRequest.java │ ├── SipDialRequest.java │ ├── SipDialResponse.java │ ├── StreamComposition.java │ ├── StreamCompositionLayout.java │ ├── StreamMode.java │ ├── TokenOptions.java │ ├── VideoClient.java │ ├── VideoResponseException.java │ ├── VideoStream.java │ ├── VideoType.java │ ├── Websocket.java │ └── package-info.java │ └── voice │ ├── AbstractAudioResponse.java │ ├── AddDtmfListenerRequest.java │ ├── AdvancedMachineDetection.java │ ├── AnswerWebhook.java │ ├── AppEndpoint.java │ ├── Call.java │ ├── CallDirection.java │ ├── CallEndpoint.java │ ├── CallEvent.java │ ├── CallInfo.java │ ├── CallInfoPage.java │ ├── CallStatus.java │ ├── CallStatusDetail.java │ ├── CallsFilter.java │ ├── DisconnectedBy.java │ ├── DtmfPayload.java │ ├── DtmfResponse.java │ ├── DtmfResult.java │ ├── EndpointType.java │ ├── EventWebhook.java │ ├── MachineDetection.java │ ├── MachineDetectionStatus.java │ ├── ModifyCallAction.java │ ├── ModifyCallPayload.java │ ├── PhoneEndpoint.java │ ├── SipEndpoint.java │ ├── SipHeader.java │ ├── SpeechResults.java │ ├── SpeechTimeoutReason.java │ ├── SpeechTranscript.java │ ├── StreamPayload.java │ ├── StreamResponse.java │ ├── TalkPayload.java │ ├── TalkResponse.java │ ├── TextToSpeechLanguage.java │ ├── TransferCallPayload.java │ ├── TransferDestination.java │ ├── UuidRequestWrapper.java │ ├── VbcEndpoint.java │ ├── VoiceClient.java │ ├── VoiceResponseException.java │ ├── WebSocketEndpoint.java │ ├── ncco │ ├── Action.java │ ├── AppEndpoint.java │ ├── ConnectAction.java │ ├── ConnectEndpoint.java │ ├── ConversationAction.java │ ├── DtmfSettings.java │ ├── EventMethod.java │ ├── EventType.java │ ├── InputAction.java │ ├── InputMode.java │ ├── Language.java │ ├── Ncco.java │ ├── NotifyAction.java │ ├── PhoneEndpoint.java │ ├── RecordAction.java │ ├── RecordingFormat.java │ ├── SipEndpoint.java │ ├── SpeechSettings.java │ ├── SplitRecording.java │ ├── StreamAction.java │ ├── TalkAction.java │ ├── TranscriptionSettings.java │ ├── VbcEndpoint.java │ ├── WebSocketEndpoint.java │ └── package-info.java │ └── package-info.java └── test ├── java ├── BugRepro.java.template └── com │ └── vonage │ └── client │ ├── AbstractClientTest.java │ ├── AbstractMethodTest.java │ ├── CustomClientTest.java │ ├── DynamicEndpointTest.java │ ├── DynamicEndpointTestSpec.java │ ├── HttpConfigTest.java │ ├── HttpWrapperTest.java │ ├── OrderedMap.java │ ├── TestUtils.java │ ├── VonageApiResponseExceptionTest.java │ ├── VonageClientTest.java │ ├── account │ ├── AccountClientTest.java │ ├── AccountEndpointTestSpec.java │ ├── AccountSecretsEndpointTestSpec.java │ └── ListSecretsResponseTest.java │ ├── application │ ├── ApplicationClientTest.java │ ├── ApplicationEndpointTestSpec.java │ ├── ApplicationListTest.java │ ├── ApplicationTest.java │ ├── ListApplicationRequestTest.java │ └── capabilities │ │ ├── MessagesTest.java │ │ ├── RtcTest.java │ │ ├── VbcTest.java │ │ └── VoiceTest.java │ ├── auth │ ├── ApiKeySecretAuthMethodTest.java │ ├── AuthCollectionTest.java │ ├── HashUtilTest.java │ ├── JWTAuthMethodTest.java │ ├── RequestSigningTest.java │ ├── VonageUnacceptableAuthExceptionTest.java │ └── camara │ │ ├── FrontendAuthRequestTest.java │ │ ├── NetworkAuthClientTest.java │ │ └── NetworkAuthEndpointTestSpec.java │ ├── camara │ ├── numberverification │ │ └── NumberVerificationClientTest.java │ └── simswap │ │ ├── SimSwapClientTest.java │ │ └── SimSwapEndpointTestSpec.java │ ├── conversations │ ├── AbstractEventTest.java │ ├── AudioDtmfEventTest.java │ ├── AudioOutEventTest.java │ ├── AudioPlayStatusEventTest.java │ ├── AudioRecordDoneEventTest.java │ ├── AudioRecordEventTest.java │ ├── AudioRecordStopEventTest.java │ ├── AudioRtcEventTest.java │ ├── AudioSayStatusEventTest.java │ ├── AudioSpeakingEventTest.java │ ├── CallEventTest.java │ ├── ConversationUpdatedEventTest.java │ ├── ConversationsClientTest.java │ ├── ConversationsEndpointTestSpec.java │ ├── EventDeleteEventTest.java │ ├── EventTypeTest.java │ ├── GenericEventTest.java │ ├── HangupEventTest.java │ ├── MemberChannelTest.java │ ├── MemberInitiatorTest.java │ ├── MemberMediaEventTest.java │ ├── MemberTransitionEventTest.java │ ├── MessageEventTest.java │ ├── MessageStatusEventTest.java │ ├── RtcAnswerEventTest.java │ ├── RtcStatusEventTest.java │ ├── RtcTransferEventTest.java │ ├── SipMachineEventTest.java │ └── SortOrderTest.java │ ├── conversion │ └── ConversionClientTest.java │ ├── insight │ ├── AdvancedAsyncInsightRequestTest.java │ ├── AdvancedAsyncInsightResponseTest.java │ ├── AdvancedInsightRequestTest.java │ ├── AdvancedInsightResponseTest.java │ ├── BasicInsightRequestTest.java │ ├── BasicInsightResponseTest.java │ ├── InsightClientTest.java │ ├── InsightEndpointTestSpec.java │ ├── StandardInsightRequestTest.java │ └── StandardInsightResponseTest.java │ ├── messages │ ├── InboundMessageTest.java │ ├── MessageRequestTest.java │ ├── MessageResponseTest.java │ ├── MessageStatusTest.java │ ├── MessagesClientTest.java │ ├── messenger │ │ ├── MessengerAudioRequestTest.java │ │ ├── MessengerFileRequestTest.java │ │ ├── MessengerImageRequestTest.java │ │ ├── MessengerTextRequestTest.java │ │ └── MessengerVideoRequestTest.java │ ├── mms │ │ ├── MmsAudioRequestTest.java │ │ ├── MmsContentRequestTest.java │ │ ├── MmsFileRequestTest.java │ │ ├── MmsImageRequestTest.java │ │ ├── MmsVcardRequestTest.java │ │ └── MmsVideoRequestTest.java │ ├── rcs │ │ ├── RcsCustomRequestTest.java │ │ ├── RcsFileRequestTest.java │ │ ├── RcsImageRequestTest.java │ │ ├── RcsTextRequestTest.java │ │ └── RcsVideoRequestTest.java │ ├── sms │ │ └── SmsTextRequestTest.java │ ├── viber │ │ ├── ViberFileRequestTest.java │ │ ├── ViberImageRequestTest.java │ │ ├── ViberTextRequestTest.java │ │ └── ViberVideoRequestTest.java │ └── whatsapp │ │ ├── WhatsappAudioRequestTest.java │ │ ├── WhatsappCustomRequestTest.java │ │ ├── WhatsappFileRequestTest.java │ │ ├── WhatsappImageRequestTest.java │ │ ├── WhatsappLocationRequestTest.java │ │ ├── WhatsappMultiProductRequestTest.java │ │ ├── WhatsappReactionRequestTest.java │ │ ├── WhatsappSingleProductRequestTest.java │ │ ├── WhatsappStickerRequestTest.java │ │ ├── WhatsappTemplateRequestTest.java │ │ ├── WhatsappTextRequestTest.java │ │ └── WhatsappVideoRequestTest.java │ ├── numbers │ ├── BaseNumberRequestEndpointTestSpec.java │ ├── BuyCancelNumberRequestEndpointTestSpec.java │ ├── EnumTests.java │ ├── NumbersClientTest.java │ └── NumbersEndpointTestSpec.java │ ├── redact │ ├── RedactClientTest.java │ └── RedactRequestTest.java │ ├── sms │ ├── MessageEventTest.java │ ├── SmsClientTest.java │ ├── SmsEndpointTestSpec.java │ └── SmsSubmissionResponseTest.java │ ├── subaccounts │ ├── CreateSubaccountRequestTest.java │ ├── ListSubaccountsResponseTest.java │ ├── SubaccountsClientTest.java │ ├── SubaccountsEndpointTestSpec.java │ └── UpdateSubaccountRequestTest.java │ ├── users │ ├── UserEndpointTestSpec.java │ ├── UserTest.java │ └── UsersClientTest.java │ ├── verify │ ├── CheckResponseTest.java │ ├── ControlResponseTest.java │ ├── Psd2RequestTest.java │ ├── VerifyClientCheckEndpointTest.java │ ├── VerifyClientPsd2EndpointTest.java │ ├── VerifyClientSearchEndpointTest.java │ ├── VerifyClientVerifyControlEndpointTest.java │ ├── VerifyClientVerifyEndpointTest.java │ ├── VerifyDetailsTest.java │ ├── VerifyEndpointTestSpec.java │ ├── VerifyRequestTest.java │ └── VerifyResponseTest.java │ ├── verify2 │ ├── VerificationCallbackTest.java │ ├── VerificationRequestTest.java │ ├── VerificationResponseTest.java │ ├── Verify2ClientTest.java │ └── Verify2EndpointTestSpec.java │ ├── video │ ├── ArchiveTest.java │ ├── BroadcastTest.java │ ├── CaptionsRequestTest.java │ ├── ConnectRequestTest.java │ ├── CreateSessionRequestTest.java │ ├── CreateSessionResponseTest.java │ ├── GetStreamResponseTest.java │ ├── ListArchivesResponseTest.java │ ├── ListRendersResponseTest.java │ ├── ListStreamCompositionsRequestTest.java │ ├── ListStreamsResponseTest.java │ ├── MuteSessionRequestTest.java │ ├── PatchVideoStreamRequestTest.java │ ├── ProjectDetailsTest.java │ ├── RenderRequestTest.java │ ├── SetScreenLayoutTypeRequestTest.java │ ├── SetStreamLayoutRequestTest.java │ ├── SignalRequestTest.java │ ├── SipDialRequestTest.java │ ├── TokenOptionsTest.java │ ├── VideoClientTest.java │ └── VideoEndpointTestSpec.java │ └── voice │ ├── AdvancedMachineDetectionTest.java │ ├── AnswerWebhookTest.java │ ├── CallInfoPageTest.java │ ├── CallInfoTest.java │ ├── CallTest.java │ ├── CallsFilterTest.java │ ├── DtmfResponseTest.java │ ├── EventWebhookTest.java │ ├── MachineDetectionTest.java │ ├── PhoneEndpointTest.java │ ├── StreamPayloadTest.java │ ├── StreamResponseTest.java │ ├── TalkPayloadTest.java │ ├── TalkResponseTest.java │ ├── TextToSpeechLanguageTest.java │ ├── TransferCallPayloadTest.java │ ├── VoiceClientTest.java │ ├── VoiceEndpointTestSpec.java │ └── ncco │ ├── AppEndpointTest.java │ ├── ConnectActionTest.java │ ├── ConversationActionTest.java │ ├── InputActionTest.java │ ├── NccoTest.java │ ├── NotifyActionTest.java │ ├── PhoneEndpointTest.java │ ├── RecordActionTest.java │ ├── RecordingFormatTest.java │ ├── SipEndpointTest.java │ ├── StreamActionTest.java │ ├── TalkActionTest.java │ ├── VbcEndpointTest.java │ └── WebSocketEndpointTest.java └── resources ├── com └── vonage │ └── client │ └── test │ └── keys │ ├── application_key │ ├── application_key2 │ └── application_public_key.der └── junit-platform.properties /.gitallowed: -------------------------------------------------------------------------------- 1 | src/test/resources/com/vonage/client/test/keys/application_key 2 | src/test/resources/com/vonage/client/test/keys/application_key2 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | src/test/resources/com/vonage/client/test/keys/application_key binary 2 | src/test/resources/com/vonage/client/test/keys/application_key2 binary 3 | *.sh linguist-vendored 4 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Tooling Team 2 | * @Vonage/server-sdk 3 | * @SMadani 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Request/Response** 27 | If applicable, please provide the request used and the response 28 | 29 | **Vonage SDK Version** 30 | - Version: 31 | 32 | **Java SDK Version** 33 | - Version: 34 | 35 | **Proxy Server Used** 36 | * [ ] Yes 37 | * [ ] No 38 | 39 | **Additional context/ Error Log** 40 | Add any other context about the problem here. 41 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | _Describe your changes here_ 2 | 3 | ## Contribution Checklist 4 | * [ ] Unit tests! 5 | * [ ] Updated [CHANGELOG.md](CHANGELOG.md) 6 | * [ ] My name is in [CONTRIBUTORS.md](CONTRIBUTORS.md) 7 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Please see the documentation for all configuration options: 2 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 3 | version: 2 4 | updates: 5 | - package-ecosystem: 'maven' 6 | directory: '/' 7 | schedule: 8 | interval: 'monthly' 9 | commit-message: 10 | prefix: 'build' 11 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "packageRules": [ 3 | { 4 | "matchUpdateTypes": [ 5 | "patch", 6 | "pin", 7 | "digest" 8 | ], 9 | "automerge": true, 10 | "matchPackageNames": [ 11 | "/.*/" 12 | ] 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build & Test 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | 8 | permissions: read-all 9 | 10 | jobs: 11 | compile: 12 | permissions: 13 | contents: read 14 | checks: write 15 | statuses: write 16 | runs-on: ${{ matrix.os }} 17 | strategy: 18 | fail-fast: false 19 | matrix: 20 | java: [8, 17, 24] 21 | os: [ubuntu-latest, macos-latest, windows-latest] 22 | steps: 23 | - name: Checkout the repo 24 | uses: actions/checkout@v4 25 | - name: Setup Java 26 | uses: actions/setup-java@v4 27 | with: 28 | distribution: 'corretto' 29 | java-version: ${{ matrix.java }} 30 | cache: maven 31 | - name: Compile with Maven 32 | run: mvn -e --batch-mode compile -T 1C 33 | 34 | test: 35 | runs-on: ${{ matrix.os }} 36 | strategy: 37 | fail-fast: false 38 | matrix: 39 | java: [21] 40 | os: [ubuntu-latest, macos-latest, windows-latest] 41 | steps: 42 | - name: Checkout the repo 43 | uses: actions/checkout@v4 44 | - name: Setup Java 45 | uses: actions/setup-java@v4 46 | with: 47 | distribution: 'zulu' 48 | java-version: ${{ matrix.java }} 49 | cache: maven 50 | - name: Test with Maven 51 | run: mvn -e --batch-mode verify -T 1C 52 | - name: Run Codecov 53 | uses: codecov/codecov-action@v5 54 | with: 55 | token: ${{ secrets.CODECOV_TOKEN }} 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.groovy 2 | .classpath 3 | .gradle 4 | .project 5 | .settings 6 | dependency-reduced-pom.xml 7 | /build 8 | /target 9 | /html 10 | /javadoc 11 | /test.properties 12 | archive/ 13 | bin/ 14 | gradle.properties 15 | vonage-sdk.jar 16 | publishing 17 | valid_application_key.pem 18 | /.idea 19 | *.iml 20 | out/ 21 | .DS_Store 22 | pom.xml.releaseBackup 23 | pom.xml.versionsBackup 24 | src/test/java/BugRepro.java 25 | -------------------------------------------------------------------------------- /.whitesource: -------------------------------------------------------------------------------- 1 | { 2 | "settingsInheritedFrom": "Vonage/whitesource-config@main" 3 | } -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Getting Involved 2 | 3 | Thanks for your interest in the project, we'd love to have you involved! Check out the sections below to find out more about what to do next... 4 | 5 | ## Opening an Issue 6 | 7 | We always welcome issues, if you've seen something that isn't quite right or you have a suggestion for a new feature, please go ahead and open an issue in this project. Include as much information as you have, it really helps. 8 | 9 | ## Making a Code Change 10 | 11 | We're always open to pull requests, but these should be small and clearly described so that we can understand what you're trying to do. Feel free to open an issue first and get some discussion going. 12 | 13 | When you're ready to start coding, fork this repository to your own GitHub account and make your changes in a new branch. Once you're happy, open a pull request and explain what the change is and why you think we should include it in our project. 14 | 15 | 16 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | Ths file describes how security issues are handled in the Vonage Java SDK. 3 | 4 | ## Supported Versions 5 | Only the latest version of the SDK is supported. The timeline for fixing issues is within the next two releases 6 | of it being reported and fixed. This is to cover the scenario where an issue is reported just before or after 7 | a planned release, to allow time for the fix to be included in the next release. 8 | 9 | ## Reporting a Vulnerability 10 | To report a security concern, use the "[Report a Vulnerability](https://github.com/Vonage/vonage-java-sdk/security/advisories/new)" tab. 11 | You can also contact the Developer Relations team directly via [email](devrel@vonage.com) for more private disclosure. 12 | You can also [raise an Issue](https://github.com/Vonage/vonage-java-sdk/issues/new/choose) and/or create a [Pull Request](https://github.com/Vonage/vonage-java-sdk/pulls) from your fork of the repo. 13 | Please include as much detail as possible, an indication of severity and, ideally, a minimal reproducible example to demonstrate the issue if possible. 14 | -------------------------------------------------------------------------------- /bumpversion.sh: -------------------------------------------------------------------------------- 1 | if [ "$1" = "" ] 2 | then 3 | echo "Usage: $0 " 4 | exit 1 5 | fi 6 | 7 | mvn versions:set -DnewVersion="$1" 8 | mvn validate 9 | rm pom.xml.versionsBackup #pom.xml.releaseBackup 10 | #mvn versions:display-plugin-updates 11 | #mvn versions:display-dependency-updates -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/BinaryRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client; 17 | 18 | /** 19 | * Indicates that a class used for request is to be serialised as binary data (e.g. for uploads). 20 | * 21 | * @since 7.10.0 22 | */ 23 | public interface BinaryRequest { 24 | 25 | /** 26 | * Serialises this request to a byte array. 27 | * 28 | * @return The binary data for this request. 29 | */ 30 | byte[] toByteArray(); 31 | 32 | /** 33 | * The MIME type header for this request to use as the {@code Content-Type}. 34 | * 35 | * @return The request MIME type as a string. 36 | */ 37 | default String getContentType() { 38 | return "multipart/form-data"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/QueryParamsRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client; 17 | 18 | import java.util.Map; 19 | 20 | /** 21 | * Indicates that a request object has query parameters. This interface 22 | * is an internal implementation detail and not part of the SDK's public API. 23 | * 24 | * @since 7.7.0 25 | */ 26 | public interface QueryParamsRequest { 27 | 28 | /** 29 | * Internal method for serializing the fields of this class into query parameters. 30 | * The Map should be mutable so that subclasses can add fields, otherwise the 31 | * method or implementing class should be marked as {@code final}. Duplicate entries 32 | * can be handled by mapping the key to a list of the entries. 33 | * 34 | * @return The query parameters as unique key-value pairs. 35 | */ 36 | Map makeParams(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/RestEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client; 17 | 18 | /** 19 | * Internal interface for defining endpoints. 20 | * 21 | * @param The request type. 22 | * @param The response type. 23 | * 24 | * @since 7.7.0 25 | */ 26 | public interface RestEndpoint { 27 | 28 | R execute(T request) throws VonageClientException; 29 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/VonageClientCreationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client; 17 | 18 | /** 19 | * Indicates that there was a failure during VonageClient creation. 20 | */ 21 | public class VonageClientCreationException extends VonageUnexpectedException { 22 | public VonageClientCreationException(String message, Throwable cause) { 23 | super(message, cause); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/VonageClientException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client; 17 | 18 | public class VonageClientException extends RuntimeException { 19 | public VonageClientException() { 20 | super(); 21 | } 22 | 23 | public VonageClientException(String message) { 24 | super(message); 25 | } 26 | 27 | public VonageClientException(String message, Throwable cause) { 28 | super(message, cause); 29 | } 30 | 31 | public VonageClientException(Throwable cause) { 32 | super(cause); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/VonageMethodFailedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client; 17 | 18 | public class VonageMethodFailedException extends VonageClientException { 19 | 20 | public VonageMethodFailedException(String message, Throwable cause) { 21 | super(message, cause); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/VonageResponseParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client; 17 | 18 | /** 19 | * An exception that indicates the contents of an HttpResponse could not be parsed. 20 | */ 21 | public class VonageResponseParseException extends VonageUnexpectedException { 22 | public VonageResponseParseException(String message) { 23 | this(message, null); 24 | } 25 | 26 | public VonageResponseParseException(Throwable ex) { 27 | this("Failed to parse the API response.", ex); 28 | } 29 | 30 | public VonageResponseParseException(String message, Throwable t) { 31 | super(message, t); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/VonageUnableToReadPrivateKeyException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client; 17 | 18 | public class VonageUnableToReadPrivateKeyException extends RuntimeException { 19 | public VonageUnableToReadPrivateKeyException(String message, Throwable cause) { 20 | super(message, cause); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/VonageUnexpectedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client; 17 | 18 | /** 19 | * VonageUnexpectedException indicates an exception that should not happen in an ideal world. 20 | */ 21 | public class VonageUnexpectedException extends RuntimeException { 22 | 23 | public VonageUnexpectedException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | public VonageUnexpectedException(Throwable cause) { 28 | super(cause); 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/account/AccountResponseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.account; 17 | 18 | import com.vonage.client.VonageApiResponseException; 19 | 20 | /** 21 | * Response returned when an error is encountered (i.e. the API returns a non-2xx status code). 22 | * 23 | * @since 7.9.0 24 | */ 25 | public final class AccountResponseException extends VonageApiResponseException { 26 | AccountResponseException() {} 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/account/CreateSecretRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.account; 17 | 18 | import com.fasterxml.jackson.annotation.JsonIgnore; 19 | import com.fasterxml.jackson.annotation.JsonProperty; 20 | import com.vonage.client.JsonableBaseObject; 21 | 22 | class CreateSecretRequest extends JsonableBaseObject { 23 | @JsonIgnore final String apiKey; 24 | @JsonProperty("secret") private final String secret; 25 | 26 | CreateSecretRequest(String apiKey, String secret) { 27 | this.apiKey = apiKey; 28 | this.secret = secret; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/account/SecretRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.account; 17 | 18 | class SecretRequest { 19 | final String apiKey, secretId; 20 | 21 | SecretRequest(String apiKey, String secretId) { 22 | if ((this.apiKey = apiKey) == null || apiKey.trim().isEmpty()) { 23 | throw new IllegalArgumentException("API key is required."); 24 | } 25 | if ((this.secretId = secretId) == null || secretId.trim().isEmpty()) { 26 | throw new IllegalArgumentException("Secret ID is required."); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/account/SecretResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.account; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.JsonableBaseObject; 20 | import java.time.Instant; 21 | 22 | /** 23 | * Represents metadata about an API account secret. 24 | */ 25 | public class SecretResponse extends JsonableBaseObject { 26 | private String id; 27 | private Instant created; 28 | 29 | /** 30 | * ID of the secret. 31 | * 32 | * @return The secret ID as a string. 33 | */ 34 | @JsonProperty("id") 35 | public String getId() { 36 | return id; 37 | } 38 | 39 | /** 40 | * Time the secret was created. 41 | * 42 | * @return The creation time as an Instant, or {@code null} if unknown. 43 | */ 44 | @JsonProperty("created_at") 45 | public Instant getCreated() { 46 | return created; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/account/TopUpRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.account; 17 | 18 | import com.vonage.client.AbstractQueryParamsRequest; 19 | import java.util.Map; 20 | 21 | class TopUpRequest extends AbstractQueryParamsRequest { 22 | final String trx; 23 | 24 | TopUpRequest(String trx) { 25 | if ((this.trx = trx) == null || trx.trim().isEmpty()) { 26 | throw new IllegalArgumentException("Transaction ID is required."); 27 | } 28 | } 29 | 30 | @Override 31 | public Map makeParams() { 32 | Map params = super.makeParams(); 33 | conditionalAdd("trx", trx); 34 | return params; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/account/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Implementation of the Account API. 19 | * See the Vonage developer portal 20 | * for an overview and documentation. 21 | */ 22 | package com.vonage.client.account; 23 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/application/ApplicationList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.application; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.common.HalPageResponse; 20 | import java.util.List; 21 | 22 | /** 23 | * HAL response returned from {@link ApplicationClient#listApplications(ListApplicationRequest)}. 24 | */ 25 | public class ApplicationList extends HalPageResponse { 26 | @JsonProperty("_embedded") private Embedded embedded; 27 | 28 | private static class Embedded { 29 | @JsonProperty("applications") List applications; 30 | } 31 | 32 | ApplicationList() {} 33 | 34 | /** 35 | * Retrieves the embedded resource contents. 36 | * 37 | * @return The list of applications. 38 | */ 39 | public List getApplications() { 40 | return embedded != null ? embedded.applications : null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/application/ApplicationResponseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.application; 17 | 18 | import com.vonage.client.VonageApiResponseException; 19 | 20 | /** 21 | * Response returned when an error is encountered (i.e. the API returns a non-2xx status code). 22 | * 23 | * @since 7.7.0 24 | */ 25 | public final class ApplicationResponseException extends VonageApiResponseException { 26 | ApplicationResponseException() {} 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/application/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Implementation of the Application API. 19 | * See the Vonage developer portal 20 | * for an overview and documentation. 21 | */ 22 | package com.vonage.client.application; 23 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/AbstractApiKeyQueryParamsAuthMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth; 17 | 18 | import java.util.LinkedHashMap; 19 | import java.util.Map; 20 | 21 | /** 22 | * Intermediate class for auth methods that use query params and have an API key. 23 | */ 24 | abstract class AbstractApiKeyQueryParamsAuthMethod extends AbstractAuthMethod implements QueryParamsAuthMethod, ApiKeyAuthMethod { 25 | final String apiKey; 26 | 27 | AbstractApiKeyQueryParamsAuthMethod(String apiKey) { 28 | this.apiKey = apiKey; 29 | } 30 | 31 | @Override 32 | public String getApiKey() { 33 | return apiKey; 34 | } 35 | 36 | @Override 37 | public Map getAuthParams(RequestQueryParams requestParams) { 38 | Map params = new LinkedHashMap<>(4); 39 | params.put("api_key", apiKey); 40 | return params; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/AbstractAuthMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth; 17 | 18 | import java.util.Objects; 19 | 20 | /** 21 | * Base class for all AuthMethod implementations. 22 | * 23 | * @since 8.8.0 24 | */ 25 | public abstract class AbstractAuthMethod implements AuthMethod { 26 | 27 | @Override 28 | public boolean equals(Object obj) { 29 | if (this == obj) return true; 30 | return obj instanceof AuthMethod && 31 | ((AuthMethod) obj).getSortKey() == this.getSortKey() && 32 | obj.getClass().equals(this.getClass()); 33 | } 34 | 35 | @Override 36 | public int hashCode() { 37 | return Objects.hash(getSortKey(), getClass()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/ApiKeyAuthMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth; 17 | 18 | /** 19 | * Signifies that the auth method has an API key. 20 | * 21 | * @since 8.8.0 22 | */ 23 | public interface ApiKeyAuthMethod extends AuthMethod { 24 | 25 | String getApiKey(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/AuthMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth; 17 | 18 | public interface AuthMethod extends Comparable { 19 | 20 | @Override 21 | default int compareTo(AuthMethod other) { 22 | return Integer.compare(this.getSortKey(), other.getSortKey()); 23 | } 24 | 25 | int getSortKey(); 26 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/BasicAuthMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth; 17 | 18 | import java.util.Objects; 19 | 20 | /** 21 | * Base class for auth methods which use the {@code Authorization: Basic } header. 22 | * 23 | * @since 8.8.0 24 | */ 25 | public abstract class BasicAuthMethod extends AbstractAuthMethod implements HeaderAuthMethod { 26 | 27 | protected abstract String getBasicToken(); 28 | 29 | @Override 30 | public final String getHeaderValue() { 31 | return "Basic " + getBasicToken(); 32 | } 33 | 34 | @Override 35 | public boolean equals(Object obj) { 36 | return obj instanceof BasicAuthMethod && super.equals(obj) && 37 | ((BasicAuthMethod) obj).getBasicToken().equals(this.getBasicToken()); 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | return Objects.hash(super.hashCode(), getBasicToken()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/BearerAuthMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth; 17 | 18 | /** 19 | * Base class for auth methods which use the {@code Authorization: Bearer } header. 20 | * 21 | * @since 8.8.0 22 | */ 23 | public abstract class BearerAuthMethod extends AbstractAuthMethod implements HeaderAuthMethod { 24 | 25 | protected abstract String getBearerToken(); 26 | 27 | @Override 28 | public final String getHeaderValue() { 29 | return "Bearer " + getBearerToken(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/HeaderAuthMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth; 17 | 18 | /** 19 | * Interface for auth methods which use the {@code Authorization: } header. 20 | * 21 | * @since 8.8.0 22 | */ 23 | public interface HeaderAuthMethod extends AuthMethod { 24 | 25 | String getHeaderValue(); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/NoAuthMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth; 17 | 18 | /** 19 | * Represents a no-op AuthMethod, for when no authentication is necessary. 20 | * 21 | * @since 8.9.0 22 | */ 23 | public final class NoAuthMethod extends AbstractAuthMethod { 24 | 25 | @Override 26 | public int getSortKey() { 27 | return 90; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/QueryParamsAuthMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth; 17 | 18 | import java.util.Map; 19 | 20 | /** 21 | * Auth methods that are appended to the request's query parameters. 22 | * 23 | * @since 8.8.0 24 | */ 25 | public interface QueryParamsAuthMethod extends AuthMethod { 26 | 27 | /** 28 | * Gets the auth parameters to be included in the query string. 29 | * 30 | * @param requestParams List of existing request parameters, which may be used in the computation. 31 | * 32 | * @return A new Map containing only the authentication parameters. 33 | */ 34 | Map getAuthParams(RequestQueryParams requestParams); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/RequestQueryParams.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth; 17 | 18 | import java.util.AbstractMap; 19 | import java.util.ArrayList; 20 | import java.util.Map; 21 | import java.util.Map.Entry; 22 | import java.util.stream.Collectors; 23 | 24 | /** 25 | * Represents query parameters in a HTTP request without depending on a specific implementation. 26 | * 27 | * @since 8.8.0 28 | */ 29 | public class RequestQueryParams extends ArrayList> { 30 | 31 | public Map toMap() { 32 | return stream().collect(Collectors.toMap(Entry::getKey, Entry::getValue)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/VonageAuthException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth; 17 | 18 | import com.vonage.client.VonageClientException; 19 | 20 | public class VonageAuthException extends VonageClientException { 21 | public VonageAuthException() { 22 | super(); 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/camara/BackendAuthRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth.camara; 17 | 18 | /** 19 | * Back-End auth request parameters for the first step in an OAuth2 three-legged check workflow. 20 | */ 21 | public final class BackendAuthRequest extends AuthRequest { 22 | 23 | /** 24 | * Creates the parameters for a Back-End Authorization OIDC request. 25 | * 26 | * @param msisdn The phone number of the user you want to authenticate in E.164 format. 27 | * @param scope The scope of the request as an enum. 28 | */ 29 | public BackendAuthRequest(String msisdn, FraudPreventionDetectionScope scope) { 30 | super(msisdn, scope); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/camara/FraudPreventionDetectionScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth.camara; 17 | 18 | public enum FraudPreventionDetectionScope { 19 | CHECK_SIM_SWAP, 20 | RETRIEVE_SIM_SWAP_DATE, 21 | NUMBER_VERIFICATION_VERIFY_READ; 22 | 23 | @Override 24 | public String toString() { 25 | return name().toLowerCase().replace('_', '-'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/camara/NetworkAuthResponseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth.camara; 17 | 18 | import com.vonage.client.VonageApiResponseException; 19 | 20 | /** 21 | * Response returned when an authentication request fails (i.e. returns a non-2xx status code). 22 | */ 23 | public final class NetworkAuthResponseException extends VonageApiResponseException { 24 | NetworkAuthResponseException() {} 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/camara/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains classes to support usage of the 19 | * Vonage Network Auth API. Please refer to 20 | * the developer documentation 21 | * for an overview of the concepts.
22 | * Note that this package is not part of the SDK's public API and thus not considered relevant as part of 23 | * semantic versioning for breaking changes. 24 | * 25 | * @since 8.8.0 26 | */ 27 | package com.vonage.client.auth.camara; -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/hashutils/HashType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.auth.hashutils; 17 | 18 | /** 19 | * Represents the hashing algorithm to be used. 20 | * 21 | * @since 9.0.0 Moved from {@linkplain HashUtil}. 22 | */ 23 | public enum HashType { 24 | MD5, 25 | HMAC_SHA1, 26 | HMAC_MD5, 27 | HMAC_SHA256, 28 | HMAC_SHA512 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/hashutils/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Provides hashing algorithms for signed SMS messages. 19 | */ 20 | package com.vonage.client.auth.hashutils; -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/auth/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Provides support for the various authentication methods supported by different Vonage APIs. 19 | */ 20 | package com.vonage.client.auth; -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/camara/CamaraResponseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.camara; 17 | 18 | import com.vonage.client.VonageApiResponseException; 19 | 20 | /** 21 | * Response returned when a network request fails (i.e. returns a non-2xx status code). 22 | */ 23 | public class CamaraResponseException extends VonageApiResponseException { 24 | CamaraResponseException() {} 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/camara/numberverification/VerifyNumberResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.camara.numberverification; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.JsonableBaseObject; 20 | 21 | final class VerifyNumberResponse extends JsonableBaseObject { 22 | private Boolean devicePhoneNumberVerified; 23 | 24 | /** 25 | * Indicates whether the phone number matches for the device. 26 | * 27 | * @return {@code true} if the number matches, {@code false} if unknown or unmatched. 28 | */ 29 | @JsonProperty("devicePhoneNumberVerified") 30 | public boolean getDevicePhoneNumberVerified() { 31 | return devicePhoneNumberVerified != null ? devicePhoneNumberVerified : false; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/camara/numberverification/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains classes to support usage of the 19 | * Number Verification API. 20 | * Please refer to 21 | * the developer documentation for an overview of the concepts. 22 | * 23 | * @since 8.9.0 24 | */ 25 | @Deprecated 26 | package com.vonage.client.camara.numberverification; -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/camara/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains classes and subpackages to support usage of the 19 | * Vonage Network APIs. 20 | * 21 | * @since 8.8.0 22 | */ 23 | @Deprecated 24 | package com.vonage.client.camara; -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/camara/simswap/CheckSimSwapResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.camara.simswap; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.JsonableBaseObject; 20 | 21 | class CheckSimSwapResponse extends JsonableBaseObject { 22 | private Boolean swapped; 23 | 24 | /** 25 | * Indicates whether the SIM card has been swapped during the period within the provided age. 26 | * 27 | * @return Whether the SIM was swapped. 28 | */ 29 | @JsonProperty("swapped") 30 | public boolean getSwapped() { 31 | return swapped != null ? swapped : false; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/camara/simswap/SimSwapDateResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.camara.simswap; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.JsonableBaseObject; 20 | import java.time.Instant; 21 | 22 | class SimSwapDateResponse extends JsonableBaseObject { 23 | private Instant latestSimChange; 24 | 25 | /** 26 | * Timestamp of latest SIM swap performed in ISO-8601 format. 27 | * 28 | * @return The last SIM swap date-time as an Instant, or {@code null} if unknown. 29 | */ 30 | @JsonProperty("latestSimChange") 31 | public Instant getLatestSimChange() { 32 | return latestSimChange; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/camara/simswap/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains classes to support usage of the 19 | * SIM Swap API. Please refer to 20 | * the developer documentation 21 | * for an overview of the concepts. 22 | * 23 | * @since 8.8.0 24 | */ 25 | @Deprecated 26 | package com.vonage.client.camara.simswap; -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/common/HttpMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.common; 17 | 18 | import com.fasterxml.jackson.annotation.JsonCreator; 19 | import com.vonage.client.Jsonable; 20 | 21 | /** 22 | * Enumeration representing various HTTP request methods used in Vonage APIs. 23 | */ 24 | public enum HttpMethod { 25 | GET, 26 | POST, 27 | PUT, 28 | DELETE, 29 | PATCH; 30 | 31 | /** 32 | * Convert a string to an HttpMethod enum. 33 | * 34 | * @param name The string to convert. 35 | * 36 | * @return The HTTP method as an enum, or {@code null} if the name is null. 37 | */ 38 | @JsonCreator 39 | public static HttpMethod fromString(String name) { 40 | return Jsonable.fromString(name, HttpMethod.class); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/common/UrlContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.common; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.JsonableBaseObject; 20 | import java.net.URI; 21 | 22 | /** 23 | * Represents a link under the {@code _links} section of a HAL response. 24 | */ 25 | public class UrlContainer extends JsonableBaseObject { 26 | protected URI href; 27 | 28 | protected UrlContainer() { 29 | } 30 | 31 | /** 32 | * {@code href} property of the link. 33 | * 34 | * @return The URL. 35 | */ 36 | @JsonProperty("href") 37 | public URI getHref() { 38 | return href; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/common/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Common utility classes used by multiple APIs. 19 | */ 20 | package com.vonage.client.common; 21 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/AbstractAudioSpeakingEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Base class for Audio Speaking events. 20 | * 21 | * @since 8.19.0 22 | */ 23 | abstract class AbstractAudioSpeakingEvent extends AbstractChannelEvent { 24 | AbstractAudioSpeakingEvent() {} 25 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/AbstractListUserRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | abstract class AbstractListUserRequest extends AbstractConversationsFilterRequest { 19 | protected String userId; 20 | 21 | AbstractListUserRequest(Builder builder) { 22 | super(builder); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/AbstractMemberStateEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.fasterxml.jackson.annotation.JsonIgnore; 19 | 20 | /** 21 | * Base class for Member transition events. 22 | * 23 | * @since 8.20.0 24 | */ 25 | abstract class AbstractMemberStateEvent extends EventWithBody { 26 | AbstractMemberStateEvent() {} 27 | 28 | /** 29 | * Get the member that the event is related to. 30 | * 31 | * @return The event body. 32 | */ 33 | @JsonIgnore 34 | public Member getMember() { 35 | return body; 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/AudioDtmfEventBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.fasterxml.jackson.annotation.JsonAlias; 19 | import com.fasterxml.jackson.annotation.JsonProperty; 20 | 21 | /** 22 | * Main body container for {@link AudioDtmfEvent}. 23 | * 24 | * @since 8.19.0 25 | */ 26 | class AudioDtmfEventBody extends AbstractChannelEvent.Body { 27 | @JsonAlias({"digit"}) @JsonProperty("digits") String digits; 28 | @JsonProperty("dtmf_seq") Integer dtmfSeq; 29 | 30 | AudioDtmfEventBody() {} 31 | 32 | AudioDtmfEventBody(AudioDtmfEvent.Builder builder) { 33 | super(builder); 34 | digits = builder.digits; 35 | dtmfSeq = builder.dtmfSeq; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/AudioPlayDoneEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents an {@link EventType#AUDIO_PLAY_DONE} event. 20 | */ 21 | public final class AudioPlayDoneEvent extends AudioPlayStatusEvent { 22 | 23 | AudioPlayDoneEvent() {} 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/AudioPlayEventBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import java.net.URI; 20 | import java.util.Objects; 21 | import java.util.UUID; 22 | 23 | final class AudioPlayEventBody extends AudioOutEvent.Body { 24 | @JsonProperty("play_id") UUID playId; 25 | @JsonProperty("stream_url") URI[] streamUrl; 26 | 27 | AudioPlayEventBody() { 28 | } 29 | 30 | AudioPlayEventBody(UUID playId) { 31 | this.playId = playId; 32 | } 33 | 34 | AudioPlayEventBody(AudioPlayEvent.Builder builder) { 35 | super(builder); 36 | streamUrl = Objects.requireNonNull(builder.streamUrl, "Stream URL is required."); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/AudioSayDoneEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents an {@link EventType#AUDIO_SAY_DONE} event. 20 | */ 21 | public final class AudioSayDoneEvent extends AudioSayStatusEvent { 22 | 23 | AudioSayDoneEvent() {} 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/AudioSpeakingOffEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents a {@linkplain EventType#AUDIO_SPEAKING_OFF} event. 20 | * 21 | * @since 8.19.0 22 | */ 23 | public final class AudioSpeakingOffEvent extends AbstractAudioSpeakingEvent { 24 | AudioSpeakingOffEvent() {} 25 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/AudioSpeakingOnEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents a {@linkplain EventType#AUDIO_SPEAKING_ON} event. 20 | * 21 | * @since 8.19.0 22 | */ 23 | public final class AudioSpeakingOnEvent extends AbstractAudioSpeakingEvent { 24 | AudioSpeakingOnEvent() {} 25 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/BaseConversationWithState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | 20 | /** 21 | * Represents the response body in {@linkplain ConversationUpdatedEvent#getConversation()}. 22 | * 23 | * @since 8.19.0 24 | */ 25 | public class BaseConversationWithState extends BaseConversation { 26 | private ConversationStatus state; 27 | 28 | protected BaseConversationWithState() {} 29 | 30 | /** 31 | * The state the conversation is in. 32 | * 33 | * @return The conversation state as an enum, or {@code null} if unknown. 34 | */ 35 | @JsonProperty("state") 36 | public ConversationStatus getState() { 37 | return state; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/ConversationResourceRequestWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | class ConversationResourceRequestWrapper { 19 | final String conversationId, resourceId; 20 | 21 | ConversationResourceRequestWrapper(String conversationId, String resourceId) { 22 | this.conversationId = conversationId; 23 | this.resourceId = resourceId; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/ConversationStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.fasterxml.jackson.annotation.JsonCreator; 19 | import com.fasterxml.jackson.annotation.JsonValue; 20 | import com.vonage.client.Jsonable; 21 | 22 | /** 23 | * Represents the status of a {@linkplain Conversation}. 24 | */ 25 | public enum ConversationStatus { 26 | ACTIVE, 27 | INACTIVE, 28 | DELETED; 29 | 30 | /** 31 | * Convert a string to a ConversationStatus enum. 32 | * 33 | * @param name The string to convert. 34 | * 35 | * @return The ConversationStatus enum, or {@code null} if invalid. 36 | */ 37 | @JsonCreator 38 | public static ConversationStatus fromString(String name) { 39 | return Jsonable.fromString(name, ConversationStatus.class); 40 | } 41 | 42 | @JsonValue 43 | @Override 44 | public String toString() { 45 | return name().toLowerCase(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/ConversationUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | 20 | /** 21 | * Represents a {@link EventType#CONVERSATION_UPDATED} event. 22 | */ 23 | public final class ConversationUpdatedEvent extends EventWithBody { 24 | 25 | ConversationUpdatedEvent() {} 26 | 27 | /** 28 | * Basic details of the updated conversation. 29 | * 30 | * @return The main Conversation object properties. 31 | */ 32 | @JsonProperty("body") 33 | public BaseConversationWithState getConversation() { 34 | return body; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/ConversationsResponseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.vonage.client.VonageApiResponseException; 19 | 20 | /** 21 | * Response returned when an error is encountered (i.e. the API returns a non-2xx status code). 22 | */ 23 | public final class ConversationsResponseException extends VonageApiResponseException { 24 | ConversationsResponseException() {} 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/EventDeleteEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents a {@link EventType#EVENT_DELETE} event. 20 | */ 21 | public final class EventDeleteEvent extends MessageStatusEvent { 22 | 23 | EventDeleteEvent() {} 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/EventWithBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | 20 | abstract class EventWithBody extends Event { 21 | @JsonProperty("body") T body; 22 | 23 | EventWithBody() {} 24 | 25 | EventWithBody(Event.Builder, ?> builder) { 26 | super(builder); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/HangupBandwidth.java: -------------------------------------------------------------------------------- 1 | package com.vonage.client.conversations; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.vonage.client.JsonableBaseObject; 5 | 6 | /** 7 | * Represents the {@code bandwidth} field in the body of a hangup event. 8 | * 9 | * @since 8.20.0 10 | */ 11 | public class HangupBandwidth extends JsonableBaseObject { 12 | private Integer byteIn, byteOut; 13 | 14 | /** 15 | * Gets the inbound byte count. 16 | * 17 | * @return The inbound byte count. 18 | */ 19 | @JsonProperty("byte_in") 20 | public Integer getByteIn() { 21 | return byteIn; 22 | } 23 | 24 | /** 25 | * Gets the outbound byte count. 26 | * 27 | * @return The outbound byte count. 28 | */ 29 | @JsonProperty("byte_out") 30 | public Integer getByteOut() { 31 | return byteOut; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/HangupReason.java: -------------------------------------------------------------------------------- 1 | package com.vonage.client.conversations; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.vonage.client.JsonableBaseObject; 5 | 6 | /** 7 | * Represents the {@code reason} field in the body of a hangup event. 8 | * 9 | * @since 8.20.0 10 | */ 11 | public class HangupReason extends JsonableBaseObject { 12 | private String text, code, sipCode; 13 | 14 | /** 15 | * Gets the reason text. 16 | * 17 | * @return The reason text. 18 | */ 19 | @JsonProperty("text") 20 | public String getText() { 21 | return text; 22 | } 23 | 24 | /** 25 | * Gets the reason code. 26 | * 27 | * @return The reason code. 28 | */ 29 | @JsonProperty("code") 30 | public String getCode() { 31 | return code; 32 | } 33 | 34 | /** 35 | * Gets the SIP code. 36 | * 37 | * @return The SIP code. 38 | */ 39 | @JsonProperty("sip_code") 40 | public String getSipCode() { 41 | return sipCode; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/MemberInvitedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.fasterxml.jackson.annotation.JsonIgnore; 19 | 20 | /** 21 | * Represents a {@link EventType#MEMBER_INVITED} event. 22 | * 23 | * @since 8.20.0 24 | */ 25 | public final class MemberInvitedEvent extends EventWithBody { 26 | MemberInvitedEvent() {} 27 | 28 | /** 29 | * Get the member that the event is related to. 30 | * 31 | * @return The event body. 32 | */ 33 | @JsonIgnore 34 | public MemberInvitedEventBody getMember() { 35 | return body; 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/MemberInvitedEventBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | 20 | /** 21 | * Main body container for a {@link MemberInvitedEvent}. 22 | * 23 | * @since 8.20.0 24 | */ 25 | public class MemberInvitedEventBody extends Member { 26 | private String cname, sdp; 27 | 28 | MemberInvitedEventBody() {} 29 | 30 | /** 31 | * Gets the {@code cname} field. 32 | * 33 | * @return The cname, or {@code null} if absent. 34 | */ 35 | @JsonProperty("cname") 36 | public String getCname() { 37 | return cname; 38 | } 39 | 40 | /** 41 | * Gets the {@code sdp} field. 42 | * 43 | * @return The SDP, or {@code null} if absent. 44 | */ 45 | @JsonProperty("sdp") 46 | public String getSdp() { 47 | return sdp; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/MemberJoinedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents a {@link EventType#MEMBER_JOINED} event. 20 | * 21 | * @since 8.20.0 22 | */ 23 | public final class MemberJoinedEvent extends AbstractMemberStateEvent { 24 | MemberJoinedEvent() {} 25 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/MemberLeftEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents a {@link EventType#MEMBER_LEFT} event. 20 | * 21 | * @since 8.20.0 22 | */ 23 | public final class MemberLeftEvent extends AbstractMemberStateEvent { 24 | MemberLeftEvent() {} 25 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/MemberState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.fasterxml.jackson.annotation.JsonCreator; 19 | import com.fasterxml.jackson.annotation.JsonEnumDefaultValue; 20 | import com.vonage.client.Jsonable; 21 | 22 | /** 23 | * Represents the state of a conversation member. 24 | */ 25 | public enum MemberState { 26 | INVITED, 27 | JOINED, 28 | LEFT, 29 | @JsonEnumDefaultValue UNKNOWN; 30 | 31 | /** 32 | * Convert a string to a MemberState enum. 33 | * 34 | * @param name The string to convert. 35 | * 36 | * @return The MemberState enum, or {@code null} if invalid. 37 | */ 38 | @JsonCreator 39 | public static MemberState fromString(String name) { 40 | return Jsonable.fromString(name, MemberState.class); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/OrderBy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.fasterxml.jackson.annotation.JsonValue; 19 | 20 | /** 21 | * Result ordering options for {@link ListUserConversationsRequest}. 22 | */ 23 | public enum OrderBy { 24 | CREATED, 25 | CUSTOM_SORT_KEY; 26 | 27 | @JsonValue 28 | @Override 29 | public String toString() { 30 | return name().toLowerCase(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/RtcAnsweredEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents a {@linkplain EventType#RTC_ANSWERED} event. 20 | * 21 | * @since 8.19.0 22 | */ 23 | public final class RtcAnsweredEvent extends AbstractCallEvent { 24 | RtcAnsweredEvent() {} 25 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/RtcHangupEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents a {@link EventType#RTC_HANGUP} event. 20 | * 21 | * @since 8.20.0 22 | */ 23 | public final class RtcHangupEvent extends AbstractHangupEvent { 24 | RtcHangupEvent() {} 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/RtcRingingEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents a {@linkplain EventType#RTC_RINGING} event. 20 | * 21 | * @since 8.19.0 22 | */ 23 | public final class RtcRingingEvent extends AbstractCallEvent { 24 | RtcRingingEvent() {} 25 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/SipAmdMachineEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents a {@linkplain EventType#SIP_AMD_MACHINE} event. 20 | * 21 | * @since 8.19.0 22 | */ 23 | public final class SipAmdMachineEvent extends AbstractSipMachineEvent { 24 | SipAmdMachineEvent() {} 25 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/SipAnsweredEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents a {@linkplain EventType#SIP_ANSWERED} event. 20 | * 21 | * @since 8.19.0 22 | */ 23 | public final class SipAnsweredEvent extends AbstractCallEvent { 24 | SipAnsweredEvent() {} 25 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/SipHangupEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents a {@link EventType#SIP_HANGUP} event. 20 | * 21 | * @since 8.20.0 22 | */ 23 | public final class SipHangupEvent extends AbstractHangupEvent { 24 | SipHangupEvent() {} 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/SipMachineEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents a {@linkplain EventType#SIP_MACHINE} event. 20 | * 21 | * @since 8.19.0 22 | */ 23 | public final class SipMachineEvent extends AbstractSipMachineEvent { 24 | SipMachineEvent() {} 25 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/SipRingingEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | /** 19 | * Represents a {@linkplain EventType#SIP_RINGING} event. 20 | * 21 | * @since 8.19.0 22 | */ 23 | public final class SipRingingEvent extends AbstractCallEvent { 24 | SipRingingEvent() {} 25 | } -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/UserConversation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | 20 | /** 21 | * Response object when querying a user's conversations. 22 | */ 23 | public class UserConversation extends Conversation { 24 | private BaseMember member; 25 | 26 | protected UserConversation() {} 27 | 28 | /** 29 | * Basic metadata about the conversation membership. 30 | * 31 | * @return The embedded member response, or {@code null} if absent. 32 | */ 33 | @JsonProperty("_embedded") 34 | public BaseMember getMember() { 35 | return member; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/WhatsappTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.messages.whatsapp.Template; 20 | import com.vonage.client.messages.whatsapp.Whatsapp; 21 | import java.util.List; 22 | 23 | public class WhatsappTemplate extends Template { 24 | private Whatsapp whatsapp; 25 | 26 | WhatsappTemplate() {} 27 | 28 | WhatsappTemplate(String name, List parameters, Whatsapp whatsapp) { 29 | super(name, parameters); 30 | this.whatsapp = whatsapp; 31 | } 32 | 33 | @JsonProperty("whatsapp") 34 | public Whatsapp getWhatsapp() { 35 | return whatsapp; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversations/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Implementation of the Conversation API. 19 | * See the Vonage developer portal 20 | * for an overview and documentation. 21 | * 22 | * @since 8.4.0 23 | */ 24 | package com.vonage.client.conversations; -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversion/Type.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversion; 17 | 18 | /** 19 | * Represents the product type for a conversion request. 20 | * 21 | * @since 9.0.0 Moved to its own class. 22 | */ 23 | public enum Type { 24 | SMS, VOICE 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/conversion/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Implementation of the Conversion API. 19 | * See the Vonage developer portal 20 | * for an overview and documentation. 21 | */ 22 | package com.vonage.client.conversion; 23 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/insight/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Implementation of the Number Insight v1 API. 19 | * See the Vonage developer portal 20 | * for an overview and documentation. 21 | */ 22 | package com.vonage.client.insight; 23 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/messages/CaptionMediaMessageRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.messages; 17 | 18 | /** 19 | * Convenience interface to indicate that a media message may have a caption. 20 | * 21 | * @since 8.11.0 22 | */ 23 | public interface CaptionMediaMessageRequest extends MediaMessageRequest { 24 | 25 | /** 26 | * Interface for builders with a media URL and caption. 27 | * @param The concrete builder type. 28 | */ 29 | interface Builder> extends MediaMessageRequest.Builder { 30 | 31 | /** 32 | * Sets the media's caption text. 33 | * 34 | * @param caption The caption string. 35 | * @return This builder. 36 | */ 37 | B caption(String caption); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/messages/MediaMessageRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.messages; 17 | 18 | /** 19 | * Convenience interface to indicate that {@link MessageRequest#getMessageType()} is media (has a URL). 20 | * 21 | * @since 8.11.0 22 | */ 23 | public interface MediaMessageRequest { 24 | 25 | /** 26 | * Interface for builders with a media URL. 27 | * @param The concrete builder type. 28 | */ 29 | interface Builder> { 30 | 31 | /** 32 | * Sets the media URL of the message request. 33 | * 34 | * @param url The media URL as a string. 35 | * @return This builder. 36 | */ 37 | B url(String url); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/messages/MessageResponseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.messages; 17 | 18 | import com.vonage.client.VonageApiResponseException; 19 | 20 | /** 21 | * Response returned when sending a message fails (i.e. returns a non-2xx status code). 22 | * Since this is an unchecked exception, users are advised to catch it when calling 23 | * {@link MessagesClient#sendMessage(MessageRequest)} to handle failures. 24 | */ 25 | public final class MessageResponseException extends VonageApiResponseException { 26 | MessageResponseException() {} 27 | 28 | @Override 29 | protected void setStatusCode(int statusCode) { 30 | super.setStatusCode(statusCode); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/messages/messenger/Category.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.messages.messenger; 17 | 18 | import com.fasterxml.jackson.annotation.JsonValue; 19 | 20 | /** 21 | * See the 22 | * Facebook documentation 23 | * for details on what these mean. 24 | */ 25 | public enum Category { 26 | RESPONSE, 27 | UPDATE, 28 | MESSAGE_TAG; 29 | 30 | @JsonValue 31 | @Override 32 | public String toString() { 33 | return name().toLowerCase().replace('_', '-'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/messages/messenger/Tag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.messages.messenger; 17 | 18 | import com.fasterxml.jackson.annotation.JsonValue; 19 | 20 | /** 21 | * Represents a Facebook Message Tag.
22 | * See the 23 | * documentation for details on what these mean. 24 | */ 25 | public enum Tag { 26 | CONFIRMED_EVENT_UPDATE, 27 | POST_PURCHASE_UPDATE, 28 | ACCOUNT_UPDATE, 29 | HUMAN_AGENT, 30 | CUSTOMER_FEEDBACK; 31 | 32 | @JsonValue 33 | @Override 34 | public String toString() { 35 | return name(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/messages/viber/Category.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.messages.viber; 17 | 18 | import com.fasterxml.jackson.annotation.JsonValue; 19 | 20 | /** 21 | * The use of different category tags enables the business to send messages for different use cases. 22 | * For Viber Service Messages the first message sent from a business to a user must be personal, informative and a 23 | * targeted message - not promotional. By default, Vonage sends the transaction category to Viber Service Messages. 24 | */ 25 | public enum Category { 26 | TRANSACTION, 27 | PROMOTION; 28 | 29 | @JsonValue 30 | @Override 31 | public String toString() { 32 | return name().toLowerCase(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/messages/viber/Video.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.messages.viber; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.messages.internal.MessagePayload; 20 | import java.net.URI; 21 | import java.util.Objects; 22 | 23 | public final class Video extends MessagePayload { 24 | final URI thumbUrl; 25 | 26 | Video(String url, String thumbUrl, String caption) { 27 | super(url, caption); 28 | this.thumbUrl = URI.create(Objects.requireNonNull(thumbUrl, "Thumbnail URL is required.")); 29 | validateFileExtensions(); 30 | } 31 | 32 | @JsonProperty("thumb_url") 33 | public URI getThumbUrl() { 34 | return thumbUrl; 35 | } 36 | 37 | void validateFileExtensions() { 38 | validateUrlExtension("mp4", "3gpp"); 39 | validateExtension(thumbUrl.getPath(), "jpg", "jpeg", "png", "bmp", "gif"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/messages/whatsapp/Policy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.messages.whatsapp; 17 | 18 | import com.fasterxml.jackson.annotation.JsonCreator; 19 | import com.fasterxml.jackson.annotation.JsonValue; 20 | import com.vonage.client.Jsonable; 21 | 22 | /** 23 | * Represents the policy for resolving what language template to use. 24 | */ 25 | public enum Policy { 26 | DETERMINISTIC; 27 | 28 | @JsonValue 29 | @Override 30 | public String toString() { 31 | return name().toLowerCase(); 32 | } 33 | 34 | /** 35 | * Convert a string value to a Policy enum. 36 | * 37 | * @param value The string value to convert. 38 | * 39 | * @return The policy as an enum, or {@code null} if invalid. 40 | * 41 | * @since 9.0.0 42 | */ 43 | @JsonCreator 44 | public static Policy fromString(String value) { 45 | return Jsonable.fromString(value, Policy.class); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/messages/whatsapp/Profile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.messages.whatsapp; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.JsonableBaseObject; 20 | 21 | /** 22 | * Used for inbound messages. 23 | * 24 | * @since 7.2.0 25 | */ 26 | public final class Profile extends JsonableBaseObject { 27 | private String name; 28 | 29 | Profile() {} 30 | 31 | /** 32 | * The WhatsApp number's displayed profile name. 33 | * 34 | * @return The profile name. 35 | */ 36 | @JsonProperty("name") 37 | public String getName() { 38 | return name; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/messages/whatsapp/Template.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.messages.whatsapp; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.JsonableBaseObject; 20 | import java.util.List; 21 | import java.util.Objects; 22 | 23 | public class Template extends JsonableBaseObject { 24 | private String name; 25 | private List parameters; 26 | 27 | protected Template() {} 28 | 29 | protected Template(String name, List parameters) { 30 | this.name = Objects.requireNonNull(name, "Name cannot be null"); 31 | this.parameters = parameters; 32 | } 33 | 34 | @JsonProperty("name") 35 | public String getName() { 36 | return name; 37 | } 38 | 39 | @JsonProperty("parameters") 40 | public List getParameters() { 41 | return parameters; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/messages/whatsapp/Whatsapp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.messages.whatsapp; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.JsonableBaseObject; 20 | 21 | import java.util.Objects; 22 | 23 | public final class Whatsapp extends JsonableBaseObject { 24 | private Policy policy; 25 | private Locale locale; 26 | 27 | Whatsapp() {} 28 | 29 | public Whatsapp(Policy policy, Locale locale) { 30 | this.policy = policy; 31 | this.locale = Objects.requireNonNull(locale, "Locale is required"); 32 | } 33 | 34 | @JsonProperty("policy") 35 | public Policy getPolicy() { 36 | return policy; 37 | } 38 | 39 | @JsonProperty("locale") 40 | public Locale getLocale() { 41 | return locale; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/numbers/AvailableNumber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.numbers; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | 20 | /** 21 | * Represents a number that is available to buy. 22 | */ 23 | public class AvailableNumber extends JsonableNumber { 24 | private String cost; 25 | 26 | AvailableNumber() {} 27 | 28 | /** 29 | * The monthly rental cost for this number, in Euros. 30 | * 31 | * @return The rental cost as a string. 32 | */ 33 | @JsonProperty("cost") 34 | public String getCost() { 35 | return cost; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/numbers/ListNumbersResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.numbers; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.JsonableBaseObject; 20 | import java.util.List; 21 | 22 | /** 23 | * Response from a request to list the numbers currently being rented buy an account. 24 | */ 25 | class ListNumbersResponse extends JsonableBaseObject { 26 | @JsonProperty("count") private Integer count; 27 | @JsonProperty("numbers") private List numbers; 28 | 29 | /** 30 | * A paginated array of owned numbers and their details. 31 | * Number of results will depend on what you set in {@linkplain ListNumbersFilter#getSize()}. 32 | * 33 | * @return The owned numbers as an array. 34 | */ 35 | public List getNumbers() { 36 | return numbers != null ? numbers : null; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/numbers/NumbersResponseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.numbers; 17 | 18 | import com.vonage.client.VonageApiResponseException; 19 | 20 | /** 21 | * Response returned when an error is encountered (i.e. the API returns a non-2xx status code). 22 | * 23 | * @since 7.8.0 24 | */ 25 | public final class NumbersResponseException extends VonageApiResponseException { 26 | NumbersResponseException() {} 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/numbers/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Implementation of the Numbers API. 19 | * See the Vonage developer portal 20 | * for an overview and documentation. 21 | */ 22 | package com.vonage.client.numbers; 23 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * The root of the Vonage client library, containing {@link com.vonage.client.VonageClient} class, which is probably what 19 | * you want. 20 | *

21 | * All behaviour is accessible via the {@link com.vonage.client.VonageClient} class, which should be instantiated with one 22 | * or more {@code AuthMethod} objects from the {@link com.vonage.client.auth} package. 23 | */ 24 | package com.vonage.client; 25 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/redact/Product.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.redact; 17 | 18 | import com.fasterxml.jackson.annotation.JsonValue; 19 | 20 | /** 21 | * Represents the product that a transaction belongs to. 22 | * 23 | * @since 9.0.0 Moved to its own file. 24 | */ 25 | public enum Product { 26 | SMS("sms"), 27 | VOICE("voice"), 28 | NUMBER_INSIGHTS("number-insight"), 29 | VERIFY("verify"), 30 | VERIFY_SDK("verify-sdk"), 31 | MESSAGES("messages"), 32 | WORKFLOW("workflow"); 33 | 34 | private final String value; 35 | 36 | Product(String value) { 37 | this.value = value; 38 | } 39 | 40 | @JsonValue 41 | public String getValue() { 42 | return value; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/redact/RedactResponseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.redact; 17 | 18 | import com.vonage.client.VonageApiResponseException; 19 | 20 | /** 21 | * Response returned when an error is encountered (i.e. the API returns a non-2xx status code). 22 | * 23 | * @since 8.14.0 24 | */ 25 | public final class RedactResponseException extends VonageApiResponseException { 26 | RedactResponseException() {} 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/redact/Type.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.redact; 17 | 18 | import com.fasterxml.jackson.annotation.JsonValue; 19 | 20 | /** 21 | * Represents the direction of a communication to redact. 22 | * 23 | * @since 9.0.0 Moved to its own file. 24 | */ 25 | public enum Type { 26 | INBOUND, OUTBOUND; 27 | 28 | @JsonValue 29 | public String getValue() { 30 | return name().toLowerCase(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/redact/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Implementation of the Redact API. 19 | * See the Vonage developer portal 20 | * for an overview and documentation. 21 | */ 22 | package com.vonage.client.redact; 23 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/sms/MessageType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.sms; 17 | 18 | import com.fasterxml.jackson.annotation.JsonCreator; 19 | import com.fasterxml.jackson.annotation.JsonValue; 20 | import com.vonage.client.Jsonable; 21 | 22 | /** 23 | * Represents the SMS message type. 24 | * 25 | * @since 8.3.0 26 | */ 27 | public enum MessageType { 28 | TEXT, UNICODE, BINARY; 29 | 30 | /** 31 | * Convert a string value to a MessageType enum. 32 | * 33 | * @param name The string value to convert. 34 | * 35 | * @return The message type as an enum, or {@code null} if invalid. 36 | */ 37 | @JsonCreator 38 | public static MessageType fromString(String name) { 39 | return Jsonable.fromString(name, MessageType.class); 40 | } 41 | 42 | @JsonValue 43 | @Override 44 | public String toString() { 45 | return name().toLowerCase(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/sms/messages/MessageType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.sms.messages; 17 | 18 | /** 19 | * Represents the type of message. 20 | * 21 | * @since 9.0.0 Moved from {@linkplain Message} to its own file. 22 | */ 23 | public enum MessageType { 24 | /** 25 | * Regular text SMS message. 26 | */ 27 | TEXT, 28 | 29 | /** 30 | * Binary SMS message with a custom UDH and binary payload. 31 | */ 32 | BINARY, 33 | 34 | /** 35 | * Unicode message, for sending messages in non-latin script to a supported handset. 36 | */ 37 | UNICODE; 38 | 39 | @Override 40 | public String toString() { 41 | return name().toLowerCase(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/sms/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains classes and sub-packages to support usage of the 19 | * Vonage SMS API. Please refer to 20 | * the developer documentation 21 | * for an overview of the concepts. 22 | *

23 | * 24 | * For more messaging channels, consider using the Messages API in the {@link com.vonage.client.messages} package, 25 | * which also includes SMS and more features, along with better support for webhooks and inbound messages. 26 | */ 27 | package com.vonage.client.sms; 28 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/subaccounts/SubaccountsResponseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.subaccounts; 17 | 18 | import com.vonage.client.VonageApiResponseException; 19 | 20 | /** 21 | * Response returned when an error is encountered (i.e. the API returns a non-2xx status code). 22 | */ 23 | public final class SubaccountsResponseException extends VonageApiResponseException { 24 | SubaccountsResponseException() {} 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/subaccounts/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Implementation of the Subaccounts API. 19 | * See the Vonage developer portal 20 | * for an overview and documentation. 21 | * 22 | * @since 7.5.0 23 | */ 24 | package com.vonage.client.subaccounts; 25 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/users/UsersResponseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.users; 17 | 18 | import com.vonage.client.VonageApiResponseException; 19 | 20 | /** 21 | * Response returned when an error is encountered (i.e. the API returns a non-2xx status code). 22 | * 23 | * @since 7.7.0 24 | */ 25 | public final class UsersResponseException extends VonageApiResponseException { 26 | UsersResponseException() {} 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/users/channels/Messenger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.users.channels; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 20 | 21 | /** 22 | * Represents a Facebook Messenger channel. 23 | */ 24 | @JsonTypeInfo(use = JsonTypeInfo.Id.NONE, visible = true) 25 | public class Messenger extends Channel { 26 | private String id; 27 | 28 | protected Messenger() {} 29 | 30 | /** 31 | * Creates a new Messenger channel. 32 | * 33 | * @param id The Facebook Messenger user ID. 34 | */ 35 | public Messenger(String id) { 36 | this.id = id; 37 | } 38 | 39 | /** 40 | * Facebook Messenger ID. 41 | * 42 | * @return The Facebook user ID. 43 | */ 44 | @JsonProperty("id") 45 | public String getId() { 46 | return id; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/users/channels/Mms.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.users.channels; 17 | 18 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 19 | 20 | /** 21 | * Represents a Multimedia Messaging Service (MMS) channel. 22 | */ 23 | @JsonTypeInfo(use = JsonTypeInfo.Id.NONE, visible = true) 24 | public class Mms extends NumberChannel { 25 | 26 | protected Mms() {} 27 | 28 | /** 29 | * Creates a new MMS channel. 30 | * 31 | * @param number The phone number in E.164 format. 32 | */ 33 | public Mms(String number) { 34 | super(number); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/users/channels/NumberChannel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.users.channels; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.common.E164; 20 | 21 | /** 22 | * Base class for channels with an E.164 phone number. 23 | */ 24 | abstract class NumberChannel extends Channel { 25 | private String number; 26 | 27 | NumberChannel() {} 28 | 29 | /** 30 | * Creates a new channel with the specified number. 31 | * 32 | * @param number The phone number in E.164 format. 33 | */ 34 | NumberChannel(String number) { 35 | this.number = new E164(number).toString(); 36 | } 37 | 38 | /** 39 | * Phone number for this channel. 40 | * 41 | * @return The number in E.164 format. 42 | */ 43 | @JsonProperty("number") 44 | public String getNumber() { 45 | return number; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/users/channels/Pstn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.users.channels; 17 | 18 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 19 | 20 | /** 21 | * Represents a Public Switched Telephone Network (PSTN) channel. 22 | */ 23 | @JsonTypeInfo(use = JsonTypeInfo.Id.NONE, visible = true) 24 | public class Pstn extends NumberChannel { 25 | 26 | protected Pstn() {} 27 | 28 | /** 29 | * Creates a new PSTN (phone) channel. 30 | * 31 | * @param number The telephone number in E.164 format. 32 | */ 33 | public Pstn(String number) { 34 | super(number); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/users/channels/Sms.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.users.channels; 17 | 18 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 19 | 20 | /** 21 | * Represents a Short Messaging Service (SMS) channel. 22 | */ 23 | @JsonTypeInfo(use = JsonTypeInfo.Id.NONE, visible = true) 24 | public class Sms extends NumberChannel { 25 | 26 | protected Sms() {} 27 | 28 | /** 29 | * Creates a new SMS channel. 30 | * 31 | * @param number The phone number in E.164 format. 32 | */ 33 | public Sms(String number) { 34 | super(number); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/users/channels/Vbc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.users.channels; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 20 | 21 | /** 22 | * Represents a Vonage Business Cloud (VBC) channel. 23 | */ 24 | @JsonTypeInfo(use = JsonTypeInfo.Id.NONE, visible = true) 25 | public class Vbc extends Channel { 26 | private String extension; 27 | 28 | protected Vbc() {} 29 | 30 | /** 31 | * Creates a new VBC channel. 32 | * 33 | * @param extension The VBC extension number. 34 | */ 35 | public Vbc(int extension) { 36 | this.extension = String.valueOf(extension); 37 | } 38 | 39 | /** 40 | * VBC extension. 41 | * 42 | * @return The extension as a string. 43 | */ 44 | @JsonProperty("extension") 45 | public String getExtension() { 46 | return extension; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/users/channels/Viber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.users.channels; 17 | 18 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 19 | 20 | /** 21 | * Represents a Viber channel. 22 | */ 23 | @JsonTypeInfo(use = JsonTypeInfo.Id.NONE, visible = true) 24 | public class Viber extends NumberChannel { 25 | 26 | protected Viber() {} 27 | 28 | /** 29 | * Creates a new Viber channel. 30 | * 31 | * @param number The phone number in E.164 format. 32 | */ 33 | public Viber(String number) { 34 | super(number); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/users/channels/Whatsapp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.users.channels; 17 | 18 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 19 | 20 | /** 21 | * Represents a WhatsApp channel. 22 | */ 23 | @JsonTypeInfo(use = JsonTypeInfo.Id.NONE, visible = true) 24 | public class Whatsapp extends NumberChannel { 25 | 26 | protected Whatsapp() {} 27 | 28 | /** 29 | * Creates a new WhatsApp channel. 30 | * 31 | * @param number The phone number in E.164 format. 32 | */ 33 | public Whatsapp(String number) { 34 | super(number); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/users/channels/WhatsappVoice.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.users.channels; 17 | 18 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 19 | 20 | /** 21 | * Represents a WhatsApp Voice channel. 22 | * 23 | * @since 8.4.0 24 | */ 25 | @JsonTypeInfo(use = JsonTypeInfo.Id.NONE, visible = true) 26 | public class WhatsappVoice extends NumberChannel { 27 | 28 | protected WhatsappVoice() {} 29 | 30 | /** 31 | * Creates a new WhatsApp Voice channel. 32 | * 33 | * @param number The phone number in E.164 format. 34 | */ 35 | public WhatsappVoice(String number) { 36 | super(number); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/users/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains classes and sub-packages to support usage of the 19 | * Vonage Users API.

20 | * The concept of a user exists in Vonage APIs, you can associate one with a user in your own application 21 | * if you choose. A user can have multiple memberships to conversations and can communicate with other users 22 | * through various different mediums, called "channels".

23 | * 24 | * @since 7.7.0 25 | */ 26 | package com.vonage.client.users; 27 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/verify/VerifyException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.verify; 17 | 18 | import com.vonage.client.VonageClientException; 19 | 20 | public class VerifyException extends VonageClientException { 21 | private final VerifyStatus status; 22 | private final String errorText; 23 | 24 | public VerifyException(VerifyStatus status, String errorText) { 25 | super(String.format("Status %s: %s", status, errorText)); 26 | this.status = status; 27 | this.errorText = errorText; 28 | } 29 | 30 | public VerifyStatus getStatus() { 31 | return status; 32 | } 33 | 34 | public String getErrorText() { 35 | return errorText; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/verify/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Implementation of the Verify v1 (legacy) API. 19 | * See the Vonage developer portal 20 | * for an overview and documentation. 21 | */ 22 | @Deprecated 23 | package com.vonage.client.verify; 24 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/verify2/FragmentChannel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.verify2; 17 | 18 | import com.fasterxml.jackson.annotation.JsonCreator; 19 | import com.fasterxml.jackson.annotation.JsonValue; 20 | import com.vonage.client.Jsonable; 21 | 22 | /** 23 | * Represents the template channel type in a {@link TemplateFragment}. 24 | */ 25 | public enum FragmentChannel { 26 | SMS, 27 | VOICE; 28 | 29 | @JsonValue 30 | @Override 31 | public String toString() { 32 | return name().toLowerCase(); 33 | } 34 | 35 | /** 36 | * Parse a channel from a string. 37 | * 38 | * @param value The string to parse. 39 | * 40 | * @return The parsed channel, or {@code null} if invalid. 41 | */ 42 | @JsonCreator 43 | public static FragmentChannel fromString(String value) { 44 | return Jsonable.fromString(value, FragmentChannel.class); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/verify2/ListTemplatesRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.verify2; 17 | 18 | import com.vonage.client.common.HalFilterRequest; 19 | import java.util.UUID; 20 | 21 | /** 22 | * Represents a filter request for listing templates and fragments. 23 | * 24 | * @since 8.13.0 25 | */ 26 | final class ListTemplatesRequest extends HalFilterRequest { 27 | final UUID templateId; 28 | 29 | ListTemplatesRequest(Integer page, Integer pageSize, UUID templateId) { 30 | super(page, pageSize, null); 31 | this.templateId = templateId; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/verify2/TemplateFragmentRequestWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.verify2; 17 | 18 | import java.util.UUID; 19 | 20 | /** 21 | * Wrapper for {@link Verify2Client#getTemplateFragment(UUID, UUID)} and 22 | * {@link Verify2Client#deleteTemplateFragment(UUID, UUID)}. 23 | * 24 | * @since 8.13.0 25 | */ 26 | final class TemplateFragmentRequestWrapper { 27 | final UUID fragmentId, templateId; 28 | 29 | TemplateFragmentRequestWrapper(UUID templateId, UUID fragmentId) { 30 | this.templateId = templateId; 31 | this.fragmentId = fragmentId; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/verify2/VerifyCodeRequestWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.verify2; 17 | 18 | import com.fasterxml.jackson.annotation.JsonIgnore; 19 | import com.fasterxml.jackson.annotation.JsonProperty; 20 | import com.vonage.client.Jsonable; 21 | 22 | class VerifyCodeRequestWrapper implements Jsonable { 23 | @JsonIgnore final String requestId; 24 | @JsonProperty("code") final String code; 25 | 26 | public VerifyCodeRequestWrapper(String requestId, String code) { 27 | this.requestId = requestId; 28 | this.code = code; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/verify2/VerifyResponseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.verify2; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.VonageApiResponseException; 20 | import java.util.UUID; 21 | 22 | /** 23 | * Response returned when verification fails (i.e. returns a non-2xx status code). 24 | */ 25 | public final class VerifyResponseException extends VonageApiResponseException { 26 | UUID requestId; 27 | 28 | VerifyResponseException() {} 29 | 30 | @Override 31 | protected void setStatusCode(int statusCode) { 32 | super.setStatusCode(statusCode); 33 | } 34 | 35 | /** 36 | * The request ID, if the status code is 409 for a failed outbound request. 37 | * 38 | * @return The request ID, or {@code null} if not applicable / available. 39 | */ 40 | @JsonProperty("request_id") 41 | public UUID getRequestId() { 42 | return requestId; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/verify2/VoiceWorkflow.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.verify2; 17 | 18 | 19 | /** 20 | * Defines workflow properties for sending a verification code to a user over a voice call. 21 | */ 22 | public final class VoiceWorkflow extends AbstractNumberWorkflow { 23 | 24 | /** 25 | * Constructs a new Voice verification workflow. 26 | * 27 | * @param to The number to call, in E.164 format. 28 | */ 29 | public VoiceWorkflow(String to) { 30 | super(Channel.VOICE, to); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/verify2/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Implementation of the Verify v2 API. 19 | * See the Vonage developer portal 20 | * for an overview and documentation. 21 | * 22 | * @since 7.4.0 23 | */ 24 | package com.vonage.client.verify2; 25 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/video/ArchiveMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.video; 17 | 18 | import com.fasterxml.jackson.annotation.JsonValue; 19 | 20 | /** 21 | * Defines values for the archiveMode parameter of the 22 | * {@link CreateSessionRequest.Builder#archiveMode(ArchiveMode archiveMode)} method. 23 | */ 24 | public enum ArchiveMode { 25 | /** 26 | * The session is not archived automatically. To archive the session, you can call the 27 | * {@link VideoClient#createArchive(Archive)} method. 28 | */ 29 | MANUAL, 30 | 31 | /** 32 | * The session is archived automatically (as soon as there are clients connected 33 | * to the session). 34 | */ 35 | ALWAYS; 36 | 37 | @JsonValue 38 | @Override 39 | public String toString() { 40 | return name().toLowerCase(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/video/CaptionsResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.video; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.JsonableBaseObject; 20 | import java.util.UUID; 21 | 22 | /** 23 | * Represents the response from {@link VideoClient#startCaptions(CaptionsRequest)}. 24 | * 25 | * @since 8.5.0 26 | */ 27 | public final class CaptionsResponse extends JsonableBaseObject { 28 | private UUID captionsId; 29 | 30 | CaptionsResponse() {} 31 | 32 | /** 33 | * Unique identifier for the audio captioning session. 34 | * 35 | * @return The captions UUID. 36 | */ 37 | @JsonProperty("captionsId") 38 | public UUID getCaptionsId() { 39 | return captionsId; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/video/GetStreamResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.video; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | 20 | /** 21 | * Represents details of a stream, as returned from {@link VideoClient#getStream(String, String)}. 22 | */ 23 | public class GetStreamResponse extends SessionStream { 24 | private VideoType videoType; 25 | private String name; 26 | 27 | protected GetStreamResponse() { 28 | } 29 | 30 | /** 31 | * @return The video source for the stream. 32 | */ 33 | @JsonProperty("videoType") 34 | public VideoType getVideoType() { 35 | return videoType; 36 | } 37 | 38 | /** 39 | * @return The name of the stream (if one was set when the client published the stream). 40 | */ 41 | @JsonProperty("name") 42 | public String getName() { 43 | return name; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/video/ListArchivesResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.video; 17 | 18 | final class ListArchivesResponse extends ListResourceResponse { 19 | ListArchivesResponse() { 20 | super(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/video/ListBroadcastsResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.video; 17 | 18 | final class ListBroadcastsResponse extends ListResourceResponse { 19 | ListBroadcastsResponse() { 20 | super(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/video/ListRendersResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.video; 17 | 18 | final class ListRendersResponse extends ListResourceResponse { 19 | ListRendersResponse() { 20 | super(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/video/ListResourceResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.video; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.JsonableBaseObject; 20 | import java.util.List; 21 | 22 | class ListResourceResponse extends JsonableBaseObject { 23 | private Integer count; 24 | private List items; 25 | 26 | protected ListResourceResponse() { 27 | } 28 | 29 | @JsonProperty("count") 30 | public Integer getCount() { 31 | return count; 32 | } 33 | 34 | @JsonProperty("items") 35 | public List getItems() { 36 | return items; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/video/ListStreamsResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.video; 17 | 18 | final class ListStreamsResponse extends ListResourceResponse { 19 | ListStreamsResponse() { 20 | super(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/video/OutputMode.java: -------------------------------------------------------------------------------- 1 | package com.vonage.client.video; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonValue; 5 | import com.vonage.client.Jsonable; 6 | 7 | /** 8 | * Defines values used in the {@link Archive.Builder#outputMode(OutputMode)} method and returned by the 9 | * {@link Archive#getOutputMode} method. 10 | */ 11 | public enum OutputMode { 12 | /** 13 | * All streams in the archive are recorded to a single (composed) file. 14 | */ 15 | COMPOSED, 16 | /** 17 | * Each stream in the archive is recorded to its own individual file. 18 | */ 19 | INDIVIDUAL; 20 | 21 | @JsonValue 22 | @Override 23 | public String toString() { 24 | return name().toLowerCase(); 25 | } 26 | 27 | /** 28 | * Parse a string to an OutputMode enum. 29 | * 30 | * @param value The string to convert. 31 | * 32 | * @return The OutputMode enum, or {@code null} if invalid. 33 | */ 34 | @JsonCreator 35 | public static OutputMode fromString(String value) { 36 | return Jsonable.fromString(value, OutputMode.class); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/video/SessionResourceRequestWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.video; 17 | 18 | class SessionResourceRequestWrapper { 19 | final String sessionId, resourceId; 20 | 21 | SessionResourceRequestWrapper(String sessionId, String streamId) { 22 | this.sessionId = sessionId; 23 | this.resourceId = streamId; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/video/SetStreamLayoutRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.video; 17 | 18 | import com.fasterxml.jackson.annotation.JsonIgnore; 19 | import com.fasterxml.jackson.annotation.JsonProperty; 20 | import com.vonage.client.Jsonable; 21 | import java.util.List; 22 | 23 | class SetStreamLayoutRequest implements Jsonable { 24 | private final List items; 25 | @JsonIgnore final String sessionId; 26 | 27 | SetStreamLayoutRequest(String sessionId, List items) { 28 | this.sessionId = sessionId; 29 | if ((this.items = items) == null || items.isEmpty()) { 30 | throw new IllegalArgumentException("At least one stream is required."); 31 | } 32 | } 33 | 34 | @JsonProperty("items") 35 | public List getItems() { 36 | return items; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/video/StreamMode.java: -------------------------------------------------------------------------------- 1 | package com.vonage.client.video; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonValue; 5 | import com.vonage.client.Jsonable; 6 | 7 | /** 8 | * Defines values for how streams will be selected for broadcasts and archives. 9 | */ 10 | public enum StreamMode { 11 | /** 12 | * Streams will be automatically included in the archive or broadcast. 13 | */ 14 | AUTO, 15 | 16 | /** 17 | * Streams will be included in the archive or broadcast based on calls to the 18 | * {@link VideoClient#addArchiveStream(String, String, Boolean, Boolean)} / 19 | * {@link VideoClient#addBroadcastStream(String, String, Boolean, Boolean)} and 20 | * {@link VideoClient#removeArchiveStream(String, String)} / 21 | * {@link VideoClient#removeBroadcastStream(String, String)} methods. 22 | */ 23 | MANUAL; 24 | 25 | @JsonValue 26 | @Override 27 | public String toString() { 28 | return name().toLowerCase(); 29 | } 30 | 31 | /** 32 | * Parse a string to a StreamMode enum. 33 | * 34 | * @param value The string to convert. 35 | * 36 | * @return The StreamMode enum, or {@code null} if invalid. 37 | */ 38 | @JsonCreator 39 | public static StreamMode fromString(String value) { 40 | return Jsonable.fromString(value, StreamMode.class); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/video/VideoResponseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.video; 17 | 18 | import com.vonage.client.VonageApiResponseException; 19 | 20 | /** 21 | * Response returned when an error is encountered (i.e. the API returns a non-2xx status code). 22 | */ 23 | public final class VideoResponseException extends VonageApiResponseException { 24 | VideoResponseException() {} 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/voice/StreamResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice; 17 | 18 | /** 19 | * Response from successfully streaming an audio file or stopping a stream to an active {@link Call}. 20 | * This is returned by {@link VoiceClient#startStream(String, String)} or {@link VoiceClient#stopStream(String)}. 21 | */ 22 | public final class StreamResponse extends AbstractAudioResponse { 23 | 24 | /** 25 | * Constructor used reflectively by Jackson for instantiation. 26 | */ 27 | private StreamResponse() {} 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/voice/TalkResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice; 17 | 18 | /** 19 | * Response from successfully sending a synthesized speech message or stopping a message to an active {@link Call}. 20 | * This is returned by {@link VoiceClient#startTalk(String, TalkPayload)} or {@link VoiceClient#stopTalk(String)}. 21 | */ 22 | public final class TalkResponse extends AbstractAudioResponse { 23 | 24 | /** 25 | * Constructor used reflectively by Jackson for instantiation. 26 | */ 27 | private TalkResponse() {} 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/voice/VoiceResponseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice; 17 | 18 | import com.vonage.client.VonageApiResponseException; 19 | 20 | /** 21 | * Response returned when an error is encountered (i.e. the API returns a non-2xx status code). 22 | * 23 | * @since 7.11.0 24 | */ 25 | public final class VoiceResponseException extends VonageApiResponseException { 26 | VoiceResponseException() {} 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/voice/ncco/ConnectEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice.ncco; 17 | 18 | import com.fasterxml.jackson.annotation.JsonProperty; 19 | import com.vonage.client.voice.CallEndpoint; 20 | import com.vonage.client.voice.EndpointType; 21 | 22 | /** 23 | * An endpoint for a {@link ConnectAction} to connect to. For outbound call endpoints, see {@link CallEndpoint}. 24 | * 25 | * @since 9.0.0 Renamed to ConnectEndpoint from Endpoint. 26 | */ 27 | public interface ConnectEndpoint { 28 | 29 | /** 30 | * Gets the endpoint type name. 31 | * 32 | * @return The endpoint type as a string. 33 | */ 34 | @JsonProperty("type") 35 | EndpointType getType(); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/voice/ncco/EventMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice.ncco; 17 | 18 | /** 19 | * The type of request to use when connecting to an event URL. 20 | */ 21 | public enum EventMethod { 22 | POST, GET 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/voice/ncco/EventType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice.ncco; 17 | 18 | import com.fasterxml.jackson.annotation.JsonValue; 19 | 20 | /** 21 | * The type of event to use for {@link ConnectAction}. 22 | */ 23 | public enum EventType { 24 | 25 | /** 26 | * Enables eventUrl to return an NCCO that overrides the current NCCO when a call moves to specific states. 27 | */ 28 | SYNCHRONOUS; 29 | 30 | @JsonValue 31 | @Override 32 | public String toString() { 33 | return name().toLowerCase(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/voice/ncco/SplitRecording.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice.ncco; 17 | 18 | import com.fasterxml.jackson.annotation.JsonValue; 19 | 20 | /** 21 | * Enum for declaring multichannel recordings in {@link RecordAction}. 22 | */ 23 | public enum SplitRecording { 24 | CONVERSATION; 25 | 26 | @JsonValue 27 | @Override 28 | public String toString() { 29 | return name().toLowerCase(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/voice/ncco/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Provides useful NCCO classes which can be serialized using Jackson when 19 | * implementing webhooks to drive the Vonage Voice API. 20 | */ 21 | package com.vonage.client.voice.ncco; -------------------------------------------------------------------------------- /src/main/java/com/vonage/client/voice/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Implementation of the Voice API. 19 | * See the Vonage developer portal 20 | * for an overview and documentation. 21 | */ 22 | package com.vonage.client.voice; 23 | -------------------------------------------------------------------------------- /src/test/java/BugRepro.java.template: -------------------------------------------------------------------------------- 1 | import com.vonage.client.*; 2 | import java.util.*; 3 | 4 | /** 5 | * Convenience class for debugging / live testing. You should copy this file and remove the 6 | * `.template` extension from the filename to make it usable. 7 | */ 8 | public class BugRepro { 9 | public static void main(String[] args) throws Throwable { 10 | String TO_NUMBER = System.getenv("TO_NUMBER"); 11 | 12 | VonageClient client = VonageClient.builder() 13 | .httpConfig(HttpConfig.builder().timeoutMillis(12_000).build()) 14 | .apiKey(System.getenv("VONAGE_API_KEY")) 15 | .apiSecret(System.getenv("VONAGE_API_SECRET")) 16 | .applicationId(System.getenv("VONAGE_APPLICATION_ID")) 17 | .privateKeyPath(System.getenv("VONAGE_PRIVATE_KEY_PATH")) 18 | .build(); 19 | 20 | try { 21 | // Debug code here 22 | 23 | System.out.println("Success"); 24 | } 25 | catch (Exception ex) { 26 | ex.printStackTrace(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/application/capabilities/VbcTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.application.capabilities; 17 | 18 | import static org.junit.jupiter.api.Assertions.*; 19 | import org.junit.jupiter.api.*; 20 | 21 | public class VbcTest { 22 | @Test 23 | public void testEmpty() { 24 | Vbc vbc = Vbc.builder().build(); 25 | 26 | assertEquals(Capability.Type.VBC, vbc.getType()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/conversations/AudioRecordStopEventTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.vonage.client.Jsonable; 19 | import org.junit.jupiter.api.*; 20 | import static org.junit.jupiter.api.Assertions.*; 21 | import java.util.Map; 22 | 23 | public class AudioRecordStopEventTest extends AbstractEventTest { 24 | 25 | @Test 26 | public void testAudioRecordStopEvent() { 27 | var event = testBaseEvent(EventType.AUDIO_RECORD_STOP, 28 | AudioRecordStopEvent.builder().recordId(randomIdStr), 29 | Map.of("record_id", randomId) 30 | ); 31 | assertEquals(randomId, event.getRecordId()); 32 | } 33 | 34 | @Test 35 | public void testEmptyJson() { 36 | var event = Jsonable.fromJson("{}", AudioRecordStopEvent.class); 37 | assertNotNull(event); 38 | assertNull(event.getRecordId()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/conversations/ConversationsEndpointTestSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import com.vonage.client.*; 19 | import com.vonage.client.auth.*; 20 | import java.util.*; 21 | 22 | abstract class ConversationsEndpointTestSpec extends DynamicEndpointTestSpec { 23 | 24 | @Override 25 | protected Collection> expectedAuthMethods() { 26 | return List.of(JWTAuthMethod.class); 27 | } 28 | 29 | @Override 30 | protected Class expectedResponseExceptionType() { 31 | return ConversationsResponseException.class; 32 | } 33 | 34 | @Override 35 | protected String expectedDefaultBaseUri() { 36 | return "https://api.nexmo.com"; 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/conversations/SortOrderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.conversations; 17 | 18 | import static com.vonage.client.common.SortOrder.*; 19 | import org.junit.jupiter.api.*; 20 | import static org.junit.jupiter.api.Assertions.*; 21 | 22 | public class SortOrderTest { 23 | 24 | @Test 25 | public void testFromString() { 26 | assertEquals(ASCENDING, fromString("ASC")); 27 | assertEquals(ASCENDING, fromString("Ascending")); 28 | assertEquals(DESCENDING, fromString("descending")); 29 | assertEquals(DESCENDING, fromString("DESC")); 30 | assertNull(fromString("")); 31 | assertNull(fromString(null)); 32 | assertThrows(IllegalArgumentException.class, () -> fromString("Newest")); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/numbers/NumbersEndpointTestSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.numbers; 17 | 18 | import com.vonage.client.DynamicEndpointTestSpec; 19 | import com.vonage.client.VonageApiResponseException; 20 | import com.vonage.client.auth.ApiKeyHeaderAuthMethod; 21 | import com.vonage.client.auth.AuthMethod; 22 | import java.util.Collection; 23 | import java.util.List; 24 | 25 | abstract class NumbersEndpointTestSpec extends DynamicEndpointTestSpec { 26 | 27 | @Override 28 | protected Collection> expectedAuthMethods() { 29 | return List.of(ApiKeyHeaderAuthMethod.class); 30 | } 31 | 32 | @Override 33 | protected Class expectedResponseExceptionType() { 34 | return NumbersResponseException.class; 35 | } 36 | 37 | @Override 38 | protected String expectedDefaultBaseUri() { 39 | return "https://rest.nexmo.com"; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/verify/CheckResponseTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.verify; 17 | 18 | import com.vonage.client.Jsonable; 19 | import com.vonage.client.VonageUnexpectedException; 20 | import static org.junit.jupiter.api.Assertions.*; 21 | import org.junit.jupiter.api.*; 22 | 23 | public class CheckResponseTest { 24 | 25 | @Test 26 | public void testConstructor() { 27 | CheckResponse response = new CheckResponse(VerifyStatus.ALREADY_REQUESTED); 28 | assertEquals(10, response.getStatus().getVerifyStatus()); 29 | } 30 | 31 | @Test 32 | public void testBadJson() { 33 | assertThrows(VonageUnexpectedException.class, () -> Jsonable.fromJson("blarg", CheckResponse.class)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/verify/VerifyDetailsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.verify; 17 | 18 | import static org.junit.jupiter.api.Assertions.*; 19 | import org.junit.jupiter.api.*; 20 | 21 | public class VerifyDetailsTest { 22 | 23 | @Test 24 | public void testVerifyDetailsStatusFromString() { 25 | assertEquals(VerifyDetails.Status.INVALID, VerifyDetails.Status.fromString("101")); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/video/VideoEndpointTestSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.video; 17 | 18 | import com.vonage.client.*; 19 | import com.vonage.client.auth.*; 20 | import java.util.*; 21 | 22 | abstract class VideoEndpointTestSpec extends DynamicEndpointTestSpec { 23 | 24 | @Override 25 | protected Collection> expectedAuthMethods() { 26 | return Arrays.asList(JWTAuthMethod.class, ApiKeyHeaderAuthMethod.class); 27 | } 28 | 29 | @Override 30 | protected Class expectedResponseExceptionType() { 31 | return VideoResponseException.class; 32 | } 33 | 34 | @Override 35 | protected String expectedDefaultBaseUri() { 36 | return "https://video.api.vonage.com"; 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/voice/MachineDetectionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice; 17 | 18 | import static org.junit.jupiter.api.Assertions.*; 19 | import org.junit.jupiter.api.*; 20 | 21 | public class MachineDetectionTest { 22 | 23 | @Test 24 | public void testMachineDetectionFromString() { 25 | assertEquals(MachineDetection.HANGUP, MachineDetection.fromString("hangup")); 26 | assertEquals(MachineDetection.CONTINUE, MachineDetection.fromString("continue")); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/voice/StreamResponseTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice; 17 | 18 | import com.vonage.client.Jsonable; 19 | import com.vonage.client.TestUtils; 20 | import static org.junit.jupiter.api.Assertions.assertEquals; 21 | import org.junit.jupiter.api.*; 22 | 23 | public class StreamResponseTest { 24 | private StreamResponse response; 25 | 26 | @BeforeEach 27 | public void setUp() { 28 | response = Jsonable.fromJson("{\n" + 29 | " \"message\": \"Stream started\",\n" + 30 | " \"uuid\": \"ssf61863-4a51-ef6b-11e1-w6edebcf93bb\"\n" + 31 | "}"); 32 | } 33 | 34 | @Test 35 | public void testBasics() { 36 | TestUtils.testJsonableBaseObject(response); 37 | assertEquals("Stream started", response.getMessage()); 38 | assertEquals("ssf61863-4a51-ef6b-11e1-w6edebcf93bb", response.getUuid()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/voice/TalkResponseTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice; 17 | 18 | import com.vonage.client.Jsonable; 19 | import com.vonage.client.TestUtils; 20 | import static org.junit.jupiter.api.Assertions.assertEquals; 21 | import org.junit.jupiter.api.*; 22 | 23 | public class TalkResponseTest { 24 | private TalkResponse response; 25 | 26 | @BeforeEach 27 | public void setUp() { 28 | response = Jsonable.fromJson("{\n" + 29 | " \"message\": \"Talk stopped\",\n" + 30 | " \"uuid\": \"ssf61863-4a51-ef6b-11e1-w6edebcf93bb\"\n" + 31 | "}"); 32 | } 33 | 34 | @Test 35 | public void testBasics() { 36 | TestUtils.testJsonableBaseObject(response); 37 | assertEquals("Talk stopped", response.getMessage()); 38 | assertEquals("ssf61863-4a51-ef6b-11e1-w6edebcf93bb", response.getUuid()); 39 | } 40 | } -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/voice/VoiceEndpointTestSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice; 17 | 18 | import com.vonage.client.DynamicEndpointTestSpec; 19 | import com.vonage.client.VonageApiResponseException; 20 | import com.vonage.client.auth.AuthMethod; 21 | import com.vonage.client.auth.JWTAuthMethod; 22 | import java.util.Collection; 23 | import java.util.List; 24 | 25 | abstract class VoiceEndpointTestSpec extends DynamicEndpointTestSpec { 26 | 27 | @Override 28 | protected Collection> expectedAuthMethods() { 29 | return List.of(JWTAuthMethod.class); 30 | } 31 | 32 | @Override 33 | protected Class expectedResponseExceptionType() { 34 | return VoiceResponseException.class; 35 | } 36 | 37 | @Override 38 | protected String expectedDefaultBaseUri() { 39 | return "https://api.nexmo.com"; 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/voice/ncco/AppEndpointTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice.ncco; 17 | 18 | import org.junit.jupiter.api.*; 19 | import static org.junit.jupiter.api.Assertions.*; 20 | 21 | public class AppEndpointTest { 22 | 23 | @Test 24 | public void testAppEndpoint() { 25 | AppEndpoint endpoint = AppEndpoint.builder("testUser").build(); 26 | ConnectAction connect = ConnectAction.builder(endpoint).build(); 27 | 28 | String expectedJson = "[{\"endpoint\":[{\"user\":\"testUser\",\"type\":\"app\"}],\"action\":\"connect\"}]"; 29 | assertEquals(expectedJson, new Ncco(connect).toJson()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/voice/ncco/RecordingFormatTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice.ncco; 17 | 18 | import org.junit.jupiter.api.*; 19 | import static org.junit.jupiter.api.Assertions.*; 20 | 21 | public class RecordingFormatTest { 22 | @Test 23 | public void testFromString() { 24 | assertEquals(RecordingFormat.MP3, RecordingFormat.fromString("mp3")); 25 | assertEquals(RecordingFormat.WAV, RecordingFormat.fromString("wav")); 26 | assertNull(RecordingFormat.fromString("test unknown")); 27 | } 28 | 29 | @Test 30 | public void testToString() { 31 | assertEquals("mp3", RecordingFormat.MP3.toString()); 32 | assertEquals("wav", RecordingFormat.WAV.toString()); 33 | } 34 | } -------------------------------------------------------------------------------- /src/test/java/com/vonage/client/voice/ncco/VbcEndpointTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 Vonage 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.vonage.client.voice.ncco; 17 | 18 | import static org.junit.jupiter.api.Assertions.*; 19 | import org.junit.jupiter.api.*; 20 | 21 | public class VbcEndpointTest { 22 | 23 | @Test 24 | public void testVbcEndpoint() { 25 | String ext = "123"; 26 | VbcEndpoint endpoint = VbcEndpoint.builder("abcd").extension(ext).build(); 27 | ConnectAction connect = ConnectAction.builder(endpoint).build(); 28 | String expectedJson = "[{\"endpoint\":[{\"extension\":\"%s\",\"type\":\"vbc\"}],\"action\":\"connect\"}]"; 29 | assertEquals(String.format(expectedJson, ext), new Ncco(connect).toJson()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/resources/com/vonage/client/test/keys/application_public_key.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vonage/vonage-java-sdk/d94eb781dd229933bd8241d4b9763c33f2bdb299/src/test/resources/com/vonage/client/test/keys/application_public_key.der -------------------------------------------------------------------------------- /src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | junit.jupiter.execution.parallel.enabled = true 2 | junit.jupiter.execution.parallel.mode.default = concurrent 3 | --------------------------------------------------------------------------------