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-6003 Update SDK Based on Recent Spec Changes #222

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ bandwidth/models/recording_transcription_metadata.py
bandwidth/models/recording_transcriptions.py
bandwidth/models/redirect_callback.py
bandwidth/models/redirect_method_enum.py
bandwidth/models/region.py
bandwidth/models/stir_shaken.py
bandwidth/models/tag.py
bandwidth/models/tn_lookup_request_error.py
Expand Down Expand Up @@ -195,6 +196,7 @@ docs/RecordingTranscriptions.md
docs/RecordingsApi.md
docs/RedirectCallback.md
docs/RedirectMethodEnum.md
docs/Region.md
docs/StatisticsApi.md
docs/StirShaken.md
docs/Tag.md
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ Class | Method | HTTP request | Description
- [RecordingTranscriptions](docs/RecordingTranscriptions.md)
- [RedirectCallback](docs/RedirectCallback.md)
- [RedirectMethodEnum](docs/RedirectMethodEnum.md)
- [Region](docs/Region.md)
- [StirShaken](docs/StirShaken.md)
- [Tag](docs/Tag.md)
- [TnLookupRequestError](docs/TnLookupRequestError.md)
Expand Down
60 changes: 41 additions & 19 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ paths:
- $ref: '#/components/parameters/pageToken'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/limitTotalCount'
- $ref: '#/components/parameters/region'
responses:
'200':
$ref: '#/components/responses/listMessagesResponse'
Expand Down Expand Up @@ -377,7 +378,7 @@ paths:
$ref: '#/components/requestBodies/updateCallRequest'
responses:
'200':
description: Call was successfully modified.
$ref: '#/components/responses/updateCallResponse'
'400':
$ref: '#/components/responses/voiceBadRequestError'
'401':
Expand Down Expand Up @@ -777,7 +778,7 @@ paths:
$ref: '#/components/requestBodies/updateCallRecordingRequest'
responses:
'200':
description: Recording state was successfully modified.
$ref: '#/components/responses/updateRecordingResponse'
'400':
$ref: '#/components/responses/voiceBadRequestError'
'401':
Expand Down Expand Up @@ -1324,7 +1325,7 @@ paths:
'403':
$ref: '#/components/responses/tnLookupForbiddenError'
'404':
description: Not Found
$ref: '#/components/responses/tnLookupNotFoundError'
'429':
$ref: '#/components/responses/tnLookupTooManyRequestsError'
'500':
Expand Down Expand Up @@ -1376,6 +1377,13 @@ components:
- sms
- mms
example: sms
region:
type: string
enum:
- US
- EU
example: US
default: US
fieldError:
type: object
properties:
Expand Down Expand Up @@ -2919,6 +2927,7 @@ components:
$ref: '#/components/schemas/conferenceId'
memberUrl:
type: string
format: uri
description: >-
A URL that may be used to retrieve information about or update

Expand Down Expand Up @@ -4276,6 +4285,7 @@ components:
example: my-recording-name
callUrl:
type: string
format: uri
description: The URL of the call associated with the event.
example: >-
https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
Expand Down Expand Up @@ -4735,7 +4745,7 @@ components:
schema:
$ref: '#/components/schemas/messagingRequestError'
createCallResponse:
description: Call Successfully Created
description: Created
headers:
Location:
description: The URL for further interactions with this call
Expand All @@ -4749,41 +4759,45 @@ components:
createCall Response:
$ref: '#/components/examples/createCallResponseExample'
getCallStateResponse:
description: Call found
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/callState'
updateCallResponse:
description: OK
listCallsResponse:
description: Calls retrieved successfully
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/callState'
getStatisticsResponse:
description: Statistics Found
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/accountStatistics'
updateRecordingResponse:
description: OK
listCallRecordingsResponse:
description: Recordings retrieved successfully
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/callRecordingMetadata'
getCallRecordingResponse:
description: Recording found
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/callRecordingMetadata'
downloadRecordingMediaResponse:
description: Media found
description: OK
content:
audio/vnd.wave:
schema:
Expand All @@ -4794,27 +4808,27 @@ components:
type: string
format: binary
getRecordingTranscriptionResponse:
description: Transcription found.
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/recordingTranscriptions'
listTranscriptionsResponse:
description: Transcription found.
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/callTranscriptionMetadataList'
getCallTranscriptionResponse:
description: Transcription found.
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/callTranscriptionResponse'
deleteCallTranscriptionResponse:
description: Transcription data was deleted.
description: No Content
listConferencesResponse:
description: Conferences retrieved successfully
description: OK
content:
application/json:
schema:
Expand All @@ -4825,27 +4839,27 @@ components:
listConferences Response:
$ref: '#/components/examples/listConferencesResponseExample'
getConferenceResponse:
description: Conferences retrieved successfully
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/conference'
getConferenceMemberResponse:
description: Conference member found
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/conferenceMember'
listConferenceRecordingsResponse:
description: Conference recordings retrieved successfully
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/conferenceRecordingMetadata'
getConferenceRecordingResponse:
description: Conference recording found
description: OK
content:
application/json:
schema:
Expand Down Expand Up @@ -5068,6 +5082,8 @@ components:
summary: Example Unsupported Media Type Error
value:
message: Content-Type must be application/json.
tnLookupNotFoundError:
description: Not Found
tnLookupTooManyRequestsError:
description: Too Many Requests
content:
Expand Down Expand Up @@ -5283,6 +5299,12 @@ components:
example: true
schema:
type: boolean
region:
name: region
in: query
description: The region to search in. One of US or EU.
schema:
$ref: '#/components/schemas/region'
callId:
name: callId
in: path
Expand Down
1 change: 1 addition & 0 deletions bandwidth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
from bandwidth.models.recording_transcriptions import RecordingTranscriptions
from bandwidth.models.redirect_callback import RedirectCallback
from bandwidth.models.redirect_method_enum import RedirectMethodEnum
from bandwidth.models.region import Region
from bandwidth.models.stir_shaken import StirShaken
from bandwidth.models.tag import Tag
from bandwidth.models.tn_lookup_request_error import TnLookupRequestError
Expand Down
18 changes: 18 additions & 0 deletions bandwidth/api/messages_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from bandwidth.models.message_status_enum import MessageStatusEnum
from bandwidth.models.message_type_enum import MessageTypeEnum
from bandwidth.models.messages_list import MessagesList
from bandwidth.models.region import Region

