@Test public void testViewTranscription() throws UnauthorizedException, GeneralException, NotFoundException { final TranscriptionResponse transcriptionResponse = TestUtil.createTranscriptionResponse(); MessageBirdService messageBirdServiceMock = mock(MessageBirdService.class); MessageBirdClient messageBirdClientInjectMock = new MessageBirdClient(messageBirdServiceMock); String url = String.format( "%s%s/%s%s/%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, "ANY_CALL_ID", LEGSPATH, "ANY_LEG_ID", RECORDINGPATH, "ANY_ID", TRANSCRIPTIONPATH); when(messageBirdServiceMock.requestByID(Mockito.eq(url), Mockito.eq("ANY_TRANSCRIPTION_ID"), Mockito.eq(TranscriptionResponse.class))) .thenReturn(transcriptionResponse); final TranscriptionResponse response = messageBirdClientInjectMock .viewTranscription("ANY_CALL_ID", "ANY_LEG_ID", "ANY_ID", "ANY_TRANSCRIPTION_ID"); verify(messageBirdServiceMock, times(1)) .requestByID(Mockito.eq(url), Mockito.eq("ANY_TRANSCRIPTION_ID"), Mockito.eq(TranscriptionResponse.class)); assertNotNull(response); assertReflectionEquals(response.getData().get(0), transcriptionResponse.getData().get(0)); }
public TranscriptionResponse viewTranscription(String callID, String legId, String recordingId, String transcriptionId) throws UnauthorizedException, GeneralException, NotFoundException { if (callID == null) { throw new IllegalArgumentException("Voice call ID must be specified."); } if (legId == null) { throw new IllegalArgumentException("Leg ID must be specified."); } if (recordingId == null) { throw new IllegalArgumentException("Recording ID must be specified."); } if(transcriptionId == null) { throw new IllegalArgumentException("Transcription ID must be specified."); } String url = String.format( "%s%s/%s%s/%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, callID, LEGSPATH, legId, RECORDINGPATH, recordingId, TRANSCRIPTIONPATH); return messageBirdService.requestByID(url, transcriptionId, TranscriptionResponse.class); }
MessageBirdClient { public TranscriptionResponse viewTranscription(String callID, String legId, String recordingId, String transcriptionId) throws UnauthorizedException, GeneralException, NotFoundException { if (callID == null) { throw new IllegalArgumentException("Voice call ID must be specified."); } if (legId == null) { throw new IllegalArgumentException("Leg ID must be specified."); } if (recordingId == null) { throw new IllegalArgumentException("Recording ID must be specified."); } if(transcriptionId == null) { throw new IllegalArgumentException("Transcription ID must be specified."); } String url = String.format( "%s%s/%s%s/%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, callID, LEGSPATH, legId, RECORDINGPATH, recordingId, TRANSCRIPTIONPATH); return messageBirdService.requestByID(url, transcriptionId, TranscriptionResponse.class); } }
MessageBirdClient { public TranscriptionResponse viewTranscription(String callID, String legId, String recordingId, String transcriptionId) throws UnauthorizedException, GeneralException, NotFoundException { if (callID == null) { throw new IllegalArgumentException("Voice call ID must be specified."); } if (legId == null) { throw new IllegalArgumentException("Leg ID must be specified."); } if (recordingId == null) { throw new IllegalArgumentException("Recording ID must be specified."); } if(transcriptionId == null) { throw new IllegalArgumentException("Transcription ID must be specified."); } String url = String.format( "%s%s/%s%s/%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, callID, LEGSPATH, legId, RECORDINGPATH, recordingId, TRANSCRIPTIONPATH); return messageBirdService.requestByID(url, transcriptionId, TranscriptionResponse.class); } MessageBirdClient(final MessageBirdService messageBirdService);  MessageBirdClient(final MessageBirdService messageBirdService, List<Feature> features); }
MessageBirdClient { public TranscriptionResponse viewTranscription(String callID, String legId, String recordingId, String transcriptionId) throws UnauthorizedException, GeneralException, NotFoundException { if (callID == null) { throw new IllegalArgumentException("Voice call ID must be specified."); } if (legId == null) { throw new IllegalArgumentException("Leg ID must be specified."); } if (recordingId == null) { throw new IllegalArgumentException("Recording ID must be specified."); } if(transcriptionId == null) { throw new IllegalArgumentException("Transcription ID must be specified."); } String url = String.format( "%s%s/%s%s/%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, callID, LEGSPATH, legId, RECORDINGPATH, recordingId, TRANSCRIPTIONPATH); return messageBirdService.requestByID(url, transcriptionId, TranscriptionResponse.class); } MessageBirdClient(final MessageBirdService messageBirdService);  MessageBirdClient(final MessageBirdService messageBirdService, List<Feature> features); Balance getBalance(); Hlr getRequestHlr(final BigInteger msisdn, final String reference); Hlr getViewHlr(final String hlrId); MessageResponse sendMessage(final Message message); MessageResponse sendMessage(final String originator, final String body, final List<BigInteger> recipients); MessageResponse sendMessage(final String originator, final String body, final List<BigInteger> recipients, final String reference); MessageResponse sendFlashMessage(final String originator, final String body, final List<BigInteger> recipients); MessageResponse sendFlashMessage(final String originator, final String body, final List<BigInteger> recipients, final String reference); MessageList listMessages(final Integer offset, final Integer limit); MessageList listMessagesFiltered(final Integer offset, final Integer limit, final Map<String, Object> filters); void deleteMessage(final String id); MessageResponse viewMessage(final String id); VoiceMessageResponse sendVoiceMessage(final VoiceMessage voiceMessage); VoiceMessageResponse sendVoiceMessage(final String body, final List<BigInteger> recipients); VoiceMessageResponse sendVoiceMessage(final String body, final List<BigInteger> recipients, final String reference); void deleteVoiceMessage(final String id); VoiceMessageResponse viewVoiceMessage(final String id); VoiceMessageList listVoiceMessages(final Integer offset, final Integer limit); Verify sendVerifyToken(VerifyRequest verifyRequest); Verify sendVerifyToken(String recipient); Verify verifyToken(String id, String token); void deleteVerifyObject(String id); Lookup viewLookup(final Lookup lookup); Lookup viewLookup(final BigInteger phoneNumber); LookupHlr requestLookupHlr(final LookupHlr lookupHlr); LookupHlr requestLookupHlr(final BigInteger phoneNumber, final String reference); LookupHlr viewLookupHlr(final LookupHlr lookupHlr); LookupHlr viewLookupHlr(final BigInteger phoneNumber); VoiceCallFlowList listVoiceCallFlows(final Integer offset, final Integer limit); VoiceCallFlowResponse viewVoiceCallFlow(final String id); VoiceCallFlowResponse sendVoiceCallFlow(final VoiceCallFlowRequest voiceCallFlowRequest); VoiceCallFlowResponse updateVoiceCallFlow(String id, VoiceCallFlowRequest voiceCallFlowRequest); void deleteVoiceCallFlow(final String id); ContactList listContacts(int offset, int limit); ContactList listContacts(); Contact sendContact(final ContactRequest contactRequest); Contact updateContact(final String id, ContactRequest contactRequest); Contact viewContact(final String id); void deleteGroup(final String id); void deleteGroupContact(final String groupId, final String contactId); GroupList listGroups(final int offset, final int limit); GroupList listGroups(); Group sendGroup(final GroupRequest groupRequest); void sendGroupContact(final String groupId, final String[] contactIds); Group updateGroup(final String id, final GroupRequest groupRequest); Group viewGroup(final String id); Conversation viewConversation(final String id); Conversation updateConversation(final String id, final ConversationStatus status); ConversationList listConversations(final int offset, final int limit); ConversationList listConversations(); Conversation startConversation(ConversationStartRequest request); ConversationSendResponse sendMessage(ConversationSendRequest request); ConversationMessageList listConversationMessages(
            final String conversationId,
            final int offset,
            final int limit
    ); ConversationMessageList listConversationMessages(
            final String conversationId
    ); ConversationMessage viewConversationMessage(final String messageId); ConversationMessage sendConversationMessage(
            final String conversationId,
            final ConversationMessageRequest request
    ); void deleteConversationWebhook(final String webhookId); ConversationWebhook sendConversationWebhook(final ConversationWebhookCreateRequest request); ConversationWebhook updateConversationWebhook(final String id, final ConversationWebhookUpdateRequest request); ConversationWebhook viewConversationWebhook(final String webhookId); ConversationWebhookList listConversationWebhooks(final int offset, final int limit); ConversationWebhookList listConversationWebhooks(); VoiceCallResponse sendVoiceCall(final VoiceCall voiceCall); VoiceCallResponseList listAllVoiceCalls(Integer page, Integer pageSize); VoiceCallResponse viewVoiceCall(final String id); void deleteVoiceCall(final String id); VoiceCallLegResponse viewCallLegsByCallId(String callId, Integer page, Integer pageSize); VoiceCallLeg viewCallLegByCallIdAndLegId(final String callId, String legId); RecordingResponse viewRecording(String callID, String legId, String recordingId); String downloadRecording(String callID, String legId, String recordingId, String basePath); RecordingResponse listRecordings(String callID, String legId, final Integer offset, final Integer limit); void deleteRecording(final String callID, final String legID, final String recordingID); TranscriptionResponse createTranscription(String callID, String legId, String recordingId, String language); TranscriptionResponse viewTranscription(String callID, String legId, String recordingId, String transcriptionId); TranscriptionResponse listTranscriptions(String callID, String legId, String recordingId, Integer page, Integer pageSize); String downloadTranscription(String callID, String legId, String recordingId, String transcriptionId, String basePath); WebhookResponseData createWebhook(Webhook webhook); WebhookResponseData updateWebhook(String id, Webhook webhook); WebhookResponseData viewWebhook(String id); WebhookList listWebhooks(final Integer offset, final Integer limit); void deleteWebhook(String id); PhoneNumbersResponse listNumbersForPurchase(String countryCode); PhoneNumbersResponse listNumbersForPurchase(String countryCode, PhoneNumbersLookup params); PurchasedNumberCreatedResponse purchaseNumber(String number, String countryCode, int billingIntervalMonths); PurchasedNumbersResponse listPurchasedNumbers(PurchasedNumbersFilter filter); PurchasedNumber viewPurchasedNumber(String number); PurchasedNumber updateNumber(String number, String... tags); void cancelNumber(String number); }
MessageBirdClient { public TranscriptionResponse viewTranscription(String callID, String legId, String recordingId, String transcriptionId) throws UnauthorizedException, GeneralException, NotFoundException { if (callID == null) { throw new IllegalArgumentException("Voice call ID must be specified."); } if (legId == null) { throw new IllegalArgumentException("Leg ID must be specified."); } if (recordingId == null) { throw new IllegalArgumentException("Recording ID must be specified."); } if(transcriptionId == null) { throw new IllegalArgumentException("Transcription ID must be specified."); } String url = String.format( "%s%s/%s%s/%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, callID, LEGSPATH, legId, RECORDINGPATH, recordingId, TRANSCRIPTIONPATH); return messageBirdService.requestByID(url, transcriptionId, TranscriptionResponse.class); } MessageBirdClient(final MessageBirdService messageBirdService);  MessageBirdClient(final MessageBirdService messageBirdService, List<Feature> features); Balance getBalance(); Hlr getRequestHlr(final BigInteger msisdn, final String reference); Hlr getViewHlr(final String hlrId); MessageResponse sendMessage(final Message message); MessageResponse sendMessage(final String originator, final String body, final List<BigInteger> recipients); MessageResponse sendMessage(final String originator, final String body, final List<BigInteger> recipients, final String reference); MessageResponse sendFlashMessage(final String originator, final String body, final List<BigInteger> recipients); MessageResponse sendFlashMessage(final String originator, final String body, final List<BigInteger> recipients, final String reference); MessageList listMessages(final Integer offset, final Integer limit); MessageList listMessagesFiltered(final Integer offset, final Integer limit, final Map<String, Object> filters); void deleteMessage(final String id); MessageResponse viewMessage(final String id); VoiceMessageResponse sendVoiceMessage(final VoiceMessage voiceMessage); VoiceMessageResponse sendVoiceMessage(final String body, final List<BigInteger> recipients); VoiceMessageResponse sendVoiceMessage(final String body, final List<BigInteger> recipients, final String reference); void deleteVoiceMessage(final String id); VoiceMessageResponse viewVoiceMessage(final String id); VoiceMessageList listVoiceMessages(final Integer offset, final Integer limit); Verify sendVerifyToken(VerifyRequest verifyRequest); Verify sendVerifyToken(String recipient); Verify verifyToken(String id, String token); void deleteVerifyObject(String id); Lookup viewLookup(final Lookup lookup); Lookup viewLookup(final BigInteger phoneNumber); LookupHlr requestLookupHlr(final LookupHlr lookupHlr); LookupHlr requestLookupHlr(final BigInteger phoneNumber, final String reference); LookupHlr viewLookupHlr(final LookupHlr lookupHlr); LookupHlr viewLookupHlr(final BigInteger phoneNumber); VoiceCallFlowList listVoiceCallFlows(final Integer offset, final Integer limit); VoiceCallFlowResponse viewVoiceCallFlow(final String id); VoiceCallFlowResponse sendVoiceCallFlow(final VoiceCallFlowRequest voiceCallFlowRequest); VoiceCallFlowResponse updateVoiceCallFlow(String id, VoiceCallFlowRequest voiceCallFlowRequest); void deleteVoiceCallFlow(final String id); ContactList listContacts(int offset, int limit); ContactList listContacts(); Contact sendContact(final ContactRequest contactRequest); Contact updateContact(final String id, ContactRequest contactRequest); Contact viewContact(final String id); void deleteGroup(final String id); void deleteGroupContact(final String groupId, final String contactId); GroupList listGroups(final int offset, final int limit); GroupList listGroups(); Group sendGroup(final GroupRequest groupRequest); void sendGroupContact(final String groupId, final String[] contactIds); Group updateGroup(final String id, final GroupRequest groupRequest); Group viewGroup(final String id); Conversation viewConversation(final String id); Conversation updateConversation(final String id, final ConversationStatus status); ConversationList listConversations(final int offset, final int limit); ConversationList listConversations(); Conversation startConversation(ConversationStartRequest request); ConversationSendResponse sendMessage(ConversationSendRequest request); ConversationMessageList listConversationMessages(
            final String conversationId,
            final int offset,
            final int limit
    ); ConversationMessageList listConversationMessages(
            final String conversationId
    ); ConversationMessage viewConversationMessage(final String messageId); ConversationMessage sendConversationMessage(
            final String conversationId,
            final ConversationMessageRequest request
    ); void deleteConversationWebhook(final String webhookId); ConversationWebhook sendConversationWebhook(final ConversationWebhookCreateRequest request); ConversationWebhook updateConversationWebhook(final String id, final ConversationWebhookUpdateRequest request); ConversationWebhook viewConversationWebhook(final String webhookId); ConversationWebhookList listConversationWebhooks(final int offset, final int limit); ConversationWebhookList listConversationWebhooks(); VoiceCallResponse sendVoiceCall(final VoiceCall voiceCall); VoiceCallResponseList listAllVoiceCalls(Integer page, Integer pageSize); VoiceCallResponse viewVoiceCall(final String id); void deleteVoiceCall(final String id); VoiceCallLegResponse viewCallLegsByCallId(String callId, Integer page, Integer pageSize); VoiceCallLeg viewCallLegByCallIdAndLegId(final String callId, String legId); RecordingResponse viewRecording(String callID, String legId, String recordingId); String downloadRecording(String callID, String legId, String recordingId, String basePath); RecordingResponse listRecordings(String callID, String legId, final Integer offset, final Integer limit); void deleteRecording(final String callID, final String legID, final String recordingID); TranscriptionResponse createTranscription(String callID, String legId, String recordingId, String language); TranscriptionResponse viewTranscription(String callID, String legId, String recordingId, String transcriptionId); TranscriptionResponse listTranscriptions(String callID, String legId, String recordingId, Integer page, Integer pageSize); String downloadTranscription(String callID, String legId, String recordingId, String transcriptionId, String basePath); WebhookResponseData createWebhook(Webhook webhook); WebhookResponseData updateWebhook(String id, Webhook webhook); WebhookResponseData viewWebhook(String id); WebhookList listWebhooks(final Integer offset, final Integer limit); void deleteWebhook(String id); PhoneNumbersResponse listNumbersForPurchase(String countryCode); PhoneNumbersResponse listNumbersForPurchase(String countryCode, PhoneNumbersLookup params); PurchasedNumberCreatedResponse purchaseNumber(String number, String countryCode, int billingIntervalMonths); PurchasedNumbersResponse listPurchasedNumbers(PurchasedNumbersFilter filter); PurchasedNumber viewPurchasedNumber(String number); PurchasedNumber updateNumber(String number, String... tags); void cancelNumber(String number);  }