From 1a853f90ebd67d7bc6da6f2da19db94aad92718d Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Tue, 21 Apr 2026 14:38:49 +0000 Subject: [PATCH 1/6] Generate SDK with OpenAPI Generator Version --- .openapi-generator/FILES | 6 + README.md | 3 + bandwidth.yml | 129 ++++++++++++++---- bandwidth/__init__.py | 6 + bandwidth/models/__init__.py | 3 + bandwidth/models/create_call.py | 4 +- bandwidth/models/create_endpoint_response.py | 12 +- bandwidth/models/endpoint_response.py | 12 +- bandwidth/models/error1.py | 114 ++++++++++++++++ bandwidth/models/error1_source.py | 107 +++++++++++++++ bandwidth/models/error_response.py | 12 +- bandwidth/models/inbound_callback.py | 4 +- .../models/inbound_callback_type_enum.py | 2 +- bandwidth/models/link1.py | 115 ++++++++++++++++ bandwidth/models/list_endpoints_response.py | 12 +- .../models/machine_detection_configuration.py | 2 +- bandwidth/models/message_request.py | 2 +- bandwidth/models/rbm_open_url_enum.py | 2 +- bandwidth/models/rbm_web_view_enum.py | 2 +- bandwidth/models/status_callback.py | 2 +- bandwidth/models/update_call.py | 2 +- docs/Callback.md | 4 +- docs/CreateCall.md | 4 +- docs/CreateEndpointResponse.md | 4 +- docs/EndpointResponse.md | 4 +- docs/EndpointsApi.md | 10 +- docs/Error1.md | 33 +++++ docs/Error1Source.md | 32 +++++ docs/ErrorResponse.md | 4 +- docs/InboundCallback.md | 4 +- docs/InboundCallbackTypeEnum.md | 2 +- docs/Link1.md | 31 +++++ docs/ListEndpointsResponse.md | 4 +- docs/MachineDetectionConfiguration.md | 2 +- docs/MessageRequest.md | 2 +- docs/RbmOpenUrlEnum.md | 2 +- docs/RbmWebViewEnum.md | 2 +- docs/StatusCallback.md | 2 +- docs/UpdateCall.md | 2 +- 39 files changed, 612 insertions(+), 89 deletions(-) create mode 100644 bandwidth/models/error1.py create mode 100644 bandwidth/models/error1_source.py create mode 100644 bandwidth/models/link1.py create mode 100644 docs/Error1.md create mode 100644 docs/Error1Source.md create mode 100644 docs/Link1.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 0cf037e9..55003ec4 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -82,6 +82,8 @@ bandwidth/models/endpoint_status_enum.py bandwidth/models/endpoint_type_enum.py bandwidth/models/endpoints.py bandwidth/models/error.py +bandwidth/models/error1.py +bandwidth/models/error1_source.py bandwidth/models/error_object.py bandwidth/models/error_response.py bandwidth/models/error_source.py @@ -99,6 +101,7 @@ bandwidth/models/initiate_callback.py bandwidth/models/latest_message_delivery_status_enum.py bandwidth/models/line_type_enum.py bandwidth/models/link.py +bandwidth/models/link1.py bandwidth/models/link_schema.py bandwidth/models/links_object.py bandwidth/models/list_endpoints_response.py @@ -282,6 +285,8 @@ docs/EndpointTypeEnum.md docs/Endpoints.md docs/EndpointsApi.md docs/Error.md +docs/Error1.md +docs/Error1Source.md docs/ErrorObject.md docs/ErrorResponse.md docs/ErrorSource.md @@ -299,6 +304,7 @@ docs/InitiateCallback.md docs/LatestMessageDeliveryStatusEnum.md docs/LineTypeEnum.md docs/Link.md +docs/Link1.md docs/LinkSchema.md docs/LinksObject.md docs/ListEndpointsResponse.md diff --git a/README.md b/README.md index 107d8960..32dff166 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,8 @@ Class | Method | HTTP request | Description - [EndpointTypeEnum](docs/EndpointTypeEnum.md) - [Endpoints](docs/Endpoints.md) - [Error](docs/Error.md) + - [Error1](docs/Error1.md) + - [Error1Source](docs/Error1Source.md) - [ErrorObject](docs/ErrorObject.md) - [ErrorResponse](docs/ErrorResponse.md) - [ErrorSource](docs/ErrorSource.md) @@ -241,6 +243,7 @@ Class | Method | HTTP request | Description - [LatestMessageDeliveryStatusEnum](docs/LatestMessageDeliveryStatusEnum.md) - [LineTypeEnum](docs/LineTypeEnum.md) - [Link](docs/Link.md) + - [Link1](docs/Link1.md) - [LinkSchema](docs/LinkSchema.md) - [LinksObject](docs/LinksObject.md) - [ListEndpointsResponse](docs/ListEndpointsResponse.md) diff --git a/bandwidth.yml b/bandwidth.yml index 4378c202..c7105f39 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -2161,7 +2161,7 @@ components: type: string description: >- The name of the Authorized Message Provider (AMP) that handled this - message. + message. In the US, this is the carrier that the message was sent to. @@ -2248,7 +2248,7 @@ components: description: >- Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and - linked to the account that is generating the message. + linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, @@ -2572,7 +2572,7 @@ components: - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn’t support WebView, this - option is used by default. + option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. enum: @@ -2585,7 +2585,7 @@ components: Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - - `FULL` WebView takes the full screen. + - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. @@ -2987,7 +2987,7 @@ components: to: type: string description: > - The destination phone number the message was sent to. + The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. @@ -3038,7 +3038,7 @@ components: client to a Bandwidth number. - `request-location-response` indicates a response to a location request - sent by the Bandwidth user's client after receiving an RBM message. + sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. @@ -3277,7 +3277,7 @@ components: nullable: true type: string description: >- - The caller display name to use when the call is created. + The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. @@ -3455,8 +3455,8 @@ components: May be cleared by setting `tag=""` - Max length 256 characters. - maxLength: 256 + Max length 4096 characters. + maxLength: 4096 example: arbitrary text here createCallResponse: type: object @@ -3833,11 +3833,11 @@ components: May be cleared by setting `tag=""`. - Max length 256 characters. + Max length 4096 characters. Not allowed if `state` is `completed`. - maxLength: 256 + maxLength: 4096 example: My Custom Tag updateCallRecording: type: object @@ -4214,7 +4214,7 @@ components: format: double description: >- When an answering machine is detected, the amount of silence (in - seconds) before assuming the message has finished playing. + seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. example: 5 @@ -5958,7 +5958,7 @@ components: format: date description: >- [DNI-Only](#section/DNI-Only). The date the phone number entered the - status described in `latestMessageDeliveryStatus`. + status described in `latestMessageDeliveryStatus`. Think of this as the "start time" for that status. @@ -7060,6 +7060,26 @@ components: required: - eventType - eventTime + link1: + type: object + properties: + href: + type: string + description: The full URL of the link. + example: >- + https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + rel: + type: string + description: The relationship of the link to the current resource. + example: self + method: + type: string + enum: + - GET + - POST + - DELETE + description: The HTTP method to use when making the request. + example: GET page: type: object properties: @@ -7085,13 +7105,57 @@ components: example: 0 required: - pageSize + error1: + type: object + properties: + id: + type: string + format: uuid + description: A unique identifier for the error. + example: 59512d87-7a92-4040-8e4a-78fb772019b9 + type: + type: string + description: The type of error. + example: resource.not_found + description: + type: string + description: A description of the error. + example: The requested resource was not found. + code: + type: string + description: A code that uniquely identifies the error. + example: '404' + source: + type: object + properties: + parameter: + type: string + description: The URI parameter that caused the error. + example: accountId + field: + type: string + description: The request body field that caused the error. + example: accountId + header: + type: string + description: The header that caused the error. + example: Authorization + reference: + type: string + description: >- + The resource ID or path to the resource (or non-existent + resource) causing the error. + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + required: + - type + - description listEndpointsResponse: type: object properties: links: type: array items: - $ref: '#/components/schemas/link' + $ref: '#/components/schemas/link1' page: $ref: '#/components/schemas/page' data: @@ -7101,7 +7165,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/error1' required: - links - data @@ -7112,13 +7176,13 @@ components: links: type: array items: - $ref: '#/components/schemas/link' + $ref: '#/components/schemas/link1' data: $ref: '#/components/schemas/endpoint' errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/error1' required: - links - data @@ -7129,13 +7193,13 @@ components: links: type: array items: - $ref: '#/components/schemas/link' + $ref: '#/components/schemas/link1' data: $ref: '#/components/schemas/createEndpointResponseData' errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/error1' required: - links - data @@ -7146,7 +7210,7 @@ components: links: type: array items: - $ref: '#/components/schemas/link' + $ref: '#/components/schemas/link1' data: type: object nullable: true @@ -7154,7 +7218,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/error1' required: - links - data @@ -7916,6 +7980,15 @@ components: $ref: '#/components/examples/unsupportedMediaTypeErrorExample' tooManyRequestsErrorResponse: description: Too Many Requests + headers: + Retry-After: + description: >- + The number of seconds the client should wait before making another + request. + required: true + schema: + type: integer + example: 900 content: application/json: schema: @@ -9137,10 +9210,10 @@ components: links: [] data: null errors: - - id: 59512d87-7a92-4040-8e4a-78fb772019b9 - type: too_many_requests - description: The client has sent too many requests in a given amount of time. - code: '429' + - type: too_many_endpoints + description: >- + Too many endpoints. Please delete an existing endpoint or wait 24 + hours for an endpoint to be removed. serviceUnavailableErrorExample: summary: Service Unavailable Error Example value: @@ -9556,12 +9629,12 @@ components: required: true description: >-

This Inbound Message Webhook is an envelope containing either a - received (MO) message to your + received (MO) message to your message-enabled Bandwidth telephone number or a multichannel - client's response to a suggestion response + client's response to a suggestion response - or location request. + or location request.

