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