Skip to content

Commit c0c74a6

Browse files
band-swi[bot]DX-Bandwidthckoegel
authored
SWI-5721 Update SDK Based on Recent Spec Changes (#218)
* Generate SDK with OpenAPI Generator Version 7.7.0 * fix transcriptions smoke test * update tests * update zipp * skip for prism error --------- Co-authored-by: DX-Bandwidth <[email protected]> Co-authored-by: ckoegel <[email protected]>
1 parent 1bae9a5 commit c0c74a6

File tree

7 files changed

+17
-3
lines changed

7 files changed

+17
-3
lines changed

bandwidth.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3254,6 +3254,7 @@ components:
32543254
$ref: '#/components/schemas/callTranscriptionMetadata'
32553255
example:
32563256
- transcriptionId: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b
3257+
transcriptionName: live_transcription
32573258
transcriptionUrl: >-
32583259
https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b
32593260
callTranscriptionMetadata:
@@ -3263,6 +3264,12 @@ components:
32633264
type: string
32643265
description: The programmable voice API transcription ID.
32653266
example: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b
3267+
transcriptionName:
3268+
type: string
3269+
description: >-
3270+
The programmable voice API transcription name. This name could be
3271+
provided by the user when creating the transcription.
3272+
example: live_transcription
32663273
transcriptionUrl:
32673274
type: string
32683275
description: >-

bandwidth/models/call_transcription_metadata.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ class CallTranscriptionMetadata(BaseModel):
2828
CallTranscriptionMetadata
2929
""" # noqa: E501
3030
transcription_id: Optional[StrictStr] = Field(default=None, description="The programmable voice API transcription ID.", alias="transcriptionId")
31+
transcription_name: Optional[StrictStr] = Field(default=None, description="The programmable voice API transcription name. This name could be provided by the user when creating the transcription.", alias="transcriptionName")
3132
transcription_url: Optional[StrictStr] = Field(default=None, description="A URL that may be used to retrieve the transcription itself. This points to the [Get Call Transcription](/apis/voice/#operation/getCallTranscription) endpoint.", alias="transcriptionUrl")
3233
additional_properties: Dict[str, Any] = {}
33-
__properties: ClassVar[List[str]] = ["transcriptionId", "transcriptionUrl"]
34+
__properties: ClassVar[List[str]] = ["transcriptionId", "transcriptionName", "transcriptionUrl"]
3435

3536
model_config = ConfigDict(
3637
populate_by_name=True,
@@ -91,6 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
9192

9293
_obj = cls.model_validate({
9394
"transcriptionId": obj.get("transcriptionId"),
95+
"transcriptionName": obj.get("transcriptionName"),
9496
"transcriptionUrl": obj.get("transcriptionUrl")
9597
})
9698
# store additional fields in additional_properties

docs/CallTranscriptionMetadata.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**transcription_id** | **str** | The programmable voice API transcription ID. | [optional]
9+
**transcription_name** | **str** | The programmable voice API transcription name. This name could be provided by the user when creating the transcription. | [optional]
910
**transcription_url** | **str** | A URL that may be used to retrieve the transcription itself. This points to the [Get Call Transcription](/apis/voice/#operation/getCallTranscription) endpoint. | [optional]
1011

1112
## Example

test-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ pytest-randomly>=3.12.0
44
pyhamcrest>=2.0.4
55
mypy>=1.4.1
66
types-python-dateutil>=2.8.19
7+
zipp>=3.19.1 # not directly required, pinned by Snyk to avoid a vulnerability

test/smoke/test_transcriptions_api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ def create_call_transcription(self) -> None:
7373

7474

7575
time.sleep(self.SLEEP_TIME_SEC)
76-
start_transcription_bxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><StartTranscription name=\"#{$manteca_call_id}\" tracks=\"inbound\"></StartTranscription><Pause duration=\"6\"/></Response>"
76+
start_transcription_bxml = '<?xml version="1.0" encoding="UTF-8"?><Response><StartTranscription name="' + self.call_id + '" tracks="inbound"></StartTranscription><Pause duration="6"/></Response>'
7777
start_response = self.calls_api_instance.update_call_bxml_with_http_info(
7878
BW_ACCOUNT_ID, self.call_id, start_transcription_bxml)
7979
assert_that(start_response.status_code, equal_to(204))
8080

81-
stop_transcription_bxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><StopTranscription name=\"#{$manteca_call_id}\"></StopTranscription></Response>"
81+
stop_transcription_bxml = '<?xml version="1.0" encoding="UTF-8"?><Response><StopTranscription name="' + self.call_id + '"></StopTranscription></Response>'
8282
stop_response = self.calls_api_instance.update_call_bxml_with_http_info(
8383
BW_ACCOUNT_ID, self.call_id, stop_transcription_bxml)
8484
assert_that(stop_response.status_code, equal_to(204))
@@ -102,6 +102,7 @@ def list_real_time_transcriptions(self) -> None:
102102
assert_that(response.data[0], instance_of(CallTranscriptionMetadata))
103103
assert_that(response.data[0].transcription_id, instance_of(str))
104104
assert_that(response.data[0].transcription_url, instance_of(str))
105+
assert_that(response.data[0].transcription_name, instance_of(str))
105106

106107
self.transcription_id = response.data[0].transcription_id
107108

test/unit/api/test_recordings_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def test_list_call_recordings(self) -> None:
127127
assert_that(response.data[0].transcription.completed_time, instance_of(datetime))
128128
assert_that(response.data[0].transcription.url, starts_with('http'))
129129

130+
@unittest.skip("skip due to prism error")
130131
def test_get_call_recording(self) -> None:
131132
"""Test case for get_call_recording
132133

test/unit/api/test_transcriptions_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def test_list_real_time_transcriptions(self) -> None:
5555
assert_that(response.data[0], instance_of(CallTranscriptionMetadata))
5656
assert_that(response.data[0].transcription_id, instance_of(str))
5757
assert_that(response.data[0].transcription_url, instance_of(str))
58+
assert_that(response.data[0].transcription_name, instance_of(str))
5859

5960
def test_get_real_time_transcription(self) -> None:
6061
"""Test case for get_real_time_transcription

0 commit comments

Comments
 (0)