Skip to content

Commit

Permalink
SWI-5240 Update SDK Based on Recent Spec Changes (#23)
Browse files Browse the repository at this point in the history
* Generate SDK with OpenAPI Generator Version 7.1.0

* add transcriptions integration tests

* 60s sleep

* update recordings tests

---------

Co-authored-by: DX-Bandwidth <[email protected]>
Co-authored-by: ckoegel <[email protected]>
  • Loading branch information
3 people authored May 20, 2024
1 parent 5aca8c3 commit f9b5b8d
Show file tree
Hide file tree
Showing 16 changed files with 982 additions and 114 deletions.
8 changes: 6 additions & 2 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ api/mfaapi.ts
api/phone-number-lookup-api.ts
api/recordings-api.ts
api/statistics-api.ts
api/transcriptions-api.ts
base.ts
common.ts
configuration.ts
Expand All @@ -22,6 +23,9 @@ models/call-direction-enum.ts
models/call-recording-metadata.ts
models/call-state-enum.ts
models/call-state.ts
models/call-transcription-metadata.ts
models/call-transcription-response.ts
models/call-transcription.ts
models/callback-method-enum.ts
models/code-request.ts
models/conference-completed-callback.ts
Expand Down Expand Up @@ -82,15 +86,15 @@ models/priority-enum.ts
models/recording-available-callback.ts
models/recording-complete-callback.ts
models/recording-state-enum.ts
models/recording-transcription-metadata.ts
models/recording-transcriptions.ts
models/redirect-callback.ts
models/redirect-method-enum.ts
models/stir-shaken.ts
models/tag.ts
models/tn-lookup-request-error.ts
models/transcribe-recording.ts
models/transcription-available-callback.ts
models/transcription-list.ts
models/transcription-metadata.ts
models/transcription.ts
models/transfer-answer-callback.ts
models/transfer-complete-callback.ts
Expand Down
1 change: 1 addition & 0 deletions api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ export * from './api/messages-api';
export * from './api/phone-number-lookup-api';
export * from './api/recordings-api';
export * from './api/statistics-api';
export * from './api/transcriptions-api';

154 changes: 77 additions & 77 deletions api/recordings-api.ts

Large diffs are not rendered by default.

320 changes: 320 additions & 0 deletions api/transcriptions-api.ts

Large diffs are not rendered by default.

240 changes: 223 additions & 17 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ tags:
- name: Conferences
- name: Recordings
- name: Statistics
- name: Transcriptions
- name: MFA
- name: Phone Number Lookup
paths:
Expand Down Expand Up @@ -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
[`<PlayAudio>`](/docs/voice/bxml/playAudio) and
Expand All @@ -974,14 +973,14 @@ paths:
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.
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':
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -2677,7 +2778,7 @@ components:
mediaUrl:
$ref: '#/components/schemas/mediaUrl'
transcription:
$ref: '#/components/schemas/transcriptionMetadata'
$ref: '#/components/schemas/recordingTranscriptionMetadata'
conference:
type: object
properties:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}':
Expand Down
Loading

0 comments on commit f9b5b8d

Please sign in to comment.