The payload type will be one of message-received, suggestion-response, or diff --git a/bandwidth/__init__.py b/bandwidth/__init__.py index 66e36a23..e09ef6e6 100644 --- a/bandwidth/__init__.py +++ b/bandwidth/__init__.py @@ -102,6 +102,8 @@ "EndpointTypeEnum", "Endpoints", "Error", + "Error1", + "Error1Source", "ErrorObject", "ErrorResponse", "ErrorSource", @@ -119,6 +121,7 @@ "LatestMessageDeliveryStatusEnum", "LineTypeEnum", "Link", + "Link1", "LinkSchema", "LinksObject", "ListEndpointsResponse", @@ -325,6 +328,8 @@ from bandwidth.models.endpoint_type_enum import EndpointTypeEnum as EndpointTypeEnum from bandwidth.models.endpoints import Endpoints as Endpoints from bandwidth.models.error import Error as Error +from bandwidth.models.error1 import Error1 as Error1 +from bandwidth.models.error1_source import Error1Source as Error1Source from bandwidth.models.error_object import ErrorObject as ErrorObject from bandwidth.models.error_response import ErrorResponse as ErrorResponse from bandwidth.models.error_source import ErrorSource as ErrorSource @@ -342,6 +347,7 @@ from bandwidth.models.latest_message_delivery_status_enum import LatestMessageDeliveryStatusEnum as LatestMessageDeliveryStatusEnum from bandwidth.models.line_type_enum import LineTypeEnum as LineTypeEnum from bandwidth.models.link import Link as Link +from bandwidth.models.link1 import Link1 as Link1 from bandwidth.models.link_schema import LinkSchema as LinkSchema from bandwidth.models.links_object import LinksObject as LinksObject from bandwidth.models.list_endpoints_response import ListEndpointsResponse as ListEndpointsResponse diff --git a/bandwidth/models/__init__.py b/bandwidth/models/__init__.py index ec247b0c..cd7fdac6 100644 --- a/bandwidth/models/__init__.py +++ b/bandwidth/models/__init__.py @@ -76,6 +76,8 @@ from bandwidth.models.endpoint_type_enum import EndpointTypeEnum from bandwidth.models.endpoints import Endpoints from bandwidth.models.error import Error +from bandwidth.models.error1 import Error1 +from bandwidth.models.error1_source import Error1Source from bandwidth.models.error_object import ErrorObject from bandwidth.models.error_response import ErrorResponse from bandwidth.models.error_source import ErrorSource @@ -93,6 +95,7 @@ from bandwidth.models.latest_message_delivery_status_enum import LatestMessageDeliveryStatusEnum from bandwidth.models.line_type_enum import LineTypeEnum from bandwidth.models.link import Link +from bandwidth.models.link1 import Link1 from bandwidth.models.link_schema import LinkSchema from bandwidth.models.links_object import LinksObject from bandwidth.models.list_endpoints_response import ListEndpointsResponse diff --git a/bandwidth/models/create_call.py b/bandwidth/models/create_call.py index a019e736..8bab5518 100644 --- a/bandwidth/models/create_call.py +++ b/bandwidth/models/create_call.py @@ -33,7 +33,7 @@ class CreateCall(BaseModel): to: StrictStr = Field(description="The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)).") var_from: StrictStr = Field(description="A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`) even if `privacy` is set to true.", alias="from") privacy: Optional[StrictBool] = Field(default=None, description="Hide the calling number. The `displayName` field can be used to customize the displayed name.") - display_name: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`.", alias="displayName") + display_name: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`.", alias="displayName") uui: Optional[StrictStr] = Field(default=None, description="A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in RFC 7433. Only 'jwt', 'base64' and 'hex' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators.") application_id: StrictStr = Field(description="The id of the application associated with the `from` number.", alias="applicationId") answer_url: Annotated[str, Field(strict=True, max_length=2048)] = Field(description="The full URL to send the Answer event to when the called party answers. This endpoint should return the first BXML document to be executed in the call. Must use `https` if specifying `username` and `password`.", alias="answerUrl") @@ -50,7 +50,7 @@ class CreateCall(BaseModel): callback_timeout: Optional[Union[Annotated[float, Field(le=25, strict=True, ge=1)], Annotated[int, Field(le=25, strict=True, ge=1)]]] = Field(default=15, description="This is the timeout (in seconds) to use when delivering webhooks for the call. Can be any numeric value (including decimals) between 1 and 25.", alias="callbackTimeout") machine_detection: Optional[MachineDetectionConfiguration] = Field(default=None, alias="machineDetection") priority: Optional[Annotated[int, Field(le=5, strict=True, ge=1)]] = Field(default=5, description="The priority of this call over other calls from your account. For example, if during a call your application needs to place a new call and bridge it with the current call, you might want to create the call with priority 1 so that it will be the next call picked off your queue, ahead of other less time sensitive calls. A lower value means higher priority, so a priority 1 call takes precedence over a priority 2 call.") - tag: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="A custom string that will be sent with all webhooks for this call unless overwritten by a future `` verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters.") + tag: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = Field(default=None, description="A custom string that will be sent with all webhooks for this call unless overwritten by a future `` verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 4096 characters.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["to", "from", "privacy", "displayName", "uui", "applicationId", "answerUrl", "answerMethod", "username", "password", "answerFallbackUrl", "answerFallbackMethod", "fallbackUsername", "fallbackPassword", "disconnectUrl", "disconnectMethod", "callTimeout", "callbackTimeout", "machineDetection", "priority", "tag"] diff --git a/bandwidth/models/create_endpoint_response.py b/bandwidth/models/create_endpoint_response.py index a230f1ba..0d7dde8a 100644 --- a/bandwidth/models/create_endpoint_response.py +++ b/bandwidth/models/create_endpoint_response.py @@ -21,8 +21,8 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List from bandwidth.models.create_endpoint_response_data import CreateEndpointResponseData -from bandwidth.models.error import Error -from bandwidth.models.link import Link +from bandwidth.models.error1 import Error1 +from bandwidth.models.link1 import Link1 from typing import Optional, Set from typing_extensions import Self @@ -30,9 +30,9 @@ class CreateEndpointResponse(BaseModel): """ CreateEndpointResponse """ # noqa: E501 - links: List[Link] + links: List[Link1] data: CreateEndpointResponseData - errors: List[Error] + errors: List[Error1] additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["links", "data", "errors"] @@ -111,9 +111,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "links": [Link.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "links": [Link1.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, "data": CreateEndpointResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None, - "errors": [Error.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + "errors": [Error1.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/endpoint_response.py b/bandwidth/models/endpoint_response.py index f2d89d88..d1a4ce7f 100644 --- a/bandwidth/models/endpoint_response.py +++ b/bandwidth/models/endpoint_response.py @@ -21,8 +21,8 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List from bandwidth.models.endpoint import Endpoint -from bandwidth.models.error import Error -from bandwidth.models.link import Link +from bandwidth.models.error1 import Error1 +from bandwidth.models.link1 import Link1 from typing import Optional, Set from typing_extensions import Self @@ -30,9 +30,9 @@ class EndpointResponse(BaseModel): """ EndpointResponse """ # noqa: E501 - links: List[Link] + links: List[Link1] data: Endpoint - errors: List[Error] + errors: List[Error1] additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["links", "data", "errors"] @@ -111,9 +111,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "links": [Link.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "links": [Link1.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, "data": Endpoint.from_dict(obj["data"]) if obj.get("data") is not None else None, - "errors": [Error.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + "errors": [Error1.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/error1.py b/bandwidth/models/error1.py new file mode 100644 index 00000000..1040e8dc --- /dev/null +++ b/bandwidth/models/error1.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from bandwidth.models.error1_source import Error1Source +from typing import Optional, Set +from typing_extensions import Self + +class Error1(BaseModel): + """ + Error1 + """ # noqa: E501 + id: Optional[UUID] = Field(default=None, description="A unique identifier for the error.") + type: StrictStr = Field(description="The type of error.") + description: StrictStr = Field(description="A description of the error.") + code: Optional[StrictStr] = Field(default=None, description="A code that uniquely identifies the error.") + source: Optional[Error1Source] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "description", "code", "source"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Error1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict['source'] = self.source.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Error1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "description": obj.get("description"), + "code": obj.get("code"), + "source": Error1Source.from_dict(obj["source"]) if obj.get("source") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/error1_source.py b/bandwidth/models/error1_source.py new file mode 100644 index 00000000..49c0fddb --- /dev/null +++ b/bandwidth/models/error1_source.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Error1Source(BaseModel): + """ + Error1Source + """ # noqa: E501 + parameter: Optional[StrictStr] = Field(default=None, description="The URI parameter that caused the error.") + var_field: Optional[StrictStr] = Field(default=None, description="The request body field that caused the error.", alias="field") + header: Optional[StrictStr] = Field(default=None, description="The header that caused the error.") + reference: Optional[StrictStr] = Field(default=None, description="The resource ID or path to the resource (or non-existent resource) causing the error.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["parameter", "field", "header", "reference"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Error1Source from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Error1Source from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "parameter": obj.get("parameter"), + "field": obj.get("field"), + "header": obj.get("header"), + "reference": obj.get("reference") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/error_response.py b/bandwidth/models/error_response.py index 9058ff78..1ee70473 100644 --- a/bandwidth/models/error_response.py +++ b/bandwidth/models/error_response.py @@ -20,8 +20,8 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from bandwidth.models.error import Error -from bandwidth.models.link import Link +from bandwidth.models.error1 import Error1 +from bandwidth.models.link1 import Link1 from typing import Optional, Set from typing_extensions import Self @@ -29,9 +29,9 @@ class ErrorResponse(BaseModel): """ ErrorResponse """ # noqa: E501 - links: List[Link] + links: List[Link1] data: Optional[Dict[str, Any]] - errors: List[Error] + errors: List[Error1] additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["links", "data", "errors"] @@ -112,9 +112,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "links": [Link.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "links": [Link1.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, "data": obj.get("data"), - "errors": [Error.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + "errors": [Error1.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/inbound_callback.py b/bandwidth/models/inbound_callback.py index f7282efd..f9875945 100644 --- a/bandwidth/models/inbound_callback.py +++ b/bandwidth/models/inbound_callback.py @@ -32,10 +32,10 @@ class InboundCallback(BaseModel): """ # noqa: E501 time: datetime type: InboundCallbackTypeEnum - to: StrictStr = Field(description="The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. ") + to: StrictStr = Field(description="The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. ") description: StrictStr = Field(description="A detailed description of the event described by the callback.") message: InboundCallbackMessage - carrier_name: Optional[StrictStr] = Field(default=None, description="The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled.", alias="carrierName") + carrier_name: Optional[StrictStr] = Field(default=None, description="The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled.", alias="carrierName") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message", "carrierName"] diff --git a/bandwidth/models/inbound_callback_type_enum.py b/bandwidth/models/inbound_callback_type_enum.py index 69527df3..5efb01c4 100644 --- a/bandwidth/models/inbound_callback_type_enum.py +++ b/bandwidth/models/inbound_callback_type_enum.py @@ -21,7 +21,7 @@ class InboundCallbackTypeEnum(str, Enum): """ - The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. + The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. """ """ diff --git a/bandwidth/models/link1.py b/bandwidth/models/link1.py new file mode 100644 index 00000000..02b526f1 --- /dev/null +++ b/bandwidth/models/link1.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Link1(BaseModel): + """ + Link1 + """ # noqa: E501 + href: Optional[StrictStr] = Field(default=None, description="The full URL of the link.") + rel: Optional[StrictStr] = Field(default=None, description="The relationship of the link to the current resource.") + method: Optional[StrictStr] = Field(default=None, description="The HTTP method to use when making the request.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["href", "rel", "method"] + + @field_validator('method') + def method_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['GET', 'POST', 'DELETE']): + raise ValueError("must be one of enum values ('GET', 'POST', 'DELETE')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Link1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Link1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "href": obj.get("href"), + "rel": obj.get("rel"), + "method": obj.get("method") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/list_endpoints_response.py b/bandwidth/models/list_endpoints_response.py index ece66219..65053b7c 100644 --- a/bandwidth/models/list_endpoints_response.py +++ b/bandwidth/models/list_endpoints_response.py @@ -21,8 +21,8 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from bandwidth.models.endpoints import Endpoints -from bandwidth.models.error import Error -from bandwidth.models.link import Link +from bandwidth.models.error1 import Error1 +from bandwidth.models.link1 import Link1 from bandwidth.models.page import Page from typing import Optional, Set from typing_extensions import Self @@ -31,10 +31,10 @@ class ListEndpointsResponse(BaseModel): """ ListEndpointsResponse """ # noqa: E501 - links: List[Link] + links: List[Link1] page: Optional[Page] = None data: List[Endpoints] - errors: List[Error] + errors: List[Error1] additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["links", "page", "data", "errors"] @@ -120,10 +120,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "links": [Link.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "links": [Link1.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, "page": Page.from_dict(obj["page"]) if obj.get("page") is not None else None, "data": [Endpoints.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, - "errors": [Error.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + "errors": [Error1.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/machine_detection_configuration.py b/bandwidth/models/machine_detection_configuration.py index 51701138..befeedd4 100644 --- a/bandwidth/models/machine_detection_configuration.py +++ b/bandwidth/models/machine_detection_configuration.py @@ -35,7 +35,7 @@ class MachineDetectionConfiguration(BaseModel): silence_timeout: Optional[Union[StrictFloat, StrictInt]] = Field(default=10, description="If no speech is detected in this period, a callback with a 'silence' result is sent.", alias="silenceTimeout") speech_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(default=10, description="When speech has ended and a result couldn't be determined based on the audio content itself, this value is used to determine if the speaker is a machine based on the speech duration. If the length of the speech detected is greater than or equal to this threshold, the result will be 'answering-machine'. If the length of speech detected is below this threshold, the result will be 'human'.", alias="speechThreshold") speech_end_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(default=5, description="Amount of silence (in seconds) before assuming the callee has finished speaking.", alias="speechEndThreshold") - machine_speech_end_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value.", alias="machineSpeechEndThreshold") + machine_speech_end_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value.", alias="machineSpeechEndThreshold") delay_result: Optional[StrictBool] = Field(default=False, description="If set to 'true' and if an answering machine is detected, the 'answering-machine' callback will be delayed until the machine is done speaking, or an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately.", alias="delayResult") callback_url: Optional[Annotated[str, Field(strict=True, max_length=2048)]] = Field(default=None, description="The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode.", alias="callbackUrl") callback_method: Optional[CallbackMethodEnum] = Field(default=CallbackMethodEnum.POST, alias="callbackMethod") diff --git a/bandwidth/models/message_request.py b/bandwidth/models/message_request.py index 44e6ffb3..416b6b74 100644 --- a/bandwidth/models/message_request.py +++ b/bandwidth/models/message_request.py @@ -32,7 +32,7 @@ class MessageRequest(BaseModel): """ # noqa: E501 application_id: StrictStr = Field(description="The ID of the Application your from number or senderId is associated with in the Bandwidth App.", alias="applicationId") to: List[StrictStr] = Field(description="The phone number(s) the message should be sent to in E164 format.") - var_from: StrictStr = Field(description="Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter.", alias="from") + var_from: StrictStr = Field(description="Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter.", alias="from") text: Optional[Annotated[str, Field(strict=True, max_length=2048)]] = Field(default=None, description="The contents of the text message. Must be 2048 characters or less.") media: Optional[List[Annotated[str, Field(strict=True, max_length=4096)]]] = Field(default=None, description="A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters.") tag: Optional[StrictStr] = Field(default=None, description="A custom string that will be included in callback events of the message. Max 1024 characters.") diff --git a/bandwidth/models/rbm_open_url_enum.py b/bandwidth/models/rbm_open_url_enum.py index e195781c..6ccce730 100644 --- a/bandwidth/models/rbm_open_url_enum.py +++ b/bandwidth/models/rbm_open_url_enum.py @@ -21,7 +21,7 @@ class RbmOpenUrlEnum(str, Enum): """ - Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn’t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. + Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn’t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. """ """ diff --git a/bandwidth/models/rbm_web_view_enum.py b/bandwidth/models/rbm_web_view_enum.py index 71f697c2..1ebbd851 100644 --- a/bandwidth/models/rbm_web_view_enum.py +++ b/bandwidth/models/rbm_web_view_enum.py @@ -21,7 +21,7 @@ class RbmWebViewEnum(str, Enum): """ - Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. + Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. """ """ diff --git a/bandwidth/models/status_callback.py b/bandwidth/models/status_callback.py index 58dc18aa..2a726876 100644 --- a/bandwidth/models/status_callback.py +++ b/bandwidth/models/status_callback.py @@ -37,7 +37,7 @@ class StatusCallback(BaseModel): description: StrictStr = Field(description="A detailed description of the event described by the callback.") message: StatusCallbackMessage error_code: Optional[StrictInt] = Field(default=None, description="Optional error code, applicable only when type is `message-failed`.", alias="errorCode") - carrier_name: Optional[StrictStr] = Field(default=None, description="The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled.", alias="carrierName") + carrier_name: Optional[StrictStr] = Field(default=None, description="The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled.", alias="carrierName") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["time", "eventTime", "type", "to", "description", "message", "errorCode", "carrierName"] diff --git a/bandwidth/models/update_call.py b/bandwidth/models/update_call.py index 2f17bfef..cac9d7b0 100644 --- a/bandwidth/models/update_call.py +++ b/bandwidth/models/update_call.py @@ -39,7 +39,7 @@ class UpdateCall(BaseModel): redirect_fallback_method: Optional[RedirectMethodEnum] = Field(default=RedirectMethodEnum.POST, alias="redirectFallbackMethod") fallback_username: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth username.", alias="fallbackUsername") fallback_password: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(default=None, description="Basic auth password.", alias="fallbackPassword") - tag: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [``](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`.") + tag: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = Field(default=None, description="A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [``](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 4096 characters. Not allowed if `state` is `completed`.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["state", "redirectUrl", "redirectMethod", "username", "password", "redirectFallbackUrl", "redirectFallbackMethod", "fallbackUsername", "fallbackPassword", "tag"] diff --git a/docs/Callback.md b/docs/Callback.md index f9c2822e..f9923bf8 100644 --- a/docs/Callback.md +++ b/docs/Callback.md @@ -9,11 +9,11 @@ Name | Type | Description | Notes **time** | **datetime** | | **event_time** | **datetime** | Represents the time at which the message was read, for `message-read` callbacks. | [optional] **type** | [**InboundCallbackTypeEnum**](InboundCallbackTypeEnum.md) | | -**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | +**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | **description** | **str** | A detailed description of the event described by the callback. | **message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | **error_code** | **int** | Optional error code, applicable only when type is `message-failed`. | [optional] -**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] +**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] ## Example diff --git a/docs/CreateCall.md b/docs/CreateCall.md index d9c18a34..57f449ee 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **to** | **str** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). | **var_from** | **str** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`) even if `privacy` is set to true. | **privacy** | **bool** | Hide the calling number. The `displayName` field can be used to customize the displayed name. | [optional] -**display_name** | **str** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] +**display_name** | **str** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] **uui** | **str** | A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt', 'base64' and 'hex' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] **application_id** | **str** | The id of the application associated with the `from` number. | **answer_url** | **str** | The full URL to send the <a href='/docs/voice/webhooks/answer'>Answer</a> event to when the called party answers. This endpoint should return the first <a href='/docs/voice/bxml'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password`. | @@ -25,7 +25,7 @@ Name | Type | Description | Notes **callback_timeout** | **float** | This is the timeout (in seconds) to use when delivering webhooks for the call. Can be any numeric value (including decimals) between 1 and 25. | [optional] [default to 15] **machine_detection** | [**MachineDetectionConfiguration**](MachineDetectionConfiguration.md) | | [optional] **priority** | **int** | The priority of this call over other calls from your account. For example, if during a call your application needs to place a new call and bridge it with the current call, you might want to create the call with priority 1 so that it will be the next call picked off your queue, ahead of other less time sensitive calls. A lower value means higher priority, so a priority 1 call takes precedence over a priority 2 call. | [optional] [default to 5] -**tag** | **str** | A custom string that will be sent with all webhooks for this call unless overwritten by a future <a href='/docs/voice/bxml/tag'>`<Tag>`</a> verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 256 characters. | [optional] +**tag** | **str** | A custom string that will be sent with all webhooks for this call unless overwritten by a future <a href='/docs/voice/bxml/tag'>`<Tag>`</a> verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 4096 characters. | [optional] ## Example diff --git a/docs/CreateEndpointResponse.md b/docs/CreateEndpointResponse.md index feeb16d2..972a2333 100644 --- a/docs/CreateEndpointResponse.md +++ b/docs/CreateEndpointResponse.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**List[Link]**](Link.md) | | +**links** | [**List[Link1]**](Link1.md) | | **data** | [**CreateEndpointResponseData**](CreateEndpointResponseData.md) | | -**errors** | [**List[Error]**](Error.md) | | +**errors** | [**List[Error1]**](Error1.md) | | ## Example diff --git a/docs/EndpointResponse.md b/docs/EndpointResponse.md index 530b77f4..d3e813ac 100644 --- a/docs/EndpointResponse.md +++ b/docs/EndpointResponse.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**List[Link]**](Link.md) | | +**links** | [**List[Link1]**](Link1.md) | | **data** | [**Endpoint**](Endpoint.md) | | -**errors** | [**List[Error]**](Error.md) | | +**errors** | [**List[Error1]**](Error1.md) | | ## Example diff --git a/docs/EndpointsApi.md b/docs/EndpointsApi.md index c515469d..a2433c39 100644 --- a/docs/EndpointsApi.md +++ b/docs/EndpointsApi.md @@ -103,7 +103,7 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | - | +**429** | Too Many Requests | * Retry-After - The number of seconds the client should wait before making another request.
| **500** | Service Unavailable | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -196,7 +196,7 @@ void (empty response body) **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | - | +**429** | Too Many Requests | * Retry-After - The number of seconds the client should wait before making another request.
| **500** | Service Unavailable | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -292,7 +292,7 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | - | +**429** | Too Many Requests | * Retry-After - The number of seconds the client should wait before making another request.
| **500** | Service Unavailable | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -396,7 +396,7 @@ Name | Type | Description | Notes **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | - | +**429** | Too Many Requests | * Retry-After - The number of seconds the client should wait before making another request.
| **500** | Service Unavailable | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -491,7 +491,7 @@ void (empty response body) **404** | Not Found | - | **405** | Method Not Allowed | - | **415** | Unsupported Media Type | - | -**429** | Too Many Requests | - | +**429** | Too Many Requests | * Retry-After - The number of seconds the client should wait before making another request.
| **500** | Service Unavailable | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/Error1.md b/docs/Error1.md new file mode 100644 index 00000000..cfaa4ac0 --- /dev/null +++ b/docs/Error1.md @@ -0,0 +1,33 @@ +# Error1 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique identifier for the error. | [optional] +**type** | **str** | The type of error. | +**description** | **str** | A description of the error. | +**code** | **str** | A code that uniquely identifies the error. | [optional] +**source** | [**Error1Source**](Error1Source.md) | | [optional] + +## Example + +```python +from bandwidth.models.error1 import Error1 + +# TODO update the JSON string below +json = "{}" +# create an instance of Error1 from a JSON string +error1_instance = Error1.from_json(json) +# print the JSON string representation of the object +print(Error1.to_json()) + +# convert the object into a dict +error1_dict = error1_instance.to_dict() +# create an instance of Error1 from a dict +error1_from_dict = Error1.from_dict(error1_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Error1Source.md b/docs/Error1Source.md new file mode 100644 index 00000000..18cda89c --- /dev/null +++ b/docs/Error1Source.md @@ -0,0 +1,32 @@ +# Error1Source + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parameter** | **str** | The URI parameter that caused the error. | [optional] +**var_field** | **str** | The request body field that caused the error. | [optional] +**header** | **str** | The header that caused the error. | [optional] +**reference** | **str** | The resource ID or path to the resource (or non-existent resource) causing the error. | [optional] + +## Example + +```python +from bandwidth.models.error1_source import Error1Source + +# TODO update the JSON string below +json = "{}" +# create an instance of Error1Source from a JSON string +error1_source_instance = Error1Source.from_json(json) +# print the JSON string representation of the object +print(Error1Source.to_json()) + +# convert the object into a dict +error1_source_dict = error1_source_instance.to_dict() +# create an instance of Error1Source from a dict +error1_source_from_dict = Error1Source.from_dict(error1_source_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md index 60910a8b..25bc8180 100644 --- a/docs/ErrorResponse.md +++ b/docs/ErrorResponse.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**List[Link]**](Link.md) | | +**links** | [**List[Link1]**](Link1.md) | | **data** | **object** | | -**errors** | [**List[Error]**](Error.md) | | +**errors** | [**List[Error1]**](Error1.md) | | ## Example diff --git a/docs/InboundCallback.md b/docs/InboundCallback.md index 40163194..ad9e2f47 100644 --- a/docs/InboundCallback.md +++ b/docs/InboundCallback.md @@ -8,10 +8,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **datetime** | | **type** | [**InboundCallbackTypeEnum**](InboundCallbackTypeEnum.md) | | -**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | +**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | **description** | **str** | A detailed description of the event described by the callback. | **message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | -**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] +**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] ## Example diff --git a/docs/InboundCallbackTypeEnum.md b/docs/InboundCallbackTypeEnum.md index f1259de4..690a01f6 100644 --- a/docs/InboundCallbackTypeEnum.md +++ b/docs/InboundCallbackTypeEnum.md @@ -1,6 +1,6 @@ # InboundCallbackTypeEnum -The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. +The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. ## Enum diff --git a/docs/Link1.md b/docs/Link1.md new file mode 100644 index 00000000..673a22d5 --- /dev/null +++ b/docs/Link1.md @@ -0,0 +1,31 @@ +# Link1 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | The full URL of the link. | [optional] +**rel** | **str** | The relationship of the link to the current resource. | [optional] +**method** | **str** | The HTTP method to use when making the request. | [optional] + +## Example + +```python +from bandwidth.models.link1 import Link1 + +# TODO update the JSON string below +json = "{}" +# create an instance of Link1 from a JSON string +link1_instance = Link1.from_json(json) +# print the JSON string representation of the object +print(Link1.to_json()) + +# convert the object into a dict +link1_dict = link1_instance.to_dict() +# create an instance of Link1 from a dict +link1_from_dict = Link1.from_dict(link1_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListEndpointsResponse.md b/docs/ListEndpointsResponse.md index 5fe2c0ec..7c66a320 100644 --- a/docs/ListEndpointsResponse.md +++ b/docs/ListEndpointsResponse.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**List[Link]**](Link.md) | | +**links** | [**List[Link1]**](Link1.md) | | **page** | [**Page**](Page.md) | | [optional] **data** | [**List[Endpoints]**](Endpoints.md) | | -**errors** | [**List[Error]**](Error.md) | | +**errors** | [**List[Error1]**](Error1.md) | | ## Example diff --git a/docs/MachineDetectionConfiguration.md b/docs/MachineDetectionConfiguration.md index 158dd706..e3f7a7a7 100644 --- a/docs/MachineDetectionConfiguration.md +++ b/docs/MachineDetectionConfiguration.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **silence_timeout** | **float** | If no speech is detected in this period, a callback with a 'silence' result is sent. | [optional] [default to 10] **speech_threshold** | **float** | When speech has ended and a result couldn't be determined based on the audio content itself, this value is used to determine if the speaker is a machine based on the speech duration. If the length of the speech detected is greater than or equal to this threshold, the result will be 'answering-machine'. If the length of speech detected is below this threshold, the result will be 'human'. | [optional] [default to 10] **speech_end_threshold** | **float** | Amount of silence (in seconds) before assuming the callee has finished speaking. | [optional] [default to 5] -**machine_speech_end_threshold** | **float** | When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. | [optional] +**machine_speech_end_threshold** | **float** | When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. | [optional] **delay_result** | **bool** | If set to 'true' and if an answering machine is detected, the 'answering-machine' callback will be delayed until the machine is done speaking, or an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately. | [optional] [default to False] **callback_url** | **str** | The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode. | [optional] **callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] [default to CallbackMethodEnum.POST] diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md index ae5664e9..093335e6 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **application_id** | **str** | The ID of the Application your from number or senderId is associated with in the Bandwidth App. | **to** | **List[str]** | The phone number(s) the message should be sent to in E164 format. | -**var_from** | **str** | Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. | +**var_from** | **str** | Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. | **text** | **str** | The contents of the text message. Must be 2048 characters or less. | [optional] **media** | **List[str]** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] **tag** | **str** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] diff --git a/docs/RbmOpenUrlEnum.md b/docs/RbmOpenUrlEnum.md index db35154f..19bac259 100644 --- a/docs/RbmOpenUrlEnum.md +++ b/docs/RbmOpenUrlEnum.md @@ -1,6 +1,6 @@ # RbmOpenUrlEnum -Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn’t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. +Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn’t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. ## Enum diff --git a/docs/RbmWebViewEnum.md b/docs/RbmWebViewEnum.md index b794fcb5..a7753830 100644 --- a/docs/RbmWebViewEnum.md +++ b/docs/RbmWebViewEnum.md @@ -1,6 +1,6 @@ # RbmWebViewEnum -Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. +Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. ## Enum diff --git a/docs/StatusCallback.md b/docs/StatusCallback.md index df8e9720..953741e1 100644 --- a/docs/StatusCallback.md +++ b/docs/StatusCallback.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **description** | **str** | A detailed description of the event described by the callback. | **message** | [**StatusCallbackMessage**](StatusCallbackMessage.md) | | **error_code** | **int** | Optional error code, applicable only when type is `message-failed`. | [optional] -**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] +**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] ## Example diff --git a/docs/UpdateCall.md b/docs/UpdateCall.md index be0a78a5..200c60df 100644 --- a/docs/UpdateCall.md +++ b/docs/UpdateCall.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **redirect_fallback_method** | [**RedirectMethodEnum**](RedirectMethodEnum.md) | | [optional] [default to RedirectMethodEnum.POST] **fallback_username** | **str** | Basic auth username. | [optional] **fallback_password** | **str** | Basic auth password. | [optional] -**tag** | **str** | A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`. | [optional] +**tag** | **str** | A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 4096 characters. Not allowed if `state` is `completed`. | [optional] ## Example From a0cd0bbb34f594960ba3717bd543310878c4c929 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 27 Apr 2026 11:00:35 -0400 Subject: [PATCH 2/6] regenerate with updated specs --- .openapi-generator/FILES | 20 +- README.md | 10 +- bandwidth.yml | 114 ++++----- bandwidth/__init__.py | 20 +- bandwidth/api/endpoints_api.py | 240 +++++++++--------- bandwidth/models/__init__.py | 10 +- bandwidth/models/{error1.py => brtc_error.py} | 14 +- ...ror_response.py => brtc_error_response.py} | 20 +- ...{error1_source.py => brtc_error_source.py} | 8 +- bandwidth/models/{link1.py => brtc_link.py} | 20 +- bandwidth/models/create_call.py | 2 +- bandwidth/models/create_endpoint_response.py | 12 +- bandwidth/models/endpoint_response.py | 12 +- bandwidth/models/inbound_callback.py | 4 +- .../models/inbound_callback_type_enum.py | 2 +- bandwidth/models/list_endpoints_response.py | 12 +- bandwidth/models/lookup_result.py | 2 +- .../models/machine_detection_configuration.py | 2 +- bandwidth/models/message_request.py | 2 +- bandwidth/models/rbm_open_url_enum.py | 2 +- bandwidth/models/rbm_web_view_enum.py | 2 +- bandwidth/models/status_callback.py | 2 +- ...error.py => webhook_subscription_error.py} | 8 +- .../models/webhook_subscriptions_list_body.py | 6 +- docs/{Error1.md => BrtcError.md} | 18 +- docs/BrtcErrorResponse.md | 31 +++ docs/{Error1Source.md => BrtcErrorSource.md} | 16 +- docs/{Link1.md => BrtcLink.md} | 16 +- docs/Callback.md | 4 +- docs/CreateCall.md | 2 +- docs/CreateEndpointResponse.md | 4 +- docs/EndpointResponse.md | 4 +- docs/ErrorResponse.md | 31 --- docs/InboundCallback.md | 4 +- docs/InboundCallbackTypeEnum.md | 2 +- docs/ListEndpointsResponse.md | 4 +- docs/LookupResult.md | 2 +- docs/MachineDetectionConfiguration.md | 2 +- docs/MessageRequest.md | 2 +- docs/RbmOpenUrlEnum.md | 2 +- docs/RbmWebViewEnum.md | 2 +- docs/StatusCallback.md | 2 +- .../{Error.md => WebhookSubscriptionError.md} | 16 +- docs/WebhookSubscriptionsListBody.md | 2 +- 44 files changed, 350 insertions(+), 362 deletions(-) rename bandwidth/models/{error1.py => brtc_error.py} (90%) rename bandwidth/models/{error_response.py => brtc_error_response.py} (86%) rename bandwidth/models/{error1_source.py => brtc_error_source.py} (94%) rename bandwidth/models/{link1.py => brtc_link.py} (85%) rename bandwidth/models/{error.py => webhook_subscription_error.py} (94%) rename docs/{Error1.md => BrtcError.md} (62%) create mode 100644 docs/BrtcErrorResponse.md rename docs/{Error1Source.md => BrtcErrorSource.md} (65%) rename docs/{Link1.md => BrtcLink.md} (67%) delete mode 100644 docs/ErrorResponse.md rename docs/{Error.md => WebhookSubscriptionError.md} (52%) diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 55003ec4..50e7d8f3 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -28,6 +28,10 @@ bandwidth/models/async_lookup_request.py bandwidth/models/blocked_webhook.py bandwidth/models/bridge_complete_callback.py bandwidth/models/bridge_target_complete_callback.py +bandwidth/models/brtc_error.py +bandwidth/models/brtc_error_response.py +bandwidth/models/brtc_error_source.py +bandwidth/models/brtc_link.py bandwidth/models/business_entity_type_enum.py bandwidth/models/business_registration_type_enum.py bandwidth/models/call_direction_enum.py @@ -81,11 +85,7 @@ bandwidth/models/endpoint_response.py bandwidth/models/endpoint_status_enum.py bandwidth/models/endpoint_type_enum.py bandwidth/models/endpoints.py -bandwidth/models/error.py -bandwidth/models/error1.py -bandwidth/models/error1_source.py bandwidth/models/error_object.py -bandwidth/models/error_response.py bandwidth/models/error_source.py bandwidth/models/failure_webhook.py bandwidth/models/field_error.py @@ -101,7 +101,6 @@ bandwidth/models/initiate_callback.py bandwidth/models/latest_message_delivery_status_enum.py bandwidth/models/line_type_enum.py bandwidth/models/link.py -bandwidth/models/link1.py bandwidth/models/link_schema.py bandwidth/models/links_object.py bandwidth/models/list_endpoints_response.py @@ -215,6 +214,7 @@ bandwidth/models/voice_api_error.py bandwidth/models/voice_code_response.py bandwidth/models/webhook_subscription.py bandwidth/models/webhook_subscription_basic_authentication.py +bandwidth/models/webhook_subscription_error.py bandwidth/models/webhook_subscription_request_schema.py bandwidth/models/webhook_subscription_type_enum.py bandwidth/models/webhook_subscriptions_list_body.py @@ -228,6 +228,10 @@ docs/AsyncLookupRequest.md docs/BlockedWebhook.md docs/BridgeCompleteCallback.md docs/BridgeTargetCompleteCallback.md +docs/BrtcError.md +docs/BrtcErrorResponse.md +docs/BrtcErrorSource.md +docs/BrtcLink.md docs/BusinessEntityTypeEnum.md docs/BusinessRegistrationTypeEnum.md docs/CallDirectionEnum.md @@ -284,11 +288,7 @@ docs/EndpointStatusEnum.md docs/EndpointTypeEnum.md docs/Endpoints.md docs/EndpointsApi.md -docs/Error.md -docs/Error1.md -docs/Error1Source.md docs/ErrorObject.md -docs/ErrorResponse.md docs/ErrorSource.md docs/FailureWebhook.md docs/FieldError.md @@ -304,7 +304,6 @@ docs/InitiateCallback.md docs/LatestMessageDeliveryStatusEnum.md docs/LineTypeEnum.md docs/Link.md -docs/Link1.md docs/LinkSchema.md docs/LinksObject.md docs/ListEndpointsResponse.md @@ -427,6 +426,7 @@ docs/VoiceApiError.md docs/VoiceCodeResponse.md docs/WebhookSubscription.md docs/WebhookSubscriptionBasicAuthentication.md +docs/WebhookSubscriptionError.md docs/WebhookSubscriptionRequestSchema.md docs/WebhookSubscriptionTypeEnum.md docs/WebhookSubscriptionsListBody.md diff --git a/README.md b/README.md index 32dff166..b965734b 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,10 @@ Class | Method | HTTP request | Description - [BlockedWebhook](docs/BlockedWebhook.md) - [BridgeCompleteCallback](docs/BridgeCompleteCallback.md) - [BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md) + - [BrtcError](docs/BrtcError.md) + - [BrtcErrorResponse](docs/BrtcErrorResponse.md) + - [BrtcErrorSource](docs/BrtcErrorSource.md) + - [BrtcLink](docs/BrtcLink.md) - [BusinessEntityTypeEnum](docs/BusinessEntityTypeEnum.md) - [BusinessRegistrationTypeEnum](docs/BusinessRegistrationTypeEnum.md) - [CallDirectionEnum](docs/CallDirectionEnum.md) @@ -223,11 +227,7 @@ Class | Method | HTTP request | Description - [EndpointStatusEnum](docs/EndpointStatusEnum.md) - [EndpointTypeEnum](docs/EndpointTypeEnum.md) - [Endpoints](docs/Endpoints.md) - - [Error](docs/Error.md) - - [Error1](docs/Error1.md) - - [Error1Source](docs/Error1Source.md) - [ErrorObject](docs/ErrorObject.md) - - [ErrorResponse](docs/ErrorResponse.md) - [ErrorSource](docs/ErrorSource.md) - [FailureWebhook](docs/FailureWebhook.md) - [FieldError](docs/FieldError.md) @@ -243,7 +243,6 @@ Class | Method | HTTP request | Description - [LatestMessageDeliveryStatusEnum](docs/LatestMessageDeliveryStatusEnum.md) - [LineTypeEnum](docs/LineTypeEnum.md) - [Link](docs/Link.md) - - [Link1](docs/Link1.md) - [LinkSchema](docs/LinkSchema.md) - [LinksObject](docs/LinksObject.md) - [ListEndpointsResponse](docs/ListEndpointsResponse.md) @@ -357,6 +356,7 @@ Class | Method | HTTP request | Description - [VoiceCodeResponse](docs/VoiceCodeResponse.md) - [WebhookSubscription](docs/WebhookSubscription.md) - [WebhookSubscriptionBasicAuthentication](docs/WebhookSubscriptionBasicAuthentication.md) + - [WebhookSubscriptionError](docs/WebhookSubscriptionError.md) - [WebhookSubscriptionRequestSchema](docs/WebhookSubscriptionRequestSchema.md) - [WebhookSubscriptionTypeEnum](docs/WebhookSubscriptionTypeEnum.md) - [WebhookSubscriptionsListBody](docs/WebhookSubscriptionsListBody.md) diff --git a/bandwidth.yml b/bandwidth.yml index c7105f39..6ad54bc1 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -2161,7 +2161,7 @@ components: type: string description: >- The name of the Authorized Message Provider (AMP) that handled this - message. + message. In the US, this is the carrier that the message was sent to. @@ -2248,7 +2248,7 @@ components: description: >- Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and - linked to the account that is generating the message. + linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, @@ -2571,8 +2571,8 @@ components: Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If - application is not set or the device doesn’t support WebView, this - option is used by default. + application is not set or the device doesn't support WebView, this + option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. enum: @@ -2585,7 +2585,7 @@ components: Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - - `FULL` WebView takes the full screen. + - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. @@ -2987,7 +2987,7 @@ components: to: type: string description: > - The destination phone number the message was sent to. + The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. @@ -3038,7 +3038,7 @@ components: client to a Bandwidth number. - `request-location-response` indicates a response to a location request - sent by the Bandwidth user's client after receiving an RBM message. + sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. @@ -3277,7 +3277,7 @@ components: nullable: true type: string description: >- - The caller display name to use when the call is created. + The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. @@ -4214,7 +4214,7 @@ components: format: double description: >- When an answering machine is detected, the amount of silence (in - seconds) before assuming the message has finished playing. + seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. example: 5 @@ -5958,7 +5958,7 @@ components: format: date description: >- [DNI-Only](#section/DNI-Only). The date the phone number entered the - status described in `latestMessageDeliveryStatus`. + status described in `latestMessageDeliveryStatus`. Think of this as the "start time" for that status. @@ -6635,7 +6635,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/webhookSubscriptionError' data: items: $ref: '#/components/schemas/webhookSubscription' @@ -6661,7 +6661,7 @@ components: If more results exist than specified by 'size', this link return the last page of result. type: string - error: + webhookSubscriptionError: type: object properties: code: @@ -7060,7 +7060,7 @@ components: required: - eventType - eventTime - link1: + brtcLink: type: object properties: href: @@ -7074,10 +7074,6 @@ components: example: self method: type: string - enum: - - GET - - POST - - DELETE description: The HTTP method to use when making the request. example: GET page: @@ -7105,7 +7101,7 @@ components: example: 0 required: - pageSize - error1: + brtcError: type: object properties: id: @@ -7126,36 +7122,38 @@ components: description: A code that uniquely identifies the error. example: '404' source: - type: object - properties: - parameter: - type: string - description: The URI parameter that caused the error. - example: accountId - field: - type: string - description: The request body field that caused the error. - example: accountId - header: - type: string - description: The header that caused the error. - example: Authorization - reference: - type: string - description: >- - The resource ID or path to the resource (or non-existent - resource) causing the error. - example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + $ref: '#/components/schemas/brtcErrorSource' required: - type - description + brtcErrorSource: + type: object + properties: + parameter: + type: string + description: The URI parameter that caused the error. + example: accountId + field: + type: string + description: The request body field that caused the error. + example: accountId + header: + type: string + description: The header that caused the error. + example: Authorization + reference: + type: string + description: >- + The resource ID or path to the resource (or non-existent resource) + causing the error. + example: e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 listEndpointsResponse: type: object properties: links: type: array items: - $ref: '#/components/schemas/link1' + $ref: '#/components/schemas/brtcLink' page: $ref: '#/components/schemas/page' data: @@ -7165,7 +7163,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error1' + $ref: '#/components/schemas/brtcError' required: - links - data @@ -7176,13 +7174,13 @@ components: links: type: array items: - $ref: '#/components/schemas/link1' + $ref: '#/components/schemas/brtcLink' data: $ref: '#/components/schemas/endpoint' errors: type: array items: - $ref: '#/components/schemas/error1' + $ref: '#/components/schemas/brtcError' required: - links - data @@ -7193,24 +7191,24 @@ components: links: type: array items: - $ref: '#/components/schemas/link1' + $ref: '#/components/schemas/brtcLink' data: $ref: '#/components/schemas/createEndpointResponseData' errors: type: array items: - $ref: '#/components/schemas/error1' + $ref: '#/components/schemas/brtcError' required: - links - data - errors - errorResponse: + brtcErrorResponse: type: object properties: links: type: array items: - $ref: '#/components/schemas/link1' + $ref: '#/components/schemas/brtcLink' data: type: object nullable: true @@ -7218,7 +7216,7 @@ components: errors: type: array items: - $ref: '#/components/schemas/error1' + $ref: '#/components/schemas/brtcError' required: - links - data @@ -7929,7 +7927,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: badRequestErrorExample: $ref: '#/components/examples/badRequestErrorExample' @@ -7938,7 +7936,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: unauthorizedErrorExample: $ref: '#/components/examples/unauthorizedErrorExample' @@ -7947,7 +7945,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: forbiddenErrorExample: $ref: '#/components/examples/forbiddenErrorExample' @@ -7956,7 +7954,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: notFoundErrorExample: $ref: '#/components/examples/notFoundErrorExample' @@ -7965,7 +7963,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: methodNotAllowedErrorExample: $ref: '#/components/examples/methodNotAllowedErrorExample' @@ -7974,7 +7972,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: unsuppotedMediaTypeErrorExample: $ref: '#/components/examples/unsupportedMediaTypeErrorExample' @@ -7992,7 +7990,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: tooManyRequestsErrorExample: $ref: '#/components/examples/tooManyRequestsErrorExample' @@ -8001,7 +7999,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/errorResponse' + $ref: '#/components/schemas/brtcErrorResponse' examples: serviceUnavailableErrorExample: $ref: '#/components/examples/serviceUnavailableErrorExample' @@ -9629,12 +9627,12 @@ components: required: true description: >-

