Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWI-5799 Update SDK Based on Recent Spec Changes #221

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2802,6 +2802,8 @@ components:
$ref: '#/components/schemas/mediaUrl'
transcription:
$ref: '#/components/schemas/recordingTranscriptionMetadata'
recordingName:
$ref: '#/components/schemas/recordingName'
conference:
type: object
properties:
Expand Down Expand Up @@ -3041,6 +3043,8 @@ components:
$ref: '#/components/schemas/status'
mediaUrl:
$ref: '#/components/schemas/mediaUrl'
recordingName:
$ref: '#/components/schemas/recordingName'
machineDetectionConfiguration:
type: object
description: >-
Expand Down Expand Up @@ -4266,6 +4270,10 @@ components:
type: string
description: The call id associated with the event.
example: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
recordingName:
type: string
description: A name to identify this recording.
example: my-recording-name
callUrl:
type: string
description: The URL of the call associated with the event.
Expand Down
6 changes: 4 additions & 2 deletions bandwidth/models/call_recording_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ class CallRecordingMetadata(BaseModel):
status: Optional[StrictStr] = Field(default=None, 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.")
media_url: Optional[StrictStr] = Field(default=None, description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.", alias="mediaUrl")
transcription: Optional[RecordingTranscriptionMetadata] = None
recording_name: Optional[StrictStr] = Field(default=None, description="A name to identify this recording.", alias="recordingName")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["applicationId", "accountId", "callId", "parentCallId", "recordingId", "to", "from", "transferCallerId", "transferTo", "duration", "direction", "channels", "startTime", "endTime", "fileFormat", "status", "mediaUrl", "transcription"]
__properties: ClassVar[List[str]] = ["applicationId", "accountId", "callId", "parentCallId", "recordingId", "to", "from", "transferCallerId", "transferTo", "duration", "direction", "channels", "startTime", "endTime", "fileFormat", "status", "mediaUrl", "transcription", "recordingName"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -140,7 +141,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"fileFormat": obj.get("fileFormat"),
"status": obj.get("status"),
"mediaUrl": obj.get("mediaUrl"),
"transcription": RecordingTranscriptionMetadata.from_dict(obj["transcription"]) if obj.get("transcription") is not None else None
"transcription": RecordingTranscriptionMetadata.from_dict(obj["transcription"]) if obj.get("transcription") is not None else None,
"recordingName": obj.get("recordingName")
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
6 changes: 4 additions & 2 deletions bandwidth/models/conference_recording_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ class ConferenceRecordingMetadata(BaseModel):
file_format: Optional[FileFormatEnum] = Field(default=None, alias="fileFormat")
status: Optional[StrictStr] = Field(default=None, 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.")
media_url: Optional[StrictStr] = Field(default=None, description="The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded.", alias="mediaUrl")
recording_name: Optional[StrictStr] = Field(default=None, description="A name to identify this recording.", alias="recordingName")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["accountId", "conferenceId", "name", "recordingId", "duration", "channels", "startTime", "endTime", "fileFormat", "status", "mediaUrl"]
__properties: ClassVar[List[str]] = ["accountId", "conferenceId", "name", "recordingId", "duration", "channels", "startTime", "endTime", "fileFormat", "status", "mediaUrl", "recordingName"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -116,7 +117,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"endTime": obj.get("endTime"),
"fileFormat": obj.get("fileFormat"),
"status": obj.get("status"),
"mediaUrl": obj.get("mediaUrl")
"mediaUrl": obj.get("mediaUrl"),
"recordingName": obj.get("recordingName")
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
1 change: 1 addition & 0 deletions docs/CallRecordingMetadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Name | Type | Description | Notes
**status** | **str** | 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]
**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional]
**transcription** | [**RecordingTranscriptionMetadata**](RecordingTranscriptionMetadata.md) | | [optional]
**recording_name** | **str** | A name to identify this recording. | [optional]

## Example

Expand Down
1 change: 1 addition & 0 deletions docs/ConferenceRecordingMetadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Name | Type | Description | Notes
**file_format** | [**FileFormatEnum**](FileFormatEnum.md) | | [optional]
**status** | **str** | 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]
**media_url** | **str** | The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. | [optional]
**recording_name** | **str** | A name to identify this recording. | [optional]

## Example

Expand Down
3 changes: 3 additions & 0 deletions test/unit/api/test_recordings_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def test_list_account_call_recordings(self) -> None:
assert_that(response.data[0].transcription.status, instance_of(str))
assert_that(response.data[0].transcription.completed_time, instance_of(datetime))
assert_that(response.data[0].transcription.url, starts_with('http'))
assert_that(response.data[0].recording_name, instance_of(str))

def test_list_call_recordings(self) -> None:
"""Test case for list_call_recordings
Expand Down Expand Up @@ -126,6 +127,7 @@ def test_list_call_recordings(self) -> None:
assert_that(response.data[0].transcription.status, instance_of(str))
assert_that(response.data[0].transcription.completed_time, instance_of(datetime))
assert_that(response.data[0].transcription.url, starts_with('http'))
assert_that(response.data[0].recording_name, instance_of(str))

@unittest.skip("skip due to prism error")
def test_get_call_recording(self) -> None:
Expand Down Expand Up @@ -160,6 +162,7 @@ def test_get_call_recording(self) -> None:
assert_that(response.data.transcription.status, instance_of(str))
assert_that(response.data.transcription.completed_time, instance_of(datetime))
assert_that(response.data.transcription.url, starts_with('http'))
assert_that(response.data.recording_name, instance_of(str))

def test_download_call_recording(self) -> None:
"""Test case for download_call_recording
Expand Down