diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index b4a6ed8b..9eba548e 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -11,6 +11,9 @@ docs/CallDirectionEnum.md docs/CallRecordingMetadata.md docs/CallState.md docs/CallStateEnum.md +docs/CallTranscription.md +docs/CallTranscriptionMetadata.md +docs/CallTranscriptionResponse.md docs/CallbackMethodEnum.md docs/CallsApi.md docs/CodeRequest.md @@ -76,6 +79,8 @@ docs/PriorityEnum.md docs/RecordingAvailableCallback.md docs/RecordingCompleteCallback.md docs/RecordingStateEnum.md +docs/RecordingTranscriptionMetadata.md +docs/RecordingTranscriptions.md docs/RecordingsApi.md docs/RedirectCallback.md docs/RedirectMethodEnum.md @@ -86,8 +91,7 @@ docs/TnLookupRequestError.md docs/TranscribeRecording.md docs/Transcription.md docs/TranscriptionAvailableCallback.md -docs/TranscriptionList.md -docs/TranscriptionMetadata.md +docs/TranscriptionsApi.md docs/TransferAnswerCallback.md docs/TransferCompleteCallback.md docs/TransferDisconnectCallback.md @@ -128,6 +132,7 @@ src/main/java/com/bandwidth/sdk/api/MfaApi.java src/main/java/com/bandwidth/sdk/api/PhoneNumberLookupApi.java src/main/java/com/bandwidth/sdk/api/RecordingsApi.java src/main/java/com/bandwidth/sdk/api/StatisticsApi.java +src/main/java/com/bandwidth/sdk/api/TranscriptionsApi.java src/main/java/com/bandwidth/sdk/auth/ApiKeyAuth.java src/main/java/com/bandwidth/sdk/auth/Authentication.java src/main/java/com/bandwidth/sdk/auth/HttpBasicAuth.java @@ -141,6 +146,9 @@ src/main/java/com/bandwidth/sdk/model/CallDirectionEnum.java src/main/java/com/bandwidth/sdk/model/CallRecordingMetadata.java src/main/java/com/bandwidth/sdk/model/CallState.java src/main/java/com/bandwidth/sdk/model/CallStateEnum.java +src/main/java/com/bandwidth/sdk/model/CallTranscription.java +src/main/java/com/bandwidth/sdk/model/CallTranscriptionMetadata.java +src/main/java/com/bandwidth/sdk/model/CallTranscriptionResponse.java src/main/java/com/bandwidth/sdk/model/CallbackMethodEnum.java src/main/java/com/bandwidth/sdk/model/CodeRequest.java src/main/java/com/bandwidth/sdk/model/Conference.java @@ -200,6 +208,8 @@ src/main/java/com/bandwidth/sdk/model/PriorityEnum.java src/main/java/com/bandwidth/sdk/model/RecordingAvailableCallback.java src/main/java/com/bandwidth/sdk/model/RecordingCompleteCallback.java src/main/java/com/bandwidth/sdk/model/RecordingStateEnum.java +src/main/java/com/bandwidth/sdk/model/RecordingTranscriptionMetadata.java +src/main/java/com/bandwidth/sdk/model/RecordingTranscriptions.java src/main/java/com/bandwidth/sdk/model/RedirectCallback.java src/main/java/com/bandwidth/sdk/model/RedirectMethodEnum.java src/main/java/com/bandwidth/sdk/model/StirShaken.java @@ -208,8 +218,6 @@ src/main/java/com/bandwidth/sdk/model/TnLookupRequestError.java src/main/java/com/bandwidth/sdk/model/TranscribeRecording.java src/main/java/com/bandwidth/sdk/model/Transcription.java src/main/java/com/bandwidth/sdk/model/TranscriptionAvailableCallback.java -src/main/java/com/bandwidth/sdk/model/TranscriptionList.java -src/main/java/com/bandwidth/sdk/model/TranscriptionMetadata.java src/main/java/com/bandwidth/sdk/model/TransferAnswerCallback.java src/main/java/com/bandwidth/sdk/model/TransferCompleteCallback.java src/main/java/com/bandwidth/sdk/model/TransferDisconnectCallback.java diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 8b23b8d4..93c8ddab 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.3.0 \ No newline at end of file +7.6.0 diff --git a/README.md b/README.md index e35def7d..85de3774 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ Bandwidth - API version: 1.0.0 + - Generator version: 7.6.0 Bandwidth's Communication APIs @@ -40,7 +41,7 @@ Add this dependency to your project's POM: com.bandwidth.sdk bandwidth-sdk - 9.1.4 + 10.0.0 compile ``` @@ -56,7 +57,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.bandwidth.sdk:bandwidth-sdk:9.1.4" + implementation "com.bandwidth.sdk:bandwidth-sdk:10.0.0" } ``` @@ -70,7 +71,7 @@ mvn clean package Then manually install the following JARs: -* `target/bandwidth-sdk-9.1.4.jar` +* `target/bandwidth-sdk-10.0.0.jar` * `target/lib/*.jar` ## Getting Started @@ -146,17 +147,20 @@ Class | Method | HTTP request | Description *MfaApi* | [**verifyCode**](docs/MfaApi.md#verifyCode) | **POST** /accounts/{accountId}/code/verify | Verify Authentication Code *PhoneNumberLookupApi* | [**createLookup**](docs/PhoneNumberLookupApi.md#createLookup) | **POST** /accounts/{accountId}/tnlookup | Create Lookup *PhoneNumberLookupApi* | [**getLookupStatus**](docs/PhoneNumberLookupApi.md#getLookupStatus) | **GET** /accounts/{accountId}/tnlookup/{requestId} | Get Lookup Request Status -*RecordingsApi* | [**deleteCallTranscription**](docs/RecordingsApi.md#deleteCallTranscription) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Delete Transcription *RecordingsApi* | [**deleteRecording**](docs/RecordingsApi.md#deleteRecording) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Delete Recording *RecordingsApi* | [**deleteRecordingMedia**](docs/RecordingsApi.md#deleteRecordingMedia) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Delete Recording Media +*RecordingsApi* | [**deleteRecordingTranscription**](docs/RecordingsApi.md#deleteRecordingTranscription) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Delete Transcription *RecordingsApi* | [**downloadCallRecording**](docs/RecordingsApi.md#downloadCallRecording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Download Recording *RecordingsApi* | [**getCallRecording**](docs/RecordingsApi.md#getCallRecording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Get Call Recording -*RecordingsApi* | [**getCallTranscription**](docs/RecordingsApi.md#getCallTranscription) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Get Transcription +*RecordingsApi* | [**getRecordingTranscription**](docs/RecordingsApi.md#getRecordingTranscription) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Get Transcription *RecordingsApi* | [**listAccountCallRecordings**](docs/RecordingsApi.md#listAccountCallRecordings) | **GET** /accounts/{accountId}/recordings | Get Call Recordings *RecordingsApi* | [**listCallRecordings**](docs/RecordingsApi.md#listCallRecordings) | **GET** /accounts/{accountId}/calls/{callId}/recordings | List Call Recordings *RecordingsApi* | [**transcribeCallRecording**](docs/RecordingsApi.md#transcribeCallRecording) | **POST** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Create Transcription Request *RecordingsApi* | [**updateCallRecordingState**](docs/RecordingsApi.md#updateCallRecordingState) | **PUT** /accounts/{accountId}/calls/{callId}/recording | Update Recording *StatisticsApi* | [**getStatistics**](docs/StatisticsApi.md#getStatistics) | **GET** /accounts/{accountId}/statistics | Get Account Statistics +*TranscriptionsApi* | [**deleteRealTimeTranscription**](docs/TranscriptionsApi.md#deleteRealTimeTranscription) | **DELETE** /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} | Delete a specific transcription +*TranscriptionsApi* | [**getRealTimeTranscription**](docs/TranscriptionsApi.md#getRealTimeTranscription) | **GET** /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} | Retrieve a specific transcription +*TranscriptionsApi* | [**listRealTimeTranscriptions**](docs/TranscriptionsApi.md#listRealTimeTranscriptions) | **GET** /accounts/{accountId}/calls/{callId}/transcriptions | Enumerate transcriptions made with StartTranscription ## Documentation for Models @@ -169,6 +173,9 @@ Class | Method | HTTP request | Description - [CallRecordingMetadata](docs/CallRecordingMetadata.md) - [CallState](docs/CallState.md) - [CallStateEnum](docs/CallStateEnum.md) + - [CallTranscription](docs/CallTranscription.md) + - [CallTranscriptionMetadata](docs/CallTranscriptionMetadata.md) + - [CallTranscriptionResponse](docs/CallTranscriptionResponse.md) - [CallbackMethodEnum](docs/CallbackMethodEnum.md) - [CodeRequest](docs/CodeRequest.md) - [Conference](docs/Conference.md) @@ -228,6 +235,8 @@ Class | Method | HTTP request | Description - [RecordingAvailableCallback](docs/RecordingAvailableCallback.md) - [RecordingCompleteCallback](docs/RecordingCompleteCallback.md) - [RecordingStateEnum](docs/RecordingStateEnum.md) + - [RecordingTranscriptionMetadata](docs/RecordingTranscriptionMetadata.md) + - [RecordingTranscriptions](docs/RecordingTranscriptions.md) - [RedirectCallback](docs/RedirectCallback.md) - [RedirectMethodEnum](docs/RedirectMethodEnum.md) - [StirShaken](docs/StirShaken.md) @@ -236,8 +245,6 @@ Class | Method | HTTP request | Description - [TranscribeRecording](docs/TranscribeRecording.md) - [Transcription](docs/Transcription.md) - [TranscriptionAvailableCallback](docs/TranscriptionAvailableCallback.md) - - [TranscriptionList](docs/TranscriptionList.md) - - [TranscriptionMetadata](docs/TranscriptionMetadata.md) - [TransferAnswerCallback](docs/TransferAnswerCallback.md) - [TransferCompleteCallback](docs/TransferCompleteCallback.md) - [TransferDisconnectCallback](docs/TransferDisconnectCallback.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 3d8d02a8..85cfd74d 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -18,6 +18,7 @@ tags: - name: Conferences - name: Recordings - name: Statistics +- name: Transcriptions - name: MFA - name: Phone Number Lookup paths: @@ -111,7 +112,8 @@ paths: summary: List Media tags: - Media - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://messaging.bandwidth.com/api/v2 @@ -197,7 +199,8 @@ paths: summary: Delete Media tags: - Media - x-accepts: application/json + x-accepts: + - application/json get: description: Downloads a media file you previously uploaded. operationId: getMedia @@ -280,7 +283,9 @@ paths: summary: Get Media tags: - Media - x-accepts: "application/json,application/octet-stream" + x-accepts: + - application/json + - application/octet-stream put: description: |- Upload a file. You may add headers to the request in order to provide some control to your media file. @@ -384,7 +389,8 @@ paths: tags: - Media x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://messaging.bandwidth.com/api/v2 @@ -607,7 +613,8 @@ paths: summary: List Messages tags: - Messages - x-accepts: application/json + x-accepts: + - application/json post: callbacks: inboundCallback: @@ -688,7 +695,8 @@ paths: tags: - Messages x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://messaging.bandwidth.com/api/v2 @@ -871,7 +879,8 @@ paths: summary: Get Calls tags: - Calls - x-accepts: application/json + x-accepts: + - application/json post: description: |- Creates an outbound phone call. @@ -992,7 +1001,8 @@ paths: tags: - Calls x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -1111,7 +1121,8 @@ paths: summary: Get Call State Information tags: - Calls - x-accepts: application/json + x-accepts: + - application/json post: description: Interrupts and redirects a call to a different URL that should return a BXML document. @@ -1232,7 +1243,8 @@ paths: tags: - Calls x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -1356,7 +1368,8 @@ paths: tags: - Calls x-content-type: application/xml - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -1523,7 +1536,8 @@ paths: summary: Get Conferences tags: - Conferences - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -1639,7 +1653,8 @@ paths: summary: Get Conference Information tags: - Conferences - x-accepts: application/json + x-accepts: + - application/json post: description: Update the conference state. operationId: updateConference @@ -1750,7 +1765,8 @@ paths: tags: - Conferences x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -1865,7 +1881,8 @@ paths: tags: - Conferences x-content-type: application/xml - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -1990,7 +2007,8 @@ paths: summary: Get Conference Member tags: - Conferences - x-accepts: application/json + x-accepts: + - application/json put: description: Updates settings for a particular conference member. operationId: updateConferenceMember @@ -2110,7 +2128,8 @@ paths: tags: - Conferences x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -2229,7 +2248,8 @@ paths: summary: Get Conference Recordings tags: - Conferences - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -2354,7 +2374,8 @@ paths: summary: Get Conference Recording Information tags: - Conferences - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -2484,7 +2505,10 @@ paths: summary: Download Conference Recording tags: - Conferences - x-accepts: "application/json,audio/mpeg,audio/vnd.wave" + x-accepts: + - application/json + - audio/mpeg + - audio/vnd.wave servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -2635,7 +2659,8 @@ paths: summary: Get Call Recordings tags: - Recordings - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -2750,7 +2775,8 @@ paths: tags: - Recordings x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -2870,7 +2896,8 @@ paths: summary: List Call Recordings tags: - Recordings - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -2994,7 +3021,8 @@ paths: summary: Delete Recording tags: - Recordings - x-accepts: application/json + x-accepts: + - application/json get: description: Returns metadata for the specified recording. operationId: getCallRecording @@ -3115,7 +3143,8 @@ paths: summary: Get Call Recording tags: - Recordings - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -3236,7 +3265,8 @@ paths: summary: Delete Recording Media tags: - Recordings - x-accepts: application/json + x-accepts: + - application/json get: description: Downloads the specified recording. operationId: downloadCallRecording @@ -3362,7 +3392,10 @@ paths: summary: Download Recording tags: - Recordings - x-accepts: "application/json,audio/mpeg,audio/vnd.wave" + x-accepts: + - application/json + - audio/mpeg + - audio/vnd.wave servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -3372,7 +3405,7 @@ paths: Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. - operationId: deleteCallTranscription + operationId: deleteRecordingTranscription parameters: - description: Your Bandwidth Account ID. example: "9900000" @@ -3486,15 +3519,15 @@ paths: summary: Delete Transcription tags: - Recordings - x-accepts: application/json + x-accepts: + - application/json get: description: |- Downloads the specified transcription. - - If the transcribed recording was multi-channel, then there will be 2 transcripts. + If the recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and [``](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. - operationId: getCallTranscription + operationId: getRecordingTranscription parameters: - description: Your Bandwidth Account ID. example: "9900000" @@ -3528,8 +3561,8 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/transcriptionList' - description: Transcription found + $ref: '#/components/schemas/recordingTranscriptions' + description: Transcription found. "400": content: application/json: @@ -3612,7 +3645,8 @@ paths: summary: Get Transcription tags: - Recordings - x-accepts: application/json + x-accepts: + - application/json post: description: |- Generate the transcription for a specific recording. Transcription @@ -3735,7 +3769,8 @@ paths: tags: - Recordings x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -3842,7 +3877,373 @@ paths: summary: Get Account Statistics tags: - Statistics - x-accepts: application/json + x-accepts: + - application/json + servers: + - description: Production + url: https://voice.bandwidth.com/api/v2 + /accounts/{accountId}/calls/{callId}/transcriptions: + get: + description: "Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription)." + operationId: listRealTimeTranscriptions + parameters: + - description: Your Bandwidth Account ID. + example: "9900000" + explode: false + in: path + name: accountId + required: true + schema: + type: string + style: simple + - description: Programmable Voice API Call ID. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + explode: false + in: path + name: callId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/callTranscriptionMetadataList' + description: Transcription found. + "400": + content: + application/json: + examples: + badRequestErrorExample: + $ref: '#/components/examples/voiceBadRequestErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Bad Request + "401": + content: + application/json: + examples: + unauthorizedErrorExample: + $ref: '#/components/examples/voiceUnauthorizedErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Unauthorized + "403": + content: + application/json: + examples: + forbiddenErrorExample: + $ref: '#/components/examples/voiceForbiddenErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Forbidden + "404": + content: + application/json: + examples: + notFoundErrorExample: + $ref: '#/components/examples/voiceNotFoundErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Not Found + "405": + content: + application/json: + examples: + notAllowedErrorExample: + $ref: '#/components/examples/voiceNotAllowedErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Method Not Allowed + "415": + content: + application/json: + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/voiceUnsupportedMediaTypeErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Unsupported Media Type + "429": + content: + application/json: + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/voiceTooManyRequestsErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Too Many Requests + headers: + Retry-After: + description: When you should try your request again. + explode: false + schema: + type: string + style: simple + "500": + content: + application/json: + examples: + internalServerErrorExample: + $ref: '#/components/examples/voiceInternalServerErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Internal Server Error + summary: Enumerate transcriptions made with StartTranscription + tags: + - Transcriptions + x-accepts: + - application/json + servers: + - description: Production + url: https://voice.bandwidth.com/api/v2 + /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}: + delete: + description: |- + Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + + Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + operationId: deleteRealTimeTranscription + parameters: + - description: Your Bandwidth Account ID. + example: "9900000" + explode: false + in: path + name: accountId + required: true + schema: + type: string + style: simple + - description: Programmable Voice API Call ID. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + explode: false + in: path + name: callId + required: true + schema: + type: string + style: simple + - description: Programmable Voice API Transcription ID. + example: t-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + explode: false + in: path + name: transcriptionId + required: true + schema: + type: string + style: simple + responses: + "204": + description: Transcription data was deleted. + "400": + content: + application/json: + examples: + badRequestErrorExample: + $ref: '#/components/examples/voiceBadRequestErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Bad Request + "401": + content: + application/json: + examples: + unauthorizedErrorExample: + $ref: '#/components/examples/voiceUnauthorizedErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Unauthorized + "403": + content: + application/json: + examples: + forbiddenErrorExample: + $ref: '#/components/examples/voiceForbiddenErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Forbidden + "404": + content: + application/json: + examples: + notFoundErrorExample: + $ref: '#/components/examples/voiceNotFoundErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Not Found + "405": + content: + application/json: + examples: + notAllowedErrorExample: + $ref: '#/components/examples/voiceNotAllowedErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Method Not Allowed + "415": + content: + application/json: + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/voiceUnsupportedMediaTypeErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Unsupported Media Type + "429": + content: + application/json: + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/voiceTooManyRequestsErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Too Many Requests + headers: + Retry-After: + description: When you should try your request again. + explode: false + schema: + type: string + style: simple + "500": + content: + application/json: + examples: + internalServerErrorExample: + $ref: '#/components/examples/voiceInternalServerErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Internal Server Error + summary: Delete a specific transcription + tags: + - Transcriptions + x-accepts: + - application/json + get: + description: "Retrieve the specified transcription that was created on this\ + \ call via [startTranscription](/docs/voice/bxml/startTranscription)." + operationId: getRealTimeTranscription + parameters: + - description: Your Bandwidth Account ID. + example: "9900000" + explode: false + in: path + name: accountId + required: true + schema: + type: string + style: simple + - description: Programmable Voice API Call ID. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + explode: false + in: path + name: callId + required: true + schema: + type: string + style: simple + - description: Programmable Voice API Transcription ID. + example: t-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + explode: false + in: path + name: transcriptionId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/callTranscriptionResponse' + description: Transcription found. + "400": + content: + application/json: + examples: + badRequestErrorExample: + $ref: '#/components/examples/voiceBadRequestErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Bad Request + "401": + content: + application/json: + examples: + unauthorizedErrorExample: + $ref: '#/components/examples/voiceUnauthorizedErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Unauthorized + "403": + content: + application/json: + examples: + forbiddenErrorExample: + $ref: '#/components/examples/voiceForbiddenErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Forbidden + "404": + content: + application/json: + examples: + notFoundErrorExample: + $ref: '#/components/examples/voiceNotFoundErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Not Found + "405": + content: + application/json: + examples: + notAllowedErrorExample: + $ref: '#/components/examples/voiceNotAllowedErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Method Not Allowed + "415": + content: + application/json: + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/voiceUnsupportedMediaTypeErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Unsupported Media Type + "429": + content: + application/json: + examples: + tooManyRequestsErrorExample: + $ref: '#/components/examples/voiceTooManyRequestsErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Too Many Requests + headers: + Retry-After: + description: When you should try your request again. + explode: false + schema: + type: string + style: simple + "500": + content: + application/json: + examples: + internalServerErrorExample: + $ref: '#/components/examples/voiceInternalServerErrorExample' + schema: + $ref: '#/components/schemas/voiceApiError' + description: Internal Server Error + summary: Retrieve a specific transcription + tags: + - Transcriptions + x-accepts: + - application/json servers: - description: Production url: https://voice.bandwidth.com/api/v2 @@ -3897,7 +4298,8 @@ paths: tags: - MFA x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://mfa.bandwidth.com/api/v1 @@ -3952,7 +4354,8 @@ paths: tags: - MFA x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://mfa.bandwidth.com/api/v1 @@ -4013,7 +4416,8 @@ paths: tags: - MFA x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://mfa.bandwidth.com/api/v1 @@ -4117,7 +4521,8 @@ paths: tags: - Phone Number Lookup x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://numbers.bandwidth.com/api/v1 @@ -4228,7 +4633,8 @@ paths: summary: Get Lookup Request Status tags: - Phone Number Lookup - x-accepts: application/json + x-accepts: + - application/json servers: - description: Production url: https://numbers.bandwidth.com/api/v1 @@ -4692,6 +5098,16 @@ components: schema: type: string style: simple + transcriptionId: + description: Programmable Voice API Transcription ID. + example: t-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + explode: false + in: path + name: transcriptionId + required: true + schema: + type: string + style: simple to: description: Filter results by the `to` field. example: '%2b19195551234' @@ -5285,12 +5701,26 @@ components: format: binary type: string description: Media found + getRecordingTranscriptionResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/recordingTranscriptions' + description: Transcription found. + listTranscriptionsResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/callTranscriptionMetadataList' + description: Transcription found. getCallTranscriptionResponse: content: application/json: schema: - $ref: '#/components/schemas/transcriptionList' - description: Transcription found + $ref: '#/components/schemas/callTranscriptionResponse' + description: Transcription found. + deleteCallTranscriptionResponse: + description: Transcription data was deleted. listConferencesResponse: content: application/json: @@ -5640,7 +6070,7 @@ components: messageStatus: RECEIVED receiveTime: 2020-04-07T14:03:07Z accountId: "9900000" - messageDirection: null + messageDirection: INBOUND messageType: sms carrierName: other recipientCount: 1 @@ -5657,7 +6087,7 @@ components: messageStatus: RECEIVED receiveTime: 2020-04-07T14:03:07Z accountId: "9900000" - messageDirection: null + messageDirection: INBOUND messageType: sms carrierName: other recipientCount: 1 @@ -5691,7 +6121,7 @@ components: messageStatus: RECEIVED receiveTime: 2020-04-07T14:03:07Z accountId: "9900000" - messageDirection: null + messageDirection: INBOUND messageType: sms carrierName: other recipientCount: 1 @@ -5881,7 +6311,7 @@ components: text: Hello world tag: custom tag applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 - direction: null + direction: in properties: id: description: The id of the message. @@ -7084,7 +7514,7 @@ components: nullable: true type: string transcription: - $ref: '#/components/schemas/transcriptionMetadata' + $ref: '#/components/schemas/recordingTranscriptionMetadata' type: object conference: example: @@ -7522,7 +7952,7 @@ components: nullable: true type: boolean type: object - transcriptionList: + recordingTranscriptions: example: transcripts: - confidence: 0.9 @@ -7535,7 +7965,90 @@ components: $ref: '#/components/schemas/transcription' type: array type: object - transcriptionMetadata: + callTranscriptionMetadataList: + example: + - transcriptionId: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + transcriptionUrl: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + items: + $ref: '#/components/schemas/callTranscriptionMetadata' + type: array + callTranscriptionMetadata: + properties: + transcriptionId: + description: The programmable voice API transcription ID. + example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + type: string + transcriptionUrl: + description: |- + A URL that may be used to retrieve the transcription itself. This points to the + [Get Call Transcription](/apis/voice/#operation/getCallTranscription) endpoint. + example: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + type: string + type: object + callTranscriptionResponse: + example: + callId: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + accountId: "920012" + transcriptionId: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + tracks: + - detectedLanguage: en-US + track: inbound + text: Hello World! This is an example. + confidence: 0.9 + properties: + accountId: + description: The user account associated with the call. + example: "920012" + type: string + callId: + description: The call id associated with the event. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + type: string + transcriptionId: + description: The programmable voice API transcription ID. + example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + type: string + tracks: + example: + - detectedLanguage: en-US + track: inbound + text: Hello World! This is an example. + confidence: 0.9 + items: + $ref: '#/components/schemas/callTranscription' + type: array + type: object + callTranscription: + properties: + detectedLanguage: + description: The detected language for this transcription. + enum: + - en-US + - es-US + - fr-FR + example: en-US + type: string + track: + description: Which `track` this transcription is derived from. + enum: + - inbound + - outbound + example: inbound + type: string + text: + description: The transcription itself. + example: Hello World! This is an example. + type: string + confidence: + description: How confident the transcription engine was in transcribing + the associated audio (from `0` to `1`). + example: 0.9 + format: double + maximum: 1 + minimum: 0 + type: number + type: object + recordingTranscriptionMetadata: description: "If the recording was transcribed, metadata about the transcription" example: completedTime: 2022-06-13T18:46:29.715Z @@ -8785,14 +9298,11 @@ components: fileFormat: $ref: '#/components/schemas/fileFormatEnum' channels: - description: "The current status of the process. For recording, current\ - \ possible values are 'processing', 'partial', 'complete', 'deleted',\ - \ and 'error'. For transcriptions, current possible values are 'none',\ - \ 'processing', 'available', 'error', 'timeout', 'file-size-too-big',\ - \ and 'file-size-too-small'. Additional states may be added in the future,\ - \ so your application must be tolerant of unknown values." - example: completed - type: string + description: Always `1` for conference recordings; multi-channel recordings + are not supported on conferences. + example: 1 + format: int32 + type: integer tag: description: "(optional) The tag specified on call creation. If no tag was\ \ specified or it was previously cleared, this field will not be present." @@ -9868,11 +10378,9 @@ components: securitySchemes: Basic: description: |- - Basic authentication is a simple authentication scheme built into the - HTTP protocol. To use it, send your HTTP requests with an Authorization - header that contains the word Basic followed by a space and a - base64-encoded string `username:password`Example: `Authorization: Basic - ZGVtbZpwQDU1dzByZA==` + Basic authentication is a simple authentication scheme built into the HTTP protocol. To use it, send your HTTP requests with an `Authorization` header that contains the word `Basic` followed by a space and a Base64-encoded string `username:password`. + + - Example: `Authorization: Basic ZGVtbZpwQDU1dzByZA==` scheme: basic type: http diff --git a/bandwidth.yml b/bandwidth.yml index bec9a4eb..c2e932a8 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -16,6 +16,7 @@ tags: - name: Conferences - name: Recordings - name: Statistics + - name: Transcriptions - name: MFA - name: Phone Number Lookup paths: @@ -962,9 +963,7 @@ paths: description: >- Downloads the specified transcription. - - If the transcribed recording was multi-channel, then there will be 2 - transcripts. + If the recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [``](/docs/voice/bxml/playAudio) and @@ -974,14 +973,14 @@ paths: During a [``](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. - operationId: getCallTranscription + operationId: getRecordingTranscription parameters: - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' - $ref: '#/components/parameters/recordingId' responses: '200': - $ref: '#/components/responses/getCallTranscriptionResponse' + $ref: '#/components/responses/getRecordingTranscriptionResponse' '400': $ref: '#/components/responses/voiceBadRequestError' '401': @@ -1047,7 +1046,7 @@ paths: transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. - operationId: deleteCallTranscription + operationId: deleteRecordingTranscription parameters: - $ref: '#/components/parameters/accountId' - $ref: '#/components/parameters/callId' @@ -1101,6 +1100,108 @@ paths: '500': $ref: '#/components/responses/voiceInternalServerError' servers: *ref_1 + /accounts/{accountId}/calls/{callId}/transcriptions: + get: + tags: + - Transcriptions + summary: Enumerate transcriptions made with StartTranscription + description: >- + Enumerates the transcriptions created on this call via + [startTranscription](/docs/voice/bxml/startTranscription). + operationId: listRealTimeTranscriptions + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + responses: + '200': + $ref: '#/components/responses/listTranscriptionsResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 + /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}: + get: + tags: + - Transcriptions + summary: Retrieve a specific transcription + description: >- + Retrieve the specified transcription that was created on this call via + [startTranscription](/docs/voice/bxml/startTranscription). + operationId: getRealTimeTranscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/transcriptionId' + responses: + '200': + $ref: '#/components/responses/getCallTranscriptionResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + delete: + tags: + - Transcriptions + summary: Delete a specific transcription + description: >- + Delete the specified transcription that was created on this call via + [startTranscription](/docs/voice/bxml/startTranscription). + + + Note: After the deletion is requested and a `204` is returned, the + transcription will not be accessible anymore. However, it is not deleted + immediately. This deletion process, while transparent and irreversible, + can take an additional 24 to 48 hours. + operationId: deleteRealTimeTranscription + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/callId' + - $ref: '#/components/parameters/transcriptionId' + responses: + '204': + $ref: '#/components/responses/deleteCallTranscriptionResponse' + '400': + $ref: '#/components/responses/voiceBadRequestError' + '401': + $ref: '#/components/responses/voiceUnauthorizedError' + '403': + $ref: '#/components/responses/voiceForbiddenError' + '404': + $ref: '#/components/responses/voiceNotFoundError' + '405': + $ref: '#/components/responses/voiceNotAllowedError' + '415': + $ref: '#/components/responses/voiceUnsupportedMediaTypeError' + '429': + $ref: '#/components/responses/voiceTooManyRequestsError' + '500': + $ref: '#/components/responses/voiceInternalServerError' + servers: *ref_1 /accounts/{accountId}/code/voice: post: tags: @@ -2677,7 +2778,7 @@ components: mediaUrl: $ref: '#/components/schemas/mediaUrl' transcription: - $ref: '#/components/schemas/transcriptionMetadata' + $ref: '#/components/schemas/recordingTranscriptionMetadata' conference: type: object properties: @@ -3114,14 +3215,95 @@ components: Current supported languages are English, French, and Spanish. default: false example: true - transcriptionList: + recordingTranscriptions: type: object properties: transcripts: type: array items: $ref: '#/components/schemas/transcription' - transcriptionMetadata: + callTranscriptionMetadataList: + type: array + items: + $ref: '#/components/schemas/callTranscriptionMetadata' + example: + - transcriptionId: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + transcriptionUrl: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + callTranscriptionMetadata: + type: object + properties: + transcriptionId: + type: string + description: The programmable voice API transcription ID. + example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + transcriptionUrl: + type: string + description: >- + A URL that may be used to retrieve the transcription itself. This + points to the + + [Get Call + Transcription](/apis/voice/#operation/getCallTranscription) + endpoint. + example: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + callTranscriptionResponse: + type: object + properties: + accountId: + type: string + description: The user account associated with the call. + example: '920012' + callId: + type: string + description: The call id associated with the event. + example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + transcriptionId: + type: string + description: The programmable voice API transcription ID. + example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + tracks: + type: array + items: + $ref: '#/components/schemas/callTranscription' + example: + - detectedLanguage: en-US + track: inbound + text: Hello World! This is an example. + confidence: 0.9 + callTranscription: + type: object + properties: + detectedLanguage: + type: string + enum: + - en-US + - es-US + - fr-FR + description: The detected language for this transcription. + example: en-US + track: + type: string + enum: + - inbound + - outbound + description: Which `track` this transcription is derived from. + example: inbound + text: + type: string + description: The transcription itself. + example: Hello World! This is an example. + confidence: + type: number + format: double + minimum: 0 + maximum: 1 + description: >- + How confident the transcription engine was in transcribing the + associated audio (from `0` to `1`). + example: 0.9 + recordingTranscriptionMetadata: nullable: true type: object description: If the recording was transcribed, metadata about the transcription @@ -3693,7 +3875,7 @@ components: fileFormat: $ref: '#/components/schemas/fileFormatEnum' channels: - $ref: '#/components/schemas/status' + $ref: '#/components/schemas/channels' tag: $ref: '#/components/schemas/tag1' status: @@ -4582,12 +4764,26 @@ components: schema: type: string format: binary + getRecordingTranscriptionResponse: + description: Transcription found. + content: + application/json: + schema: + $ref: '#/components/schemas/recordingTranscriptions' + listTranscriptionsResponse: + description: Transcription found. + content: + application/json: + schema: + $ref: '#/components/schemas/callTranscriptionMetadataList' getCallTranscriptionResponse: - description: Transcription found + description: Transcription found. content: application/json: schema: - $ref: '#/components/schemas/transcriptionList' + $ref: '#/components/schemas/callTranscriptionResponse' + deleteCallTranscriptionResponse: + description: Transcription data was deleted. listConferencesResponse: description: Conferences retrieved successfully content: @@ -5090,6 +5286,14 @@ components: type: string description: Programmable Voice API Conference Member ID. example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + transcriptionId: + name: transcriptionId + in: path + required: true + schema: + type: string + description: Programmable Voice API Transcription ID. + example: t-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 to: name: to in: query @@ -5517,12 +5721,14 @@ components: Basic: type: http scheme: basic - description: |- + description: >- Basic authentication is a simple authentication scheme built into the - HTTP protocol. To use it, send your HTTP requests with an Authorization - header that contains the word Basic followed by a space and a - base64-encoded string `username:password`Example: `Authorization: Basic - ZGVtbZpwQDU1dzByZA==` + HTTP protocol. To use it, send your HTTP requests with an + `Authorization` header that contains the word `Basic` followed by a + space and a Base64-encoded string `username:password`. + + + - Example: `Authorization: Basic ZGVtbZpwQDU1dzByZA==` callbacks: inboundCallback: '{inboundCallbackUrl}': diff --git a/build.gradle b/build.gradle index 107ec296..a805f53b 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'com.bandwidth.sdk' -version = '9.1.4' +version = '10.0.0' buildscript { repositories { @@ -108,8 +108,8 @@ ext { dependencies { implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.10.0' - implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.squareup.okhttp3:okhttp:4.12.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' implementation 'com.google.code.gson:gson:2.9.1' implementation 'io.gsonfire:gson-fire:1.9.0' implementation 'javax.ws.rs:jsr311-api:1.1.1' @@ -117,9 +117,9 @@ dependencies { implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/build.sbt b/build.sbt index 6fd82031..c1271347 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.bandwidth.sdk", name := "bandwidth-sdk", - version := "9.1.4", + version := "10.0.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), @@ -10,8 +10,8 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.6.5", - "com.squareup.okhttp3" % "okhttp" % "4.10.0", - "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.squareup.okhttp3" % "okhttp" % "4.12.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", "org.apache.commons" % "commons-lang3" % "3.12.0", "javax.ws.rs" % "jsr311-api" % "1.1.1", @@ -21,7 +21,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/docs/CallRecordingMetadata.md b/docs/CallRecordingMetadata.md index fe287c14..eab93928 100644 --- a/docs/CallRecordingMetadata.md +++ b/docs/CallRecordingMetadata.md @@ -24,7 +24,7 @@ |**fileFormat** | **FileFormatEnum** | | [optional] | |**status** | **String** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] | |**mediaUrl** | **URI** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional] | -|**transcription** | [**TranscriptionMetadata**](TranscriptionMetadata.md) | | [optional] | +|**transcription** | [**RecordingTranscriptionMetadata**](RecordingTranscriptionMetadata.md) | | [optional] | diff --git a/docs/CallTranscription.md b/docs/CallTranscription.md new file mode 100644 index 00000000..966ff1b8 --- /dev/null +++ b/docs/CallTranscription.md @@ -0,0 +1,35 @@ + + +# CallTranscription + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**detectedLanguage** | [**DetectedLanguageEnum**](#DetectedLanguageEnum) | The detected language for this transcription. | [optional] | +|**track** | [**TrackEnum**](#TrackEnum) | Which `track` this transcription is derived from. | [optional] | +|**text** | **String** | The transcription itself. | [optional] | +|**confidence** | **Double** | How confident the transcription engine was in transcribing the associated audio (from `0` to `1`). | [optional] | + + + +## Enum: DetectedLanguageEnum + +| Name | Value | +|---- | -----| +| EN_US | "en-US" | +| ES_US | "es-US" | +| FR_FR | "fr-FR" | + + + +## Enum: TrackEnum + +| Name | Value | +|---- | -----| +| INBOUND | "inbound" | +| OUTBOUND | "outbound" | + + + diff --git a/docs/CallTranscriptionMetadata.md b/docs/CallTranscriptionMetadata.md new file mode 100644 index 00000000..25884d34 --- /dev/null +++ b/docs/CallTranscriptionMetadata.md @@ -0,0 +1,14 @@ + + +# CallTranscriptionMetadata + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transcriptionId** | **String** | The programmable voice API transcription ID. | [optional] | +|**transcriptionUrl** | **String** | A URL that may be used to retrieve the transcription itself. This points to the [Get Call Transcription](/apis/voice/#operation/getCallTranscription) endpoint. | [optional] | + + + diff --git a/docs/CallTranscriptionResponse.md b/docs/CallTranscriptionResponse.md new file mode 100644 index 00000000..69dd040d --- /dev/null +++ b/docs/CallTranscriptionResponse.md @@ -0,0 +1,16 @@ + + +# CallTranscriptionResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accountId** | **String** | The user account associated with the call. | [optional] | +|**callId** | **String** | The call id associated with the event. | [optional] | +|**transcriptionId** | **String** | The programmable voice API transcription ID. | [optional] | +|**tracks** | [**List<CallTranscription>**](CallTranscription.md) | | [optional] | + + + diff --git a/docs/RecordingAvailableCallback.md b/docs/RecordingAvailableCallback.md index dcdf970f..793b51db 100644 --- a/docs/RecordingAvailableCallback.md +++ b/docs/RecordingAvailableCallback.md @@ -25,7 +25,7 @@ The Recording Available event is sent after a recording has been processed. It i |**endTime** | **OffsetDateTime** | The time that the recording ended in ISO-8601 format | [optional] | |**duration** | **String** | The duration of the recording in ISO-8601 format | [optional] | |**fileFormat** | **FileFormatEnum** | | [optional] | -|**channels** | **String** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] | +|**channels** | **Integer** | Always `1` for conference recordings; multi-channel recordings are not supported on conferences. | [optional] | |**tag** | **String** | (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present. | [optional] | |**status** | **String** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] | |**transferCallerId** | **String** | The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable. | [optional] | diff --git a/docs/RecordingTranscriptionMetadata.md b/docs/RecordingTranscriptionMetadata.md new file mode 100644 index 00000000..924c93a9 --- /dev/null +++ b/docs/RecordingTranscriptionMetadata.md @@ -0,0 +1,17 @@ + + +# RecordingTranscriptionMetadata + +If the recording was transcribed, metadata about the transcription + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | The unique transcription ID | [optional] | +|**status** | **String** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] | +|**completedTime** | **String** | The time that the transcription was completed | [optional] | +|**url** | **URI** | The URL of the [transcription](#operation/getCallTranscription) | [optional] | + + + diff --git a/docs/RecordingTranscriptions.md b/docs/RecordingTranscriptions.md new file mode 100644 index 00000000..43289805 --- /dev/null +++ b/docs/RecordingTranscriptions.md @@ -0,0 +1,13 @@ + + +# RecordingTranscriptions + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**transcripts** | [**List<Transcription>**](Transcription.md) | | [optional] | + + + diff --git a/docs/RecordingsApi.md b/docs/RecordingsApi.md index 51a8a235..d810ecf3 100644 --- a/docs/RecordingsApi.md +++ b/docs/RecordingsApi.md @@ -4,25 +4,25 @@ All URIs are relative to *http://localhost* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**deleteCallTranscription**](RecordingsApi.md#deleteCallTranscription) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Delete Transcription | | [**deleteRecording**](RecordingsApi.md#deleteRecording) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Delete Recording | | [**deleteRecordingMedia**](RecordingsApi.md#deleteRecordingMedia) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Delete Recording Media | +| [**deleteRecordingTranscription**](RecordingsApi.md#deleteRecordingTranscription) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Delete Transcription | | [**downloadCallRecording**](RecordingsApi.md#downloadCallRecording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media | Download Recording | | [**getCallRecording**](RecordingsApi.md#getCallRecording) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Get Call Recording | -| [**getCallTranscription**](RecordingsApi.md#getCallTranscription) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Get Transcription | +| [**getRecordingTranscription**](RecordingsApi.md#getRecordingTranscription) | **GET** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Get Transcription | | [**listAccountCallRecordings**](RecordingsApi.md#listAccountCallRecordings) | **GET** /accounts/{accountId}/recordings | Get Call Recordings | | [**listCallRecordings**](RecordingsApi.md#listCallRecordings) | **GET** /accounts/{accountId}/calls/{callId}/recordings | List Call Recordings | | [**transcribeCallRecording**](RecordingsApi.md#transcribeCallRecording) | **POST** /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription | Create Transcription Request | | [**updateCallRecordingState**](RecordingsApi.md#updateCallRecordingState) | **PUT** /accounts/{accountId}/calls/{callId}/recording | Update Recording | - -# **deleteCallTranscription** -> deleteCallTranscription(accountId, callId, recordingId) + +# **deleteRecording** +> deleteRecording(accountId, callId, recordingId) -Delete Transcription +Delete Recording -Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. +Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. ### Example ```java @@ -49,9 +49,9 @@ public class Example { String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. try { - apiInstance.deleteCallTranscription(accountId, callId, recordingId); + apiInstance.deleteRecording(accountId, callId, recordingId); } catch (ApiException e) { - System.err.println("Exception when calling RecordingsApi#deleteCallTranscription"); + System.err.println("Exception when calling RecordingsApi#deleteRecording"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -85,7 +85,7 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **204** | The transcription was successfully deleted. | - | +| **204** | Recording was deleted. | - | | **400** | Bad Request | - | | **401** | Unauthorized | - | | **403** | Forbidden | - | @@ -95,13 +95,13 @@ null (empty response body) | **429** | Too Many Requests | * Retry-After - When you should try your request again.
| | **500** | Internal Server Error | - | - -# **deleteRecording** -> deleteRecording(accountId, callId, recordingId) + +# **deleteRecordingMedia** +> deleteRecordingMedia(accountId, callId, recordingId) -Delete Recording +Delete Recording Media -Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. +Deletes the specified recording's media. ### Example ```java @@ -128,9 +128,9 @@ public class Example { String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. try { - apiInstance.deleteRecording(accountId, callId, recordingId); + apiInstance.deleteRecordingMedia(accountId, callId, recordingId); } catch (ApiException e) { - System.err.println("Exception when calling RecordingsApi#deleteRecording"); + System.err.println("Exception when calling RecordingsApi#deleteRecordingMedia"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -164,7 +164,7 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **204** | Recording was deleted. | - | +| **204** | The recording media was successfully deleted. | - | | **400** | Bad Request | - | | **401** | Unauthorized | - | | **403** | Forbidden | - | @@ -174,13 +174,13 @@ null (empty response body) | **429** | Too Many Requests | * Retry-After - When you should try your request again.
| | **500** | Internal Server Error | - | - -# **deleteRecordingMedia** -> deleteRecordingMedia(accountId, callId, recordingId) + +# **deleteRecordingTranscription** +> deleteRecordingTranscription(accountId, callId, recordingId) -Delete Recording Media +Delete Transcription -Deletes the specified recording's media. +Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. ### Example ```java @@ -207,9 +207,9 @@ public class Example { String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. try { - apiInstance.deleteRecordingMedia(accountId, callId, recordingId); + apiInstance.deleteRecordingTranscription(accountId, callId, recordingId); } catch (ApiException e) { - System.err.println("Exception when calling RecordingsApi#deleteRecordingMedia"); + System.err.println("Exception when calling RecordingsApi#deleteRecordingTranscription"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -243,7 +243,7 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **204** | The recording media was successfully deleted. | - | +| **204** | The transcription was successfully deleted. | - | | **400** | Bad Request | - | | **401** | Unauthorized | - | | **403** | Forbidden | - | @@ -413,13 +413,13 @@ public class Example { | **429** | Too Many Requests | * Retry-After - When you should try your request again.
| | **500** | Internal Server Error | - | - -# **getCallTranscription** -> TranscriptionList getCallTranscription(accountId, callId, recordingId) + +# **getRecordingTranscription** +> RecordingTranscriptions getRecordingTranscription(accountId, callId, recordingId) Get Transcription -Downloads the specified transcription. If the transcribed recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. +Downloads the specified transcription. If the recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. ### Example ```java @@ -446,10 +446,10 @@ public class Example { String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. try { - TranscriptionList result = apiInstance.getCallTranscription(accountId, callId, recordingId); + RecordingTranscriptions result = apiInstance.getRecordingTranscription(accountId, callId, recordingId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling RecordingsApi#getCallTranscription"); + System.err.println("Exception when calling RecordingsApi#getRecordingTranscription"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -469,7 +469,7 @@ public class Example { ### Return type -[**TranscriptionList**](TranscriptionList.md) +[**RecordingTranscriptions**](RecordingTranscriptions.md) ### Authorization @@ -483,7 +483,7 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Transcription found | - | +| **200** | Transcription found. | - | | **400** | Bad Request | - | | **401** | Unauthorized | - | | **403** | Forbidden | - | diff --git a/docs/TranscriptionsApi.md b/docs/TranscriptionsApi.md new file mode 100644 index 00000000..7ec2dadf --- /dev/null +++ b/docs/TranscriptionsApi.md @@ -0,0 +1,248 @@ +# TranscriptionsApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteRealTimeTranscription**](TranscriptionsApi.md#deleteRealTimeTranscription) | **DELETE** /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} | Delete a specific transcription | +| [**getRealTimeTranscription**](TranscriptionsApi.md#getRealTimeTranscription) | **GET** /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} | Retrieve a specific transcription | +| [**listRealTimeTranscriptions**](TranscriptionsApi.md#listRealTimeTranscriptions) | **GET** /accounts/{accountId}/calls/{callId}/transcriptions | Enumerate transcriptions made with StartTranscription | + + + +# **deleteRealTimeTranscription** +> deleteRealTimeTranscription(accountId, callId, transcriptionId) + +Delete a specific transcription + +Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + +### Example +```java +// Import classes: +import com.bandwidth.sdk.ApiClient; +import com.bandwidth.sdk.ApiException; +import com.bandwidth.sdk.Configuration; +import com.bandwidth.sdk.auth.*; +import com.bandwidth.sdk.models.*; +import com.bandwidth.sdk.api.TranscriptionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + TranscriptionsApi apiInstance = new TranscriptionsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. + String transcriptionId = "t-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Transcription ID. + try { + apiInstance.deleteRealTimeTranscription(accountId, callId, transcriptionId); + } catch (ApiException e) { + System.err.println("Exception when calling TranscriptionsApi#deleteRealTimeTranscription"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | **String**| Your Bandwidth Account ID. | | +| **callId** | **String**| Programmable Voice API Call ID. | | +| **transcriptionId** | **String**| Programmable Voice API Transcription ID. | | + +### Return type + +null (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Transcription data was deleted. | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **405** | Method Not Allowed | - | +| **415** | Unsupported Media Type | - | +| **429** | Too Many Requests | * Retry-After - When you should try your request again.
| +| **500** | Internal Server Error | - | + + +# **getRealTimeTranscription** +> CallTranscriptionResponse getRealTimeTranscription(accountId, callId, transcriptionId) + +Retrieve a specific transcription + +Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + +### Example +```java +// Import classes: +import com.bandwidth.sdk.ApiClient; +import com.bandwidth.sdk.ApiException; +import com.bandwidth.sdk.Configuration; +import com.bandwidth.sdk.auth.*; +import com.bandwidth.sdk.models.*; +import com.bandwidth.sdk.api.TranscriptionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + TranscriptionsApi apiInstance = new TranscriptionsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. + String transcriptionId = "t-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Transcription ID. + try { + CallTranscriptionResponse result = apiInstance.getRealTimeTranscription(accountId, callId, transcriptionId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TranscriptionsApi#getRealTimeTranscription"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | **String**| Your Bandwidth Account ID. | | +| **callId** | **String**| Programmable Voice API Call ID. | | +| **transcriptionId** | **String**| Programmable Voice API Transcription ID. | | + +### Return type + +[**CallTranscriptionResponse**](CallTranscriptionResponse.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Transcription found. | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **405** | Method Not Allowed | - | +| **415** | Unsupported Media Type | - | +| **429** | Too Many Requests | * Retry-After - When you should try your request again.
| +| **500** | Internal Server Error | - | + + +# **listRealTimeTranscriptions** +> List<CallTranscriptionMetadata> listRealTimeTranscriptions(accountId, callId) + +Enumerate transcriptions made with StartTranscription + +Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + +### Example +```java +// Import classes: +import com.bandwidth.sdk.ApiClient; +import com.bandwidth.sdk.ApiException; +import com.bandwidth.sdk.Configuration; +import com.bandwidth.sdk.auth.*; +import com.bandwidth.sdk.models.*; +import com.bandwidth.sdk.api.TranscriptionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + TranscriptionsApi apiInstance = new TranscriptionsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. + try { + List result = apiInstance.listRealTimeTranscriptions(accountId, callId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TranscriptionsApi#listRealTimeTranscriptions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | **String**| Your Bandwidth Account ID. | | +| **callId** | **String**| Programmable Voice API Call ID. | | + +### Return type + +[**List<CallTranscriptionMetadata>**](CallTranscriptionMetadata.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Transcription found. | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | +| **405** | Method Not Allowed | - | +| **415** | Unsupported Media Type | - | +| **429** | Too Many Requests | * Retry-After - When you should try your request again.
| +| **500** | Internal Server Error | - | + diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180f..e6441136 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a25..b82aa23a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 005bcde0..9d0ce634 100644 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi +fi else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 6a68175e..25da30db 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/openapi-config.yml b/openapi-config.yml index 094ac3b1..6e3fdb34 100644 --- a/openapi-config.yml +++ b/openapi-config.yml @@ -1,5 +1,5 @@ artifactId: bandwidth-sdk -artifactVersion: 9.1.4 +artifactVersion: 10.0.0 artifactDescription: The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs artifactUrl: https://github.com/Bandwidth/java-sdk developerEmail: dx@bandwidth.com diff --git a/openapitools.json b/openapitools.json index 9841a49b..5c50d6a2 100644 --- a/openapitools.json +++ b/openapitools.json @@ -2,6 +2,6 @@ "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { - "version": "7.3.0" + "version": "7.6.0" } } diff --git a/pom.xml b/pom.xml index ce851964..bfbd01ec 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ bandwidth-sdk jar bandwidth-sdk - 9.1.4 + 10.0.0 https://github.com/Bandwidth/java-sdk The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs @@ -89,7 +89,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.5 + 2.22.2 diff --git a/src/main/java/com/bandwidth/sdk/ApiClient.java b/src/main/java/com/bandwidth/sdk/ApiClient.java index a714adbe..1338dddb 100644 --- a/src/main/java/com/bandwidth/sdk/ApiClient.java +++ b/src/main/java/com/bandwidth/sdk/ApiClient.java @@ -141,7 +141,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/9.1.4/java"); + setUserAgent("OpenAPI-Generator/10.0.0/java"); authentications = new HashMap(); } @@ -467,6 +467,19 @@ public void setAWS4Configuration(String accessKey, String secretKey, String regi throw new RuntimeException("No AWS4 authentication configured!"); } + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + /** * Set the User-Agent header's value (by adding to the default header map). * diff --git a/src/main/java/com/bandwidth/sdk/ApiException.java b/src/main/java/com/bandwidth/sdk/ApiException.java index 7d0e7fb5..a1c6b060 100644 --- a/src/main/java/com/bandwidth/sdk/ApiException.java +++ b/src/main/java/com/bandwidth/sdk/ApiException.java @@ -21,7 +21,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class ApiException extends Exception { private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/bandwidth/sdk/Configuration.java b/src/main/java/com/bandwidth/sdk/Configuration.java index a2050f6a..285c19a9 100644 --- a/src/main/java/com/bandwidth/sdk/Configuration.java +++ b/src/main/java/com/bandwidth/sdk/Configuration.java @@ -13,9 +13,9 @@ package com.bandwidth.sdk; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class Configuration { - public static final String VERSION = "9.1.4"; + public static final String VERSION = "10.0.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/bandwidth/sdk/JSON.java b/src/main/java/com/bandwidth/sdk/JSON.java index 028dcf6e..0659d01f 100644 --- a/src/main/java/com/bandwidth/sdk/JSON.java +++ b/src/main/java/com/bandwidth/sdk/JSON.java @@ -93,7 +93,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); @@ -106,6 +106,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.BridgeTargetCompleteCallback.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CallRecordingMetadata.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CallState.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CallTranscription.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CallTranscriptionMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CallTranscriptionResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.CodeRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.Conference.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.ConferenceCompletedCallback.CustomTypeAdapterFactory()); @@ -154,6 +157,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.PageInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.RecordingAvailableCallback.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.RecordingCompleteCallback.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.RecordingTranscriptionMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.RecordingTranscriptions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.RedirectCallback.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.StirShaken.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.Tag.CustomTypeAdapterFactory()); @@ -161,8 +166,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.TranscribeRecording.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.Transcription.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.TranscriptionAvailableCallback.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.TranscriptionList.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.TranscriptionMetadata.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.TransferAnswerCallback.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.TransferCompleteCallback.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.bandwidth.sdk.model.TransferDisconnectCallback.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/bandwidth/sdk/Pair.java b/src/main/java/com/bandwidth/sdk/Pair.java index 93fad347..bb9a088b 100644 --- a/src/main/java/com/bandwidth/sdk/Pair.java +++ b/src/main/java/com/bandwidth/sdk/Pair.java @@ -13,7 +13,7 @@ package com.bandwidth.sdk; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/com/bandwidth/sdk/ServerConfiguration.java b/src/main/java/com/bandwidth/sdk/ServerConfiguration.java index df9dc784..b02050dc 100644 --- a/src/main/java/com/bandwidth/sdk/ServerConfiguration.java +++ b/src/main/java/com/bandwidth/sdk/ServerConfiguration.java @@ -5,6 +5,7 @@ /** * Representing a Server configuration. */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class ServerConfiguration { public String URL; public String description; diff --git a/src/main/java/com/bandwidth/sdk/ServerVariable.java b/src/main/java/com/bandwidth/sdk/ServerVariable.java index 675f9e28..bc89b1ba 100644 --- a/src/main/java/com/bandwidth/sdk/ServerVariable.java +++ b/src/main/java/com/bandwidth/sdk/ServerVariable.java @@ -5,6 +5,7 @@ /** * Representing a Server Variable for server URL template substitution. */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/src/main/java/com/bandwidth/sdk/StringUtil.java b/src/main/java/com/bandwidth/sdk/StringUtil.java index 29277114..6b85f153 100644 --- a/src/main/java/com/bandwidth/sdk/StringUtil.java +++ b/src/main/java/com/bandwidth/sdk/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/com/bandwidth/sdk/api/MediaApi.java b/src/main/java/com/bandwidth/sdk/api/MediaApi.java index b8eda7e9..d31a0e7e 100644 --- a/src/main/java/com/bandwidth/sdk/api/MediaApi.java +++ b/src/main/java/com/bandwidth/sdk/api/MediaApi.java @@ -677,6 +677,8 @@ public okhttp3.Call uploadMediaCall(String accountId, String mediaId, File body, "video/webm", "video/x-ms-wmv" }; + + if (contentType == null) { final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { diff --git a/src/main/java/com/bandwidth/sdk/api/RecordingsApi.java b/src/main/java/com/bandwidth/sdk/api/RecordingsApi.java index 5666d38a..5d6639bf 100644 --- a/src/main/java/com/bandwidth/sdk/api/RecordingsApi.java +++ b/src/main/java/com/bandwidth/sdk/api/RecordingsApi.java @@ -29,8 +29,8 @@ import com.bandwidth.sdk.model.CallRecordingMetadata; import java.io.File; +import com.bandwidth.sdk.model.RecordingTranscriptions; import com.bandwidth.sdk.model.TranscribeRecording; -import com.bandwidth.sdk.model.TranscriptionList; import com.bandwidth.sdk.model.UpdateCallRecording; import com.bandwidth.sdk.model.VoiceApiError; @@ -78,7 +78,7 @@ public void setCustomBaseUrl(String customBaseUrl) { } /** - * Build call for deleteCallTranscription + * Build call for deleteRecording * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -88,7 +88,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * @http.response.details - + @@ -99,7 +99,7 @@ public void setCustomBaseUrl(String customBaseUrl) {
Status Code Description Response Headers
204 The transcription was successfully deleted. -
204 Recording was deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public okhttp3.Call deleteCallTranscriptionCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteRecordingCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { "https://voice.bandwidth.com/api/v2" }; @@ -116,7 +116,7 @@ public okhttp3.Call deleteCallTranscriptionCall(String accountId, String callId, Object localVarPostBody = null; // create path and map variables - String localVarPath = "/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription" + String localVarPath = "/accounts/{accountId}/calls/{callId}/recordings/{recordingId}" .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString())) .replace("{" + "callId" + "}", localVarApiClient.escapeString(callId.toString())) .replace("{" + "recordingId" + "}", localVarApiClient.escapeString(recordingId.toString())); @@ -147,29 +147,29 @@ public okhttp3.Call deleteCallTranscriptionCall(String accountId, String callId, } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteCallTranscriptionValidateBeforeCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteRecordingValidateBeforeCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountId' is set if (accountId == null) { - throw new ApiException("Missing the required parameter 'accountId' when calling deleteCallTranscription(Async)"); + throw new ApiException("Missing the required parameter 'accountId' when calling deleteRecording(Async)"); } // verify the required parameter 'callId' is set if (callId == null) { - throw new ApiException("Missing the required parameter 'callId' when calling deleteCallTranscription(Async)"); + throw new ApiException("Missing the required parameter 'callId' when calling deleteRecording(Async)"); } // verify the required parameter 'recordingId' is set if (recordingId == null) { - throw new ApiException("Missing the required parameter 'recordingId' when calling deleteCallTranscription(Async)"); + throw new ApiException("Missing the required parameter 'recordingId' when calling deleteRecording(Async)"); } - return deleteCallTranscriptionCall(accountId, callId, recordingId, _callback); + return deleteRecordingCall(accountId, callId, recordingId, _callback); } /** - * Delete Transcription - * Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + * Delete Recording + * Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -177,7 +177,7 @@ private okhttp3.Call deleteCallTranscriptionValidateBeforeCall(String accountId, * @http.response.details - + @@ -188,13 +188,13 @@ private okhttp3.Call deleteCallTranscriptionValidateBeforeCall(String accountId,
Status Code Description Response Headers
204 The transcription was successfully deleted. -
204 Recording was deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public void deleteCallTranscription(String accountId, String callId, String recordingId) throws ApiException { - deleteCallTranscriptionWithHttpInfo(accountId, callId, recordingId); + public void deleteRecording(String accountId, String callId, String recordingId) throws ApiException { + deleteRecordingWithHttpInfo(accountId, callId, recordingId); } /** - * Delete Transcription - * Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + * Delete Recording + * Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -203,7 +203,7 @@ public void deleteCallTranscription(String accountId, String callId, String reco * @http.response.details - + @@ -214,14 +214,14 @@ public void deleteCallTranscription(String accountId, String callId, String reco
Status Code Description Response Headers
204 The transcription was successfully deleted. -
204 Recording was deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public ApiResponse deleteCallTranscriptionWithHttpInfo(String accountId, String callId, String recordingId) throws ApiException { - okhttp3.Call localVarCall = deleteCallTranscriptionValidateBeforeCall(accountId, callId, recordingId, null); + public ApiResponse deleteRecordingWithHttpInfo(String accountId, String callId, String recordingId) throws ApiException { + okhttp3.Call localVarCall = deleteRecordingValidateBeforeCall(accountId, callId, recordingId, null); return localVarApiClient.execute(localVarCall); } /** - * Delete Transcription (asynchronously) - * Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + * Delete Recording (asynchronously) + * Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -231,7 +231,7 @@ public ApiResponse deleteCallTranscriptionWithHttpInfo(String accountId, S * @http.response.details - + @@ -242,14 +242,14 @@ public ApiResponse deleteCallTranscriptionWithHttpInfo(String accountId, S
Status Code Description Response Headers
204 The transcription was successfully deleted. -
204 Recording was deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public okhttp3.Call deleteCallTranscriptionAsync(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteRecordingAsync(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteCallTranscriptionValidateBeforeCall(accountId, callId, recordingId, _callback); + okhttp3.Call localVarCall = deleteRecordingValidateBeforeCall(accountId, callId, recordingId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteRecording + * Build call for deleteRecordingMedia * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -259,7 +259,7 @@ public okhttp3.Call deleteCallTranscriptionAsync(String accountId, String callId * @http.response.details - + @@ -270,7 +270,7 @@ public okhttp3.Call deleteCallTranscriptionAsync(String accountId, String callId
Status Code Description Response Headers
204 Recording was deleted. -
204 The recording media was successfully deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public okhttp3.Call deleteRecordingCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteRecordingMediaCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { "https://voice.bandwidth.com/api/v2" }; @@ -287,7 +287,7 @@ public okhttp3.Call deleteRecordingCall(String accountId, String callId, String Object localVarPostBody = null; // create path and map variables - String localVarPath = "/accounts/{accountId}/calls/{callId}/recordings/{recordingId}" + String localVarPath = "/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media" .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString())) .replace("{" + "callId" + "}", localVarApiClient.escapeString(callId.toString())) .replace("{" + "recordingId" + "}", localVarApiClient.escapeString(recordingId.toString())); @@ -318,29 +318,29 @@ public okhttp3.Call deleteRecordingCall(String accountId, String callId, String } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteRecordingValidateBeforeCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteRecordingMediaValidateBeforeCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountId' is set if (accountId == null) { - throw new ApiException("Missing the required parameter 'accountId' when calling deleteRecording(Async)"); + throw new ApiException("Missing the required parameter 'accountId' when calling deleteRecordingMedia(Async)"); } // verify the required parameter 'callId' is set if (callId == null) { - throw new ApiException("Missing the required parameter 'callId' when calling deleteRecording(Async)"); + throw new ApiException("Missing the required parameter 'callId' when calling deleteRecordingMedia(Async)"); } // verify the required parameter 'recordingId' is set if (recordingId == null) { - throw new ApiException("Missing the required parameter 'recordingId' when calling deleteRecording(Async)"); + throw new ApiException("Missing the required parameter 'recordingId' when calling deleteRecordingMedia(Async)"); } - return deleteRecordingCall(accountId, callId, recordingId, _callback); + return deleteRecordingMediaCall(accountId, callId, recordingId, _callback); } /** - * Delete Recording - * Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + * Delete Recording Media + * Deletes the specified recording's media. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -348,7 +348,7 @@ private okhttp3.Call deleteRecordingValidateBeforeCall(String accountId, String * @http.response.details - + @@ -359,13 +359,13 @@ private okhttp3.Call deleteRecordingValidateBeforeCall(String accountId, String
Status Code Description Response Headers
204 Recording was deleted. -
204 The recording media was successfully deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public void deleteRecording(String accountId, String callId, String recordingId) throws ApiException { - deleteRecordingWithHttpInfo(accountId, callId, recordingId); + public void deleteRecordingMedia(String accountId, String callId, String recordingId) throws ApiException { + deleteRecordingMediaWithHttpInfo(accountId, callId, recordingId); } /** - * Delete Recording - * Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + * Delete Recording Media + * Deletes the specified recording's media. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -374,7 +374,7 @@ public void deleteRecording(String accountId, String callId, String recordingId) * @http.response.details - + @@ -385,14 +385,14 @@ public void deleteRecording(String accountId, String callId, String recordingId)
Status Code Description Response Headers
204 Recording was deleted. -
204 The recording media was successfully deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public ApiResponse deleteRecordingWithHttpInfo(String accountId, String callId, String recordingId) throws ApiException { - okhttp3.Call localVarCall = deleteRecordingValidateBeforeCall(accountId, callId, recordingId, null); + public ApiResponse deleteRecordingMediaWithHttpInfo(String accountId, String callId, String recordingId) throws ApiException { + okhttp3.Call localVarCall = deleteRecordingMediaValidateBeforeCall(accountId, callId, recordingId, null); return localVarApiClient.execute(localVarCall); } /** - * Delete Recording (asynchronously) - * Delete the recording information, media and transcription. Note: After the deletion is requested and a `204` is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + * Delete Recording Media (asynchronously) + * Deletes the specified recording's media. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -402,7 +402,7 @@ public ApiResponse deleteRecordingWithHttpInfo(String accountId, String ca * @http.response.details - + @@ -413,14 +413,14 @@ public ApiResponse deleteRecordingWithHttpInfo(String accountId, String ca
Status Code Description Response Headers
204 Recording was deleted. -
204 The recording media was successfully deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public okhttp3.Call deleteRecordingAsync(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteRecordingMediaAsync(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteRecordingValidateBeforeCall(accountId, callId, recordingId, _callback); + okhttp3.Call localVarCall = deleteRecordingMediaValidateBeforeCall(accountId, callId, recordingId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for deleteRecordingMedia + * Build call for deleteRecordingTranscription * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -430,7 +430,7 @@ public okhttp3.Call deleteRecordingAsync(String accountId, String callId, String * @http.response.details - + @@ -441,7 +441,7 @@ public okhttp3.Call deleteRecordingAsync(String accountId, String callId, String
Status Code Description Response Headers
204 The recording media was successfully deleted. -
204 The transcription was successfully deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public okhttp3.Call deleteRecordingMediaCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteRecordingTranscriptionCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { "https://voice.bandwidth.com/api/v2" }; @@ -458,7 +458,7 @@ public okhttp3.Call deleteRecordingMediaCall(String accountId, String callId, St Object localVarPostBody = null; // create path and map variables - String localVarPath = "/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media" + String localVarPath = "/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription" .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString())) .replace("{" + "callId" + "}", localVarApiClient.escapeString(callId.toString())) .replace("{" + "recordingId" + "}", localVarApiClient.escapeString(recordingId.toString())); @@ -489,29 +489,29 @@ public okhttp3.Call deleteRecordingMediaCall(String accountId, String callId, St } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteRecordingMediaValidateBeforeCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteRecordingTranscriptionValidateBeforeCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountId' is set if (accountId == null) { - throw new ApiException("Missing the required parameter 'accountId' when calling deleteRecordingMedia(Async)"); + throw new ApiException("Missing the required parameter 'accountId' when calling deleteRecordingTranscription(Async)"); } // verify the required parameter 'callId' is set if (callId == null) { - throw new ApiException("Missing the required parameter 'callId' when calling deleteRecordingMedia(Async)"); + throw new ApiException("Missing the required parameter 'callId' when calling deleteRecordingTranscription(Async)"); } // verify the required parameter 'recordingId' is set if (recordingId == null) { - throw new ApiException("Missing the required parameter 'recordingId' when calling deleteRecordingMedia(Async)"); + throw new ApiException("Missing the required parameter 'recordingId' when calling deleteRecordingTranscription(Async)"); } - return deleteRecordingMediaCall(accountId, callId, recordingId, _callback); + return deleteRecordingTranscriptionCall(accountId, callId, recordingId, _callback); } /** - * Delete Recording Media - * Deletes the specified recording's media. + * Delete Transcription + * Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -519,7 +519,7 @@ private okhttp3.Call deleteRecordingMediaValidateBeforeCall(String accountId, St * @http.response.details - + @@ -530,13 +530,13 @@ private okhttp3.Call deleteRecordingMediaValidateBeforeCall(String accountId, St
Status Code Description Response Headers
204 The recording media was successfully deleted. -
204 The transcription was successfully deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public void deleteRecordingMedia(String accountId, String callId, String recordingId) throws ApiException { - deleteRecordingMediaWithHttpInfo(accountId, callId, recordingId); + public void deleteRecordingTranscription(String accountId, String callId, String recordingId) throws ApiException { + deleteRecordingTranscriptionWithHttpInfo(accountId, callId, recordingId); } /** - * Delete Recording Media - * Deletes the specified recording's media. + * Delete Transcription + * Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -545,7 +545,7 @@ public void deleteRecordingMedia(String accountId, String callId, String recordi * @http.response.details - + @@ -556,14 +556,14 @@ public void deleteRecordingMedia(String accountId, String callId, String recordi
Status Code Description Response Headers
204 The recording media was successfully deleted. -
204 The transcription was successfully deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public ApiResponse deleteRecordingMediaWithHttpInfo(String accountId, String callId, String recordingId) throws ApiException { - okhttp3.Call localVarCall = deleteRecordingMediaValidateBeforeCall(accountId, callId, recordingId, null); + public ApiResponse deleteRecordingTranscriptionWithHttpInfo(String accountId, String callId, String recordingId) throws ApiException { + okhttp3.Call localVarCall = deleteRecordingTranscriptionValidateBeforeCall(accountId, callId, recordingId, null); return localVarApiClient.execute(localVarCall); } /** - * Delete Recording Media (asynchronously) - * Deletes the specified recording's media. + * Delete Transcription (asynchronously) + * Deletes the specified recording's transcription. Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -573,7 +573,7 @@ public ApiResponse deleteRecordingMediaWithHttpInfo(String accountId, Stri * @http.response.details - + @@ -584,9 +584,9 @@ public ApiResponse deleteRecordingMediaWithHttpInfo(String accountId, Stri
Status Code Description Response Headers
204 The recording media was successfully deleted. -
204 The transcription was successfully deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public okhttp3.Call deleteRecordingMediaAsync(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteRecordingTranscriptionAsync(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteRecordingMediaValidateBeforeCall(accountId, callId, recordingId, _callback); + okhttp3.Call localVarCall = deleteRecordingTranscriptionValidateBeforeCall(accountId, callId, recordingId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } @@ -943,7 +943,7 @@ public okhttp3.Call getCallRecordingAsync(String accountId, String callId, Strin return localVarCall; } /** - * Build call for getCallTranscription + * Build call for getRecordingTranscription * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -953,7 +953,7 @@ public okhttp3.Call getCallRecordingAsync(String accountId, String callId, Strin * @http.response.details - + @@ -964,7 +964,7 @@ public okhttp3.Call getCallRecordingAsync(String accountId, String callId, Strin
Status Code Description Response Headers
200 Transcription found -
200 Transcription found. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public okhttp3.Call getCallTranscriptionCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getRecordingTranscriptionCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { "https://voice.bandwidth.com/api/v2" }; @@ -1012,38 +1012,38 @@ public okhttp3.Call getCallTranscriptionCall(String accountId, String callId, St } @SuppressWarnings("rawtypes") - private okhttp3.Call getCallTranscriptionValidateBeforeCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getRecordingTranscriptionValidateBeforeCall(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountId' is set if (accountId == null) { - throw new ApiException("Missing the required parameter 'accountId' when calling getCallTranscription(Async)"); + throw new ApiException("Missing the required parameter 'accountId' when calling getRecordingTranscription(Async)"); } // verify the required parameter 'callId' is set if (callId == null) { - throw new ApiException("Missing the required parameter 'callId' when calling getCallTranscription(Async)"); + throw new ApiException("Missing the required parameter 'callId' when calling getRecordingTranscription(Async)"); } // verify the required parameter 'recordingId' is set if (recordingId == null) { - throw new ApiException("Missing the required parameter 'recordingId' when calling getCallTranscription(Async)"); + throw new ApiException("Missing the required parameter 'recordingId' when calling getRecordingTranscription(Async)"); } - return getCallTranscriptionCall(accountId, callId, recordingId, _callback); + return getRecordingTranscriptionCall(accountId, callId, recordingId, _callback); } /** * Get Transcription - * Downloads the specified transcription. If the transcribed recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. + * Downloads the specified transcription. If the recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) - * @return TranscriptionList + * @return RecordingTranscriptions * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + @@ -1054,23 +1054,23 @@ private okhttp3.Call getCallTranscriptionValidateBeforeCall(String accountId, St
Status Code Description Response Headers
200 Transcription found -
200 Transcription found. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public TranscriptionList getCallTranscription(String accountId, String callId, String recordingId) throws ApiException { - ApiResponse localVarResp = getCallTranscriptionWithHttpInfo(accountId, callId, recordingId); + public RecordingTranscriptions getRecordingTranscription(String accountId, String callId, String recordingId) throws ApiException { + ApiResponse localVarResp = getRecordingTranscriptionWithHttpInfo(accountId, callId, recordingId); return localVarResp.getData(); } /** * Get Transcription - * Downloads the specified transcription. If the transcribed recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. + * Downloads the specified transcription. If the recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) - * @return ApiResponse<TranscriptionList> + * @return ApiResponse<RecordingTranscriptions> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - + @@ -1081,15 +1081,15 @@ public TranscriptionList getCallTranscription(String accountId, String callId, S
Status Code Description Response Headers
200 Transcription found -
200 Transcription found. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public ApiResponse getCallTranscriptionWithHttpInfo(String accountId, String callId, String recordingId) throws ApiException { - okhttp3.Call localVarCall = getCallTranscriptionValidateBeforeCall(accountId, callId, recordingId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse getRecordingTranscriptionWithHttpInfo(String accountId, String callId, String recordingId) throws ApiException { + okhttp3.Call localVarCall = getRecordingTranscriptionValidateBeforeCall(accountId, callId, recordingId, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get Transcription (asynchronously) - * Downloads the specified transcription. If the transcribed recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. + * Downloads the specified transcription. If the recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while [`<PlayAudio>`](/docs/voice/bxml/playAudio) and [`<SpeakSentence>`](/docs/voice/bxml/speakSentence) transcript will be the second item. During a [`<Transfer>`](/docs/voice/bxml/transfer) the A-leg transcript will be the first item while the B-leg transcript will be the second item. * @param accountId Your Bandwidth Account ID. (required) * @param callId Programmable Voice API Call ID. (required) * @param recordingId Programmable Voice API Recording ID. (required) @@ -1099,7 +1099,7 @@ public ApiResponse getCallTranscriptionWithHttpInfo(String ac * @http.response.details - + @@ -1110,10 +1110,10 @@ public ApiResponse getCallTranscriptionWithHttpInfo(String ac
Status Code Description Response Headers
200 Transcription found -
200 Transcription found. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
*/ - public okhttp3.Call getCallTranscriptionAsync(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getRecordingTranscriptionAsync(String accountId, String callId, String recordingId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getCallTranscriptionValidateBeforeCall(accountId, callId, recordingId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = getRecordingTranscriptionValidateBeforeCall(accountId, callId, recordingId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/bandwidth/sdk/api/TranscriptionsApi.java b/src/main/java/com/bandwidth/sdk/api/TranscriptionsApi.java new file mode 100644 index 00000000..cbb52776 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/api/TranscriptionsApi.java @@ -0,0 +1,588 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.api; + +import com.bandwidth.sdk.ApiCallback; +import com.bandwidth.sdk.ApiClient; +import com.bandwidth.sdk.ApiException; +import com.bandwidth.sdk.ApiResponse; +import com.bandwidth.sdk.Configuration; +import com.bandwidth.sdk.Pair; +import com.bandwidth.sdk.ProgressRequestBody; +import com.bandwidth.sdk.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.bandwidth.sdk.model.CallTranscriptionMetadata; +import com.bandwidth.sdk.model.CallTranscriptionResponse; +import com.bandwidth.sdk.model.VoiceApiError; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TranscriptionsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public TranscriptionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public TranscriptionsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deleteRealTimeTranscription + * @param accountId Your Bandwidth Account ID. (required) + * @param callId Programmable Voice API Call ID. (required) + * @param transcriptionId Programmable Voice API Transcription ID. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + + +
Status Code Description Response Headers
204 Transcription data was deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests * Retry-After - When you should try your request again.
500 Internal Server Error -
+ */ + public okhttp3.Call deleteRealTimeTranscriptionCall(String accountId, String callId, String transcriptionId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://voice.bandwidth.com/api/v2" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}" + .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString())) + .replace("{" + "callId" + "}", localVarApiClient.escapeString(callId.toString())) + .replace("{" + "transcriptionId" + "}", localVarApiClient.escapeString(transcriptionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteRealTimeTranscriptionValidateBeforeCall(String accountId, String callId, String transcriptionId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accountId' is set + if (accountId == null) { + throw new ApiException("Missing the required parameter 'accountId' when calling deleteRealTimeTranscription(Async)"); + } + + // verify the required parameter 'callId' is set + if (callId == null) { + throw new ApiException("Missing the required parameter 'callId' when calling deleteRealTimeTranscription(Async)"); + } + + // verify the required parameter 'transcriptionId' is set + if (transcriptionId == null) { + throw new ApiException("Missing the required parameter 'transcriptionId' when calling deleteRealTimeTranscription(Async)"); + } + + return deleteRealTimeTranscriptionCall(accountId, callId, transcriptionId, _callback); + + } + + /** + * Delete a specific transcription + * Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + * @param accountId Your Bandwidth Account ID. (required) + * @param callId Programmable Voice API Call ID. (required) + * @param transcriptionId Programmable Voice API Transcription ID. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + +
Status Code Description Response Headers
204 Transcription data was deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests * Retry-After - When you should try your request again.
500 Internal Server Error -
+ */ + public void deleteRealTimeTranscription(String accountId, String callId, String transcriptionId) throws ApiException { + deleteRealTimeTranscriptionWithHttpInfo(accountId, callId, transcriptionId); + } + + /** + * Delete a specific transcription + * Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + * @param accountId Your Bandwidth Account ID. (required) + * @param callId Programmable Voice API Call ID. (required) + * @param transcriptionId Programmable Voice API Transcription ID. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + +
Status Code Description Response Headers
204 Transcription data was deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests * Retry-After - When you should try your request again.
500 Internal Server Error -
+ */ + public ApiResponse deleteRealTimeTranscriptionWithHttpInfo(String accountId, String callId, String transcriptionId) throws ApiException { + okhttp3.Call localVarCall = deleteRealTimeTranscriptionValidateBeforeCall(accountId, callId, transcriptionId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a specific transcription (asynchronously) + * Delete the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). Note: After the deletion is requested and a `204` is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours. + * @param accountId Your Bandwidth Account ID. (required) + * @param callId Programmable Voice API Call ID. (required) + * @param transcriptionId Programmable Voice API Transcription ID. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + + +
Status Code Description Response Headers
204 Transcription data was deleted. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests * Retry-After - When you should try your request again.
500 Internal Server Error -
+ */ + public okhttp3.Call deleteRealTimeTranscriptionAsync(String accountId, String callId, String transcriptionId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteRealTimeTranscriptionValidateBeforeCall(accountId, callId, transcriptionId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getRealTimeTranscription + * @param accountId Your Bandwidth Account ID. (required) + * @param callId Programmable Voice API Call ID. (required) + * @param transcriptionId Programmable Voice API Transcription ID. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + + +
Status Code Description Response Headers
200 Transcription found. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests * Retry-After - When you should try your request again.
500 Internal Server Error -
+ */ + public okhttp3.Call getRealTimeTranscriptionCall(String accountId, String callId, String transcriptionId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://voice.bandwidth.com/api/v2" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId}" + .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString())) + .replace("{" + "callId" + "}", localVarApiClient.escapeString(callId.toString())) + .replace("{" + "transcriptionId" + "}", localVarApiClient.escapeString(transcriptionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getRealTimeTranscriptionValidateBeforeCall(String accountId, String callId, String transcriptionId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accountId' is set + if (accountId == null) { + throw new ApiException("Missing the required parameter 'accountId' when calling getRealTimeTranscription(Async)"); + } + + // verify the required parameter 'callId' is set + if (callId == null) { + throw new ApiException("Missing the required parameter 'callId' when calling getRealTimeTranscription(Async)"); + } + + // verify the required parameter 'transcriptionId' is set + if (transcriptionId == null) { + throw new ApiException("Missing the required parameter 'transcriptionId' when calling getRealTimeTranscription(Async)"); + } + + return getRealTimeTranscriptionCall(accountId, callId, transcriptionId, _callback); + + } + + /** + * Retrieve a specific transcription + * Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + * @param accountId Your Bandwidth Account ID. (required) + * @param callId Programmable Voice API Call ID. (required) + * @param transcriptionId Programmable Voice API Transcription ID. (required) + * @return CallTranscriptionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + +
Status Code Description Response Headers
200 Transcription found. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests * Retry-After - When you should try your request again.
500 Internal Server Error -
+ */ + public CallTranscriptionResponse getRealTimeTranscription(String accountId, String callId, String transcriptionId) throws ApiException { + ApiResponse localVarResp = getRealTimeTranscriptionWithHttpInfo(accountId, callId, transcriptionId); + return localVarResp.getData(); + } + + /** + * Retrieve a specific transcription + * Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + * @param accountId Your Bandwidth Account ID. (required) + * @param callId Programmable Voice API Call ID. (required) + * @param transcriptionId Programmable Voice API Transcription ID. (required) + * @return ApiResponse<CallTranscriptionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + +
Status Code Description Response Headers
200 Transcription found. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests * Retry-After - When you should try your request again.
500 Internal Server Error -
+ */ + public ApiResponse getRealTimeTranscriptionWithHttpInfo(String accountId, String callId, String transcriptionId) throws ApiException { + okhttp3.Call localVarCall = getRealTimeTranscriptionValidateBeforeCall(accountId, callId, transcriptionId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve a specific transcription (asynchronously) + * Retrieve the specified transcription that was created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + * @param accountId Your Bandwidth Account ID. (required) + * @param callId Programmable Voice API Call ID. (required) + * @param transcriptionId Programmable Voice API Transcription ID. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + + +
Status Code Description Response Headers
200 Transcription found. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests * Retry-After - When you should try your request again.
500 Internal Server Error -
+ */ + public okhttp3.Call getRealTimeTranscriptionAsync(String accountId, String callId, String transcriptionId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getRealTimeTranscriptionValidateBeforeCall(accountId, callId, transcriptionId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listRealTimeTranscriptions + * @param accountId Your Bandwidth Account ID. (required) + * @param callId Programmable Voice API Call ID. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + + +
Status Code Description Response Headers
200 Transcription found. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests * Retry-After - When you should try your request again.
500 Internal Server Error -
+ */ + public okhttp3.Call listRealTimeTranscriptionsCall(String accountId, String callId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://voice.bandwidth.com/api/v2" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/accounts/{accountId}/calls/{callId}/transcriptions" + .replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.toString())) + .replace("{" + "callId" + "}", localVarApiClient.escapeString(callId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "Basic" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listRealTimeTranscriptionsValidateBeforeCall(String accountId, String callId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accountId' is set + if (accountId == null) { + throw new ApiException("Missing the required parameter 'accountId' when calling listRealTimeTranscriptions(Async)"); + } + + // verify the required parameter 'callId' is set + if (callId == null) { + throw new ApiException("Missing the required parameter 'callId' when calling listRealTimeTranscriptions(Async)"); + } + + return listRealTimeTranscriptionsCall(accountId, callId, _callback); + + } + + /** + * Enumerate transcriptions made with StartTranscription + * Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + * @param accountId Your Bandwidth Account ID. (required) + * @param callId Programmable Voice API Call ID. (required) + * @return List<CallTranscriptionMetadata> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + +
Status Code Description Response Headers
200 Transcription found. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests * Retry-After - When you should try your request again.
500 Internal Server Error -
+ */ + public List listRealTimeTranscriptions(String accountId, String callId) throws ApiException { + ApiResponse> localVarResp = listRealTimeTranscriptionsWithHttpInfo(accountId, callId); + return localVarResp.getData(); + } + + /** + * Enumerate transcriptions made with StartTranscription + * Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + * @param accountId Your Bandwidth Account ID. (required) + * @param callId Programmable Voice API Call ID. (required) + * @return ApiResponse<List<CallTranscriptionMetadata>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + + + +
Status Code Description Response Headers
200 Transcription found. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests * Retry-After - When you should try your request again.
500 Internal Server Error -
+ */ + public ApiResponse> listRealTimeTranscriptionsWithHttpInfo(String accountId, String callId) throws ApiException { + okhttp3.Call localVarCall = listRealTimeTranscriptionsValidateBeforeCall(accountId, callId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Enumerate transcriptions made with StartTranscription (asynchronously) + * Enumerates the transcriptions created on this call via [startTranscription](/docs/voice/bxml/startTranscription). + * @param accountId Your Bandwidth Account ID. (required) + * @param callId Programmable Voice API Call ID. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + + + +
Status Code Description Response Headers
200 Transcription found. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
405 Method Not Allowed -
415 Unsupported Media Type -
429 Too Many Requests * Retry-After - When you should try your request again.
500 Internal Server Error -
+ */ + public okhttp3.Call listRealTimeTranscriptionsAsync(String accountId, String callId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = listRealTimeTranscriptionsValidateBeforeCall(accountId, callId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/bandwidth/sdk/auth/ApiKeyAuth.java b/src/main/java/com/bandwidth/sdk/auth/ApiKeyAuth.java index 6cf0d0c8..a091f358 100644 --- a/src/main/java/com/bandwidth/sdk/auth/ApiKeyAuth.java +++ b/src/main/java/com/bandwidth/sdk/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/com/bandwidth/sdk/auth/HttpBearerAuth.java b/src/main/java/com/bandwidth/sdk/auth/HttpBearerAuth.java index 18b22cdd..4d95d13c 100644 --- a/src/main/java/com/bandwidth/sdk/auth/HttpBearerAuth.java +++ b/src/main/java/com/bandwidth/sdk/auth/HttpBearerAuth.java @@ -22,7 +22,7 @@ import java.util.Optional; import java.util.function.Supplier; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class HttpBearerAuth implements Authentication { private final String scheme; private Supplier tokenSupplier; diff --git a/src/main/java/com/bandwidth/sdk/model/AbstractOpenApiSchema.java b/src/main/java/com/bandwidth/sdk/model/AbstractOpenApiSchema.java index be6f0672..60cd0928 100644 --- a/src/main/java/com/bandwidth/sdk/model/AbstractOpenApiSchema.java +++ b/src/main/java/com/bandwidth/sdk/model/AbstractOpenApiSchema.java @@ -21,7 +21,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/com/bandwidth/sdk/model/AccountStatistics.java b/src/main/java/com/bandwidth/sdk/model/AccountStatistics.java index 42fbc8e6..70c75675 100644 --- a/src/main/java/com/bandwidth/sdk/model/AccountStatistics.java +++ b/src/main/java/com/bandwidth/sdk/model/AccountStatistics.java @@ -49,7 +49,7 @@ /** * AccountStatistics */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class AccountStatistics { public static final String SERIALIZED_NAME_CURRENT_CALL_QUEUE_SIZE = "currentCallQueueSize"; @SerializedName(SERIALIZED_NAME_CURRENT_CALL_QUEUE_SIZE) diff --git a/src/main/java/com/bandwidth/sdk/model/AnswerCallback.java b/src/main/java/com/bandwidth/sdk/model/AnswerCallback.java index 0ebabfcc..df58335f 100644 --- a/src/main/java/com/bandwidth/sdk/model/AnswerCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/AnswerCallback.java @@ -53,7 +53,7 @@ /** * The Answer event is sent to the answerUrl specified in the createCall request when an outbound call is answered. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class AnswerCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/BridgeCompleteCallback.java b/src/main/java/com/bandwidth/sdk/model/BridgeCompleteCallback.java index 7bc25303..b7d7a166 100644 --- a/src/main/java/com/bandwidth/sdk/model/BridgeCompleteCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/BridgeCompleteCallback.java @@ -52,7 +52,7 @@ /** * If the target call leaves the <Bridge>, then this callback is sent to the bridgeCompleteUrl, and the BXML returned in it is executed on the call. If this webhook is sent, the Bridge Target Complete webhook is NOT sent. This callback is also sent if any problem occurs that prevents the calls to be bridged. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class BridgeCompleteCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/BridgeTargetCompleteCallback.java b/src/main/java/com/bandwidth/sdk/model/BridgeTargetCompleteCallback.java index c4ad58b6..f0328fcd 100644 --- a/src/main/java/com/bandwidth/sdk/model/BridgeTargetCompleteCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/BridgeTargetCompleteCallback.java @@ -52,7 +52,7 @@ /** * If the originating call leaves the <Bridge>, then this callback is sent to the bridgeTargetCompleteUrl, and the BXML returned in it is executed on the target call. If this webhook is sent, the Bridge Complete webhook is NOT sent. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class BridgeTargetCompleteCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/CallRecordingMetadata.java b/src/main/java/com/bandwidth/sdk/model/CallRecordingMetadata.java index eacbaeca..0ab021a3 100644 --- a/src/main/java/com/bandwidth/sdk/model/CallRecordingMetadata.java +++ b/src/main/java/com/bandwidth/sdk/model/CallRecordingMetadata.java @@ -16,7 +16,7 @@ import java.util.Objects; import com.bandwidth.sdk.model.CallDirectionEnum; import com.bandwidth.sdk.model.FileFormatEnum; -import com.bandwidth.sdk.model.TranscriptionMetadata; +import com.bandwidth.sdk.model.RecordingTranscriptionMetadata; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -55,7 +55,7 @@ /** * CallRecordingMetadata */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class CallRecordingMetadata { public static final String SERIALIZED_NAME_APPLICATION_ID = "applicationId"; @SerializedName(SERIALIZED_NAME_APPLICATION_ID) @@ -127,7 +127,7 @@ public class CallRecordingMetadata { public static final String SERIALIZED_NAME_TRANSCRIPTION = "transcription"; @SerializedName(SERIALIZED_NAME_TRANSCRIPTION) - private TranscriptionMetadata transcription; + private RecordingTranscriptionMetadata transcription; public CallRecordingMetadata() { } @@ -455,7 +455,7 @@ public void setMediaUrl(URI mediaUrl) { } - public CallRecordingMetadata transcription(TranscriptionMetadata transcription) { + public CallRecordingMetadata transcription(RecordingTranscriptionMetadata transcription) { this.transcription = transcription; return this; } @@ -465,11 +465,11 @@ public CallRecordingMetadata transcription(TranscriptionMetadata transcription) * @return transcription **/ @javax.annotation.Nullable - public TranscriptionMetadata getTranscription() { + public RecordingTranscriptionMetadata getTranscription() { return transcription; } - public void setTranscription(TranscriptionMetadata transcription) { + public void setTranscription(RecordingTranscriptionMetadata transcription) { this.transcription = transcription; } @@ -692,7 +692,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `transcription` if (jsonObj.get("transcription") != null && !jsonObj.get("transcription").isJsonNull()) { - TranscriptionMetadata.validateJsonElement(jsonObj.get("transcription")); + RecordingTranscriptionMetadata.validateJsonElement(jsonObj.get("transcription")); } } diff --git a/src/main/java/com/bandwidth/sdk/model/CallState.java b/src/main/java/com/bandwidth/sdk/model/CallState.java index ba260adc..d0f13890 100644 --- a/src/main/java/com/bandwidth/sdk/model/CallState.java +++ b/src/main/java/com/bandwidth/sdk/model/CallState.java @@ -54,7 +54,7 @@ /** * CallState */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class CallState { public static final String SERIALIZED_NAME_APPLICATION_ID = "applicationId"; @SerializedName(SERIALIZED_NAME_APPLICATION_ID) diff --git a/src/main/java/com/bandwidth/sdk/model/CallTranscription.java b/src/main/java/com/bandwidth/sdk/model/CallTranscription.java new file mode 100644 index 00000000..cd778a8c --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/CallTranscription.java @@ -0,0 +1,487 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.bandwidth.sdk.JSON; + +/** + * CallTranscription + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") +public class CallTranscription { + /** + * The detected language for this transcription. + */ + @JsonAdapter(DetectedLanguageEnum.Adapter.class) + public enum DetectedLanguageEnum { + EN_US("en-US"), + + ES_US("es-US"), + + FR_FR("fr-FR"); + + private String value; + + DetectedLanguageEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DetectedLanguageEnum fromValue(String value) { + for (DetectedLanguageEnum b : DetectedLanguageEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final DetectedLanguageEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DetectedLanguageEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DetectedLanguageEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + DetectedLanguageEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_DETECTED_LANGUAGE = "detectedLanguage"; + @SerializedName(SERIALIZED_NAME_DETECTED_LANGUAGE) + private DetectedLanguageEnum detectedLanguage; + + /** + * Which `track` this transcription is derived from. + */ + @JsonAdapter(TrackEnum.Adapter.class) + public enum TrackEnum { + INBOUND("inbound"), + + OUTBOUND("outbound"); + + private String value; + + TrackEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TrackEnum fromValue(String value) { + for (TrackEnum b : TrackEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TrackEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TrackEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TrackEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TrackEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TRACK = "track"; + @SerializedName(SERIALIZED_NAME_TRACK) + private TrackEnum track; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + private String text; + + public static final String SERIALIZED_NAME_CONFIDENCE = "confidence"; + @SerializedName(SERIALIZED_NAME_CONFIDENCE) + private Double confidence; + + public CallTranscription() { + } + + public CallTranscription detectedLanguage(DetectedLanguageEnum detectedLanguage) { + this.detectedLanguage = detectedLanguage; + return this; + } + + /** + * The detected language for this transcription. + * @return detectedLanguage + **/ + @javax.annotation.Nullable + public DetectedLanguageEnum getDetectedLanguage() { + return detectedLanguage; + } + + public void setDetectedLanguage(DetectedLanguageEnum detectedLanguage) { + this.detectedLanguage = detectedLanguage; + } + + + public CallTranscription track(TrackEnum track) { + this.track = track; + return this; + } + + /** + * Which `track` this transcription is derived from. + * @return track + **/ + @javax.annotation.Nullable + public TrackEnum getTrack() { + return track; + } + + public void setTrack(TrackEnum track) { + this.track = track; + } + + + public CallTranscription text(String text) { + this.text = text; + return this; + } + + /** + * The transcription itself. + * @return text + **/ + @javax.annotation.Nullable + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + + public CallTranscription confidence(Double confidence) { + this.confidence = confidence; + return this; + } + + /** + * How confident the transcription engine was in transcribing the associated audio (from `0` to `1`). + * minimum: 0 + * maximum: 1 + * @return confidence + **/ + @javax.annotation.Nullable + public Double getConfidence() { + return confidence; + } + + public void setConfidence(Double confidence) { + this.confidence = confidence; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CallTranscription instance itself + */ + public CallTranscription putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CallTranscription callTranscription = (CallTranscription) o; + return Objects.equals(this.detectedLanguage, callTranscription.detectedLanguage) && + Objects.equals(this.track, callTranscription.track) && + Objects.equals(this.text, callTranscription.text) && + Objects.equals(this.confidence, callTranscription.confidence)&& + Objects.equals(this.additionalProperties, callTranscription.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(detectedLanguage, track, text, confidence, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CallTranscription {\n"); + sb.append(" detectedLanguage: ").append(toIndentedString(detectedLanguage)).append("\n"); + sb.append(" track: ").append(toIndentedString(track)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" confidence: ").append(toIndentedString(confidence)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("detectedLanguage"); + openapiFields.add("track"); + openapiFields.add("text"); + openapiFields.add("confidence"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CallTranscription + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CallTranscription.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CallTranscription is not found in the empty JSON string", CallTranscription.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("detectedLanguage") != null && !jsonObj.get("detectedLanguage").isJsonNull()) && !jsonObj.get("detectedLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `detectedLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detectedLanguage").toString())); + } + // validate the optional field `detectedLanguage` + if (jsonObj.get("detectedLanguage") != null && !jsonObj.get("detectedLanguage").isJsonNull()) { + DetectedLanguageEnum.validateJsonElement(jsonObj.get("detectedLanguage")); + } + if ((jsonObj.get("track") != null && !jsonObj.get("track").isJsonNull()) && !jsonObj.get("track").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `track` to be a primitive type in the JSON string but got `%s`", jsonObj.get("track").toString())); + } + // validate the optional field `track` + if (jsonObj.get("track") != null && !jsonObj.get("track").isJsonNull()) { + TrackEnum.validateJsonElement(jsonObj.get("track")); + } + if ((jsonObj.get("text") != null && !jsonObj.get("text").isJsonNull()) && !jsonObj.get("text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("text").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CallTranscription.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CallTranscription' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CallTranscription.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CallTranscription value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CallTranscription read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CallTranscription instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CallTranscription given an JSON string + * + * @param jsonString JSON string + * @return An instance of CallTranscription + * @throws IOException if the JSON string is invalid with respect to CallTranscription + */ + public static CallTranscription fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CallTranscription.class); + } + + /** + * Convert an instance of CallTranscription to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/CallTranscriptionMetadata.java b/src/main/java/com/bandwidth/sdk/model/CallTranscriptionMetadata.java new file mode 100644 index 00000000..30e0eba5 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/CallTranscriptionMetadata.java @@ -0,0 +1,316 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.bandwidth.sdk.JSON; + +/** + * CallTranscriptionMetadata + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") +public class CallTranscriptionMetadata { + public static final String SERIALIZED_NAME_TRANSCRIPTION_ID = "transcriptionId"; + @SerializedName(SERIALIZED_NAME_TRANSCRIPTION_ID) + private String transcriptionId; + + public static final String SERIALIZED_NAME_TRANSCRIPTION_URL = "transcriptionUrl"; + @SerializedName(SERIALIZED_NAME_TRANSCRIPTION_URL) + private String transcriptionUrl; + + public CallTranscriptionMetadata() { + } + + public CallTranscriptionMetadata transcriptionId(String transcriptionId) { + this.transcriptionId = transcriptionId; + return this; + } + + /** + * The programmable voice API transcription ID. + * @return transcriptionId + **/ + @javax.annotation.Nullable + public String getTranscriptionId() { + return transcriptionId; + } + + public void setTranscriptionId(String transcriptionId) { + this.transcriptionId = transcriptionId; + } + + + public CallTranscriptionMetadata transcriptionUrl(String transcriptionUrl) { + this.transcriptionUrl = transcriptionUrl; + return this; + } + + /** + * A URL that may be used to retrieve the transcription itself. This points to the [Get Call Transcription](/apis/voice/#operation/getCallTranscription) endpoint. + * @return transcriptionUrl + **/ + @javax.annotation.Nullable + public String getTranscriptionUrl() { + return transcriptionUrl; + } + + public void setTranscriptionUrl(String transcriptionUrl) { + this.transcriptionUrl = transcriptionUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CallTranscriptionMetadata instance itself + */ + public CallTranscriptionMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CallTranscriptionMetadata callTranscriptionMetadata = (CallTranscriptionMetadata) o; + return Objects.equals(this.transcriptionId, callTranscriptionMetadata.transcriptionId) && + Objects.equals(this.transcriptionUrl, callTranscriptionMetadata.transcriptionUrl)&& + Objects.equals(this.additionalProperties, callTranscriptionMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(transcriptionId, transcriptionUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CallTranscriptionMetadata {\n"); + sb.append(" transcriptionId: ").append(toIndentedString(transcriptionId)).append("\n"); + sb.append(" transcriptionUrl: ").append(toIndentedString(transcriptionUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transcriptionId"); + openapiFields.add("transcriptionUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CallTranscriptionMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CallTranscriptionMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CallTranscriptionMetadata is not found in the empty JSON string", CallTranscriptionMetadata.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("transcriptionId") != null && !jsonObj.get("transcriptionId").isJsonNull()) && !jsonObj.get("transcriptionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transcriptionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transcriptionId").toString())); + } + if ((jsonObj.get("transcriptionUrl") != null && !jsonObj.get("transcriptionUrl").isJsonNull()) && !jsonObj.get("transcriptionUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transcriptionUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transcriptionUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CallTranscriptionMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CallTranscriptionMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CallTranscriptionMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CallTranscriptionMetadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CallTranscriptionMetadata read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CallTranscriptionMetadata instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CallTranscriptionMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of CallTranscriptionMetadata + * @throws IOException if the JSON string is invalid with respect to CallTranscriptionMetadata + */ + public static CallTranscriptionMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CallTranscriptionMetadata.class); + } + + /** + * Convert an instance of CallTranscriptionMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/CallTranscriptionResponse.java b/src/main/java/com/bandwidth/sdk/model/CallTranscriptionResponse.java new file mode 100644 index 00000000..1814433e --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/CallTranscriptionResponse.java @@ -0,0 +1,396 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import com.bandwidth.sdk.model.CallTranscription; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.bandwidth.sdk.JSON; + +/** + * CallTranscriptionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") +public class CallTranscriptionResponse { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_CALL_ID = "callId"; + @SerializedName(SERIALIZED_NAME_CALL_ID) + private String callId; + + public static final String SERIALIZED_NAME_TRANSCRIPTION_ID = "transcriptionId"; + @SerializedName(SERIALIZED_NAME_TRANSCRIPTION_ID) + private String transcriptionId; + + public static final String SERIALIZED_NAME_TRACKS = "tracks"; + @SerializedName(SERIALIZED_NAME_TRACKS) + private List tracks = new ArrayList<>(); + + public CallTranscriptionResponse() { + } + + public CallTranscriptionResponse accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The user account associated with the call. + * @return accountId + **/ + @javax.annotation.Nullable + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public CallTranscriptionResponse callId(String callId) { + this.callId = callId; + return this; + } + + /** + * The call id associated with the event. + * @return callId + **/ + @javax.annotation.Nullable + public String getCallId() { + return callId; + } + + public void setCallId(String callId) { + this.callId = callId; + } + + + public CallTranscriptionResponse transcriptionId(String transcriptionId) { + this.transcriptionId = transcriptionId; + return this; + } + + /** + * The programmable voice API transcription ID. + * @return transcriptionId + **/ + @javax.annotation.Nullable + public String getTranscriptionId() { + return transcriptionId; + } + + public void setTranscriptionId(String transcriptionId) { + this.transcriptionId = transcriptionId; + } + + + public CallTranscriptionResponse tracks(List tracks) { + this.tracks = tracks; + return this; + } + + public CallTranscriptionResponse addTracksItem(CallTranscription tracksItem) { + if (this.tracks == null) { + this.tracks = new ArrayList<>(); + } + this.tracks.add(tracksItem); + return this; + } + + /** + * Get tracks + * @return tracks + **/ + @javax.annotation.Nullable + public List getTracks() { + return tracks; + } + + public void setTracks(List tracks) { + this.tracks = tracks; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CallTranscriptionResponse instance itself + */ + public CallTranscriptionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CallTranscriptionResponse callTranscriptionResponse = (CallTranscriptionResponse) o; + return Objects.equals(this.accountId, callTranscriptionResponse.accountId) && + Objects.equals(this.callId, callTranscriptionResponse.callId) && + Objects.equals(this.transcriptionId, callTranscriptionResponse.transcriptionId) && + Objects.equals(this.tracks, callTranscriptionResponse.tracks)&& + Objects.equals(this.additionalProperties, callTranscriptionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, callId, transcriptionId, tracks, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CallTranscriptionResponse {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" callId: ").append(toIndentedString(callId)).append("\n"); + sb.append(" transcriptionId: ").append(toIndentedString(transcriptionId)).append("\n"); + sb.append(" tracks: ").append(toIndentedString(tracks)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("callId"); + openapiFields.add("transcriptionId"); + openapiFields.add("tracks"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CallTranscriptionResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CallTranscriptionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CallTranscriptionResponse is not found in the empty JSON string", CallTranscriptionResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("accountId") != null && !jsonObj.get("accountId").isJsonNull()) && !jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if ((jsonObj.get("callId") != null && !jsonObj.get("callId").isJsonNull()) && !jsonObj.get("callId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `callId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("callId").toString())); + } + if ((jsonObj.get("transcriptionId") != null && !jsonObj.get("transcriptionId").isJsonNull()) && !jsonObj.get("transcriptionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transcriptionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transcriptionId").toString())); + } + if (jsonObj.get("tracks") != null && !jsonObj.get("tracks").isJsonNull()) { + JsonArray jsonArraytracks = jsonObj.getAsJsonArray("tracks"); + if (jsonArraytracks != null) { + // ensure the json data is an array + if (!jsonObj.get("tracks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tracks` to be an array in the JSON string but got `%s`", jsonObj.get("tracks").toString())); + } + + // validate the optional field `tracks` (array) + for (int i = 0; i < jsonArraytracks.size(); i++) { + CallTranscription.validateJsonElement(jsonArraytracks.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CallTranscriptionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CallTranscriptionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CallTranscriptionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CallTranscriptionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CallTranscriptionResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CallTranscriptionResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CallTranscriptionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CallTranscriptionResponse + * @throws IOException if the JSON string is invalid with respect to CallTranscriptionResponse + */ + public static CallTranscriptionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CallTranscriptionResponse.class); + } + + /** + * Convert an instance of CallTranscriptionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/CodeRequest.java b/src/main/java/com/bandwidth/sdk/model/CodeRequest.java index b4f53075..59a827f8 100644 --- a/src/main/java/com/bandwidth/sdk/model/CodeRequest.java +++ b/src/main/java/com/bandwidth/sdk/model/CodeRequest.java @@ -49,7 +49,7 @@ /** * CodeRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class CodeRequest { public static final String SERIALIZED_NAME_TO = "to"; @SerializedName(SERIALIZED_NAME_TO) diff --git a/src/main/java/com/bandwidth/sdk/model/Conference.java b/src/main/java/com/bandwidth/sdk/model/Conference.java index 6fcfc83f..509a0b15 100644 --- a/src/main/java/com/bandwidth/sdk/model/Conference.java +++ b/src/main/java/com/bandwidth/sdk/model/Conference.java @@ -56,7 +56,7 @@ /** * Conference */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class Conference { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/com/bandwidth/sdk/model/ConferenceCompletedCallback.java b/src/main/java/com/bandwidth/sdk/model/ConferenceCompletedCallback.java index d84dcb2a..257c8bad 100644 --- a/src/main/java/com/bandwidth/sdk/model/ConferenceCompletedCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/ConferenceCompletedCallback.java @@ -51,7 +51,7 @@ /** * The Conference Completed event is fired when the last member leaves the conference. The response to this event may not contain BXML. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class ConferenceCompletedCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/ConferenceCreatedCallback.java b/src/main/java/com/bandwidth/sdk/model/ConferenceCreatedCallback.java index 8543c224..d0cb449d 100644 --- a/src/main/java/com/bandwidth/sdk/model/ConferenceCreatedCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/ConferenceCreatedCallback.java @@ -51,7 +51,7 @@ /** * The Conference Created event is fired whenever a new conference that specified a callbackUrl is created. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class ConferenceCreatedCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/ConferenceMember.java b/src/main/java/com/bandwidth/sdk/model/ConferenceMember.java index fe364c78..ebae4f4a 100644 --- a/src/main/java/com/bandwidth/sdk/model/ConferenceMember.java +++ b/src/main/java/com/bandwidth/sdk/model/ConferenceMember.java @@ -52,7 +52,7 @@ /** * ConferenceMember */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class ConferenceMember { public static final String SERIALIZED_NAME_CALL_ID = "callId"; @SerializedName(SERIALIZED_NAME_CALL_ID) diff --git a/src/main/java/com/bandwidth/sdk/model/ConferenceMemberExitCallback.java b/src/main/java/com/bandwidth/sdk/model/ConferenceMemberExitCallback.java index 950fb522..662408af 100644 --- a/src/main/java/com/bandwidth/sdk/model/ConferenceMemberExitCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/ConferenceMemberExitCallback.java @@ -51,7 +51,7 @@ /** * The Conference Member Exit event is fired whenever a caller exits a conference that specified a callbackUrl. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class ConferenceMemberExitCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/ConferenceMemberJoinCallback.java b/src/main/java/com/bandwidth/sdk/model/ConferenceMemberJoinCallback.java index 6d3b9b06..349fa9a2 100644 --- a/src/main/java/com/bandwidth/sdk/model/ConferenceMemberJoinCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/ConferenceMemberJoinCallback.java @@ -51,7 +51,7 @@ /** * The Conference Member Join event is fired whenever a caller joins a conference that specified a callbackUrl. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class ConferenceMemberJoinCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/ConferenceRecordingAvailableCallback.java b/src/main/java/com/bandwidth/sdk/model/ConferenceRecordingAvailableCallback.java index eec5e1e7..2663f047 100644 --- a/src/main/java/com/bandwidth/sdk/model/ConferenceRecordingAvailableCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/ConferenceRecordingAvailableCallback.java @@ -53,7 +53,7 @@ /** * The Conference Recording Available event is sent after a conference recording has been processed. It indicates that the recording is available for download. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class ConferenceRecordingAvailableCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/ConferenceRecordingMetadata.java b/src/main/java/com/bandwidth/sdk/model/ConferenceRecordingMetadata.java index 01c5b260..02ae4b98 100644 --- a/src/main/java/com/bandwidth/sdk/model/ConferenceRecordingMetadata.java +++ b/src/main/java/com/bandwidth/sdk/model/ConferenceRecordingMetadata.java @@ -53,7 +53,7 @@ /** * ConferenceRecordingMetadata */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class ConferenceRecordingMetadata { public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) diff --git a/src/main/java/com/bandwidth/sdk/model/ConferenceRedirectCallback.java b/src/main/java/com/bandwidth/sdk/model/ConferenceRedirectCallback.java index 71e83f34..0857f61d 100644 --- a/src/main/java/com/bandwidth/sdk/model/ConferenceRedirectCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/ConferenceRedirectCallback.java @@ -51,7 +51,7 @@ /** * The Conference Redirect event is fired whenever an existing conference is modified via a POST request made to the /conferences/{conferenceId} endpoint. The response may be either empty or a BXML document. Only the following verbs are valid for conferences: PlayAudio, SpeakSentence, StartRecording, StopRecording, PauseRecording, ResumeRecording. Audio verbs will be heard by all members of the conference. Recordings capture audio from all members who are not muted or on hold, as well as any audio verbs that are played into the conference. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class ConferenceRedirectCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/CreateCall.java b/src/main/java/com/bandwidth/sdk/model/CreateCall.java index 10a6d3a1..101308ca 100644 --- a/src/main/java/com/bandwidth/sdk/model/CreateCall.java +++ b/src/main/java/com/bandwidth/sdk/model/CreateCall.java @@ -53,7 +53,7 @@ /** * CreateCall */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class CreateCall { public static final String SERIALIZED_NAME_TO = "to"; @SerializedName(SERIALIZED_NAME_TO) diff --git a/src/main/java/com/bandwidth/sdk/model/CreateCallResponse.java b/src/main/java/com/bandwidth/sdk/model/CreateCallResponse.java index a4d79525..78bf72b6 100644 --- a/src/main/java/com/bandwidth/sdk/model/CreateCallResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/CreateCallResponse.java @@ -53,7 +53,7 @@ /** * CreateCallResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class CreateCallResponse { public static final String SERIALIZED_NAME_APPLICATION_ID = "applicationId"; @SerializedName(SERIALIZED_NAME_APPLICATION_ID) diff --git a/src/main/java/com/bandwidth/sdk/model/CreateLookupResponse.java b/src/main/java/com/bandwidth/sdk/model/CreateLookupResponse.java index 72635523..35a1012c 100644 --- a/src/main/java/com/bandwidth/sdk/model/CreateLookupResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/CreateLookupResponse.java @@ -50,7 +50,7 @@ /** * The request has been accepted for processing but not yet finished and in a terminal state (COMPLETE, PARTIAL_COMPLETE, or FAILED). */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class CreateLookupResponse { public static final String SERIALIZED_NAME_REQUEST_ID = "requestId"; @SerializedName(SERIALIZED_NAME_REQUEST_ID) diff --git a/src/main/java/com/bandwidth/sdk/model/CreateMessageRequestError.java b/src/main/java/com/bandwidth/sdk/model/CreateMessageRequestError.java index 7289d0d2..9191f939 100644 --- a/src/main/java/com/bandwidth/sdk/model/CreateMessageRequestError.java +++ b/src/main/java/com/bandwidth/sdk/model/CreateMessageRequestError.java @@ -52,7 +52,7 @@ /** * CreateMessageRequestError */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class CreateMessageRequestError { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @@ -64,7 +64,7 @@ public class CreateMessageRequestError { public static final String SERIALIZED_NAME_FIELD_ERRORS = "fieldErrors"; @SerializedName(SERIALIZED_NAME_FIELD_ERRORS) - private List fieldErrors; + private List fieldErrors = new ArrayList<>(); public CreateMessageRequestError() { } diff --git a/src/main/java/com/bandwidth/sdk/model/DeferredResult.java b/src/main/java/com/bandwidth/sdk/model/DeferredResult.java index b9f7fc69..ae14eab6 100644 --- a/src/main/java/com/bandwidth/sdk/model/DeferredResult.java +++ b/src/main/java/com/bandwidth/sdk/model/DeferredResult.java @@ -49,7 +49,7 @@ /** * DeferredResult */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class DeferredResult { public static final String SERIALIZED_NAME_RESULT = "result"; @SerializedName(SERIALIZED_NAME_RESULT) diff --git a/src/main/java/com/bandwidth/sdk/model/DisconnectCallback.java b/src/main/java/com/bandwidth/sdk/model/DisconnectCallback.java index a6869eec..d8877d64 100644 --- a/src/main/java/com/bandwidth/sdk/model/DisconnectCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/DisconnectCallback.java @@ -52,7 +52,7 @@ /** * The Disconnect event is fired when a call ends, for any reason. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class DisconnectCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/Diversion.java b/src/main/java/com/bandwidth/sdk/model/Diversion.java index 11ea34b7..3e7ccb17 100644 --- a/src/main/java/com/bandwidth/sdk/model/Diversion.java +++ b/src/main/java/com/bandwidth/sdk/model/Diversion.java @@ -49,7 +49,7 @@ /** * Diversion */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class Diversion { public static final String SERIALIZED_NAME_REASON = "reason"; @SerializedName(SERIALIZED_NAME_REASON) diff --git a/src/main/java/com/bandwidth/sdk/model/DtmfCallback.java b/src/main/java/com/bandwidth/sdk/model/DtmfCallback.java index 61a3ae3c..15a899d9 100644 --- a/src/main/java/com/bandwidth/sdk/model/DtmfCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/DtmfCallback.java @@ -52,7 +52,7 @@ /** * The DTMF event is sent for every digit detected after a <StartGather> verb is executed. You may not respond to this event with BXML. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class DtmfCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/FieldError.java b/src/main/java/com/bandwidth/sdk/model/FieldError.java index 4ebd11a5..92914b7e 100644 --- a/src/main/java/com/bandwidth/sdk/model/FieldError.java +++ b/src/main/java/com/bandwidth/sdk/model/FieldError.java @@ -49,7 +49,7 @@ /** * FieldError */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class FieldError { public static final String SERIALIZED_NAME_FIELD_NAME = "fieldName"; @SerializedName(SERIALIZED_NAME_FIELD_NAME) diff --git a/src/main/java/com/bandwidth/sdk/model/GatherCallback.java b/src/main/java/com/bandwidth/sdk/model/GatherCallback.java index 8141bd97..d25d9193 100644 --- a/src/main/java/com/bandwidth/sdk/model/GatherCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/GatherCallback.java @@ -52,7 +52,7 @@ /** * The gather event is sent after a <Gather> verb is executed. Its purpose is to report the gathered digits to the calling application. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class GatherCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/InboundMessageCallback.java b/src/main/java/com/bandwidth/sdk/model/InboundMessageCallback.java index 05c05577..8dca880d 100644 --- a/src/main/java/com/bandwidth/sdk/model/InboundMessageCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/InboundMessageCallback.java @@ -51,7 +51,7 @@ /** * Inbound Message Callback */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class InboundMessageCallback { public static final String SERIALIZED_NAME_TIME = "time"; @SerializedName(SERIALIZED_NAME_TIME) diff --git a/src/main/java/com/bandwidth/sdk/model/InboundMessageCallbackMessage.java b/src/main/java/com/bandwidth/sdk/model/InboundMessageCallbackMessage.java index d88c356a..ac08aa7e 100644 --- a/src/main/java/com/bandwidth/sdk/model/InboundMessageCallbackMessage.java +++ b/src/main/java/com/bandwidth/sdk/model/InboundMessageCallbackMessage.java @@ -57,7 +57,7 @@ /** * Inbound Message Callback Message Schema */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class InboundMessageCallbackMessage { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -101,7 +101,7 @@ public class InboundMessageCallbackMessage { public static final String SERIALIZED_NAME_MEDIA = "media"; @SerializedName(SERIALIZED_NAME_MEDIA) - private List media; + private List media = new ArrayList<>(); public static final String SERIALIZED_NAME_PRIORITY = "priority"; @SerializedName(SERIALIZED_NAME_PRIORITY) diff --git a/src/main/java/com/bandwidth/sdk/model/InitiateCallback.java b/src/main/java/com/bandwidth/sdk/model/InitiateCallback.java index cbb5c651..e1e271ef 100644 --- a/src/main/java/com/bandwidth/sdk/model/InitiateCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/InitiateCallback.java @@ -53,7 +53,7 @@ /** * The Initiate event is fired when an inbound call is received for a Telephone Number on your Account. It is sent to the URL specified in the application associated with the location (sip-peer) that the called telephone number belongs to. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class InitiateCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/ListMessageItem.java b/src/main/java/com/bandwidth/sdk/model/ListMessageItem.java index 2ba9635d..988186b3 100644 --- a/src/main/java/com/bandwidth/sdk/model/ListMessageItem.java +++ b/src/main/java/com/bandwidth/sdk/model/ListMessageItem.java @@ -54,7 +54,7 @@ /** * ListMessageItem */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class ListMessageItem { public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId"; @SerializedName(SERIALIZED_NAME_MESSAGE_ID) diff --git a/src/main/java/com/bandwidth/sdk/model/LookupRequest.java b/src/main/java/com/bandwidth/sdk/model/LookupRequest.java index 79ab25b9..75414526 100644 --- a/src/main/java/com/bandwidth/sdk/model/LookupRequest.java +++ b/src/main/java/com/bandwidth/sdk/model/LookupRequest.java @@ -51,7 +51,7 @@ /** * Create phone number lookup request. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class LookupRequest { public static final String SERIALIZED_NAME_TNS = "tns"; @SerializedName(SERIALIZED_NAME_TNS) diff --git a/src/main/java/com/bandwidth/sdk/model/LookupResult.java b/src/main/java/com/bandwidth/sdk/model/LookupResult.java index 0d353417..e9079cb3 100644 --- a/src/main/java/com/bandwidth/sdk/model/LookupResult.java +++ b/src/main/java/com/bandwidth/sdk/model/LookupResult.java @@ -49,7 +49,7 @@ /** * Carrier information results for the specified telephone number. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class LookupResult { public static final String SERIALIZED_NAME_RESPONSE_CODE = "Response Code"; @SerializedName(SERIALIZED_NAME_RESPONSE_CODE) diff --git a/src/main/java/com/bandwidth/sdk/model/LookupStatus.java b/src/main/java/com/bandwidth/sdk/model/LookupStatus.java index f438c752..dfca01c8 100644 --- a/src/main/java/com/bandwidth/sdk/model/LookupStatus.java +++ b/src/main/java/com/bandwidth/sdk/model/LookupStatus.java @@ -53,7 +53,7 @@ /** * If requestId exists, the result for that request is returned. See the Examples for details on the various responses that you can receive. Generally, if you see a Response Code of 0 in a result for a TN, information will be available for it. Any other Response Code will indicate no information was available for the TN. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class LookupStatus { public static final String SERIALIZED_NAME_REQUEST_ID = "requestId"; @SerializedName(SERIALIZED_NAME_REQUEST_ID) @@ -65,11 +65,11 @@ public class LookupStatus { public static final String SERIALIZED_NAME_RESULT = "result"; @SerializedName(SERIALIZED_NAME_RESULT) - private List result; + private List result = new ArrayList<>(); public static final String SERIALIZED_NAME_FAILED_TELEPHONE_NUMBERS = "failedTelephoneNumbers"; @SerializedName(SERIALIZED_NAME_FAILED_TELEPHONE_NUMBERS) - private List failedTelephoneNumbers; + private List failedTelephoneNumbers = new ArrayList<>(); public LookupStatus() { } diff --git a/src/main/java/com/bandwidth/sdk/model/MachineDetectionCompleteCallback.java b/src/main/java/com/bandwidth/sdk/model/MachineDetectionCompleteCallback.java index 7d380947..ab17c1b3 100644 --- a/src/main/java/com/bandwidth/sdk/model/MachineDetectionCompleteCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/MachineDetectionCompleteCallback.java @@ -53,7 +53,7 @@ /** * This event is sent to the url informed when requesting a machine detection operation. It contains the machine detection operation result, which can be: human, answering-machine, silence, timeout, error. This event is not sent when sync answering machine detection mode is chosen. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MachineDetectionCompleteCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java b/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java index 1a08054f..57d22b12 100644 --- a/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java +++ b/src/main/java/com/bandwidth/sdk/model/MachineDetectionConfiguration.java @@ -53,7 +53,7 @@ /** * The machine detection request used to perform <a href='/docs/voice/guides/machineDetection'>machine detection</a> on the call. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MachineDetectionConfiguration { public static final String SERIALIZED_NAME_MODE = "mode"; @SerializedName(SERIALIZED_NAME_MODE) diff --git a/src/main/java/com/bandwidth/sdk/model/MachineDetectionResult.java b/src/main/java/com/bandwidth/sdk/model/MachineDetectionResult.java index 49e7b798..f3ff2b2e 100644 --- a/src/main/java/com/bandwidth/sdk/model/MachineDetectionResult.java +++ b/src/main/java/com/bandwidth/sdk/model/MachineDetectionResult.java @@ -49,7 +49,7 @@ /** * (optional) if machine detection was requested in sync mode, the result will be specified here. Possible values are the same as the async counterpart: Machine Detection Complete */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MachineDetectionResult { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) diff --git a/src/main/java/com/bandwidth/sdk/model/Media.java b/src/main/java/com/bandwidth/sdk/model/Media.java index 223d1fc7..f31d58bf 100644 --- a/src/main/java/com/bandwidth/sdk/model/Media.java +++ b/src/main/java/com/bandwidth/sdk/model/Media.java @@ -49,7 +49,7 @@ /** * Media */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class Media { public static final String SERIALIZED_NAME_CONTENT = "content"; @SerializedName(SERIALIZED_NAME_CONTENT) diff --git a/src/main/java/com/bandwidth/sdk/model/Message.java b/src/main/java/com/bandwidth/sdk/model/Message.java index 1a6e0e71..f7893107 100644 --- a/src/main/java/com/bandwidth/sdk/model/Message.java +++ b/src/main/java/com/bandwidth/sdk/model/Message.java @@ -54,7 +54,7 @@ /** * Message */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class Message { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -82,7 +82,7 @@ public class Message { public static final String SERIALIZED_NAME_TO = "to"; @SerializedName(SERIALIZED_NAME_TO) - private Set to; + private Set to = new LinkedHashSet<>(); public static final String SERIALIZED_NAME_FROM = "from"; @SerializedName(SERIALIZED_NAME_FROM) @@ -90,7 +90,7 @@ public class Message { public static final String SERIALIZED_NAME_MEDIA = "media"; @SerializedName(SERIALIZED_NAME_MEDIA) - private Set media; + private Set media = new LinkedHashSet<>(); public static final String SERIALIZED_NAME_TEXT = "text"; @SerializedName(SERIALIZED_NAME_TEXT) diff --git a/src/main/java/com/bandwidth/sdk/model/MessageDeliveredCallback.java b/src/main/java/com/bandwidth/sdk/model/MessageDeliveredCallback.java index 22e3d23e..fe3ce3db 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessageDeliveredCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/MessageDeliveredCallback.java @@ -51,7 +51,7 @@ /** * Message Delivered Callback */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MessageDeliveredCallback { public static final String SERIALIZED_NAME_TIME = "time"; @SerializedName(SERIALIZED_NAME_TIME) diff --git a/src/main/java/com/bandwidth/sdk/model/MessageDeliveredCallbackMessage.java b/src/main/java/com/bandwidth/sdk/model/MessageDeliveredCallbackMessage.java index eda66577..dbafd12b 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessageDeliveredCallbackMessage.java +++ b/src/main/java/com/bandwidth/sdk/model/MessageDeliveredCallbackMessage.java @@ -57,7 +57,7 @@ /** * Message Delivered Callback Message Schema */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MessageDeliveredCallbackMessage { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -101,7 +101,7 @@ public class MessageDeliveredCallbackMessage { public static final String SERIALIZED_NAME_MEDIA = "media"; @SerializedName(SERIALIZED_NAME_MEDIA) - private List media; + private List media = new ArrayList<>(); public static final String SERIALIZED_NAME_PRIORITY = "priority"; @SerializedName(SERIALIZED_NAME_PRIORITY) diff --git a/src/main/java/com/bandwidth/sdk/model/MessageFailedCallback.java b/src/main/java/com/bandwidth/sdk/model/MessageFailedCallback.java index 44358a45..49153874 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessageFailedCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/MessageFailedCallback.java @@ -51,7 +51,7 @@ /** * Message Failed Callback */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MessageFailedCallback { public static final String SERIALIZED_NAME_TIME = "time"; @SerializedName(SERIALIZED_NAME_TIME) diff --git a/src/main/java/com/bandwidth/sdk/model/MessageFailedCallbackMessage.java b/src/main/java/com/bandwidth/sdk/model/MessageFailedCallbackMessage.java index a1bf8a14..12dc3384 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessageFailedCallbackMessage.java +++ b/src/main/java/com/bandwidth/sdk/model/MessageFailedCallbackMessage.java @@ -57,7 +57,7 @@ /** * Message Failed Callback Message Schema */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MessageFailedCallbackMessage { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -101,7 +101,7 @@ public class MessageFailedCallbackMessage { public static final String SERIALIZED_NAME_MEDIA = "media"; @SerializedName(SERIALIZED_NAME_MEDIA) - private List media; + private List media = new ArrayList<>(); public static final String SERIALIZED_NAME_PRIORITY = "priority"; @SerializedName(SERIALIZED_NAME_PRIORITY) diff --git a/src/main/java/com/bandwidth/sdk/model/MessageRequest.java b/src/main/java/com/bandwidth/sdk/model/MessageRequest.java index 4be77b2f..44b019c0 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessageRequest.java +++ b/src/main/java/com/bandwidth/sdk/model/MessageRequest.java @@ -56,7 +56,7 @@ /** * MessageRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MessageRequest { public static final String SERIALIZED_NAME_APPLICATION_ID = "applicationId"; @SerializedName(SERIALIZED_NAME_APPLICATION_ID) @@ -76,7 +76,7 @@ public class MessageRequest { public static final String SERIALIZED_NAME_MEDIA = "media"; @SerializedName(SERIALIZED_NAME_MEDIA) - private List media; + private List media = new ArrayList<>(); public static final String SERIALIZED_NAME_TAG = "tag"; @SerializedName(SERIALIZED_NAME_TAG) diff --git a/src/main/java/com/bandwidth/sdk/model/MessageSendingCallback.java b/src/main/java/com/bandwidth/sdk/model/MessageSendingCallback.java index 1bc60314..97861788 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessageSendingCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/MessageSendingCallback.java @@ -51,7 +51,7 @@ /** * Message Sending Callback */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MessageSendingCallback { public static final String SERIALIZED_NAME_TIME = "time"; @SerializedName(SERIALIZED_NAME_TIME) diff --git a/src/main/java/com/bandwidth/sdk/model/MessageSendingCallbackMessage.java b/src/main/java/com/bandwidth/sdk/model/MessageSendingCallbackMessage.java index bc98b2d8..14f30700 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessageSendingCallbackMessage.java +++ b/src/main/java/com/bandwidth/sdk/model/MessageSendingCallbackMessage.java @@ -57,7 +57,7 @@ /** * Message Sending Callback Message Schema */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MessageSendingCallbackMessage { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/src/main/java/com/bandwidth/sdk/model/MessagesList.java b/src/main/java/com/bandwidth/sdk/model/MessagesList.java index 62ce1bae..13bc6bce 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessagesList.java +++ b/src/main/java/com/bandwidth/sdk/model/MessagesList.java @@ -53,7 +53,7 @@ /** * MessagesList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MessagesList { public static final String SERIALIZED_NAME_TOTAL_COUNT = "totalCount"; @SerializedName(SERIALIZED_NAME_TOTAL_COUNT) @@ -65,7 +65,7 @@ public class MessagesList { public static final String SERIALIZED_NAME_MESSAGES = "messages"; @SerializedName(SERIALIZED_NAME_MESSAGES) - private List messages; + private List messages = new ArrayList<>(); public MessagesList() { } diff --git a/src/main/java/com/bandwidth/sdk/model/MessagingCodeResponse.java b/src/main/java/com/bandwidth/sdk/model/MessagingCodeResponse.java index f4964937..d4224fb0 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessagingCodeResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/MessagingCodeResponse.java @@ -49,7 +49,7 @@ /** * MessagingCodeResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MessagingCodeResponse { public static final String SERIALIZED_NAME_MESSAGE_ID = "messageId"; @SerializedName(SERIALIZED_NAME_MESSAGE_ID) diff --git a/src/main/java/com/bandwidth/sdk/model/MessagingRequestError.java b/src/main/java/com/bandwidth/sdk/model/MessagingRequestError.java index 3a2b4b72..8097ac14 100644 --- a/src/main/java/com/bandwidth/sdk/model/MessagingRequestError.java +++ b/src/main/java/com/bandwidth/sdk/model/MessagingRequestError.java @@ -49,7 +49,7 @@ /** * MessagingRequestError */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MessagingRequestError { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/MfaForbiddenRequestError.java b/src/main/java/com/bandwidth/sdk/model/MfaForbiddenRequestError.java index 1e106166..96e1f5ee 100644 --- a/src/main/java/com/bandwidth/sdk/model/MfaForbiddenRequestError.java +++ b/src/main/java/com/bandwidth/sdk/model/MfaForbiddenRequestError.java @@ -49,7 +49,7 @@ /** * MfaForbiddenRequestError */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MfaForbiddenRequestError { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/src/main/java/com/bandwidth/sdk/model/MfaRequestError.java b/src/main/java/com/bandwidth/sdk/model/MfaRequestError.java index c2d56a44..fec8d616 100644 --- a/src/main/java/com/bandwidth/sdk/model/MfaRequestError.java +++ b/src/main/java/com/bandwidth/sdk/model/MfaRequestError.java @@ -49,7 +49,7 @@ /** * MfaRequestError */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MfaRequestError { public static final String SERIALIZED_NAME_ERROR = "error"; @SerializedName(SERIALIZED_NAME_ERROR) diff --git a/src/main/java/com/bandwidth/sdk/model/MfaUnauthorizedRequestError.java b/src/main/java/com/bandwidth/sdk/model/MfaUnauthorizedRequestError.java index 61de33df..1c9d9966 100644 --- a/src/main/java/com/bandwidth/sdk/model/MfaUnauthorizedRequestError.java +++ b/src/main/java/com/bandwidth/sdk/model/MfaUnauthorizedRequestError.java @@ -49,7 +49,7 @@ /** * MfaUnauthorizedRequestError */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class MfaUnauthorizedRequestError { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/src/main/java/com/bandwidth/sdk/model/PageInfo.java b/src/main/java/com/bandwidth/sdk/model/PageInfo.java index 717c80da..fdc30505 100644 --- a/src/main/java/com/bandwidth/sdk/model/PageInfo.java +++ b/src/main/java/com/bandwidth/sdk/model/PageInfo.java @@ -49,7 +49,7 @@ /** * PageInfo */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class PageInfo { public static final String SERIALIZED_NAME_PREV_PAGE = "prevPage"; @SerializedName(SERIALIZED_NAME_PREV_PAGE) diff --git a/src/main/java/com/bandwidth/sdk/model/RecordingAvailableCallback.java b/src/main/java/com/bandwidth/sdk/model/RecordingAvailableCallback.java index 0ac0a4a8..d34978ed 100644 --- a/src/main/java/com/bandwidth/sdk/model/RecordingAvailableCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/RecordingAvailableCallback.java @@ -54,7 +54,7 @@ /** * The Recording Available event is sent after a recording has been processed. It indicates that the recording is available for download. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class RecordingAvailableCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) @@ -126,7 +126,7 @@ public class RecordingAvailableCallback { public static final String SERIALIZED_NAME_CHANNELS = "channels"; @SerializedName(SERIALIZED_NAME_CHANNELS) - private String channels; + private Integer channels; public static final String SERIALIZED_NAME_TAG = "tag"; @SerializedName(SERIALIZED_NAME_TAG) @@ -470,21 +470,21 @@ public void setFileFormat(FileFormatEnum fileFormat) { } - public RecordingAvailableCallback channels(String channels) { + public RecordingAvailableCallback channels(Integer channels) { this.channels = channels; return this; } /** - * The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. + * Always `1` for conference recordings; multi-channel recordings are not supported on conferences. * @return channels **/ @javax.annotation.Nullable - public String getChannels() { + public Integer getChannels() { return channels; } - public void setChannels(String channels) { + public void setChannels(Integer channels) { this.channels = channels; } @@ -790,9 +790,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("fileFormat") != null && !jsonObj.get("fileFormat").isJsonNull()) { FileFormatEnum.validateJsonElement(jsonObj.get("fileFormat")); } - if ((jsonObj.get("channels") != null && !jsonObj.get("channels").isJsonNull()) && !jsonObj.get("channels").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `channels` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channels").toString())); - } if ((jsonObj.get("tag") != null && !jsonObj.get("tag").isJsonNull()) && !jsonObj.get("tag").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tag").toString())); } diff --git a/src/main/java/com/bandwidth/sdk/model/RecordingCompleteCallback.java b/src/main/java/com/bandwidth/sdk/model/RecordingCompleteCallback.java index 4325aaf1..3253834b 100644 --- a/src/main/java/com/bandwidth/sdk/model/RecordingCompleteCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/RecordingCompleteCallback.java @@ -54,7 +54,7 @@ /** * The Record Complete event is sent after a <Record> verb has executed if the call is still active. The BXML returned by this callback is executed next. When the recording is available for download, a Recording Available event will be sent. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class RecordingCompleteCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/RecordingTranscriptionMetadata.java b/src/main/java/com/bandwidth/sdk/model/RecordingTranscriptionMetadata.java new file mode 100644 index 00000000..c93b9c4f --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/RecordingTranscriptionMetadata.java @@ -0,0 +1,375 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.bandwidth.sdk.JSON; + +/** + * If the recording was transcribed, metadata about the transcription + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") +public class RecordingTranscriptionMetadata { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_COMPLETED_TIME = "completedTime"; + @SerializedName(SERIALIZED_NAME_COMPLETED_TIME) + private String completedTime; + + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + private URI url; + + public RecordingTranscriptionMetadata() { + } + + public RecordingTranscriptionMetadata id(String id) { + this.id = id; + return this; + } + + /** + * The unique transcription ID + * @return id + **/ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public RecordingTranscriptionMetadata status(String status) { + this.status = status; + return this; + } + + /** + * The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. + * @return status + **/ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + + public RecordingTranscriptionMetadata completedTime(String completedTime) { + this.completedTime = completedTime; + return this; + } + + /** + * The time that the transcription was completed + * @return completedTime + **/ + @javax.annotation.Nullable + public String getCompletedTime() { + return completedTime; + } + + public void setCompletedTime(String completedTime) { + this.completedTime = completedTime; + } + + + public RecordingTranscriptionMetadata url(URI url) { + this.url = url; + return this; + } + + /** + * The URL of the [transcription](#operation/getCallTranscription) + * @return url + **/ + @javax.annotation.Nullable + public URI getUrl() { + return url; + } + + public void setUrl(URI url) { + this.url = url; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RecordingTranscriptionMetadata instance itself + */ + public RecordingTranscriptionMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecordingTranscriptionMetadata recordingTranscriptionMetadata = (RecordingTranscriptionMetadata) o; + return Objects.equals(this.id, recordingTranscriptionMetadata.id) && + Objects.equals(this.status, recordingTranscriptionMetadata.status) && + Objects.equals(this.completedTime, recordingTranscriptionMetadata.completedTime) && + Objects.equals(this.url, recordingTranscriptionMetadata.url)&& + Objects.equals(this.additionalProperties, recordingTranscriptionMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, completedTime, url, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecordingTranscriptionMetadata {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" completedTime: ").append(toIndentedString(completedTime)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("status"); + openapiFields.add("completedTime"); + openapiFields.add("url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RecordingTranscriptionMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RecordingTranscriptionMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RecordingTranscriptionMetadata is not found in the empty JSON string", RecordingTranscriptionMetadata.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("completedTime") != null && !jsonObj.get("completedTime").isJsonNull()) && !jsonObj.get("completedTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `completedTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("completedTime").toString())); + } + if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !jsonObj.get("url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RecordingTranscriptionMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RecordingTranscriptionMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RecordingTranscriptionMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RecordingTranscriptionMetadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RecordingTranscriptionMetadata read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RecordingTranscriptionMetadata instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RecordingTranscriptionMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of RecordingTranscriptionMetadata + * @throws IOException if the JSON string is invalid with respect to RecordingTranscriptionMetadata + */ + public static RecordingTranscriptionMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RecordingTranscriptionMetadata.class); + } + + /** + * Convert an instance of RecordingTranscriptionMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/RecordingTranscriptions.java b/src/main/java/com/bandwidth/sdk/model/RecordingTranscriptions.java new file mode 100644 index 00000000..96087470 --- /dev/null +++ b/src/main/java/com/bandwidth/sdk/model/RecordingTranscriptions.java @@ -0,0 +1,309 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import java.util.Objects; +import com.bandwidth.sdk.model.Transcription; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.bandwidth.sdk.JSON; + +/** + * RecordingTranscriptions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") +public class RecordingTranscriptions { + public static final String SERIALIZED_NAME_TRANSCRIPTS = "transcripts"; + @SerializedName(SERIALIZED_NAME_TRANSCRIPTS) + private List transcripts = new ArrayList<>(); + + public RecordingTranscriptions() { + } + + public RecordingTranscriptions transcripts(List transcripts) { + this.transcripts = transcripts; + return this; + } + + public RecordingTranscriptions addTranscriptsItem(Transcription transcriptsItem) { + if (this.transcripts == null) { + this.transcripts = new ArrayList<>(); + } + this.transcripts.add(transcriptsItem); + return this; + } + + /** + * Get transcripts + * @return transcripts + **/ + @javax.annotation.Nullable + public List getTranscripts() { + return transcripts; + } + + public void setTranscripts(List transcripts) { + this.transcripts = transcripts; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RecordingTranscriptions instance itself + */ + public RecordingTranscriptions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecordingTranscriptions recordingTranscriptions = (RecordingTranscriptions) o; + return Objects.equals(this.transcripts, recordingTranscriptions.transcripts)&& + Objects.equals(this.additionalProperties, recordingTranscriptions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(transcripts, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecordingTranscriptions {\n"); + sb.append(" transcripts: ").append(toIndentedString(transcripts)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transcripts"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RecordingTranscriptions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RecordingTranscriptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RecordingTranscriptions is not found in the empty JSON string", RecordingTranscriptions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("transcripts") != null && !jsonObj.get("transcripts").isJsonNull()) { + JsonArray jsonArraytranscripts = jsonObj.getAsJsonArray("transcripts"); + if (jsonArraytranscripts != null) { + // ensure the json data is an array + if (!jsonObj.get("transcripts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transcripts` to be an array in the JSON string but got `%s`", jsonObj.get("transcripts").toString())); + } + + // validate the optional field `transcripts` (array) + for (int i = 0; i < jsonArraytranscripts.size(); i++) { + Transcription.validateJsonElement(jsonArraytranscripts.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RecordingTranscriptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RecordingTranscriptions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RecordingTranscriptions.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RecordingTranscriptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RecordingTranscriptions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RecordingTranscriptions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RecordingTranscriptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of RecordingTranscriptions + * @throws IOException if the JSON string is invalid with respect to RecordingTranscriptions + */ + public static RecordingTranscriptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RecordingTranscriptions.class); + } + + /** + * Convert an instance of RecordingTranscriptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/bandwidth/sdk/model/RedirectCallback.java b/src/main/java/com/bandwidth/sdk/model/RedirectCallback.java index dab359ac..ea4f7ca3 100644 --- a/src/main/java/com/bandwidth/sdk/model/RedirectCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/RedirectCallback.java @@ -52,7 +52,7 @@ /** * The Redirect event is fired when a <Redirect> verb is executed. Its purpose is to get the next set of verbs from the calling application. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class RedirectCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/StirShaken.java b/src/main/java/com/bandwidth/sdk/model/StirShaken.java index 1b0e0ecc..ce8dc501 100644 --- a/src/main/java/com/bandwidth/sdk/model/StirShaken.java +++ b/src/main/java/com/bandwidth/sdk/model/StirShaken.java @@ -49,7 +49,7 @@ /** * StirShaken */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class StirShaken { public static final String SERIALIZED_NAME_VERSTAT = "verstat"; @SerializedName(SERIALIZED_NAME_VERSTAT) diff --git a/src/main/java/com/bandwidth/sdk/model/Tag.java b/src/main/java/com/bandwidth/sdk/model/Tag.java index 6dc61cde..0607f53c 100644 --- a/src/main/java/com/bandwidth/sdk/model/Tag.java +++ b/src/main/java/com/bandwidth/sdk/model/Tag.java @@ -49,7 +49,7 @@ /** * Tag */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class Tag { public static final String SERIALIZED_NAME_KEY = "key"; @SerializedName(SERIALIZED_NAME_KEY) diff --git a/src/main/java/com/bandwidth/sdk/model/TnLookupRequestError.java b/src/main/java/com/bandwidth/sdk/model/TnLookupRequestError.java index 948becc4..8737295b 100644 --- a/src/main/java/com/bandwidth/sdk/model/TnLookupRequestError.java +++ b/src/main/java/com/bandwidth/sdk/model/TnLookupRequestError.java @@ -49,7 +49,7 @@ /** * TnLookupRequestError */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class TnLookupRequestError { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/src/main/java/com/bandwidth/sdk/model/TranscribeRecording.java b/src/main/java/com/bandwidth/sdk/model/TranscribeRecording.java index 7a95598e..4bcf208f 100644 --- a/src/main/java/com/bandwidth/sdk/model/TranscribeRecording.java +++ b/src/main/java/com/bandwidth/sdk/model/TranscribeRecording.java @@ -52,7 +52,7 @@ /** * TranscribeRecording */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class TranscribeRecording { public static final String SERIALIZED_NAME_CALLBACK_URL = "callbackUrl"; @SerializedName(SERIALIZED_NAME_CALLBACK_URL) diff --git a/src/main/java/com/bandwidth/sdk/model/Transcription.java b/src/main/java/com/bandwidth/sdk/model/Transcription.java index 1a8e531e..69a77729 100644 --- a/src/main/java/com/bandwidth/sdk/model/Transcription.java +++ b/src/main/java/com/bandwidth/sdk/model/Transcription.java @@ -49,7 +49,7 @@ /** * Transcription */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class Transcription { public static final String SERIALIZED_NAME_TEXT = "text"; @SerializedName(SERIALIZED_NAME_TEXT) diff --git a/src/main/java/com/bandwidth/sdk/model/TranscriptionAvailableCallback.java b/src/main/java/com/bandwidth/sdk/model/TranscriptionAvailableCallback.java index 446e4ea6..cc7873e6 100644 --- a/src/main/java/com/bandwidth/sdk/model/TranscriptionAvailableCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/TranscriptionAvailableCallback.java @@ -55,7 +55,7 @@ /** * The Transcription Available event is sent when the recording transcription is available to be downloaded. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class TranscriptionAvailableCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/TransferAnswerCallback.java b/src/main/java/com/bandwidth/sdk/model/TransferAnswerCallback.java index 32333989..1861f4a1 100644 --- a/src/main/java/com/bandwidth/sdk/model/TransferAnswerCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/TransferAnswerCallback.java @@ -52,7 +52,7 @@ /** * When processing a <Transfer> verb, this event is sent when a called party (B-leg) answers. The event is sent to the endpoint specified in the transferAnswerUrl attribute of the <PhoneNumber> tag that answered. BXML returned by this callback will be executed for the called party only. After all BXML has been executed, the called party will be bridged to the original call. Most BXML verbs are allowed in response to a transferAnswer event, but some are not allowed. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class TransferAnswerCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/TransferCompleteCallback.java b/src/main/java/com/bandwidth/sdk/model/TransferCompleteCallback.java index 19d9a4b4..26df82fe 100644 --- a/src/main/java/com/bandwidth/sdk/model/TransferCompleteCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/TransferCompleteCallback.java @@ -52,7 +52,7 @@ /** * This event is sent to the transferCompleteUrl of the A-leg's <Transfer> verb when the transferred call (B-leg) completes. In a simultaneous ringing scenario, only one B-leg succeeds and this event corresponds to that successful leg. If none of the calls were answered, the transferComplete event corresponds to one of the legs. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class TransferCompleteCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/TransferDisconnectCallback.java b/src/main/java/com/bandwidth/sdk/model/TransferDisconnectCallback.java index c9e438ae..4d8bf17b 100644 --- a/src/main/java/com/bandwidth/sdk/model/TransferDisconnectCallback.java +++ b/src/main/java/com/bandwidth/sdk/model/TransferDisconnectCallback.java @@ -52,7 +52,7 @@ /** * This event is sent to the transferDisconnectUrl of each <PhoneNumber> tag when its respective call leg ends for any reason. The event is sent in the normal case, when the transferred leg is answered and later hung up, but is also sent if the new leg was never answered in the first place, if it was rejected, and if the original call leg hung up before the transferred leg. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class TransferDisconnectCallback { public static final String SERIALIZED_NAME_EVENT_TYPE = "eventType"; @SerializedName(SERIALIZED_NAME_EVENT_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/UpdateCall.java b/src/main/java/com/bandwidth/sdk/model/UpdateCall.java index afa0dfc7..dd2cc35c 100644 --- a/src/main/java/com/bandwidth/sdk/model/UpdateCall.java +++ b/src/main/java/com/bandwidth/sdk/model/UpdateCall.java @@ -53,7 +53,7 @@ /** * UpdateCall */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class UpdateCall { public static final String SERIALIZED_NAME_STATE = "state"; @SerializedName(SERIALIZED_NAME_STATE) diff --git a/src/main/java/com/bandwidth/sdk/model/UpdateCallRecording.java b/src/main/java/com/bandwidth/sdk/model/UpdateCallRecording.java index 58f982c4..b7eec69c 100644 --- a/src/main/java/com/bandwidth/sdk/model/UpdateCallRecording.java +++ b/src/main/java/com/bandwidth/sdk/model/UpdateCallRecording.java @@ -50,7 +50,7 @@ /** * UpdateCallRecording */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class UpdateCallRecording { public static final String SERIALIZED_NAME_STATE = "state"; @SerializedName(SERIALIZED_NAME_STATE) diff --git a/src/main/java/com/bandwidth/sdk/model/UpdateConference.java b/src/main/java/com/bandwidth/sdk/model/UpdateConference.java index 7aa26838..511da727 100644 --- a/src/main/java/com/bandwidth/sdk/model/UpdateConference.java +++ b/src/main/java/com/bandwidth/sdk/model/UpdateConference.java @@ -53,7 +53,7 @@ /** * UpdateConference */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class UpdateConference { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) diff --git a/src/main/java/com/bandwidth/sdk/model/UpdateConferenceMember.java b/src/main/java/com/bandwidth/sdk/model/UpdateConferenceMember.java index deeae0bf..d80e102f 100644 --- a/src/main/java/com/bandwidth/sdk/model/UpdateConferenceMember.java +++ b/src/main/java/com/bandwidth/sdk/model/UpdateConferenceMember.java @@ -52,7 +52,7 @@ /** * UpdateConferenceMember */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class UpdateConferenceMember { public static final String SERIALIZED_NAME_MUTE = "mute"; @SerializedName(SERIALIZED_NAME_MUTE) diff --git a/src/main/java/com/bandwidth/sdk/model/VerifyCodeRequest.java b/src/main/java/com/bandwidth/sdk/model/VerifyCodeRequest.java index 4a7eee10..9bf0a02d 100644 --- a/src/main/java/com/bandwidth/sdk/model/VerifyCodeRequest.java +++ b/src/main/java/com/bandwidth/sdk/model/VerifyCodeRequest.java @@ -50,7 +50,7 @@ /** * VerifyCodeRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class VerifyCodeRequest { public static final String SERIALIZED_NAME_TO = "to"; @SerializedName(SERIALIZED_NAME_TO) diff --git a/src/main/java/com/bandwidth/sdk/model/VerifyCodeResponse.java b/src/main/java/com/bandwidth/sdk/model/VerifyCodeResponse.java index b6f2707c..397c5e6c 100644 --- a/src/main/java/com/bandwidth/sdk/model/VerifyCodeResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/VerifyCodeResponse.java @@ -49,7 +49,7 @@ /** * VerifyCodeResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class VerifyCodeResponse { public static final String SERIALIZED_NAME_VALID = "valid"; @SerializedName(SERIALIZED_NAME_VALID) diff --git a/src/main/java/com/bandwidth/sdk/model/VoiceApiError.java b/src/main/java/com/bandwidth/sdk/model/VoiceApiError.java index a6ece3fc..5d049049 100644 --- a/src/main/java/com/bandwidth/sdk/model/VoiceApiError.java +++ b/src/main/java/com/bandwidth/sdk/model/VoiceApiError.java @@ -50,7 +50,7 @@ /** * VoiceApiError */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class VoiceApiError { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) diff --git a/src/main/java/com/bandwidth/sdk/model/VoiceCodeResponse.java b/src/main/java/com/bandwidth/sdk/model/VoiceCodeResponse.java index 636618b3..7976d567 100644 --- a/src/main/java/com/bandwidth/sdk/model/VoiceCodeResponse.java +++ b/src/main/java/com/bandwidth/sdk/model/VoiceCodeResponse.java @@ -49,7 +49,7 @@ /** * VoiceCodeResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0") public class VoiceCodeResponse { public static final String SERIALIZED_NAME_CALL_ID = "callId"; @SerializedName(SERIALIZED_NAME_CALL_ID) diff --git a/src/test/java/com/bandwidth/sdk/api/RecordingsApiTest.java b/src/test/java/com/bandwidth/sdk/api/RecordingsApiTest.java index 6eb6faaf..1f2b2a7a 100644 --- a/src/test/java/com/bandwidth/sdk/api/RecordingsApiTest.java +++ b/src/test/java/com/bandwidth/sdk/api/RecordingsApiTest.java @@ -11,7 +11,7 @@ import com.bandwidth.sdk.model.CreateCallResponse; import com.bandwidth.sdk.model.RecordingStateEnum; import com.bandwidth.sdk.model.TranscribeRecording; -import com.bandwidth.sdk.model.TranscriptionList; +import com.bandwidth.sdk.model.RecordingTranscriptions; import com.bandwidth.sdk.model.UpdateCall; import com.bandwidth.sdk.model.UpdateCallRecording; import com.bandwidth.sdk.utils.MantecaStatusResponse; @@ -205,12 +205,12 @@ public void testCallRecordingAndTranscription() throws Exception { assertThat(transcriptionStatus, is(true)); // Validate the transcription metadata endpoint - ApiResponse listTranscriptionsResponse = recordingsApi - .getCallTranscriptionWithHttpInfo(BW_ACCOUNT_ID, callId, recordingId); + ApiResponse listTranscriptionsResponse = recordingsApi + .getRecordingTranscriptionWithHttpInfo(BW_ACCOUNT_ID, callId, recordingId); assertThat(listTranscriptionsResponse.getStatusCode(), is(200)); // Delete transcription - ApiResponse deleteTranscriptionResponse = recordingsApi.deleteCallTranscriptionWithHttpInfo(BW_ACCOUNT_ID, + ApiResponse deleteTranscriptionResponse = recordingsApi.deleteRecordingTranscriptionWithHttpInfo(BW_ACCOUNT_ID, callId, recordingId); assertThat(deleteTranscriptionResponse.getStatusCode(), is(204)); @@ -368,7 +368,7 @@ public void testUnauthorizedGetTranscription() { Basic.setPassword("bad_password"); ApiException exception = Assertions.assertThrows(ApiException.class, - () -> recordingsApi.deleteCallTranscription(BW_ACCOUNT_ID, callId, + () -> recordingsApi.deleteRecordingTranscription(BW_ACCOUNT_ID, callId, recordingId)); assertThat(exception.getCode(), is(401)); @@ -380,7 +380,7 @@ public void testForbiddenGetTranscription() { Basic.setPassword(FORBIDDEN_PASSWORD); ApiException exception = Assertions.assertThrows(ApiException.class, - () -> recordingsApi.deleteCallTranscription(BW_ACCOUNT_ID, callId, + () -> recordingsApi.deleteRecordingTranscription(BW_ACCOUNT_ID, callId, recordingId)); assertThat(exception.getCode(), is(403)); @@ -416,7 +416,7 @@ public void testUnauthorizedDeleteTranscription() throws ApiException { Basic.setPassword("bad_password"); ApiException exception = Assertions.assertThrows(ApiException.class, - () -> recordingsApi.deleteCallTranscription(BW_ACCOUNT_ID, callId, + () -> recordingsApi.deleteRecordingTranscription(BW_ACCOUNT_ID, callId, recordingId)); assertThat(exception.getCode(), is(401)); @@ -428,7 +428,7 @@ public void testForbiddenDeleteTranscription() { Basic.setPassword(FORBIDDEN_PASSWORD); ApiException exception = Assertions.assertThrows(ApiException.class, - () -> recordingsApi.deleteCallTranscription(BW_ACCOUNT_ID, callId, + () -> recordingsApi.deleteRecordingTranscription(BW_ACCOUNT_ID, callId, recordingId)); assertThat(exception.getCode(), is(403)); diff --git a/src/test/java/com/bandwidth/sdk/api/TranscriptionsApiTest.java b/src/test/java/com/bandwidth/sdk/api/TranscriptionsApiTest.java new file mode 100644 index 00000000..31928343 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/api/TranscriptionsApiTest.java @@ -0,0 +1,124 @@ +package com.bandwidth.sdk.api; + +import com.bandwidth.sdk.ApiResponse; +import com.bandwidth.sdk.ApiException; +import com.bandwidth.sdk.ApiClient; +import com.bandwidth.sdk.auth.HttpBasicAuth; +import com.bandwidth.sdk.Configuration; +import com.bandwidth.sdk.model.CallbackMethodEnum; +import com.bandwidth.sdk.model.CreateCall; +import com.bandwidth.sdk.model.CreateCallResponse; +import com.bandwidth.sdk.model.CallDirectionEnum; +import com.bandwidth.sdk.model.CallState; +import com.bandwidth.sdk.model.CallStateEnum; +import com.bandwidth.sdk.model.UpdateCall; +import com.bandwidth.sdk.model.CallTranscription; +import com.bandwidth.sdk.model.CallTranscriptionMetadata; +import com.bandwidth.sdk.model.CallTranscriptionResponse; +import com.bandwidth.sdk.model.VoiceApiError; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.Assertions; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.List; +import java.util.HashMap; +import java.util.Map; +import java.time.OffsetDateTime; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.beans.HasPropertyWithValue.hasProperty; + +import static com.bandwidth.sdk.utils.TestingEnvironmentVariables.*; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) + + +/** + * API tests for TranscriptionsApi + */ + +public class TranscriptionsApiTest { + + ApiClient defaultClient = Configuration.getDefaultApiClient(); + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + private final CallsApi callsApi = new CallsApi(defaultClient); + private final TranscriptionsApi transcriptionsApi = new TranscriptionsApi(defaultClient); + + + private static CreateCall createMantecaCallBody = new CreateCall(); + private static UpdateCall completeMantecaCallBody = new UpdateCall(); + private static URI mantecaAnswerUrl; + private static String bxmlBody = "This is a bxml start transcription test.Ideally this part is being transcribed."; + private static int TEST_SLEEP = 10; + private static int TEST_SLEEP_LONG = 60; + + + @Test + public void getAndDeleteRealTimeTranscriptionsTest() throws ApiException, InterruptedException, URISyntaxException { + Basic.setUsername(BW_USERNAME); + Basic.setPassword(BW_PASSWORD); + mantecaAnswerUrl = new URI(MANTECA_BASE_URL + "/bxml/pause"); + + createMantecaCallBody.setFrom(MANTECA_ACTIVE_NUMBER); + createMantecaCallBody.setTo(MANTECA_IDLE_NUMBER); + createMantecaCallBody.setApplicationId(MANTECA_APPLICATION_ID); + createMantecaCallBody.setAnswerUrl(mantecaAnswerUrl); + completeMantecaCallBody.setState(CallStateEnum.COMPLETED); + + + // This is just creating the call, modifying with StartTranscript, and ending it so we can test the transcription below. + + ApiResponse createCallResponse = callsApi.createCallWithHttpInfo(BW_ACCOUNT_ID, createMantecaCallBody); + + + String callId = createCallResponse.getData().getCallId(); + assertThat(createCallResponse.getStatusCode(), is(201)); + + + TimeUnit.SECONDS.sleep(TEST_SLEEP); + // Redirect call to different url + ApiResponse updateCallResponse = callsApi.updateCallBxmlWithHttpInfo(BW_ACCOUNT_ID, callId, bxmlBody); + + assertThat(updateCallResponse.getStatusCode(), is(204)); + + // Complete call + TimeUnit.SECONDS.sleep(TEST_SLEEP); + ApiResponse completeCallResponse = callsApi.updateCallWithHttpInfo(BW_ACCOUNT_ID, + createCallResponse.getData().getCallId(), completeMantecaCallBody); + + assertThat(completeCallResponse.getStatusCode(), is(200)); + + + TimeUnit.SECONDS.sleep(TEST_SLEEP_LONG); + // The Transcriptions API tests start here + ApiResponse> listRealTimeTranscriptionResponse = transcriptionsApi.listRealTimeTranscriptionsWithHttpInfo(BW_ACCOUNT_ID, createCallResponse.getData().getCallId()); + + String transcriptionId = listRealTimeTranscriptionResponse.getData().get(0).getTranscriptionId(); + TimeUnit.SECONDS.sleep(TEST_SLEEP); + + ApiResponse getRealTimeTranscriptionResponse = transcriptionsApi.getRealTimeTranscriptionWithHttpInfo(BW_ACCOUNT_ID, callId, transcriptionId); + + assertThat(getRealTimeTranscriptionResponse.getStatusCode(), is(200)); + assertThat(getRealTimeTranscriptionResponse.getData(), hasProperty("transcriptionId", is(instanceOf(String.class)))); + assertThat(getRealTimeTranscriptionResponse.getData().getTracks().get(0), is(instanceOf(CallTranscription.class))); + assertThat(getRealTimeTranscriptionResponse.getData().getTracks().get(0).getTrack(), is(instanceOf(CallTranscription.TrackEnum.class))); + assertThat(getRealTimeTranscriptionResponse.getData().getTracks().get(0).getConfidence(), is(0.0)); + + + ApiResponse deleteRealTimeTranscriptionResponse = transcriptionsApi.deleteRealTimeTranscriptionWithHttpInfo(BW_ACCOUNT_ID, createCallResponse.getData().getCallId(), transcriptionId); + + assertThat(deleteRealTimeTranscriptionResponse.getStatusCode(), is(200)); // This should be 204 but there is currently a bug in the API to be fixed in VAPI-1863 + + } +} + + diff --git a/src/test/java/com/bandwidth/sdk/model/CallTranscriptionMetadataTest.java b/src/test/java/com/bandwidth/sdk/model/CallTranscriptionMetadataTest.java new file mode 100644 index 00000000..a2b460d0 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/model/CallTranscriptionMetadataTest.java @@ -0,0 +1,56 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CallTranscriptionMetadata + */ +public class CallTranscriptionMetadataTest { + private final CallTranscriptionMetadata model = new CallTranscriptionMetadata(); + + /** + * Model tests for CallTranscriptionMetadata + */ + @Test + public void testCallTranscriptionMetadata() { + // TODO: test CallTranscriptionMetadata + } + + /** + * Test the property 'transcriptionId' + */ + @Test + public void transcriptionIdTest() { + // TODO: test transcriptionId + } + + /** + * Test the property 'transcriptionUrl' + */ + @Test + public void transcriptionUrlTest() { + // TODO: test transcriptionUrl + } + +} diff --git a/src/test/java/com/bandwidth/sdk/model/CallTranscriptionResponseTest.java b/src/test/java/com/bandwidth/sdk/model/CallTranscriptionResponseTest.java new file mode 100644 index 00000000..b725b6d9 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/model/CallTranscriptionResponseTest.java @@ -0,0 +1,75 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import com.bandwidth.sdk.model.CallTranscription; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CallTranscriptionResponse + */ +public class CallTranscriptionResponseTest { + private final CallTranscriptionResponse model = new CallTranscriptionResponse(); + + /** + * Model tests for CallTranscriptionResponse + */ + @Test + public void testCallTranscriptionResponse() { + // TODO: test CallTranscriptionResponse + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'callId' + */ + @Test + public void callIdTest() { + // TODO: test callId + } + + /** + * Test the property 'transcriptionId' + */ + @Test + public void transcriptionIdTest() { + // TODO: test transcriptionId + } + + /** + * Test the property 'tracks' + */ + @Test + public void tracksTest() { + // TODO: test tracks + } + +} diff --git a/src/test/java/com/bandwidth/sdk/model/CallTranscriptionTest.java b/src/test/java/com/bandwidth/sdk/model/CallTranscriptionTest.java new file mode 100644 index 00000000..6c2d6fe6 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/model/CallTranscriptionTest.java @@ -0,0 +1,72 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CallTranscription + */ +public class CallTranscriptionTest { + private final CallTranscription model = new CallTranscription(); + + /** + * Model tests for CallTranscription + */ + @Test + public void testCallTranscription() { + // TODO: test CallTranscription + } + + /** + * Test the property 'detectedLanguage' + */ + @Test + public void detectedLanguageTest() { + // TODO: test detectedLanguage + } + + /** + * Test the property 'track' + */ + @Test + public void trackTest() { + // TODO: test track + } + + /** + * Test the property 'text' + */ + @Test + public void textTest() { + // TODO: test text + } + + /** + * Test the property 'confidence' + */ + @Test + public void confidenceTest() { + // TODO: test confidence + } + +} diff --git a/src/test/java/com/bandwidth/sdk/model/RecordingTranscriptionMetadataTest.java b/src/test/java/com/bandwidth/sdk/model/RecordingTranscriptionMetadataTest.java new file mode 100644 index 00000000..2f4b304d --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/model/RecordingTranscriptionMetadataTest.java @@ -0,0 +1,73 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RecordingTranscriptionMetadata + */ +public class RecordingTranscriptionMetadataTest { + private final RecordingTranscriptionMetadata model = new RecordingTranscriptionMetadata(); + + /** + * Model tests for RecordingTranscriptionMetadata + */ + @Test + public void testRecordingTranscriptionMetadata() { + // TODO: test RecordingTranscriptionMetadata + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'completedTime' + */ + @Test + public void completedTimeTest() { + // TODO: test completedTime + } + + /** + * Test the property 'url' + */ + @Test + public void urlTest() { + // TODO: test url + } + +} diff --git a/src/test/java/com/bandwidth/sdk/model/RecordingTranscriptionsTest.java b/src/test/java/com/bandwidth/sdk/model/RecordingTranscriptionsTest.java new file mode 100644 index 00000000..a44a9cc3 --- /dev/null +++ b/src/test/java/com/bandwidth/sdk/model/RecordingTranscriptionsTest.java @@ -0,0 +1,51 @@ +/* + * Bandwidth + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.bandwidth.sdk.model; + +import com.bandwidth.sdk.model.Transcription; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RecordingTranscriptions + */ +public class RecordingTranscriptionsTest { + private final RecordingTranscriptions model = new RecordingTranscriptions(); + + /** + * Model tests for RecordingTranscriptions + */ + @Test + public void testRecordingTranscriptions() { + // TODO: test RecordingTranscriptions + } + + /** + * Test the property 'transcripts' + */ + @Test + public void transcriptsTest() { + // TODO: test transcripts + } + +}