This Inbound Message Webhook is an envelope containing either a - received (MO) message to your + received (MO) message to your message-enabled Bandwidth telephone number or a multichannel - client's response to a suggestion response + client's response to a suggestion response - or location request. + or location request.

The payload type will be one of message-received, suggestion-response, or diff --git a/bandwidth/__init__.py b/bandwidth/__init__.py index e09ef6e6..13602e40 100644 --- a/bandwidth/__init__.py +++ b/bandwidth/__init__.py @@ -48,6 +48,10 @@ "BlockedWebhook", "BridgeCompleteCallback", "BridgeTargetCompleteCallback", + "BrtcError", + "BrtcErrorResponse", + "BrtcErrorSource", + "BrtcLink", "BusinessEntityTypeEnum", "BusinessRegistrationTypeEnum", "CallDirectionEnum", @@ -101,11 +105,7 @@ "EndpointStatusEnum", "EndpointTypeEnum", "Endpoints", - "Error", - "Error1", - "Error1Source", "ErrorObject", - "ErrorResponse", "ErrorSource", "FailureWebhook", "FieldError", @@ -121,7 +121,6 @@ "LatestMessageDeliveryStatusEnum", "LineTypeEnum", "Link", - "Link1", "LinkSchema", "LinksObject", "ListEndpointsResponse", @@ -235,6 +234,7 @@ "VoiceCodeResponse", "WebhookSubscription", "WebhookSubscriptionBasicAuthentication", + "WebhookSubscriptionError", "WebhookSubscriptionRequestSchema", "WebhookSubscriptionTypeEnum", "WebhookSubscriptionsListBody", @@ -274,6 +274,10 @@ from bandwidth.models.blocked_webhook import BlockedWebhook as BlockedWebhook from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback as BridgeCompleteCallback from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback as BridgeTargetCompleteCallback +from bandwidth.models.brtc_error import BrtcError as BrtcError +from bandwidth.models.brtc_error_response import BrtcErrorResponse as BrtcErrorResponse +from bandwidth.models.brtc_error_source import BrtcErrorSource as BrtcErrorSource +from bandwidth.models.brtc_link import BrtcLink as BrtcLink from bandwidth.models.business_entity_type_enum import BusinessEntityTypeEnum as BusinessEntityTypeEnum from bandwidth.models.business_registration_type_enum import BusinessRegistrationTypeEnum as BusinessRegistrationTypeEnum from bandwidth.models.call_direction_enum import CallDirectionEnum as CallDirectionEnum @@ -327,11 +331,7 @@ from bandwidth.models.endpoint_status_enum import EndpointStatusEnum as EndpointStatusEnum from bandwidth.models.endpoint_type_enum import EndpointTypeEnum as EndpointTypeEnum from bandwidth.models.endpoints import Endpoints as Endpoints -from bandwidth.models.error import Error as Error -from bandwidth.models.error1 import Error1 as Error1 -from bandwidth.models.error1_source import Error1Source as Error1Source from bandwidth.models.error_object import ErrorObject as ErrorObject -from bandwidth.models.error_response import ErrorResponse as ErrorResponse from bandwidth.models.error_source import ErrorSource as ErrorSource from bandwidth.models.failure_webhook import FailureWebhook as FailureWebhook from bandwidth.models.field_error import FieldError as FieldError @@ -347,7 +347,6 @@ from bandwidth.models.latest_message_delivery_status_enum import LatestMessageDeliveryStatusEnum as LatestMessageDeliveryStatusEnum from bandwidth.models.line_type_enum import LineTypeEnum as LineTypeEnum from bandwidth.models.link import Link as Link -from bandwidth.models.link1 import Link1 as Link1 from bandwidth.models.link_schema import LinkSchema as LinkSchema from bandwidth.models.links_object import LinksObject as LinksObject from bandwidth.models.list_endpoints_response import ListEndpointsResponse as ListEndpointsResponse @@ -461,6 +460,7 @@ from bandwidth.models.voice_code_response import VoiceCodeResponse as VoiceCodeResponse from bandwidth.models.webhook_subscription import WebhookSubscription as WebhookSubscription from bandwidth.models.webhook_subscription_basic_authentication import WebhookSubscriptionBasicAuthentication as WebhookSubscriptionBasicAuthentication +from bandwidth.models.webhook_subscription_error import WebhookSubscriptionError as WebhookSubscriptionError from bandwidth.models.webhook_subscription_request_schema import WebhookSubscriptionRequestSchema as WebhookSubscriptionRequestSchema from bandwidth.models.webhook_subscription_type_enum import WebhookSubscriptionTypeEnum as WebhookSubscriptionTypeEnum from bandwidth.models.webhook_subscriptions_list_body import WebhookSubscriptionsListBody as WebhookSubscriptionsListBody diff --git a/bandwidth/api/endpoints_api.py b/bandwidth/api/endpoints_api.py index e8b26ba3..506a77fa 100644 --- a/bandwidth/api/endpoints_api.py +++ b/bandwidth/api/endpoints_api.py @@ -104,14 +104,14 @@ def create_endpoint( _response_types_map: Dict[str, Optional[str]] = { '201': "CreateEndpointResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -183,14 +183,14 @@ def create_endpoint_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '201': "CreateEndpointResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -262,14 +262,14 @@ def create_endpoint_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '201': "CreateEndpointResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -421,14 +421,14 @@ def delete_endpoint( _response_types_map: Dict[str, Optional[str]] = { '204': None, - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -500,14 +500,14 @@ def delete_endpoint_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '204': None, - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -579,14 +579,14 @@ def delete_endpoint_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '204': None, - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -725,14 +725,14 @@ def get_endpoint( _response_types_map: Dict[str, Optional[str]] = { '200': "EndpointResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -804,14 +804,14 @@ def get_endpoint_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "EndpointResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -883,14 +883,14 @@ def get_endpoint_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "EndpointResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1041,14 +1041,14 @@ def list_endpoints( _response_types_map: Dict[str, Optional[str]] = { '200': "ListEndpointsResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1132,14 +1132,14 @@ def list_endpoints_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ListEndpointsResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1223,14 +1223,14 @@ def list_endpoints_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ListEndpointsResponse", - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1390,14 +1390,14 @@ def update_endpoint_bxml( _response_types_map: Dict[str, Optional[str]] = { '204': None, - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1473,14 +1473,14 @@ def update_endpoint_bxml_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '204': None, - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1556,14 +1556,14 @@ def update_endpoint_bxml_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '204': None, - '400': "ErrorResponse", - '401': "ErrorResponse", - '403': "ErrorResponse", - '404': "ErrorResponse", - '405': "ErrorResponse", - '415': "ErrorResponse", - '429': "ErrorResponse", - '500': "ErrorResponse", + '400': "BrtcErrorResponse", + '401': "BrtcErrorResponse", + '403': "BrtcErrorResponse", + '404': "BrtcErrorResponse", + '405': "BrtcErrorResponse", + '415': "BrtcErrorResponse", + '429': "BrtcErrorResponse", + '500': "BrtcErrorResponse", } response_data = self.api_client.call_api( *_param, diff --git a/bandwidth/models/__init__.py b/bandwidth/models/__init__.py index cd7fdac6..9e15825d 100644 --- a/bandwidth/models/__init__.py +++ b/bandwidth/models/__init__.py @@ -22,6 +22,10 @@ from bandwidth.models.blocked_webhook import BlockedWebhook from bandwidth.models.bridge_complete_callback import BridgeCompleteCallback from bandwidth.models.bridge_target_complete_callback import BridgeTargetCompleteCallback +from bandwidth.models.brtc_error import BrtcError +from bandwidth.models.brtc_error_response import BrtcErrorResponse +from bandwidth.models.brtc_error_source import BrtcErrorSource +from bandwidth.models.brtc_link import BrtcLink from bandwidth.models.business_entity_type_enum import BusinessEntityTypeEnum from bandwidth.models.business_registration_type_enum import BusinessRegistrationTypeEnum from bandwidth.models.call_direction_enum import CallDirectionEnum @@ -75,11 +79,7 @@ from bandwidth.models.endpoint_status_enum import EndpointStatusEnum from bandwidth.models.endpoint_type_enum import EndpointTypeEnum from bandwidth.models.endpoints import Endpoints -from bandwidth.models.error import Error -from bandwidth.models.error1 import Error1 -from bandwidth.models.error1_source import Error1Source from bandwidth.models.error_object import ErrorObject -from bandwidth.models.error_response import ErrorResponse from bandwidth.models.error_source import ErrorSource from bandwidth.models.failure_webhook import FailureWebhook from bandwidth.models.field_error import FieldError @@ -95,7 +95,6 @@ from bandwidth.models.latest_message_delivery_status_enum import LatestMessageDeliveryStatusEnum from bandwidth.models.line_type_enum import LineTypeEnum from bandwidth.models.link import Link -from bandwidth.models.link1 import Link1 from bandwidth.models.link_schema import LinkSchema from bandwidth.models.links_object import LinksObject from bandwidth.models.list_endpoints_response import ListEndpointsResponse @@ -209,6 +208,7 @@ from bandwidth.models.voice_code_response import VoiceCodeResponse from bandwidth.models.webhook_subscription import WebhookSubscription from bandwidth.models.webhook_subscription_basic_authentication import WebhookSubscriptionBasicAuthentication +from bandwidth.models.webhook_subscription_error import WebhookSubscriptionError from bandwidth.models.webhook_subscription_request_schema import WebhookSubscriptionRequestSchema from bandwidth.models.webhook_subscription_type_enum import WebhookSubscriptionTypeEnum from bandwidth.models.webhook_subscriptions_list_body import WebhookSubscriptionsListBody diff --git a/bandwidth/models/error1.py b/bandwidth/models/brtc_error.py similarity index 90% rename from bandwidth/models/error1.py rename to bandwidth/models/brtc_error.py index 1040e8dc..30c7c8ce 100644 --- a/bandwidth/models/error1.py +++ b/bandwidth/models/brtc_error.py @@ -21,19 +21,19 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from uuid import UUID -from bandwidth.models.error1_source import Error1Source +from bandwidth.models.brtc_error_source import BrtcErrorSource from typing import Optional, Set from typing_extensions import Self -class Error1(BaseModel): +class BrtcError(BaseModel): """ - Error1 + BrtcError """ # noqa: E501 id: Optional[UUID] = Field(default=None, description="A unique identifier for the error.") type: StrictStr = Field(description="The type of error.") description: StrictStr = Field(description="A description of the error.") code: Optional[StrictStr] = Field(default=None, description="A code that uniquely identifies the error.") - source: Optional[Error1Source] = None + source: Optional[BrtcErrorSource] = None additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "type", "description", "code", "source"] @@ -55,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Error1 from a JSON string""" + """Create an instance of BrtcError from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -90,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Error1 from a dict""" + """Create an instance of BrtcError from a dict""" if obj is None: return None @@ -102,7 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "type": obj.get("type"), "description": obj.get("description"), "code": obj.get("code"), - "source": Error1Source.from_dict(obj["source"]) if obj.get("source") is not None else None + "source": BrtcErrorSource.from_dict(obj["source"]) if obj.get("source") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/error_response.py b/bandwidth/models/brtc_error_response.py similarity index 86% rename from bandwidth/models/error_response.py rename to bandwidth/models/brtc_error_response.py index 1ee70473..b7492185 100644 --- a/bandwidth/models/error_response.py +++ b/bandwidth/models/brtc_error_response.py @@ -20,18 +20,18 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from bandwidth.models.error1 import Error1 -from bandwidth.models.link1 import Link1 +from bandwidth.models.brtc_error import BrtcError +from bandwidth.models.brtc_link import BrtcLink from typing import Optional, Set from typing_extensions import Self -class ErrorResponse(BaseModel): +class BrtcErrorResponse(BaseModel): """ - ErrorResponse + BrtcErrorResponse """ # noqa: E501 - links: List[Link1] + links: List[BrtcLink] data: Optional[Dict[str, Any]] - errors: List[Error1] + errors: List[BrtcError] additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["links", "data", "errors"] @@ -53,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ErrorResponse from a JSON string""" + """Create an instance of BrtcErrorResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -104,7 +104,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ErrorResponse from a dict""" + """Create an instance of BrtcErrorResponse from a dict""" if obj is None: return None @@ -112,9 +112,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "links": [Link1.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "links": [BrtcLink.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, "data": obj.get("data"), - "errors": [Error1.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + "errors": [BrtcError.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/error1_source.py b/bandwidth/models/brtc_error_source.py similarity index 94% rename from bandwidth/models/error1_source.py rename to bandwidth/models/brtc_error_source.py index 49c0fddb..41bfe9a8 100644 --- a/bandwidth/models/error1_source.py +++ b/bandwidth/models/brtc_error_source.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class Error1Source(BaseModel): +class BrtcErrorSource(BaseModel): """ - Error1Source + BrtcErrorSource """ # noqa: E501 parameter: Optional[StrictStr] = Field(default=None, description="The URI parameter that caused the error.") var_field: Optional[StrictStr] = Field(default=None, description="The request body field that caused the error.", alias="field") @@ -52,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Error1Source from a JSON string""" + """Create an instance of BrtcErrorSource from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -84,7 +84,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Error1Source from a dict""" + """Create an instance of BrtcErrorSource from a dict""" if obj is None: return None diff --git a/bandwidth/models/link1.py b/bandwidth/models/brtc_link.py similarity index 85% rename from bandwidth/models/link1.py rename to bandwidth/models/brtc_link.py index 02b526f1..65f43ac3 100644 --- a/bandwidth/models/link1.py +++ b/bandwidth/models/brtc_link.py @@ -18,14 +18,14 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class Link1(BaseModel): +class BrtcLink(BaseModel): """ - Link1 + BrtcLink """ # noqa: E501 href: Optional[StrictStr] = Field(default=None, description="The full URL of the link.") rel: Optional[StrictStr] = Field(default=None, description="The relationship of the link to the current resource.") @@ -33,16 +33,6 @@ class Link1(BaseModel): additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["href", "rel", "method"] - @field_validator('method') - def method_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['GET', 'POST', 'DELETE']): - raise ValueError("must be one of enum values ('GET', 'POST', 'DELETE')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -61,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Link1 from a JSON string""" + """Create an instance of BrtcLink from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -93,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Link1 from a dict""" + """Create an instance of BrtcLink from a dict""" if obj is None: return None diff --git a/bandwidth/models/create_call.py b/bandwidth/models/create_call.py index 8bab5518..f47876e0 100644 --- a/bandwidth/models/create_call.py +++ b/bandwidth/models/create_call.py @@ -33,7 +33,7 @@ class CreateCall(BaseModel): to: StrictStr = Field(description="The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)).") var_from: StrictStr = Field(description="A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`) even if `privacy` is set to true.", alias="from") privacy: Optional[StrictBool] = Field(default=None, description="Hide the calling number. The `displayName` field can be used to customize the displayed name.") - display_name: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`.", alias="displayName") + display_name: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(default=None, description="The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`.", alias="displayName") uui: Optional[StrictStr] = Field(default=None, description="A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in RFC 7433. Only 'jwt', 'base64' and 'hex' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators.") application_id: StrictStr = Field(description="The id of the application associated with the `from` number.", alias="applicationId") answer_url: Annotated[str, Field(strict=True, max_length=2048)] = Field(description="The full URL to send the Answer event to when the called party answers. This endpoint should return the first BXML document to be executed in the call. Must use `https` if specifying `username` and `password`.", alias="answerUrl") diff --git a/bandwidth/models/create_endpoint_response.py b/bandwidth/models/create_endpoint_response.py index 0d7dde8a..c87761d7 100644 --- a/bandwidth/models/create_endpoint_response.py +++ b/bandwidth/models/create_endpoint_response.py @@ -20,9 +20,9 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List +from bandwidth.models.brtc_error import BrtcError +from bandwidth.models.brtc_link import BrtcLink from bandwidth.models.create_endpoint_response_data import CreateEndpointResponseData -from bandwidth.models.error1 import Error1 -from bandwidth.models.link1 import Link1 from typing import Optional, Set from typing_extensions import Self @@ -30,9 +30,9 @@ class CreateEndpointResponse(BaseModel): """ CreateEndpointResponse """ # noqa: E501 - links: List[Link1] + links: List[BrtcLink] data: CreateEndpointResponseData - errors: List[Error1] + errors: List[BrtcError] additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["links", "data", "errors"] @@ -111,9 +111,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "links": [Link1.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "links": [BrtcLink.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, "data": CreateEndpointResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None, - "errors": [Error1.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + "errors": [BrtcError.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/endpoint_response.py b/bandwidth/models/endpoint_response.py index d1a4ce7f..67e9bd4c 100644 --- a/bandwidth/models/endpoint_response.py +++ b/bandwidth/models/endpoint_response.py @@ -20,9 +20,9 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List +from bandwidth.models.brtc_error import BrtcError +from bandwidth.models.brtc_link import BrtcLink from bandwidth.models.endpoint import Endpoint -from bandwidth.models.error1 import Error1 -from bandwidth.models.link1 import Link1 from typing import Optional, Set from typing_extensions import Self @@ -30,9 +30,9 @@ class EndpointResponse(BaseModel): """ EndpointResponse """ # noqa: E501 - links: List[Link1] + links: List[BrtcLink] data: Endpoint - errors: List[Error1] + errors: List[BrtcError] additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["links", "data", "errors"] @@ -111,9 +111,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "links": [Link1.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "links": [BrtcLink.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, "data": Endpoint.from_dict(obj["data"]) if obj.get("data") is not None else None, - "errors": [Error1.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + "errors": [BrtcError.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/inbound_callback.py b/bandwidth/models/inbound_callback.py index f9875945..f7282efd 100644 --- a/bandwidth/models/inbound_callback.py +++ b/bandwidth/models/inbound_callback.py @@ -32,10 +32,10 @@ class InboundCallback(BaseModel): """ # noqa: E501 time: datetime type: InboundCallbackTypeEnum - to: StrictStr = Field(description="The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. ") + to: StrictStr = Field(description="The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. ") description: StrictStr = Field(description="A detailed description of the event described by the callback.") message: InboundCallbackMessage - carrier_name: Optional[StrictStr] = Field(default=None, description="The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled.", alias="carrierName") + carrier_name: Optional[StrictStr] = Field(default=None, description="The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled.", alias="carrierName") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message", "carrierName"] diff --git a/bandwidth/models/inbound_callback_type_enum.py b/bandwidth/models/inbound_callback_type_enum.py index 5efb01c4..69527df3 100644 --- a/bandwidth/models/inbound_callback_type_enum.py +++ b/bandwidth/models/inbound_callback_type_enum.py @@ -21,7 +21,7 @@ class InboundCallbackTypeEnum(str, Enum): """ - The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. + The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. """ """ diff --git a/bandwidth/models/list_endpoints_response.py b/bandwidth/models/list_endpoints_response.py index 65053b7c..e83f0134 100644 --- a/bandwidth/models/list_endpoints_response.py +++ b/bandwidth/models/list_endpoints_response.py @@ -20,9 +20,9 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional +from bandwidth.models.brtc_error import BrtcError +from bandwidth.models.brtc_link import BrtcLink from bandwidth.models.endpoints import Endpoints -from bandwidth.models.error1 import Error1 -from bandwidth.models.link1 import Link1 from bandwidth.models.page import Page from typing import Optional, Set from typing_extensions import Self @@ -31,10 +31,10 @@ class ListEndpointsResponse(BaseModel): """ ListEndpointsResponse """ # noqa: E501 - links: List[Link1] + links: List[BrtcLink] page: Optional[Page] = None data: List[Endpoints] - errors: List[Error1] + errors: List[BrtcError] additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["links", "page", "data", "errors"] @@ -120,10 +120,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "links": [Link1.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "links": [BrtcLink.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, "page": Page.from_dict(obj["page"]) if obj.get("page") is not None else None, "data": [Endpoints.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, - "errors": [Error1.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + "errors": [BrtcError.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/lookup_result.py b/bandwidth/models/lookup_result.py index 34f348e5..521759b3 100644 --- a/bandwidth/models/lookup_result.py +++ b/bandwidth/models/lookup_result.py @@ -40,7 +40,7 @@ class LookupResult(BaseModel): deactivation_date: Optional[StrictStr] = Field(default=None, description="[DNI-Only](#section/DNI-Only). The datetime the carrier reported a deactivation event.", alias="deactivationDate") deactivation_event: Optional[DeactivationEventEnum] = Field(default=None, alias="deactivationEvent") latest_message_delivery_status: Optional[LatestMessageDeliveryStatusEnum] = Field(default=None, alias="latestMessageDeliveryStatus") - initial_message_delivery_status_date: Optional[date] = Field(default=None, description="[DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes.", alias="initialMessageDeliveryStatusDate") + initial_message_delivery_status_date: Optional[date] = Field(default=None, description="[DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes.", alias="initialMessageDeliveryStatusDate") latest_message_delivery_status_date: Optional[date] = Field(default=None, description="[DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes.", alias="latestMessageDeliveryStatusDate") rcs_enabled: Optional[StrictBool] = Field(default=None, description="[RCS-Only](#section/RCS-Only). Indicates whether the phone number is capable of receiving RCS messages. Value will be null if account has RCS, but no value was returned. Absent when account does not have RCS. ", alias="rcsEnabled") additional_properties: Dict[str, Any] = {} diff --git a/bandwidth/models/machine_detection_configuration.py b/bandwidth/models/machine_detection_configuration.py index befeedd4..51701138 100644 --- a/bandwidth/models/machine_detection_configuration.py +++ b/bandwidth/models/machine_detection_configuration.py @@ -35,7 +35,7 @@ class MachineDetectionConfiguration(BaseModel): silence_timeout: Optional[Union[StrictFloat, StrictInt]] = Field(default=10, description="If no speech is detected in this period, a callback with a 'silence' result is sent.", alias="silenceTimeout") speech_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(default=10, description="When speech has ended and a result couldn't be determined based on the audio content itself, this value is used to determine if the speaker is a machine based on the speech duration. If the length of the speech detected is greater than or equal to this threshold, the result will be 'answering-machine'. If the length of speech detected is below this threshold, the result will be 'human'.", alias="speechThreshold") speech_end_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(default=5, description="Amount of silence (in seconds) before assuming the callee has finished speaking.", alias="speechEndThreshold") - machine_speech_end_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value.", alias="machineSpeechEndThreshold") + machine_speech_end_threshold: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value.", alias="machineSpeechEndThreshold") delay_result: Optional[StrictBool] = Field(default=False, description="If set to 'true' and if an answering machine is detected, the 'answering-machine' callback will be delayed until the machine is done speaking, or an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately.", alias="delayResult") callback_url: Optional[Annotated[str, Field(strict=True, max_length=2048)]] = Field(default=None, description="The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode.", alias="callbackUrl") callback_method: Optional[CallbackMethodEnum] = Field(default=CallbackMethodEnum.POST, alias="callbackMethod") diff --git a/bandwidth/models/message_request.py b/bandwidth/models/message_request.py index 416b6b74..44e6ffb3 100644 --- a/bandwidth/models/message_request.py +++ b/bandwidth/models/message_request.py @@ -32,7 +32,7 @@ class MessageRequest(BaseModel): """ # noqa: E501 application_id: StrictStr = Field(description="The ID of the Application your from number or senderId is associated with in the Bandwidth App.", alias="applicationId") to: List[StrictStr] = Field(description="The phone number(s) the message should be sent to in E164 format.") - var_from: StrictStr = Field(description="Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter.", alias="from") + var_from: StrictStr = Field(description="Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter.", alias="from") text: Optional[Annotated[str, Field(strict=True, max_length=2048)]] = Field(default=None, description="The contents of the text message. Must be 2048 characters or less.") media: Optional[List[Annotated[str, Field(strict=True, max_length=4096)]]] = Field(default=None, description="A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters.") tag: Optional[StrictStr] = Field(default=None, description="A custom string that will be included in callback events of the message. Max 1024 characters.") diff --git a/bandwidth/models/rbm_open_url_enum.py b/bandwidth/models/rbm_open_url_enum.py index 6ccce730..3121edfc 100644 --- a/bandwidth/models/rbm_open_url_enum.py +++ b/bandwidth/models/rbm_open_url_enum.py @@ -21,7 +21,7 @@ class RbmOpenUrlEnum(str, Enum): """ - Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn’t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. + Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn't support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. """ """ diff --git a/bandwidth/models/rbm_web_view_enum.py b/bandwidth/models/rbm_web_view_enum.py index 1ebbd851..71f697c2 100644 --- a/bandwidth/models/rbm_web_view_enum.py +++ b/bandwidth/models/rbm_web_view_enum.py @@ -21,7 +21,7 @@ class RbmWebViewEnum(str, Enum): """ - Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. + Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. """ """ diff --git a/bandwidth/models/status_callback.py b/bandwidth/models/status_callback.py index 2a726876..58dc18aa 100644 --- a/bandwidth/models/status_callback.py +++ b/bandwidth/models/status_callback.py @@ -37,7 +37,7 @@ class StatusCallback(BaseModel): description: StrictStr = Field(description="A detailed description of the event described by the callback.") message: StatusCallbackMessage error_code: Optional[StrictInt] = Field(default=None, description="Optional error code, applicable only when type is `message-failed`.", alias="errorCode") - carrier_name: Optional[StrictStr] = Field(default=None, description="The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled.", alias="carrierName") + carrier_name: Optional[StrictStr] = Field(default=None, description="The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled.", alias="carrierName") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["time", "eventTime", "type", "to", "description", "message", "errorCode", "carrierName"] diff --git a/bandwidth/models/error.py b/bandwidth/models/webhook_subscription_error.py similarity index 94% rename from bandwidth/models/error.py rename to bandwidth/models/webhook_subscription_error.py index 33ac3e86..67be76da 100644 --- a/bandwidth/models/error.py +++ b/bandwidth/models/webhook_subscription_error.py @@ -24,9 +24,9 @@ from typing import Optional, Set from typing_extensions import Self -class Error(BaseModel): +class WebhookSubscriptionError(BaseModel): """ - Error + WebhookSubscriptionError """ # noqa: E501 code: Optional[StrictInt] = None description: Optional[StrictStr] = None @@ -52,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Error from a JSON string""" + """Create an instance of WebhookSubscriptionError from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -91,7 +91,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Error from a dict""" + """Create an instance of WebhookSubscriptionError from a dict""" if obj is None: return None diff --git a/bandwidth/models/webhook_subscriptions_list_body.py b/bandwidth/models/webhook_subscriptions_list_body.py index 21cbeaec..68817c6e 100644 --- a/bandwidth/models/webhook_subscriptions_list_body.py +++ b/bandwidth/models/webhook_subscriptions_list_body.py @@ -20,9 +20,9 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from bandwidth.models.error import Error from bandwidth.models.links_object import LinksObject from bandwidth.models.webhook_subscription import WebhookSubscription +from bandwidth.models.webhook_subscription_error import WebhookSubscriptionError from typing import Optional, Set from typing_extensions import Self @@ -31,7 +31,7 @@ class WebhookSubscriptionsListBody(BaseModel): A list of all webhook subscriptions registered for this account ID for this particular feature (unpaginated). """ # noqa: E501 links: Optional[LinksObject] = None - errors: Optional[List[Error]] = None + errors: Optional[List[WebhookSubscriptionError]] = None data: List[WebhookSubscription] additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["links", "errors", "data"] @@ -112,7 +112,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "links": LinksObject.from_dict(obj["links"]) if obj.get("links") is not None else None, - "errors": [Error.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None, + "errors": [WebhookSubscriptionError.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None, "data": [WebhookSubscription.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None }) # store additional fields in additional_properties diff --git a/docs/Error1.md b/docs/BrtcError.md similarity index 62% rename from docs/Error1.md rename to docs/BrtcError.md index cfaa4ac0..69c132d1 100644 --- a/docs/Error1.md +++ b/docs/BrtcError.md @@ -1,4 +1,4 @@ -# Error1 +# BrtcError ## Properties @@ -9,24 +9,24 @@ Name | Type | Description | Notes **type** | **str** | The type of error. | **description** | **str** | A description of the error. | **code** | **str** | A code that uniquely identifies the error. | [optional] -**source** | [**Error1Source**](Error1Source.md) | | [optional] +**source** | [**BrtcErrorSource**](BrtcErrorSource.md) | | [optional] ## Example ```python -from bandwidth.models.error1 import Error1 +from bandwidth.models.brtc_error import BrtcError # TODO update the JSON string below json = "{}" -# create an instance of Error1 from a JSON string -error1_instance = Error1.from_json(json) +# create an instance of BrtcError from a JSON string +brtc_error_instance = BrtcError.from_json(json) # print the JSON string representation of the object -print(Error1.to_json()) +print(BrtcError.to_json()) # convert the object into a dict -error1_dict = error1_instance.to_dict() -# create an instance of Error1 from a dict -error1_from_dict = Error1.from_dict(error1_dict) +brtc_error_dict = brtc_error_instance.to_dict() +# create an instance of BrtcError from a dict +brtc_error_from_dict = BrtcError.from_dict(brtc_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BrtcErrorResponse.md b/docs/BrtcErrorResponse.md new file mode 100644 index 00000000..9298def5 --- /dev/null +++ b/docs/BrtcErrorResponse.md @@ -0,0 +1,31 @@ +# BrtcErrorResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**List[BrtcLink]**](BrtcLink.md) | | +**data** | **object** | | +**errors** | [**List[BrtcError]**](BrtcError.md) | | + +## Example + +```python +from bandwidth.models.brtc_error_response import BrtcErrorResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of BrtcErrorResponse from a JSON string +brtc_error_response_instance = BrtcErrorResponse.from_json(json) +# print the JSON string representation of the object +print(BrtcErrorResponse.to_json()) + +# convert the object into a dict +brtc_error_response_dict = brtc_error_response_instance.to_dict() +# create an instance of BrtcErrorResponse from a dict +brtc_error_response_from_dict = BrtcErrorResponse.from_dict(brtc_error_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Error1Source.md b/docs/BrtcErrorSource.md similarity index 65% rename from docs/Error1Source.md rename to docs/BrtcErrorSource.md index 18cda89c..feef4cb0 100644 --- a/docs/Error1Source.md +++ b/docs/BrtcErrorSource.md @@ -1,4 +1,4 @@ -# Error1Source +# BrtcErrorSource ## Properties @@ -13,19 +13,19 @@ Name | Type | Description | Notes ## Example ```python -from bandwidth.models.error1_source import Error1Source +from bandwidth.models.brtc_error_source import BrtcErrorSource # TODO update the JSON string below json = "{}" -# create an instance of Error1Source from a JSON string -error1_source_instance = Error1Source.from_json(json) +# create an instance of BrtcErrorSource from a JSON string +brtc_error_source_instance = BrtcErrorSource.from_json(json) # print the JSON string representation of the object -print(Error1Source.to_json()) +print(BrtcErrorSource.to_json()) # convert the object into a dict -error1_source_dict = error1_source_instance.to_dict() -# create an instance of Error1Source from a dict -error1_source_from_dict = Error1Source.from_dict(error1_source_dict) +brtc_error_source_dict = brtc_error_source_instance.to_dict() +# create an instance of BrtcErrorSource from a dict +brtc_error_source_from_dict = BrtcErrorSource.from_dict(brtc_error_source_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Link1.md b/docs/BrtcLink.md similarity index 67% rename from docs/Link1.md rename to docs/BrtcLink.md index 673a22d5..1ec0dddc 100644 --- a/docs/Link1.md +++ b/docs/BrtcLink.md @@ -1,4 +1,4 @@ -# Link1 +# BrtcLink ## Properties @@ -12,19 +12,19 @@ Name | Type | Description | Notes ## Example ```python -from bandwidth.models.link1 import Link1 +from bandwidth.models.brtc_link import BrtcLink # TODO update the JSON string below json = "{}" -# create an instance of Link1 from a JSON string -link1_instance = Link1.from_json(json) +# create an instance of BrtcLink from a JSON string +brtc_link_instance = BrtcLink.from_json(json) # print the JSON string representation of the object -print(Link1.to_json()) +print(BrtcLink.to_json()) # convert the object into a dict -link1_dict = link1_instance.to_dict() -# create an instance of Link1 from a dict -link1_from_dict = Link1.from_dict(link1_dict) +brtc_link_dict = brtc_link_instance.to_dict() +# create an instance of BrtcLink from a dict +brtc_link_from_dict = BrtcLink.from_dict(brtc_link_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Callback.md b/docs/Callback.md index f9923bf8..f9c2822e 100644 --- a/docs/Callback.md +++ b/docs/Callback.md @@ -9,11 +9,11 @@ Name | Type | Description | Notes **time** | **datetime** | | **event_time** | **datetime** | Represents the time at which the message was read, for `message-read` callbacks. | [optional] **type** | [**InboundCallbackTypeEnum**](InboundCallbackTypeEnum.md) | | -**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | +**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | **description** | **str** | A detailed description of the event described by the callback. | **message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | **error_code** | **int** | Optional error code, applicable only when type is `message-failed`. | [optional] -**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] +**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] ## Example diff --git a/docs/CreateCall.md b/docs/CreateCall.md index 57f449ee..5b7bb813 100644 --- a/docs/CreateCall.md +++ b/docs/CreateCall.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **to** | **str** | The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)). | **var_from** | **str** | A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`) even if `privacy` is set to true. | **privacy** | **bool** | Hide the calling number. The `displayName` field can be used to customize the displayed name. | [optional] -**display_name** | **str** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] +**display_name** | **str** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] **uui** | **str** | A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt', 'base64' and 'hex' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] **application_id** | **str** | The id of the application associated with the `from` number. | **answer_url** | **str** | The full URL to send the <a href='/docs/voice/webhooks/answer'>Answer</a> event to when the called party answers. This endpoint should return the first <a href='/docs/voice/bxml'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password`. | diff --git a/docs/CreateEndpointResponse.md b/docs/CreateEndpointResponse.md index 972a2333..a22e49c1 100644 --- a/docs/CreateEndpointResponse.md +++ b/docs/CreateEndpointResponse.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**List[Link1]**](Link1.md) | | +**links** | [**List[BrtcLink]**](BrtcLink.md) | | **data** | [**CreateEndpointResponseData**](CreateEndpointResponseData.md) | | -**errors** | [**List[Error1]**](Error1.md) | | +**errors** | [**List[BrtcError]**](BrtcError.md) | | ## Example diff --git a/docs/EndpointResponse.md b/docs/EndpointResponse.md index d3e813ac..e70c702b 100644 --- a/docs/EndpointResponse.md +++ b/docs/EndpointResponse.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**List[Link1]**](Link1.md) | | +**links** | [**List[BrtcLink]**](BrtcLink.md) | | **data** | [**Endpoint**](Endpoint.md) | | -**errors** | [**List[Error1]**](Error1.md) | | +**errors** | [**List[BrtcError]**](BrtcError.md) | | ## Example diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md deleted file mode 100644 index 25bc8180..00000000 --- a/docs/ErrorResponse.md +++ /dev/null @@ -1,31 +0,0 @@ -# ErrorResponse - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**links** | [**List[Link1]**](Link1.md) | | -**data** | **object** | | -**errors** | [**List[Error1]**](Error1.md) | | - -## Example - -```python -from bandwidth.models.error_response import ErrorResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of ErrorResponse from a JSON string -error_response_instance = ErrorResponse.from_json(json) -# print the JSON string representation of the object -print(ErrorResponse.to_json()) - -# convert the object into a dict -error_response_dict = error_response_instance.to_dict() -# create an instance of ErrorResponse from a dict -error_response_from_dict = ErrorResponse.from_dict(error_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/InboundCallback.md b/docs/InboundCallback.md index ad9e2f47..40163194 100644 --- a/docs/InboundCallback.md +++ b/docs/InboundCallback.md @@ -8,10 +8,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **datetime** | | **type** | [**InboundCallbackTypeEnum**](InboundCallbackTypeEnum.md) | | -**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | +**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | **description** | **str** | A detailed description of the event described by the callback. | **message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | -**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] +**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] ## Example diff --git a/docs/InboundCallbackTypeEnum.md b/docs/InboundCallbackTypeEnum.md index 690a01f6..f1259de4 100644 --- a/docs/InboundCallbackTypeEnum.md +++ b/docs/InboundCallbackTypeEnum.md @@ -1,6 +1,6 @@ # InboundCallbackTypeEnum -The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. +The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. ## Enum diff --git a/docs/ListEndpointsResponse.md b/docs/ListEndpointsResponse.md index 7c66a320..a64b7904 100644 --- a/docs/ListEndpointsResponse.md +++ b/docs/ListEndpointsResponse.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**List[Link1]**](Link1.md) | | +**links** | [**List[BrtcLink]**](BrtcLink.md) | | **page** | [**Page**](Page.md) | | [optional] **data** | [**List[Endpoints]**](Endpoints.md) | | -**errors** | [**List[Error1]**](Error1.md) | | +**errors** | [**List[BrtcError]**](BrtcError.md) | | ## Example diff --git a/docs/LookupResult.md b/docs/LookupResult.md index 649e6896..4e9e79e7 100644 --- a/docs/LookupResult.md +++ b/docs/LookupResult.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **deactivation_date** | **str** | [DNI-Only](#section/DNI-Only). The datetime the carrier reported a deactivation event. | [optional] **deactivation_event** | [**DeactivationEventEnum**](DeactivationEventEnum.md) | | [optional] **latest_message_delivery_status** | [**LatestMessageDeliveryStatusEnum**](LatestMessageDeliveryStatusEnum.md) | | [optional] -**initial_message_delivery_status_date** | **date** | [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] +**initial_message_delivery_status_date** | **date** | [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] **latest_message_delivery_status_date** | **date** | [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] **rcs_enabled** | **bool** | [RCS-Only](#section/RCS-Only). Indicates whether the phone number is capable of receiving RCS messages. Value will be null if account has RCS, but no value was returned. Absent when account does not have RCS. | [optional] diff --git a/docs/MachineDetectionConfiguration.md b/docs/MachineDetectionConfiguration.md index e3f7a7a7..158dd706 100644 --- a/docs/MachineDetectionConfiguration.md +++ b/docs/MachineDetectionConfiguration.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **silence_timeout** | **float** | If no speech is detected in this period, a callback with a 'silence' result is sent. | [optional] [default to 10] **speech_threshold** | **float** | When speech has ended and a result couldn't be determined based on the audio content itself, this value is used to determine if the speaker is a machine based on the speech duration. If the length of the speech detected is greater than or equal to this threshold, the result will be 'answering-machine'. If the length of speech detected is below this threshold, the result will be 'human'. | [optional] [default to 10] **speech_end_threshold** | **float** | Amount of silence (in seconds) before assuming the callee has finished speaking. | [optional] [default to 5] -**machine_speech_end_threshold** | **float** | When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. | [optional] +**machine_speech_end_threshold** | **float** | When an answering machine is detected, the amount of silence (in seconds) before assuming the message has finished playing. If not provided it will default to the speechEndThreshold value. | [optional] **delay_result** | **bool** | If set to 'true' and if an answering machine is detected, the 'answering-machine' callback will be delayed until the machine is done speaking, or an end of message tone is detected, or until the 'detectionTimeout' is exceeded. If false, the 'answering-machine' result is sent immediately. | [optional] [default to False] **callback_url** | **str** | The URL to send the 'machineDetectionComplete' webhook when the detection is completed. Only for 'async' mode. | [optional] **callback_method** | [**CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] [default to CallbackMethodEnum.POST] diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md index 093335e6..ae5664e9 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **application_id** | **str** | The ID of the Application your from number or senderId is associated with in the Bandwidth App. | **to** | **List[str]** | The phone number(s) the message should be sent to in E164 format. | -**var_from** | **str** | Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. | +**var_from** | **str** | Either an alphanumeric sender ID or the sender's Bandwidth phone number in E.164 format, which must be hosted within Bandwidth and linked to the account that is generating the message. Alphanumeric Sender IDs can contain up to 11 characters, upper-case letters A-Z, lower-case letters a-z, numbers 0-9, space, hyphen -, plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. | **text** | **str** | The contents of the text message. Must be 2048 characters or less. | [optional] **media** | **List[str]** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] **tag** | **str** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] diff --git a/docs/RbmOpenUrlEnum.md b/docs/RbmOpenUrlEnum.md index 19bac259..5069384a 100644 --- a/docs/RbmOpenUrlEnum.md +++ b/docs/RbmOpenUrlEnum.md @@ -1,6 +1,6 @@ # RbmOpenUrlEnum -Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn’t support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. +Specifies how the URL should be opened on a mobile device. - `BROWSER` Opens the URL in the device's default browser. If application is not set or the device doesn't support WebView, this option is used by default. - `WEBVIEW` Opens the URL in an in-app WebView. ## Enum diff --git a/docs/RbmWebViewEnum.md b/docs/RbmWebViewEnum.md index a7753830..b794fcb5 100644 --- a/docs/RbmWebViewEnum.md +++ b/docs/RbmWebViewEnum.md @@ -1,6 +1,6 @@ # RbmWebViewEnum -Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. +Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. ## Enum diff --git a/docs/StatusCallback.md b/docs/StatusCallback.md index 953741e1..df8e9720 100644 --- a/docs/StatusCallback.md +++ b/docs/StatusCallback.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **description** | **str** | A detailed description of the event described by the callback. | **message** | [**StatusCallbackMessage**](StatusCallbackMessage.md) | | **error_code** | **int** | Optional error code, applicable only when type is `message-failed`. | [optional] -**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] +**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] ## Example diff --git a/docs/Error.md b/docs/WebhookSubscriptionError.md similarity index 52% rename from docs/Error.md rename to docs/WebhookSubscriptionError.md index 2eab7688..3ee409d4 100644 --- a/docs/Error.md +++ b/docs/WebhookSubscriptionError.md @@ -1,4 +1,4 @@ -# Error +# WebhookSubscriptionError ## Properties @@ -12,19 +12,19 @@ Name | Type | Description | Notes ## Example ```python -from bandwidth.models.error import Error +from bandwidth.models.webhook_subscription_error import WebhookSubscriptionError # TODO update the JSON string below json = "{}" -# create an instance of Error from a JSON string -error_instance = Error.from_json(json) +# create an instance of WebhookSubscriptionError from a JSON string +webhook_subscription_error_instance = WebhookSubscriptionError.from_json(json) # print the JSON string representation of the object -print(Error.to_json()) +print(WebhookSubscriptionError.to_json()) # convert the object into a dict -error_dict = error_instance.to_dict() -# create an instance of Error from a dict -error_from_dict = Error.from_dict(error_dict) +webhook_subscription_error_dict = webhook_subscription_error_instance.to_dict() +# create an instance of WebhookSubscriptionError from a dict +webhook_subscription_error_from_dict = WebhookSubscriptionError.from_dict(webhook_subscription_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/WebhookSubscriptionsListBody.md b/docs/WebhookSubscriptionsListBody.md index 1c5d5ac4..d53d1549 100644 --- a/docs/WebhookSubscriptionsListBody.md +++ b/docs/WebhookSubscriptionsListBody.md @@ -7,7 +7,7 @@ A list of all webhook subscriptions registered for this account ID for this part Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **links** | [**LinksObject**](LinksObject.md) | | [optional] -**errors** | [**List[Error]**](Error.md) | | [optional] +**errors** | [**List[WebhookSubscriptionError]**](WebhookSubscriptionError.md) | | [optional] **data** | [**List[WebhookSubscription]**](WebhookSubscription.md) | | ## Example From c6c85f301e80442b0dc3e7b3c3109404da60c406 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 27 Apr 2026 11:18:08 -0400 Subject: [PATCH 3/6] add/remove model tests --- test/unit/models/test_brtc_error.py | 62 +++++++++++++ test/unit/models/test_brtc_error_response.py | 89 +++++++++++++++++++ test/unit/models/test_brtc_error_source.py | 55 ++++++++++++ test/unit/models/test_brtc_link.py | 54 +++++++++++ test/unit/models/test_error.py | 61 ------------- test/unit/models/test_error_response.py | 72 --------------- .../models/test_webhook_subscription_error.py | 57 ++++++++++++ 7 files changed, 317 insertions(+), 133 deletions(-) create mode 100644 test/unit/models/test_brtc_error.py create mode 100644 test/unit/models/test_brtc_error_response.py create mode 100644 test/unit/models/test_brtc_error_source.py create mode 100644 test/unit/models/test_brtc_link.py delete mode 100644 test/unit/models/test_error.py delete mode 100644 test/unit/models/test_error_response.py create mode 100644 test/unit/models/test_webhook_subscription_error.py diff --git a/test/unit/models/test_brtc_error.py b/test/unit/models/test_brtc_error.py new file mode 100644 index 00000000..17e725f4 --- /dev/null +++ b/test/unit/models/test_brtc_error.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.brtc_error import BrtcError + +class TestBrtcError(unittest.TestCase): + """BrtcError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BrtcError: + """Test BrtcError + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BrtcError` + """ + model = BrtcError() + if include_optional: + return BrtcError( + id = '59512d87-7a92-4040-8e4a-78fb772019b9', + type = 'resource.not_found', + description = 'The requested resource was not found.', + code = '404', + source = bandwidth.models.brtc_error_source.brtcErrorSource( + parameter = 'accountId', + field = 'accountId', + header = 'Authorization', + reference = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', ) + ) + else: + return BrtcError( + type = 'resource.not_found', + description = 'The requested resource was not found.', + ) + """ + + def testBrtcError(self): + """Test BrtcError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_brtc_error_response.py b/test/unit/models/test_brtc_error_response.py new file mode 100644 index 00000000..8b314475 --- /dev/null +++ b/test/unit/models/test_brtc_error_response.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.brtc_error_response import BrtcErrorResponse + +class TestBrtcErrorResponse(unittest.TestCase): + """BrtcErrorResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BrtcErrorResponse: + """Test BrtcErrorResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BrtcErrorResponse` + """ + model = BrtcErrorResponse() + if include_optional: + return BrtcErrorResponse( + links = [ + bandwidth.models.brtc_link.brtcLink( + href = 'https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + rel = 'self', + method = 'GET', ) + ], + data = None, + errors = [ + bandwidth.models.brtc_error.brtcError( + id = '59512d87-7a92-4040-8e4a-78fb772019b9', + type = 'resource.not_found', + description = 'The requested resource was not found.', + code = '404', + source = bandwidth.models.brtc_error_source.brtcErrorSource( + parameter = 'accountId', + field = 'accountId', + header = 'Authorization', + reference = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', ), ) + ] + ) + else: + return BrtcErrorResponse( + links = [ + bandwidth.models.brtc_link.brtcLink( + href = 'https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + rel = 'self', + method = 'GET', ) + ], + data = None, + errors = [ + bandwidth.models.brtc_error.brtcError( + id = '59512d87-7a92-4040-8e4a-78fb772019b9', + type = 'resource.not_found', + description = 'The requested resource was not found.', + code = '404', + source = bandwidth.models.brtc_error_source.brtcErrorSource( + parameter = 'accountId', + field = 'accountId', + header = 'Authorization', + reference = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', ), ) + ], + ) + """ + + def testBrtcErrorResponse(self): + """Test BrtcErrorResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_brtc_error_source.py b/test/unit/models/test_brtc_error_source.py new file mode 100644 index 00000000..fa215292 --- /dev/null +++ b/test/unit/models/test_brtc_error_source.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.brtc_error_source import BrtcErrorSource + +class TestBrtcErrorSource(unittest.TestCase): + """BrtcErrorSource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BrtcErrorSource: + """Test BrtcErrorSource + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BrtcErrorSource` + """ + model = BrtcErrorSource() + if include_optional: + return BrtcErrorSource( + parameter = 'accountId', + var_field = 'accountId', + header = 'Authorization', + reference = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + ) + else: + return BrtcErrorSource( + ) + """ + + def testBrtcErrorSource(self): + """Test BrtcErrorSource""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_brtc_link.py b/test/unit/models/test_brtc_link.py new file mode 100644 index 00000000..83873a9b --- /dev/null +++ b/test/unit/models/test_brtc_link.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.brtc_link import BrtcLink + +class TestBrtcLink(unittest.TestCase): + """BrtcLink unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BrtcLink: + """Test BrtcLink + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BrtcLink` + """ + model = BrtcLink() + if include_optional: + return BrtcLink( + href = 'https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + rel = 'self', + method = 'GET' + ) + else: + return BrtcLink( + ) + """ + + def testBrtcLink(self): + """Test BrtcLink""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_error.py b/test/unit/models/test_error.py deleted file mode 100644 index 59da3064..00000000 --- a/test/unit/models/test_error.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from bandwidth.models.error import Error -from bandwidth.models.telephone_number import TelephoneNumber - -class TestError(unittest.TestCase): - """Error unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Error: - """Test Error - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - if include_optional: - return Error( - code = 56, - description = '', - telephone_numbers = [ - TelephoneNumber( - telephone_number = '', ) - ] - ) - else: - return Error( - ) - - def testError(self): - """Test Error""" - instance = self.make_instance(True) - assert instance is not None - assert isinstance(instance, Error) - assert instance.code == 56 - assert instance.description == '' - assert isinstance(instance.telephone_numbers, list) - assert len(instance.telephone_numbers) == 1 - assert isinstance(instance.telephone_numbers[0], TelephoneNumber) - assert instance.telephone_numbers[0].telephone_number == '' - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/models/test_error_response.py b/test/unit/models/test_error_response.py deleted file mode 100644 index 82d66d32..00000000 --- a/test/unit/models/test_error_response.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from bandwidth.models.error_response import ErrorResponse -from bandwidth.models.error import Error -from bandwidth.models.link import Link - -class TestErrorResponse(unittest.TestCase): - """ErrorResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ErrorResponse: - """Test ErrorResponse - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - if include_optional: - return ErrorResponse( - links=[ - Link(href='https://api.bandwidth.com/errors', rel='self') - ], - data={'key': 'value'}, - errors=[ - Error( - code=400, - description='Bad Request' - ) - ] - ) - else: - return ErrorResponse( - ) - - def testErrorResponse(self): - """Test ErrorResponse""" - instance = self.make_instance(True) - assert instance is not None - assert isinstance(instance, ErrorResponse) - assert isinstance(instance.links, list) - assert len(instance.links) == 1 - assert isinstance(instance.links[0], Link) - assert instance.links[0].href == 'https://api.bandwidth.com/errors' - assert instance.links[0].rel == 'self' - assert isinstance(instance.data, dict) - assert instance.data['key'] == 'value' - assert isinstance(instance.errors, list) - assert len(instance.errors) == 1 - assert isinstance(instance.errors[0], Error) - assert instance.errors[0].code == 400 - assert instance.errors[0].description == 'Bad Request' - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/models/test_webhook_subscription_error.py b/test/unit/models/test_webhook_subscription_error.py new file mode 100644 index 00000000..a08f5d9c --- /dev/null +++ b/test/unit/models/test_webhook_subscription_error.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.webhook_subscription_error import WebhookSubscriptionError + +class TestWebhookSubscriptionError(unittest.TestCase): + """WebhookSubscriptionError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebhookSubscriptionError: + """Test WebhookSubscriptionError + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebhookSubscriptionError` + """ + model = WebhookSubscriptionError() + if include_optional: + return WebhookSubscriptionError( + code = 56, + description = '', + telephone_numbers = [ + bandwidth.models.telephone_number.telephoneNumber( + telephone_number = '', ) + ] + ) + else: + return WebhookSubscriptionError( + ) + """ + + def testWebhookSubscriptionError(self): + """Test WebhookSubscriptionError""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() From 242a0e489d7c6b007e8278e837f90de7dbf4000d Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 27 Apr 2026 11:26:26 -0400 Subject: [PATCH 4/6] update wfs --- .github/workflows/deploy.yml | 2 +- .github/workflows/test-pr.yml | 6 +++--- .github/workflows/test-smoke.yml | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2dbc23df..5dea6ae6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -47,7 +47,7 @@ jobs: fi - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set OpenAPI Generator Version run: | diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index ee6c5ab9..af0bd2f6 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -37,7 +37,7 @@ jobs: strategy: matrix: os: [windows-2022, windows-2025, ubuntu-22.04, ubuntu-24.04] - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] fail-fast: false env: PYTHON_VERSION: ${{ matrix.python-version }} @@ -45,10 +45,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/test-smoke.yml b/.github/workflows/test-smoke.yml index 53673f93..5b2b3cb2 100644 --- a/.github/workflows/test-smoke.yml +++ b/.github/workflows/test-smoke.yml @@ -52,12 +52,12 @@ jobs: MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: - python-version: '3.12' + python-version: '3.14' - name: Install Packages run: | @@ -91,12 +91,12 @@ jobs: MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_UP_APPLICATION_ID }} steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: - python-version: '3.12' + python-version: '3.14' - name: Install Packages run: | From 556af4e275e8f3e0810fd5c02a8cd28356c9e100 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 27 Apr 2026 11:26:31 -0400 Subject: [PATCH 5/6] update tests --- test/unit/api/test_endpoints_api.py | 8 +- test/unit/models/test_brtc_error.py | 45 ++++++----- test/unit/models/test_brtc_error_response.py | 81 +++++++++---------- test/unit/models/test_brtc_error_source.py | 25 +++--- test/unit/models/test_brtc_link.py | 21 +++-- .../models/test_create_endpoint_response.py | 8 +- test/unit/models/test_endpoint_response.py | 8 +- .../models/test_list_endpoints_response.py | 8 +- .../models/test_webhook_subscription_error.py | 30 +++---- .../test_webhook_subscriptions_list_body.py | 10 +-- 10 files changed, 123 insertions(+), 121 deletions(-) diff --git a/test/unit/api/test_endpoints_api.py b/test/unit/api/test_endpoints_api.py index c31b1151..957edb9f 100644 --- a/test/unit/api/test_endpoints_api.py +++ b/test/unit/api/test_endpoints_api.py @@ -27,7 +27,7 @@ from bandwidth.models.endpoint import Endpoint from bandwidth.models.endpoints import Endpoints from bandwidth.models.list_endpoints_response import ListEndpointsResponse -from bandwidth.models.link import Link +from bandwidth.models.brtc_link import BrtcLink from bandwidth.models.page import Page from bandwidth.models.endpoint_type_enum import EndpointTypeEnum from bandwidth.models.endpoint_direction_enum import EndpointDirectionEnum @@ -73,7 +73,7 @@ def test_create_endpoint(self) -> None: assert_that(response.data, instance_of(CreateEndpointResponse)) assert_that(response.data.links, instance_of(list)) - assert_that(response.data.links[0], instance_of(Link)) + assert_that(response.data.links[0], instance_of(BrtcLink)) assert_that(response.data.links[0].href, starts_with('http')) assert_that(response.data.links[0].rel, equal_to('endpoint')) @@ -115,7 +115,7 @@ def test_get_endpoint(self) -> None: assert_that(response.data, instance_of(EndpointResponse)) assert_that(response.data.links, instance_of(list)) - assert_that(response.data.links[0], instance_of(Link)) + assert_that(response.data.links[0], instance_of(BrtcLink)) assert_that(response.data.links[0].href, starts_with('http')) assert_that(response.data.links[0].rel, equal_to('self')) @@ -143,7 +143,7 @@ def test_list_endpoints(self) -> None: assert_that(response.data, instance_of(ListEndpointsResponse)) assert_that(response.data.links, instance_of(list)) - assert_that(response.data.links[0], instance_of(Link)) + assert_that(response.data.links[0], instance_of(BrtcLink)) assert_that(response.data.links[0].href, starts_with('http')) assert_that(response.data.links[0].rel, equal_to('self')) diff --git a/test/unit/models/test_brtc_error.py b/test/unit/models/test_brtc_error.py index 17e725f4..58413546 100644 --- a/test/unit/models/test_brtc_error.py +++ b/test/unit/models/test_brtc_error.py @@ -14,8 +14,10 @@ import unittest +from uuid import UUID from bandwidth.models.brtc_error import BrtcError +from bandwidth.models.brtc_error_source import BrtcErrorSource class TestBrtcError(unittest.TestCase): """BrtcError unit test stubs""" @@ -31,32 +33,39 @@ def make_instance(self, include_optional) -> BrtcError: include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BrtcError` - """ - model = BrtcError() if include_optional: return BrtcError( - id = '59512d87-7a92-4040-8e4a-78fb772019b9', - type = 'resource.not_found', - description = 'The requested resource was not found.', - code = '404', - source = bandwidth.models.brtc_error_source.brtcErrorSource( - parameter = 'accountId', - field = 'accountId', - header = 'Authorization', - reference = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', ) + id='59512d87-7a92-4040-8e4a-78fb772019b9', + type='resource.not_found', + description='The requested resource was not found.', + code='404', + source=BrtcErrorSource( + parameter='accountId', + var_field='accountId', + header='Authorization', + reference='e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + ) ) else: return BrtcError( - type = 'resource.not_found', - description = 'The requested resource was not found.', - ) - """ + type='resource.not_found', + description='The requested resource was not found.' + ) def testBrtcError(self): """Test BrtcError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, BrtcError) + assert isinstance(instance.id, UUID) + assert instance.type == 'resource.not_found' + assert instance.description == 'The requested resource was not found.' + assert instance.code == '404' + assert isinstance(instance.source, BrtcErrorSource) + assert instance.source.parameter == 'accountId' + assert instance.source.var_field == 'accountId' + assert instance.source.header == 'Authorization' + assert instance.source.reference == 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_brtc_error_response.py b/test/unit/models/test_brtc_error_response.py index 8b314475..f9e70b35 100644 --- a/test/unit/models/test_brtc_error_response.py +++ b/test/unit/models/test_brtc_error_response.py @@ -16,6 +16,8 @@ import unittest from bandwidth.models.brtc_error_response import BrtcErrorResponse +from bandwidth.models.brtc_error import BrtcError +from bandwidth.models.brtc_link import BrtcLink class TestBrtcErrorResponse(unittest.TestCase): """BrtcErrorResponse unit test stubs""" @@ -31,59 +33,48 @@ def make_instance(self, include_optional) -> BrtcErrorResponse: include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BrtcErrorResponse` - """ - model = BrtcErrorResponse() if include_optional: return BrtcErrorResponse( - links = [ - bandwidth.models.brtc_link.brtcLink( - href = 'https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - rel = 'self', - method = 'GET', ) - ], - data = None, - errors = [ - bandwidth.models.brtc_error.brtcError( - id = '59512d87-7a92-4040-8e4a-78fb772019b9', - type = 'resource.not_found', - description = 'The requested resource was not found.', - code = '404', - source = bandwidth.models.brtc_error_source.brtcErrorSource( - parameter = 'accountId', - field = 'accountId', - header = 'Authorization', - reference = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', ), ) - ] + links=[ + BrtcLink( + href='https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + rel='self', + method='GET' + ) + ], + data=None, + errors=[ + BrtcError( + id='59512d87-7a92-4040-8e4a-78fb772019b9', + type='resource.not_found', + description='The requested resource was not found.', + code='404' + ) + ] ) else: return BrtcErrorResponse( - links = [ - bandwidth.models.brtc_link.brtcLink( - href = 'https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - rel = 'self', - method = 'GET', ) - ], - data = None, - errors = [ - bandwidth.models.brtc_error.brtcError( - id = '59512d87-7a92-4040-8e4a-78fb772019b9', - type = 'resource.not_found', - description = 'The requested resource was not found.', - code = '404', - source = bandwidth.models.brtc_error_source.brtcErrorSource( - parameter = 'accountId', - field = 'accountId', - header = 'Authorization', - reference = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', ), ) - ], - ) - """ + links=[], + data=None, + errors=[] + ) def testBrtcErrorResponse(self): """Test BrtcErrorResponse""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, BrtcErrorResponse) + assert isinstance(instance.links, list) + assert len(instance.links) == 1 + assert isinstance(instance.links[0], BrtcLink) + assert instance.links[0].href == 'https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.links[0].rel == 'self' + assert instance.data is None + assert isinstance(instance.errors, list) + assert len(instance.errors) == 1 + assert isinstance(instance.errors[0], BrtcError) + assert instance.errors[0].type == 'resource.not_found' + assert instance.errors[0].description == 'The requested resource was not found.' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_brtc_error_source.py b/test/unit/models/test_brtc_error_source.py index fa215292..924a1cc0 100644 --- a/test/unit/models/test_brtc_error_source.py +++ b/test/unit/models/test_brtc_error_source.py @@ -17,6 +17,7 @@ from bandwidth.models.brtc_error_source import BrtcErrorSource + class TestBrtcErrorSource(unittest.TestCase): """BrtcErrorSource unit test stubs""" @@ -31,25 +32,25 @@ def make_instance(self, include_optional) -> BrtcErrorSource: include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BrtcErrorSource` - """ - model = BrtcErrorSource() if include_optional: return BrtcErrorSource( - parameter = 'accountId', - var_field = 'accountId', - header = 'Authorization', - reference = 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + parameter='accountId', + var_field='accountId', + header='Authorization', + reference='e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' ) else: - return BrtcErrorSource( - ) - """ + return BrtcErrorSource() def testBrtcErrorSource(self): """Test BrtcErrorSource""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, BrtcErrorSource) + assert instance.parameter == 'accountId' + assert instance.var_field == 'accountId' + assert instance.header == 'Authorization' + assert instance.reference == 'e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_brtc_link.py b/test/unit/models/test_brtc_link.py index 83873a9b..6231d325 100644 --- a/test/unit/models/test_brtc_link.py +++ b/test/unit/models/test_brtc_link.py @@ -31,24 +31,23 @@ def make_instance(self, include_optional) -> BrtcLink: include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BrtcLink` - """ - model = BrtcLink() if include_optional: return BrtcLink( - href = 'https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', - rel = 'self', - method = 'GET' + href='https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85', + rel='self', + method='GET' ) else: - return BrtcLink( - ) - """ + return BrtcLink() def testBrtcLink(self): """Test BrtcLink""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, BrtcLink) + assert instance.href == 'https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + assert instance.rel == 'self' + assert instance.method == 'GET' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_create_endpoint_response.py b/test/unit/models/test_create_endpoint_response.py index ad245e89..6d5e2e6c 100644 --- a/test/unit/models/test_create_endpoint_response.py +++ b/test/unit/models/test_create_endpoint_response.py @@ -18,8 +18,8 @@ from bandwidth.models.create_endpoint_response import CreateEndpointResponse from bandwidth.models.create_endpoint_response_data import CreateEndpointResponseData -from bandwidth.models.link import Link -from bandwidth.models.error import Error +from bandwidth.models.brtc_link import BrtcLink +from bandwidth.models.brtc_error import BrtcError from bandwidth.models.endpoint_status_enum import EndpointStatusEnum from bandwidth.models.endpoint_type_enum import EndpointTypeEnum @@ -40,7 +40,7 @@ def make_instance(self, include_optional) -> CreateEndpointResponse: if include_optional: return CreateEndpointResponse( links=[ - Link(href='https://api.bandwidth.com/endpoint-123', rel='self') + BrtcLink(href='https://api.bandwidth.com/endpoint-123', rel='self') ], data=CreateEndpointResponseData( endpoint_id='endpoint-123', @@ -63,7 +63,7 @@ def testCreateEndpointResponse(self): assert isinstance(instance, CreateEndpointResponse) assert isinstance(instance.links, list) assert len(instance.links) == 1 - assert isinstance(instance.links[0], Link) + assert isinstance(instance.links[0], BrtcLink) assert isinstance(instance.data, CreateEndpointResponseData) assert instance.data.endpoint_id == 'endpoint-123' assert instance.data.token == 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.test.token' diff --git a/test/unit/models/test_endpoint_response.py b/test/unit/models/test_endpoint_response.py index 5d00ca9e..86137153 100644 --- a/test/unit/models/test_endpoint_response.py +++ b/test/unit/models/test_endpoint_response.py @@ -18,8 +18,8 @@ from bandwidth.models.endpoint_response import EndpointResponse from bandwidth.models.endpoint import Endpoint -from bandwidth.models.link import Link -from bandwidth.models.error import Error +from bandwidth.models.brtc_link import BrtcLink +from bandwidth.models.brtc_error import BrtcError from bandwidth.models.endpoint_status_enum import EndpointStatusEnum from bandwidth.models.endpoint_type_enum import EndpointTypeEnum @@ -40,7 +40,7 @@ def make_instance(self, include_optional) -> EndpointResponse: if include_optional: return EndpointResponse( links=[ - Link(href='https://api.bandwidth.com/endpoint-999', rel='self') + BrtcLink(href='https://api.bandwidth.com/endpoint-999', rel='self') ], data=Endpoint( endpoint_id='endpoint-999', @@ -62,7 +62,7 @@ def testEndpointResponse(self): assert isinstance(instance, EndpointResponse) assert isinstance(instance.links, list) assert len(instance.links) == 1 - assert isinstance(instance.links[0], Link) + assert isinstance(instance.links[0], BrtcLink) assert isinstance(instance.data, Endpoint) assert instance.data.endpoint_id == 'endpoint-999' assert instance.data.type == EndpointTypeEnum.WEBRTC diff --git a/test/unit/models/test_list_endpoints_response.py b/test/unit/models/test_list_endpoints_response.py index ad832e46..555e1c86 100644 --- a/test/unit/models/test_list_endpoints_response.py +++ b/test/unit/models/test_list_endpoints_response.py @@ -18,8 +18,8 @@ from bandwidth.models.list_endpoints_response import ListEndpointsResponse from bandwidth.models.endpoints import Endpoints -from bandwidth.models.link import Link -from bandwidth.models.error import Error +from bandwidth.models.brtc_link import BrtcLink +from bandwidth.models.brtc_error import BrtcError from bandwidth.models.page import Page from bandwidth.models.endpoint_status_enum import EndpointStatusEnum from bandwidth.models.endpoint_type_enum import EndpointTypeEnum @@ -41,8 +41,8 @@ def make_instance(self, include_optional) -> ListEndpointsResponse: if include_optional: return ListEndpointsResponse( links=[ - Link(href='https://api.bandwidth.com/endpoints', rel='self'), - Link(href='https://api.bandwidth.com/endpoints?page=2', rel='next') + BrtcLink(href='https://api.bandwidth.com/endpoints', rel='self'), + BrtcLink(href='https://api.bandwidth.com/endpoints?page=2', rel='next') ], page=Page( page_size=10, diff --git a/test/unit/models/test_webhook_subscription_error.py b/test/unit/models/test_webhook_subscription_error.py index a08f5d9c..2db14ebb 100644 --- a/test/unit/models/test_webhook_subscription_error.py +++ b/test/unit/models/test_webhook_subscription_error.py @@ -16,6 +16,7 @@ import unittest from bandwidth.models.webhook_subscription_error import WebhookSubscriptionError +from bandwidth.models.telephone_number import TelephoneNumber class TestWebhookSubscriptionError(unittest.TestCase): """WebhookSubscriptionError unit test stubs""" @@ -31,27 +32,28 @@ def make_instance(self, include_optional) -> WebhookSubscriptionError: include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `WebhookSubscriptionError` - """ - model = WebhookSubscriptionError() if include_optional: return WebhookSubscriptionError( - code = 56, - description = '', - telephone_numbers = [ - bandwidth.models.telephone_number.telephoneNumber( - telephone_number = '', ) - ] + code=56, + description='description', + telephone_numbers=[ + TelephoneNumber(telephone_number='+19195551234') + ] ) else: - return WebhookSubscriptionError( - ) - """ + return WebhookSubscriptionError() def testWebhookSubscriptionError(self): """Test WebhookSubscriptionError""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, WebhookSubscriptionError) + assert instance.code == 56 + assert instance.description == 'description' + assert isinstance(instance.telephone_numbers, list) + assert len(instance.telephone_numbers) == 1 + assert isinstance(instance.telephone_numbers[0], TelephoneNumber) + assert instance.telephone_numbers[0].telephone_number == '+19195551234' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_webhook_subscriptions_list_body.py b/test/unit/models/test_webhook_subscriptions_list_body.py index 82e245d9..205121b3 100644 --- a/test/unit/models/test_webhook_subscriptions_list_body.py +++ b/test/unit/models/test_webhook_subscriptions_list_body.py @@ -18,7 +18,7 @@ from bandwidth.models.webhook_subscriptions_list_body import WebhookSubscriptionsListBody from bandwidth.models.links_object import LinksObject -from bandwidth.models.error import Error +from bandwidth.models.webhook_subscription_error import WebhookSubscriptionError from bandwidth.models.telephone_number import TelephoneNumber from bandwidth.models.webhook_subscription import WebhookSubscription from bandwidth.models.webhook_subscription_basic_authentication import WebhookSubscriptionBasicAuthentication @@ -45,9 +45,9 @@ def make_instance(self, include_optional) -> WebhookSubscriptionsListBody: previous = 'https://api.com/abc/previous', last = 'https://api.com/abc/last', ), errors = [ - Error( - code = 56, - description = 'description', + WebhookSubscriptionError( + code = 56, + description = 'description', telephone_numbers = [ TelephoneNumber( telephone_number = '+19195551234', ) @@ -94,7 +94,7 @@ def testWebhookSubscriptionsListBody(self): assert instance.links.last == 'https://api.com/abc/last' assert isinstance(instance.errors, list) assert len(instance.errors) == 1 - assert isinstance(instance.errors[0], Error) + assert isinstance(instance.errors[0], WebhookSubscriptionError) assert instance.errors[0].code == 56 assert instance.errors[0].description == 'description' assert isinstance(instance.errors[0].telephone_numbers, list) From d8e686523f61595efe97915c5ca0b3f72a28c401 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 27 Apr 2026 11:34:38 -0400 Subject: [PATCH 6/6] add `generate-model-tests` script --- generate-model-tests.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 generate-model-tests.sh diff --git a/generate-model-tests.sh b/generate-model-tests.sh new file mode 100644 index 00000000..9084d544 --- /dev/null +++ b/generate-model-tests.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Generates new test files for models. Run from the root. + +# allow generator to write test files +sed -i.bak 's/^test\/\*/# test\/*/' .openapi-generator-ignore && rm .openapi-generator-ignore.bak +# remove current test files for models +rm -f ./test/unit/models/test_*.py +# generate new test files for models +openapi-generator-cli generate -i bandwidth.yml -o ./ -c openapi-config.yml -g python > /dev/null +# move generated model test files to the correct location (exclude api tests) +for f in ./test/test_*.py; do + [[ "$f" != *"_api.py" ]] && mv "$f" ./test/unit/models/ +done +# remove remaining generated test files (api tests, etc.) +rm -f ./test/test_*.py +# discard changes to modified files only (leaves deletions and new test files intact) +modified=$(git diff --name-only --diff-filter=M) && [ -n "$modified" ] && echo "$modified" | xargs git checkout --