from bandwidth.api_client import ApiClient, RequestSerialized
from bandwidth.api_response import ApiResponse
Expand Down Expand Up @@ -378,6 +379,7 @@ def list_messages(
page_token: Annotated[Optional[StrictStr], Field(description="A base64 encoded value used for pagination of results.")] = None,
limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.")] = None,
limit_total_count: Annotated[Optional[StrictBool], Field(description="When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.")] = None,
region: Annotated[Optional[Region], Field(description="The region to search in. One of US or EU.")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand Down Expand Up @@ -427,6 +429,8 @@ def list_messages(
:type limit: int
:param limit_total_count: When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.
:type limit_total_count: bool
:param region: The region to search in. One of US or EU.
:type region: Region
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -466,6 +470,7 @@ def list_messages(
page_token=page_token,
limit=limit,
limit_total_count=limit_total_count,
region=region,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand Down Expand Up @@ -512,6 +517,7 @@ def list_messages_with_http_info(
page_token: Annotated[Optional[StrictStr], Field(description="A base64 encoded value used for pagination of results.")] = None,
limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.")] = None,
limit_total_count: Annotated[Optional[StrictBool], Field(description="When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.")] = None,
region: Annotated[Optional[Region], Field(description="The region to search in. One of US or EU.")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand Down Expand Up @@ -561,6 +567,8 @@ def list_messages_with_http_info(
:type limit: int
:param limit_total_count: When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.
:type limit_total_count: bool
:param region: The region to search in. One of US or EU.
:type region: Region
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -600,6 +608,7 @@ def list_messages_with_http_info(
page_token=page_token,
limit=limit,
limit_total_count=limit_total_count,
region=region,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand Down Expand Up @@ -646,6 +655,7 @@ def list_messages_without_preload_content(
page_token: Annotated[Optional[StrictStr], Field(description="A base64 encoded value used for pagination of results.")] = None,
limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.")] = None,
limit_total_count: Annotated[Optional[StrictBool], Field(description="When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.")] = None,
region: Annotated[Optional[Region], Field(description="The region to search in. One of US or EU.")] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand Down Expand Up @@ -695,6 +705,8 @@ def list_messages_without_preload_content(
:type limit: int
:param limit_total_count: When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.
:type limit_total_count: bool
:param region: The region to search in. One of US or EU.
:type region: Region
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -734,6 +746,7 @@ def list_messages_without_preload_content(
page_token=page_token,
limit=limit,
limit_total_count=limit_total_count,
region=region,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand Down Expand Up @@ -775,6 +788,7 @@ def _list_messages_serialize(
page_token,
limit,
limit_total_count,
region,
_request_auth,
_content_type,
_headers,
Expand Down Expand Up @@ -860,6 +874,10 @@ def _list_messages_serialize(

_query_params.append(('limitTotalCount', limit_total_count))

if region is not None:

_query_params.append(('region', region.value))

# process the header parameters
# process the form parameters
# process the body parameter
Expand Down
1 change: 1 addition & 0 deletions bandwidth/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
from bandwidth.models.recording_transcriptions import RecordingTranscriptions
from bandwidth.models.redirect_callback import RedirectCallback
from bandwidth.models.redirect_method_enum import RedirectMethodEnum
from bandwidth.models.region import Region
from bandwidth.models.stir_shaken import StirShaken
from bandwidth.models.tag import Tag
from bandwidth.models.tn_lookup_request_error import TnLookupRequestError
Expand Down
38 changes: 38 additions & 0 deletions bandwidth/models/region.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# coding: utf-8

"""
Bandwidth

Bandwidth's Communication APIs

The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self


class Region(str, Enum):
"""
Region
"""

"""
allowed enum values
"""
US = 'US'
EU = 'EU'

@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of Region from a JSON string"""
return cls(json.loads(json_str))


Loading