From b078654023ae205de9821b566f1805ce8872d0d0 Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Tue, 14 Jan 2025 14:06:26 +0000 Subject: [PATCH 1/8] Generate SDK with OpenAPI Generator Version --- .openapi-generator/FILES | 22 +- README.md | 11 +- bandwidth.yml | 893 +++++++++---------- bandwidth/__init__.py | 11 +- bandwidth/api/media_api.py | 18 +- bandwidth/api/messages_api.py | 96 +- bandwidth/models/__init__.py | 11 +- bandwidth/models/callback_type_enum.py | 40 + bandwidth/models/message.py | 4 +- bandwidth/models/message_callback.py | 122 +++ bandwidth/models/message_callback_message.py | 131 +++ bandwidth/models/message_request.py | 6 +- bandwidth/models/message_status_enum.py | 2 +- docs/CallbackTypeEnum.md | 17 + docs/MediaApi.md | 6 +- docs/Message.md | 4 +- docs/MessageCallback.md | 35 + docs/MessageCallbackMessage.md | 41 + docs/MessageRequest.md | 6 +- docs/MessageStatusEnum.md | 2 +- docs/MessagesApi.md | 32 +- 21 files changed, 911 insertions(+), 599 deletions(-) create mode 100644 bandwidth/models/callback_type_enum.py create mode 100644 bandwidth/models/message_callback.py create mode 100644 bandwidth/models/message_callback_message.py create mode 100644 docs/CallbackTypeEnum.md create mode 100644 docs/MessageCallback.md create mode 100644 docs/MessageCallbackMessage.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index a641d920..2d4e02e6 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -31,6 +31,7 @@ bandwidth/models/call_transcription_metadata.py bandwidth/models/call_transcription_response.py bandwidth/models/call_transcription_track_enum.py bandwidth/models/callback_method_enum.py +bandwidth/models/callback_type_enum.py bandwidth/models/code_request.py bandwidth/models/conference.py bandwidth/models/conference_completed_callback.py @@ -53,8 +54,6 @@ bandwidth/models/dtmf_callback.py bandwidth/models/field_error.py bandwidth/models/file_format_enum.py bandwidth/models/gather_callback.py -bandwidth/models/inbound_message_callback.py -bandwidth/models/inbound_message_callback_message.py bandwidth/models/initiate_callback.py bandwidth/models/list_message_direction_enum.py bandwidth/models/list_message_item.py @@ -68,14 +67,10 @@ bandwidth/models/machine_detection_mode_enum.py bandwidth/models/machine_detection_result.py bandwidth/models/media.py bandwidth/models/message.py -bandwidth/models/message_delivered_callback.py -bandwidth/models/message_delivered_callback_message.py +bandwidth/models/message_callback.py +bandwidth/models/message_callback_message.py bandwidth/models/message_direction_enum.py -bandwidth/models/message_failed_callback.py -bandwidth/models/message_failed_callback_message.py bandwidth/models/message_request.py -bandwidth/models/message_sending_callback.py -bandwidth/models/message_sending_callback_message.py bandwidth/models/message_status_enum.py bandwidth/models/message_type_enum.py bandwidth/models/messages_list.py @@ -126,6 +121,7 @@ docs/CallTranscriptionMetadata.md docs/CallTranscriptionResponse.md docs/CallTranscriptionTrackEnum.md docs/CallbackMethodEnum.md +docs/CallbackTypeEnum.md docs/CallsApi.md docs/CodeRequest.md docs/Conference.md @@ -150,8 +146,6 @@ docs/DtmfCallback.md docs/FieldError.md docs/FileFormatEnum.md docs/GatherCallback.md -docs/InboundMessageCallback.md -docs/InboundMessageCallbackMessage.md docs/InitiateCallback.md docs/ListMessageDirectionEnum.md docs/ListMessageItem.md @@ -167,14 +161,10 @@ docs/MachineDetectionResult.md docs/Media.md docs/MediaApi.md docs/Message.md -docs/MessageDeliveredCallback.md -docs/MessageDeliveredCallbackMessage.md +docs/MessageCallback.md +docs/MessageCallbackMessage.md docs/MessageDirectionEnum.md -docs/MessageFailedCallback.md -docs/MessageFailedCallbackMessage.md docs/MessageRequest.md -docs/MessageSendingCallback.md -docs/MessageSendingCallbackMessage.md docs/MessageStatusEnum.md docs/MessageTypeEnum.md docs/MessagesApi.md diff --git a/README.md b/README.md index 5e1ec4a7..e51dac5c 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,7 @@ Class | Method | HTTP request | Description - [CallTranscriptionResponse](docs/CallTranscriptionResponse.md) - [CallTranscriptionTrackEnum](docs/CallTranscriptionTrackEnum.md) - [CallbackMethodEnum](docs/CallbackMethodEnum.md) + - [CallbackTypeEnum](docs/CallbackTypeEnum.md) - [CodeRequest](docs/CodeRequest.md) - [Conference](docs/Conference.md) - [ConferenceCompletedCallback](docs/ConferenceCompletedCallback.md) @@ -176,8 +177,6 @@ Class | Method | HTTP request | Description - [FieldError](docs/FieldError.md) - [FileFormatEnum](docs/FileFormatEnum.md) - [GatherCallback](docs/GatherCallback.md) - - [InboundMessageCallback](docs/InboundMessageCallback.md) - - [InboundMessageCallbackMessage](docs/InboundMessageCallbackMessage.md) - [InitiateCallback](docs/InitiateCallback.md) - [ListMessageDirectionEnum](docs/ListMessageDirectionEnum.md) - [ListMessageItem](docs/ListMessageItem.md) @@ -191,14 +190,10 @@ Class | Method | HTTP request | Description - [MachineDetectionResult](docs/MachineDetectionResult.md) - [Media](docs/Media.md) - [Message](docs/Message.md) - - [MessageDeliveredCallback](docs/MessageDeliveredCallback.md) - - [MessageDeliveredCallbackMessage](docs/MessageDeliveredCallbackMessage.md) + - [MessageCallback](docs/MessageCallback.md) + - [MessageCallbackMessage](docs/MessageCallbackMessage.md) - [MessageDirectionEnum](docs/MessageDirectionEnum.md) - - [MessageFailedCallback](docs/MessageFailedCallback.md) - - [MessageFailedCallbackMessage](docs/MessageFailedCallbackMessage.md) - [MessageRequest](docs/MessageRequest.md) - - [MessageSendingCallback](docs/MessageSendingCallback.md) - - [MessageSendingCallbackMessage](docs/MessageSendingCallbackMessage.md) - [MessageStatusEnum](docs/MessageStatusEnum.md) - [MessageTypeEnum](docs/MessageTypeEnum.md) - [MessagesList](docs/MessagesList.md) diff --git a/bandwidth.yml b/bandwidth.yml index 11c79d23..8725d1d6 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -230,8 +230,6 @@ paths: '500': $ref: '#/components/responses/messagingInternalServerError' callbacks: - inboundCallback: - $ref: '#/components/callbacks/inboundCallback' statusCallback: $ref: '#/components/callbacks/statusCallback' servers: *ref_0 @@ -1332,6 +1330,21 @@ paths: servers: *ref_3 components: schemas: + callbackTypeEnum: + type: string + enum: + - message-received + - message-sending + - message-delivered + - message-failed + description: > + Indicates the type of the callback: + + - `message-received` for inbound callbacks. + + - One of `message-sending`, `message-delivered`, `message-failed` for + status callbacks. + example: message-delivered priorityEnum: type: string description: |- @@ -1344,7 +1357,7 @@ components: example: default messageStatusEnum: type: string - description: >- + description: > The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. enum: @@ -1574,10 +1587,10 @@ components: type: string format: date-time description: The datetime stamp of the message in ISO 8601 - example: 2022-09-14T18:20:16.000Z + example: 2024-12-02T20:15:57.278Z segmentCount: type: integer - description: >- + description: > The number of segments the original message from the user is broken into before sending over to carrier networks. example: 2 @@ -1600,7 +1613,7 @@ components: type: array items: type: string - description: >- + description: > The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to @@ -1647,7 +1660,7 @@ components: type: string from: type: string - description: >- + 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. @@ -1668,7 +1681,7 @@ components: type: string format: uri maxLength: 4096 - description: >- + description: > A list of URLs to include as media attachments as part of the message. @@ -1687,7 +1700,7 @@ components: expiration: type: string format: date-time - description: >- + description: > A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a @@ -1695,288 +1708,38 @@ components: Not supported on MMS. example: '2021-02-01T11:29:18-05:00' - inboundMessageCallback: - description: Inbound Message Callback - type: object - properties: - time: - type: string - format: date-time - example: 2016-09-14T18:20:16.000Z - type: - type: string - example: message-received - to: - type: string - example: '+15552223333' - description: - type: string - example: Incoming message received - message: - $ref: '#/components/schemas/inboundMessageCallbackMessage' - required: - - time - - type - - to - - description - - message - inboundMessageCallbackMessage: - description: Inbound Message Callback Message Schema - type: object - properties: - id: - type: string - example: 1661365814859loidf7mcwd4qacn7 - owner: - type: string - example: '+15553332222' - applicationId: - type: string - example: 93de2206-9669-4e07-948d-329f4b722ee2 - time: - type: string - format: date-time - example: 2016-09-14T18:20:16.000Z - segmentCount: - type: integer - example: 1 - direction: - $ref: '#/components/schemas/messageDirectionEnum' - to: - uniqueItems: true - type: array - items: - type: string - example: - - '+15552223333' - from: - type: string - example: '+15553332222' - text: - type: string - example: Hello world - tag: - type: string - example: custom string - media: - type: array - items: - type: string - format: uri - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - - https://dev.bandwidth.com/images/github_logo.png - priority: - $ref: '#/components/schemas/priorityEnum' - required: - - id - - owner - - applicationId - - time - - segmentCount - - direction - - to - - from - - text - messageSendingCallback: - type: object - description: Message Sending Callback - properties: - time: - type: string - format: date-time - example: 2016-09-14T18:20:16.000Z - type: - type: string - example: message-sending - to: - type: string - example: '+15552223333' - description: - type: string - example: Message is sending to carrier - message: - $ref: '#/components/schemas/messageSendingCallbackMessage' - required: - - time - - type - - to - - description - - message - messageSendingCallbackMessage: - description: Message Sending Callback Message Schema - type: object - properties: - id: - type: string - example: 1661365814859loidf7mcwd4qacn7 - owner: - type: string - example: '+15553332222' - applicationId: - type: string - example: 93de2206-9669-4e07-948d-329f4b722ee2 - time: - type: string - format: date-time - example: 2016-09-14T18:20:16.000Z - segmentCount: - type: integer - example: 1 - direction: - $ref: '#/components/schemas/messageDirectionEnum' - to: - uniqueItems: true - type: array - items: - type: string - example: - - '+15552223333' - from: - type: string - example: '+15553332222' - text: - type: string - example: Hello world - tag: - type: string - example: custom string - media: - type: array - items: - type: string - format: uri - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - - https://dev.bandwidth.com/images/github_logo.png - priority: - $ref: '#/components/schemas/priorityEnum' - required: - - id - - owner - - applicationId - - time - - segmentCount - - direction - - to - - from - - text - - media - messageDeliveredCallback: - description: Message Delivered Callback - type: object - properties: - time: - type: string - format: date-time - example: 2016-09-14T18:20:16.000Z - type: - type: string - example: message-delivered - to: - type: string - example: '+15552223333' - description: - type: string - example: Message delivered to carrier. - message: - $ref: '#/components/schemas/messageDeliveredCallbackMessage' - required: - - time - - type - - to - - description - - message - messageDeliveredCallbackMessage: - description: Message Delivered Callback Message Schema - type: object - properties: - id: - type: string - example: 1661365814859loidf7mcwd4qacn7 - owner: - type: string - example: '+15553332222' - applicationId: - type: string - example: 93de2206-9669-4e07-948d-329f4b722ee2 - time: - type: string - format: date-time - example: 2016-09-14T18:20:16.000Z - segmentCount: - type: integer - example: 1 - direction: - $ref: '#/components/schemas/messageDirectionEnum' - to: - uniqueItems: true - type: array - items: - type: string - example: - - '+15552223333' - from: - type: string - example: '+15553332222' - text: - type: string - example: Hello world - tag: - type: string - example: custom string - media: - type: array - items: - type: string - format: uri - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - - https://dev.bandwidth.com/images/github_logo.png - priority: - $ref: '#/components/schemas/priorityEnum' - required: - - id - - owner - - applicationId - - time - - segmentCount - - direction - - to - - from - - text - - tag - messageFailedCallback: - description: Message Failed Callback + messageCallback: + description: Message Callback Schema type: object properties: time: type: string format: date-time - example: 2016-09-14T18:20:16.000Z + example: 2024-12-02T20:15:57.278Z type: - type: string - example: message-failed + $ref: '#/components/schemas/callbackTypeEnum' to: type: string example: '+15552223333' description: type: string + description: A detailed description of the event described by the callback. example: rejected-unallocated-from-number message: - $ref: '#/components/schemas/messageFailedCallbackMessage' + $ref: '#/components/schemas/messageCallbackMessage' errorCode: type: integer - example: 9902 + description: Optional error code, applicable only when type is `message-failed`. + nullable: true + example: 4405 required: - time - type - to - description - message - - errorCode - messageFailedCallbackMessage: - description: Message Failed Callback Message Schema + messageCallbackMessage: + description: Message payload schema within a MessageCallback type: object properties: id: @@ -1991,7 +1754,7 @@ components: time: type: string format: date-time - example: 2016-09-14T18:20:16.000Z + example: 2024-12-02T20:15:57.666Z segmentCount: type: integer example: 1 @@ -2015,6 +1778,8 @@ components: example: custom string media: type: array + description: Optional media, applicable only for mms + nullable: true items: type: string format: uri @@ -2033,7 +1798,6 @@ components: - to - from - text - - tag callbackMethodEnum: type: string nullable: true @@ -5127,7 +4891,7 @@ components: name: Cache-Control style: simple explode: false - description: >- + description: > General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. example: no-cache @@ -5145,7 +4909,7 @@ components: in: query name: messageId required: false - description: >- + description: > The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and @@ -5158,7 +4922,7 @@ components: in: query name: sourceTn required: false - description: >- + description: > The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. @@ -5170,7 +4934,7 @@ components: in: query name: destinationTn required: false - description: >- + description: > The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 @@ -5182,7 +4946,7 @@ components: in: query name: messageStatus required: false - description: >- + description: > The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. schema: @@ -5198,7 +4962,7 @@ components: in: query name: carrierName required: false - description: >- + description: > The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). @@ -5224,7 +4988,7 @@ components: in: query name: fromDateTime required: false - description: >- + description: > The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. example: 2022-09-14T18:20:16.000Z @@ -5234,7 +4998,7 @@ components: in: query name: toDateTime required: false - description: >- + description: > The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. example: 2022-09-14T18:20:16.000Z @@ -5270,7 +5034,7 @@ components: in: query name: limit required: false - description: >- + description: > The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. schema: @@ -5463,19 +5227,330 @@ components: type: string description: The phone number lookup request ID from Bandwidth. example: 004223a0-8b17-41b1-bf81-20732adf5590 - requestBodies: - createMessageRequest: - content: - application/json: - schema: - $ref: '#/components/schemas/messageRequest' - required: true - uploadMediaRequest: - content: - application/json: - schema: - type: string - format: binary + examples: + smsMessageReceivedCallbackExample: + summary: An example of a sms message-received callback body. + value: + time: '2025-01-06T15:43:35.502180Z' + type: message-received + to: '+12345678902' + description: Incoming message received + message: + id: 14762070468292kw2fuqty55yp2b2 + owner: '+12345678902' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + time: '2025-01-06T15:43:34.000000Z' + segmentCount: 1 + direction: in + to: + - '+12345678902' + from: '+12345678901' + text: Hey, check out this SMS! + mmsMessageReceivedCallbackExample: + summary: An example of a mms message-received callback body. + value: + time: '2024-09-14T18:20:45.160744Z' + type: message-received + to: '+12345678902' + description: Incoming message received + message: + id: 14762070468292kw2fuqty55yp2b2 + owner: '+12345678902' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + time: '2024-09-14T18:20:45.160744Z' + segmentCount: 1 + direction: in + to: + - '+12345678902' + - '+12345678903' + from: '+12345678901' + text: Hey, check out the MMS! + media: + - >- + https://messaging.bandwidth.com/api/v2/users/9900902/media/14762070468292kw2fuqty55yp2b2/0/bw.png + messageSendingCallbackExample: + summary: An example of a message-sending callback body. + value: + time: '2024-06-25T18:42:36.979456Z' + type: message-sending + to: '+15554443333' + description: Message is sending to carrier. + message: + id: 1593110555875xo7watq5px6rbe5d + owner: '+15552221111' + applicationId: cfd4fb83-7531-4acc-b471-42d0bb76a65c + time: '2024-06-25T18:42:35.876906Z' + segmentCount: 1 + direction: out + to: + - '+15554443333' + from: '+15552221111' + text: '' + media: + - https://dev.bandwidth.com/images/bandwidth-logo.png + tag: your tag here + smsMessageDeliveredCallbackExample: + summary: An example of a sms message-delivered callback body. + value: + type: message-delivered + time: '2024-09-14T18:20:11.160744Z' + description: Message delivered to carrier. + to: '+12345678902' + message: + id: 14762070468292kw2fuqty55yp2b2 + time: '2024-09-14T18:20:11.160744Z' + to: + - '+12345678902' + from: '+12345678901' + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + owner: '+12345678902' + direction: out + segmentCount: 1 + mmsMessageDeliveredCallbackExample: + summary: An example of a mms message-delivered callback body. + value: + type: message-delivered + time: '2024-09-14T18:20:24.160544Z' + description: Message delivered to carrier. + to: '+12345678902' + message: + id: 14762070468292kw2fuqty55yp2b2 + time: '2024-09-14T18:20:24.160544Z' + to: + - '+12345678902' + from: '+12345678901' + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + owner: '+12345678902' + direction: out + segmentCount: 1 + media: + - https://dev.bandwidth.com/images/bandwidth-logo.png + groupMmsMessageDeliveredCallbackExample: + summary: An example of a group mms message-delivered callback body. + value: + type: message-delivered + time: '2024-09-14T18:20:17.160544Z' + description: Message delivered to carrier. + to: '+12345678902' + message: + id: 14762070468292kw2fuqty55yp2b2 + time: '2024-09-14T18:20:17.160544Z' + to: + - '+12345678902' + - '+12345678903' + from: '+12345678901' + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + owner: '+12345678902' + direction: out + segmentCount: 1 + messageFailedCallbackExample: + summary: An example of a message-failed callback body. + value: + type: message-failed + time: '2024-12-18T16:51:27.704450Z' + description: forbidden to country + to: '+52345678903' + errorCode: 4432 + message: + id: 14762070468292kw2fuqty55yp2b2 + time: '2024-12-18T16:51:27.704450Z' + to: + - '+12345678902' + - '+52345678903' + from: '+12345678901' + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + media: + - https://dev.bandwidth.com/images/bandwidth-logo.png + owner: '+12345678901' + direction: out + segmentCount: 1 + createCallResponseExample: + summary: Example of a createCall Response + value: + applicationId: 04e88489-df02-4e34-a0ee-27a91849555f + accountId: '9900000' + callId: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + to: '+19195551234' + from: '+19195554312' + enqueuedTime: '2022-06-16T13:15:07.160Z' + callUrl: >- + https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + callTimeout: 30 + callbackTimeout: 15 + tag: My custom tag value + answerMethod: POST + answerUrl: https://myServer.example/bandwidth/webhooks/answer + answerFallbackMethod: POST + answerFallbackUrl: https://myServer.example/bandwidth/webhooks/answerFallback + disconnectMethod: POST + disconnectUrl: https://myServer.example/bandwidth/webhooks/disconnect + username: mySecretUsername + password: '*****' + fallbackUsername: mySecretUsername + fallbackPassword: '*****' + priority: 5 + listConferencesResponseExample: + summary: Example of a listConferences Response + value: + - id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 + name: my-conference-name + createdTime: '2022-06-17T22:19:40.375Z' + completedTime: '2022-06-17T22:20:00.000Z' + conferenceEventUrl: https://myServer.example/bandwidth/webhooks/conferenceEvent + conferenceEventMethod: POST + tag: my custom tag + voiceBadRequestErrorExample: + summary: Example of a Bad Request (400) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceUnauthorizedErrorExample: + summary: Example of an Unauthorized (401) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceForbiddenErrorExample: + summary: Example of a Forbidden (403) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceNotFoundErrorExample: + summary: Example of a Not Found (404) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceNotAllowedErrorExample: + summary: Example of a Not Allowed (405) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceConflictErrorExample: + summary: Example of a Conflict (409) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceUnsupportedMediaTypeErrorExample: + summary: Example of an Unsupported Media Type (415) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceTooManyRequestsErrorExample: + summary: Example of a Too Many Requests (429) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + voiceInternalServerErrorExample: + summary: Example of an Internal Server (500) Error + value: + type: validation + description: 'Invalid answerUrl: only http and https are allowed.' + singleNumberRequestExample: + summary: Example Number Lookup Request for One Number + value: + tns: + - '+19195551234' + multipleNumberRequestExample: + summary: Example Number Lookup Request for Multiple Numbers + value: + tns: + - '+19195551234' + - '+19195554321' + lookupInProgressExample: + summary: Example Lookup In Progress Response + value: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: IN_PROGRESS + lookupFailedExample: + summary: Example Lookup Failed Response + value: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: FAILED + failedTelephoneNumbers: + - '+191955512345' + lookupSingleNumberCompleteExample: + summary: Example Single Number Lookup Complete Response + value: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: COMPLETE + result: + - Response Code: 0 + Message: NOERROR + E.164 Format: '+19195551234' + Formatted: (919) 555-1234 + Country: US + Line Type: Mobile + Line Provider: Verizon Wireless + Mobile Country Code: '310' + Mobile Network Code: '010' + lookupMultipleNumbersCompleteExample: + summary: Example Multiple Numbers Lookup Complete Response + value: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: COMPLETE + result: + - Response Code: 0 + Message: NOERROR + E.164 Format: '+19195551234' + Formatted: (919) 555-1234 + Country: US + Line Type: Mobile + Line Provider: Verizon Wireless + Mobile Country Code: '310' + Mobile Network Code: '010' + - Response Code: 0 + Message: NOERROR + E.164 Format: '+19195554321' + Formatted: (919) 555-4321 + Country: US + Line Type: Mobile + Line Provider: T-Mobile USA + Mobile Country Code: '310' + Mobile Network Code: '160' + lookupMultipleNumbersPartialCompleteExample: + summary: Example Multiple Numbers Lookup Partial Complete Response + value: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: PARTIAL_COMPLETE + result: + - Response Code: 0 + Message: NOERROR + E.164 Format: '+19195551234' + Formatted: (919) 555-1234 + Country: US + Line Type: Mobile + Line Provider: Verizon Wireless + Mobile Country Code: '310' + Mobile Network Code: '010' + failedTelephoneNumbers: + - '+191955512345' + lookupSingleNumberCompleteNoInfoExample: + summary: Example Single Number Lookup Complete with No Information Response + value: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: COMPLETE + result: + - Response Code: 3 + Message: NXDOMAIN + E.164 Format: '+19195550000' + Formatted: (919) 555-0000 + Country: US + requestBodies: + createMessageRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/messageRequest' + required: true + uploadMediaRequest: + content: + application/json: + schema: + type: string + format: binary application/ogg: schema: type: string @@ -5560,6 +5635,14 @@ components: schema: type: string format: binary + image/heic: + schema: + type: string + format: binary + image/heif: + schema: + type: string + format: binary image/jpeg: schema: type: string @@ -5600,6 +5683,10 @@ components: schema: type: string format: binary + text/html: + schema: + type: string + format: binary text/plain: schema: type: string @@ -5648,6 +5735,10 @@ components: schema: type: string format: binary + video/x-flv: + schema: + type: string + format: binary required: true createCallRequest: description: JSON object containing information to create an outbound call @@ -5770,11 +5861,22 @@ components: post: requestBody: required: true - description: Inbound Message Callback Payload + description: > +

This Inbound Message Webhook is an envelope containing a + received (MO) message to your message-enabled Bandwidth telephone + number. The payload type will always indicate "message-received". + +

Please visit Webhooks

content: application/json: schema: - $ref: '#/components/schemas/inboundMessageCallback' + $ref: '#/components/schemas/messageCallback' + examples: + smsMessageReceivedCallback: + $ref: '#/components/examples/smsMessageReceivedCallbackExample' + mmsMessageReceivedCallback: + $ref: '#/components/examples/mmsMessageReceivedCallbackExample' responses: '200': description: OK @@ -5783,186 +5885,31 @@ components: post: requestBody: required: true - description: Status Callback Payload + description: > +

This Outbound Message Webhook is an envelope containing status + information regarding a message sent (MT) from your + message-enabled Bandwidth telephone number. The payload type will + be one of "message-sending", "message-delivered", or + "message-failed". + +

Please visit Webhooks

content: application/json: schema: - type: object - oneOf: - - $ref: '#/components/schemas/messageSendingCallback' - - $ref: '#/components/schemas/messageDeliveredCallback' - - $ref: '#/components/schemas/messageFailedCallback' + $ref: '#/components/schemas/messageCallback' + examples: + messageSendingCallback: + $ref: '#/components/examples/messageSendingCallbackExample' + smsMessageDeliveredCallback: + $ref: '#/components/examples/smsMessageDeliveredCallbackExample' + mmsMessageDeliveredCallback: + $ref: '#/components/examples/mmsMessageDeliveredCallbackExample' + groupMmsMessageDeliveredCallback: + $ref: >- + #/components/examples/groupMmsMessageDeliveredCallbackExample + messageFailedCallback: + $ref: '#/components/examples/messageFailedCallbackExample' responses: '200': description: OK - examples: - createCallResponseExample: - summary: Example of a createCall Response - value: - applicationId: 04e88489-df02-4e34-a0ee-27a91849555f - accountId: '9900000' - callId: c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - to: '+19195551234' - from: '+19195554312' - enqueuedTime: '2022-06-16T13:15:07.160Z' - callUrl: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 - callTimeout: 30 - callbackTimeout: 15 - tag: My custom tag value - answerMethod: POST - answerUrl: https://myServer.example/bandwidth/webhooks/answer - answerFallbackMethod: POST - answerFallbackUrl: https://myServer.example/bandwidth/webhooks/answerFallback - disconnectMethod: POST - disconnectUrl: https://myServer.example/bandwidth/webhooks/disconnect - username: mySecretUsername - password: '*****' - fallbackUsername: mySecretUsername - fallbackPassword: '*****' - priority: 5 - listConferencesResponseExample: - summary: Example of a listConferences Response - value: - - id: conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9 - name: my-conference-name - createdTime: '2022-06-17T22:19:40.375Z' - completedTime: '2022-06-17T22:20:00.000Z' - conferenceEventUrl: https://myServer.example/bandwidth/webhooks/conferenceEvent - conferenceEventMethod: POST - tag: my custom tag - voiceBadRequestErrorExample: - summary: Example of a Bad Request (400) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceUnauthorizedErrorExample: - summary: Example of an Unauthorized (401) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceForbiddenErrorExample: - summary: Example of a Forbidden (403) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceNotFoundErrorExample: - summary: Example of a Not Found (404) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceNotAllowedErrorExample: - summary: Example of a Not Allowed (405) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceConflictErrorExample: - summary: Example of a Conflict (409) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceUnsupportedMediaTypeErrorExample: - summary: Example of an Unsupported Media Type (415) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceTooManyRequestsErrorExample: - summary: Example of a Too Many Requests (429) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - voiceInternalServerErrorExample: - summary: Example of an Internal Server (500) Error - value: - type: validation - description: 'Invalid answerUrl: only http and https are allowed.' - singleNumberRequestExample: - summary: Example Number Lookup Request for One Number - value: - tns: - - '+19195551234' - multipleNumberRequestExample: - summary: Example Number Lookup Request for Multiple Numbers - value: - tns: - - '+19195551234' - - '+19195554321' - lookupInProgressExample: - summary: Example Lookup In Progress Response - value: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: IN_PROGRESS - lookupFailedExample: - summary: Example Lookup Failed Response - value: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: FAILED - failedTelephoneNumbers: - - '+191955512345' - lookupSingleNumberCompleteExample: - summary: Example Single Number Lookup Complete Response - value: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: COMPLETE - result: - - Response Code: 0 - Message: NOERROR - E.164 Format: '+19195551234' - Formatted: (919) 555-1234 - Country: US - Line Type: Mobile - Line Provider: Verizon Wireless - Mobile Country Code: '310' - Mobile Network Code: '010' - lookupMultipleNumbersCompleteExample: - summary: Example Multiple Numbers Lookup Complete Response - value: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: COMPLETE - result: - - Response Code: 0 - Message: NOERROR - E.164 Format: '+19195551234' - Formatted: (919) 555-1234 - Country: US - Line Type: Mobile - Line Provider: Verizon Wireless - Mobile Country Code: '310' - Mobile Network Code: '010' - - Response Code: 0 - Message: NOERROR - E.164 Format: '+19195554321' - Formatted: (919) 555-4321 - Country: US - Line Type: Mobile - Line Provider: T-Mobile USA - Mobile Country Code: '310' - Mobile Network Code: '160' - lookupMultipleNumbersPartialCompleteExample: - summary: Example Multiple Numbers Lookup Partial Complete Response - value: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: PARTIAL_COMPLETE - result: - - Response Code: 0 - Message: NOERROR - E.164 Format: '+19195551234' - Formatted: (919) 555-1234 - Country: US - Line Type: Mobile - Line Provider: Verizon Wireless - Mobile Country Code: '310' - Mobile Network Code: '010' - failedTelephoneNumbers: - - '+191955512345' - lookupSingleNumberCompleteNoInfoExample: - summary: Example Single Number Lookup Complete with No Information Response - value: - requestId: 004223a0-8b17-41b1-bf81-20732adf5590 - status: COMPLETE - result: - - Response Code: 3 - Message: NXDOMAIN - E.164 Format: '+19195550000' - Formatted: (919) 555-0000 - Country: US diff --git a/bandwidth/__init__.py b/bandwidth/__init__.py index 6ba66bc5..fd36416d 100644 --- a/bandwidth/__init__.py +++ b/bandwidth/__init__.py @@ -54,6 +54,7 @@ from bandwidth.models.call_transcription_response import CallTranscriptionResponse from bandwidth.models.call_transcription_track_enum import CallTranscriptionTrackEnum from bandwidth.models.callback_method_enum import CallbackMethodEnum +from bandwidth.models.callback_type_enum import CallbackTypeEnum from bandwidth.models.code_request import CodeRequest from bandwidth.models.conference import Conference from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback @@ -76,8 +77,6 @@ from bandwidth.models.field_error import FieldError from bandwidth.models.file_format_enum import FileFormatEnum from bandwidth.models.gather_callback import GatherCallback -from bandwidth.models.inbound_message_callback import InboundMessageCallback -from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage from bandwidth.models.initiate_callback import InitiateCallback from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum from bandwidth.models.list_message_item import ListMessageItem @@ -91,14 +90,10 @@ from bandwidth.models.machine_detection_result import MachineDetectionResult from bandwidth.models.media import Media from bandwidth.models.message import Message -from bandwidth.models.message_delivered_callback import MessageDeliveredCallback -from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage +from bandwidth.models.message_callback import MessageCallback +from bandwidth.models.message_callback_message import MessageCallbackMessage from bandwidth.models.message_direction_enum import MessageDirectionEnum -from bandwidth.models.message_failed_callback import MessageFailedCallback -from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage from bandwidth.models.message_request import MessageRequest -from bandwidth.models.message_sending_callback import MessageSendingCallback -from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage from bandwidth.models.message_status_enum import MessageStatusEnum from bandwidth.models.message_type_enum import MessageTypeEnum from bandwidth.models.messages_list import MessagesList diff --git a/bandwidth/api/media_api.py b/bandwidth/api/media_api.py index 8258fce9..47b9de62 100644 --- a/bandwidth/api/media_api.py +++ b/bandwidth/api/media_api.py @@ -951,7 +951,7 @@ def upload_media( media_id: Annotated[StrictStr, Field(description="Media ID to retrieve.")], body: Union[StrictBytes, StrictStr], content_type: Annotated[Optional[StrictStr], Field(description="The media type of the entity-body.")] = None, - cache_control: Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.")] = None, + cache_control: Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -977,7 +977,7 @@ def upload_media( :type body: bytearray :param content_type: The media type of the entity-body. :type content_type: str - :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. :type cache_control: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1042,7 +1042,7 @@ def upload_media_with_http_info( media_id: Annotated[StrictStr, Field(description="Media ID to retrieve.")], body: Union[StrictBytes, StrictStr], content_type: Annotated[Optional[StrictStr], Field(description="The media type of the entity-body.")] = None, - cache_control: Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.")] = None, + cache_control: Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1068,7 +1068,7 @@ def upload_media_with_http_info( :type body: bytearray :param content_type: The media type of the entity-body. :type content_type: str - :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. :type cache_control: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1133,7 +1133,7 @@ def upload_media_without_preload_content( media_id: Annotated[StrictStr, Field(description="Media ID to retrieve.")], body: Union[StrictBytes, StrictStr], content_type: Annotated[Optional[StrictStr], Field(description="The media type of the entity-body.")] = None, - cache_control: Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.")] = None, + cache_control: Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1159,7 +1159,7 @@ def upload_media_without_preload_content( :type body: bytearray :param content_type: The media type of the entity-body. :type content_type: str - :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. :type cache_control: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1300,6 +1300,8 @@ def _upload_media_serialize( 'audio/3gpp', 'image/bmp', 'image/gif', + 'image/heic', + 'image/heif', 'image/jpeg', 'image/pjpeg', 'image/png', @@ -1310,6 +1312,7 @@ def _upload_media_serialize( 'text/css', 'text/csv', 'text/calendar', + 'text/html', 'text/plain', 'text/javascript', 'text/vcard', @@ -1321,7 +1324,8 @@ def _upload_media_serialize( 'video/ogg', 'video/quicktime', 'video/webm', - 'video/x-ms-wmv' + 'video/x-ms-wmv', + 'video/x-flv' ] ) ) diff --git a/bandwidth/api/messages_api.py b/bandwidth/api/messages_api.py index 93af0c06..207930b0 100644 --- a/bandwidth/api/messages_api.py +++ b/bandwidth/api/messages_api.py @@ -363,20 +363,20 @@ def _create_message_serialize( def list_messages( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], - message_id: Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter.")] = None, - source_tn: Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, - destination_tn: Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, - message_status: Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.")] = None, + message_id: Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. ")] = None, + source_tn: Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). ")] = None, + destination_tn: Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). ")] = None, + message_status: Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. ")] = None, message_direction: Annotated[Optional[ListMessageDirectionEnum], Field(description="The direction of the message. One of INBOUND OUTBOUND.")] = None, - carrier_name: Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T).")] = None, + carrier_name: Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). ")] = None, message_type: Annotated[Optional[MessageTypeEnum], Field(description="The type of message. Either sms or mms.")] = None, error_code: Annotated[Optional[StrictInt], Field(description="The error code of the message.")] = None, - from_date_time: Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, - to_date_time: Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, + from_date_time: Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. ")] = None, + to_date_time: Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. ")] = None, campaign_id: Annotated[Optional[StrictStr], Field(description="The campaign ID of the message.")] = None, sort: Annotated[Optional[StrictStr], Field(description="The field and direction to sort by combined with a colon. Direction is either asc or desc.")] = None, page_token: Annotated[Optional[StrictStr], Field(description="A base64 encoded value used for pagination of results.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. ")] = None, limit_total_count: Annotated[Optional[StrictBool], Field(description="When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.")] = None, _request_timeout: Union[ None, @@ -397,25 +397,25 @@ def list_messages( :param account_id: Your Bandwidth Account ID. (required) :type account_id: str - :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. :type message_id: str - :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). :type source_tn: str - :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). :type destination_tn: str - :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. :type message_status: MessageStatusEnum :param message_direction: The direction of the message. One of INBOUND OUTBOUND. :type message_direction: ListMessageDirectionEnum - :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). :type carrier_name: str :param message_type: The type of message. Either sms or mms. :type message_type: MessageTypeEnum :param error_code: The error code of the message. :type error_code: int - :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. :type from_date_time: str - :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. :type to_date_time: str :param campaign_id: The campaign ID of the message. :type campaign_id: str @@ -423,7 +423,7 @@ def list_messages( :type sort: str :param page_token: A base64 encoded value used for pagination of results. :type page_token: str - :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. :type limit: int :param limit_total_count: When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. :type limit_total_count: bool @@ -497,20 +497,20 @@ def list_messages( def list_messages_with_http_info( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], - message_id: Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter.")] = None, - source_tn: Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, - destination_tn: Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, - message_status: Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.")] = None, + message_id: Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. ")] = None, + source_tn: Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). ")] = None, + destination_tn: Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). ")] = None, + message_status: Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. ")] = None, message_direction: Annotated[Optional[ListMessageDirectionEnum], Field(description="The direction of the message. One of INBOUND OUTBOUND.")] = None, - carrier_name: Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T).")] = None, + carrier_name: Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). ")] = None, message_type: Annotated[Optional[MessageTypeEnum], Field(description="The type of message. Either sms or mms.")] = None, error_code: Annotated[Optional[StrictInt], Field(description="The error code of the message.")] = None, - from_date_time: Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, - to_date_time: Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, + from_date_time: Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. ")] = None, + to_date_time: Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. ")] = None, campaign_id: Annotated[Optional[StrictStr], Field(description="The campaign ID of the message.")] = None, sort: Annotated[Optional[StrictStr], Field(description="The field and direction to sort by combined with a colon. Direction is either asc or desc.")] = None, page_token: Annotated[Optional[StrictStr], Field(description="A base64 encoded value used for pagination of results.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. ")] = None, limit_total_count: Annotated[Optional[StrictBool], Field(description="When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.")] = None, _request_timeout: Union[ None, @@ -531,25 +531,25 @@ def list_messages_with_http_info( :param account_id: Your Bandwidth Account ID. (required) :type account_id: str - :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. :type message_id: str - :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). :type source_tn: str - :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). :type destination_tn: str - :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. :type message_status: MessageStatusEnum :param message_direction: The direction of the message. One of INBOUND OUTBOUND. :type message_direction: ListMessageDirectionEnum - :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). :type carrier_name: str :param message_type: The type of message. Either sms or mms. :type message_type: MessageTypeEnum :param error_code: The error code of the message. :type error_code: int - :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. :type from_date_time: str - :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. :type to_date_time: str :param campaign_id: The campaign ID of the message. :type campaign_id: str @@ -557,7 +557,7 @@ def list_messages_with_http_info( :type sort: str :param page_token: A base64 encoded value used for pagination of results. :type page_token: str - :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. :type limit: int :param limit_total_count: When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. :type limit_total_count: bool @@ -631,20 +631,20 @@ def list_messages_with_http_info( def list_messages_without_preload_content( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], - message_id: Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter.")] = None, - source_tn: Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, - destination_tn: Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, - message_status: Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.")] = None, + message_id: Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. ")] = None, + source_tn: Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). ")] = None, + destination_tn: Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). ")] = None, + message_status: Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. ")] = None, message_direction: Annotated[Optional[ListMessageDirectionEnum], Field(description="The direction of the message. One of INBOUND OUTBOUND.")] = None, - carrier_name: Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T).")] = None, + carrier_name: Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). ")] = None, message_type: Annotated[Optional[MessageTypeEnum], Field(description="The type of message. Either sms or mms.")] = None, error_code: Annotated[Optional[StrictInt], Field(description="The error code of the message.")] = None, - from_date_time: Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, - to_date_time: Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, + from_date_time: Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. ")] = None, + to_date_time: Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. ")] = None, campaign_id: Annotated[Optional[StrictStr], Field(description="The campaign ID of the message.")] = None, sort: Annotated[Optional[StrictStr], Field(description="The field and direction to sort by combined with a colon. Direction is either asc or desc.")] = None, page_token: Annotated[Optional[StrictStr], Field(description="A base64 encoded value used for pagination of results.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. ")] = None, limit_total_count: Annotated[Optional[StrictBool], Field(description="When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.")] = None, _request_timeout: Union[ None, @@ -665,25 +665,25 @@ def list_messages_without_preload_content( :param account_id: Your Bandwidth Account ID. (required) :type account_id: str - :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. :type message_id: str - :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). :type source_tn: str - :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). :type destination_tn: str - :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. :type message_status: MessageStatusEnum :param message_direction: The direction of the message. One of INBOUND OUTBOUND. :type message_direction: ListMessageDirectionEnum - :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). :type carrier_name: str :param message_type: The type of message. Either sms or mms. :type message_type: MessageTypeEnum :param error_code: The error code of the message. :type error_code: int - :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. :type from_date_time: str - :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. :type to_date_time: str :param campaign_id: The campaign ID of the message. :type campaign_id: str @@ -691,7 +691,7 @@ def list_messages_without_preload_content( :type sort: str :param page_token: A base64 encoded value used for pagination of results. :type page_token: str - :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. :type limit: int :param limit_total_count: When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. :type limit_total_count: bool diff --git a/bandwidth/models/__init__.py b/bandwidth/models/__init__.py index da557bc1..c92ffced 100644 --- a/bandwidth/models/__init__.py +++ b/bandwidth/models/__init__.py @@ -29,6 +29,7 @@ from bandwidth.models.call_transcription_response import CallTranscriptionResponse from bandwidth.models.call_transcription_track_enum import CallTranscriptionTrackEnum from bandwidth.models.callback_method_enum import CallbackMethodEnum +from bandwidth.models.callback_type_enum import CallbackTypeEnum from bandwidth.models.code_request import CodeRequest from bandwidth.models.conference import Conference from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback @@ -51,8 +52,6 @@ from bandwidth.models.field_error import FieldError from bandwidth.models.file_format_enum import FileFormatEnum from bandwidth.models.gather_callback import GatherCallback -from bandwidth.models.inbound_message_callback import InboundMessageCallback -from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage from bandwidth.models.initiate_callback import InitiateCallback from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum from bandwidth.models.list_message_item import ListMessageItem @@ -66,14 +65,10 @@ from bandwidth.models.machine_detection_result import MachineDetectionResult from bandwidth.models.media import Media from bandwidth.models.message import Message -from bandwidth.models.message_delivered_callback import MessageDeliveredCallback -from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage +from bandwidth.models.message_callback import MessageCallback +from bandwidth.models.message_callback_message import MessageCallbackMessage from bandwidth.models.message_direction_enum import MessageDirectionEnum -from bandwidth.models.message_failed_callback import MessageFailedCallback -from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage from bandwidth.models.message_request import MessageRequest -from bandwidth.models.message_sending_callback import MessageSendingCallback -from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage from bandwidth.models.message_status_enum import MessageStatusEnum from bandwidth.models.message_type_enum import MessageTypeEnum from bandwidth.models.messages_list import MessagesList diff --git a/bandwidth/models/callback_type_enum.py b/bandwidth/models/callback_type_enum.py new file mode 100644 index 00000000..7b1f9919 --- /dev/null +++ b/bandwidth/models/callback_type_enum.py @@ -0,0 +1,40 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class CallbackTypeEnum(str, Enum): + """ + Indicates the type of the callback: - `message-received` for inbound callbacks. - One of `message-sending`, `message-delivered`, `message-failed` for status callbacks. + """ + + """ + allowed enum values + """ + MESSAGE_MINUS_RECEIVED = 'message-received' + MESSAGE_MINUS_SENDING = 'message-sending' + MESSAGE_MINUS_DELIVERED = 'message-delivered' + MESSAGE_MINUS_FAILED = 'message-failed' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CallbackTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/bandwidth/models/message.py b/bandwidth/models/message.py index d69c72f3..52a5ed17 100644 --- a/bandwidth/models/message.py +++ b/bandwidth/models/message.py @@ -34,11 +34,11 @@ class Message(BaseModel): owner: Optional[StrictStr] = Field(default=None, description="The Bandwidth phone number associated with the message.") application_id: Optional[StrictStr] = Field(default=None, description="The application ID associated with the message.", alias="applicationId") time: Optional[datetime] = Field(default=None, description="The datetime stamp of the message in ISO 8601") - segment_count: Optional[StrictInt] = Field(default=None, description="The number of segments the original message from the user is broken into before sending over to carrier networks.", alias="segmentCount") + segment_count: Optional[StrictInt] = Field(default=None, description="The number of segments the original message from the user is broken into before sending over to carrier networks. ", alias="segmentCount") direction: Optional[MessageDirectionEnum] = None to: Optional[List[StrictStr]] = Field(default=None, description="The phone number recipients of the message.") var_from: Optional[StrictStr] = Field(default=None, description="The phone number the message was sent from.", alias="from") - media: Optional[List[StrictStr]] = Field(default=None, description="The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name.") + media: Optional[List[StrictStr]] = Field(default=None, description="The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. ") text: Optional[StrictStr] = Field(default=None, description="The contents of the message.") tag: Optional[StrictStr] = Field(default=None, description="The custom string set by the user.") priority: Optional[PriorityEnum] = None diff --git a/bandwidth/models/message_callback.py b/bandwidth/models/message_callback.py new file mode 100644 index 00000000..5006aadc --- /dev/null +++ b/bandwidth/models/message_callback.py @@ -0,0 +1,122 @@ +# 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from bandwidth.models.callback_type_enum import CallbackTypeEnum +from bandwidth.models.message_callback_message import MessageCallbackMessage +from typing import Optional, Set +from typing_extensions import Self + +class MessageCallback(BaseModel): + """ + Message Callback Schema + """ # noqa: E501 + time: datetime + type: CallbackTypeEnum + to: StrictStr + description: StrictStr = Field(description="A detailed description of the event described by the callback.") + message: MessageCallbackMessage + error_code: Optional[StrictInt] = Field(default=None, description="Optional error code, applicable only when type is `message-failed`.", alias="errorCode") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message", "errorCode"] + + 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 MessageCallback 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 message + if self.message: + _dict['message'] = self.message.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 + + # set to None if error_code (nullable) is None + # and model_fields_set contains the field + if self.error_code is None and "error_code" in self.model_fields_set: + _dict['errorCode'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MessageCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "time": obj.get("time"), + "type": obj.get("type"), + "to": obj.get("to"), + "description": obj.get("description"), + "message": MessageCallbackMessage.from_dict(obj["message"]) if obj.get("message") is not None else None, + "errorCode": obj.get("errorCode") + }) + # 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/message_callback_message.py b/bandwidth/models/message_callback_message.py new file mode 100644 index 00000000..6cdb17b7 --- /dev/null +++ b/bandwidth/models/message_callback_message.py @@ -0,0 +1,131 @@ +# 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from bandwidth.models.message_direction_enum import MessageDirectionEnum +from bandwidth.models.priority_enum import PriorityEnum +from typing import Optional, Set +from typing_extensions import Self + +class MessageCallbackMessage(BaseModel): + """ + Message payload schema within a MessageCallback + """ # noqa: E501 + id: StrictStr + owner: StrictStr + application_id: StrictStr = Field(alias="applicationId") + time: datetime + segment_count: StrictInt = Field(alias="segmentCount") + direction: MessageDirectionEnum + to: List[StrictStr] + var_from: StrictStr = Field(alias="from") + text: StrictStr + tag: Optional[StrictStr] = None + media: Optional[List[StrictStr]] = Field(default=None, description="Optional media, applicable only for mms") + priority: Optional[PriorityEnum] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"] + + 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 MessageCallbackMessage 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 + + # set to None if media (nullable) is None + # and model_fields_set contains the field + if self.media is None and "media" in self.model_fields_set: + _dict['media'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MessageCallbackMessage 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"), + "owner": obj.get("owner"), + "applicationId": obj.get("applicationId"), + "time": obj.get("time"), + "segmentCount": obj.get("segmentCount"), + "direction": obj.get("direction"), + "to": obj.get("to"), + "from": obj.get("from"), + "text": obj.get("text"), + "tag": obj.get("tag"), + "media": obj.get("media"), + "priority": obj.get("priority") + }) + # 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/message_request.py b/bandwidth/models/message_request.py index c323adeb..3b722b7a 100644 --- a/bandwidth/models/message_request.py +++ b/bandwidth/models/message_request.py @@ -32,12 +32,12 @@ class MessageRequest(BaseModel): """ # noqa: E501 application_id: StrictStr = Field(description="The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard.", 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.") + 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.") priority: Optional[PriorityEnum] = None - expiration: Optional[datetime] = Field(default=None, description="A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS.") + expiration: Optional[datetime] = Field(default=None, description="A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. ") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["applicationId", "to", "from", "text", "media", "tag", "priority", "expiration"] diff --git a/bandwidth/models/message_status_enum.py b/bandwidth/models/message_status_enum.py index 0c2e9c04..21c69eab 100644 --- a/bandwidth/models/message_status_enum.py +++ b/bandwidth/models/message_status_enum.py @@ -21,7 +21,7 @@ class MessageStatusEnum(str, Enum): """ - The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. """ """ diff --git a/docs/CallbackTypeEnum.md b/docs/CallbackTypeEnum.md new file mode 100644 index 00000000..0d071f57 --- /dev/null +++ b/docs/CallbackTypeEnum.md @@ -0,0 +1,17 @@ +# CallbackTypeEnum + +Indicates the type of the callback: - `message-received` for inbound callbacks. - One of `message-sending`, `message-delivered`, `message-failed` for status callbacks. + +## Enum + +* `MESSAGE_MINUS_RECEIVED` (value: `'message-received'`) + +* `MESSAGE_MINUS_SENDING` (value: `'message-sending'`) + +* `MESSAGE_MINUS_DELIVERED` (value: `'message-delivered'`) + +* `MESSAGE_MINUS_FAILED` (value: `'message-failed'`) + +[[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/MediaApi.md b/docs/MediaApi.md index adc790a5..08d5b702 100644 --- a/docs/MediaApi.md +++ b/docs/MediaApi.md @@ -314,7 +314,7 @@ with bandwidth.ApiClient(configuration) as api_client: media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # str | Media ID to retrieve. body = None # bytearray | content_type = 'audio/wav' # str | The media type of the entity-body. (optional) - cache_control = 'no-cache' # str | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. (optional) + cache_control = 'no-cache' # str | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. (optional) try: # Upload Media @@ -334,7 +334,7 @@ Name | Type | Description | Notes **media_id** | **str**| Media ID to retrieve. | **body** | **bytearray**| | **content_type** | **str**| The media type of the entity-body. | [optional] - **cache_control** | **str**| General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. | [optional] + **cache_control** | **str**| General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. | [optional] ### Return type @@ -346,7 +346,7 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/ogg, application/pdf, application/rtf, application/zip, application/x-tar, application/xml, application/gzip, application/x-bzip2, application/x-gzip, application/smil, application/javascript, audio/mp4, audio/mpeg, audio/ogg, audio/flac, audio/webm, audio/wav, audio/amr, audio/3gpp, image/bmp, image/gif, image/jpeg, image/pjpeg, image/png, image/svg+xml, image/tiff, image/webp, image/x-icon, text/css, text/csv, text/calendar, text/plain, text/javascript, text/vcard, text/vnd.wap.wml, text/xml, video/avi, video/mp4, video/mpeg, video/ogg, video/quicktime, video/webm, video/x-ms-wmv + - **Content-Type**: application/json, application/ogg, application/pdf, application/rtf, application/zip, application/x-tar, application/xml, application/gzip, application/x-bzip2, application/x-gzip, application/smil, application/javascript, audio/mp4, audio/mpeg, audio/ogg, audio/flac, audio/webm, audio/wav, audio/amr, audio/3gpp, image/bmp, image/gif, image/heic, image/heif, image/jpeg, image/pjpeg, image/png, image/svg+xml, image/tiff, image/webp, image/x-icon, text/css, text/csv, text/calendar, text/html, text/plain, text/javascript, text/vcard, text/vnd.wap.wml, text/xml, video/avi, video/mp4, video/mpeg, video/ogg, video/quicktime, video/webm, video/x-ms-wmv, video/x-flv - **Accept**: application/json ### HTTP response details diff --git a/docs/Message.md b/docs/Message.md index ba5d87c2..7521b5cb 100644 --- a/docs/Message.md +++ b/docs/Message.md @@ -9,11 +9,11 @@ Name | Type | Description | Notes **owner** | **str** | The Bandwidth phone number associated with the message. | [optional] **application_id** | **str** | The application ID associated with the message. | [optional] **time** | **datetime** | The datetime stamp of the message in ISO 8601 | [optional] -**segment_count** | **int** | The number of segments the original message from the user is broken into before sending over to carrier networks. | [optional] +**segment_count** | **int** | The number of segments the original message from the user is broken into before sending over to carrier networks. | [optional] **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | [optional] **to** | **List[str]** | The phone number recipients of the message. | [optional] **var_from** | **str** | The phone number the message was sent from. | [optional] -**media** | **List[str]** | The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. | [optional] +**media** | **List[str]** | The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. | [optional] **text** | **str** | The contents of the message. | [optional] **tag** | **str** | The custom string set by the user. | [optional] **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] diff --git a/docs/MessageCallback.md b/docs/MessageCallback.md new file mode 100644 index 00000000..1a1d3da1 --- /dev/null +++ b/docs/MessageCallback.md @@ -0,0 +1,35 @@ +# MessageCallback + +Message Callback Schema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **datetime** | | +**type** | [**CallbackTypeEnum**](CallbackTypeEnum.md) | | +**to** | **str** | | +**description** | **str** | A detailed description of the event described by the callback. | +**message** | [**MessageCallbackMessage**](MessageCallbackMessage.md) | | +**error_code** | **int** | Optional error code, applicable only when type is `message-failed`. | [optional] + +## Example + +```python +from bandwidth.models.message_callback import MessageCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of MessageCallback from a JSON string +message_callback_instance = MessageCallback.from_json(json) +# print the JSON string representation of the object +print(MessageCallback.to_json()) + +# convert the object into a dict +message_callback_dict = message_callback_instance.to_dict() +# create an instance of MessageCallback from a dict +message_callback_from_dict = MessageCallback.from_dict(message_callback_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/MessageCallbackMessage.md b/docs/MessageCallbackMessage.md new file mode 100644 index 00000000..a0c97fed --- /dev/null +++ b/docs/MessageCallbackMessage.md @@ -0,0 +1,41 @@ +# MessageCallbackMessage + +Message payload schema within a MessageCallback + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**owner** | **str** | | +**application_id** | **str** | | +**time** | **datetime** | | +**segment_count** | **int** | | +**direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | +**to** | **List[str]** | | +**var_from** | **str** | | +**text** | **str** | | +**tag** | **str** | | [optional] +**media** | **List[str]** | Optional media, applicable only for mms | [optional] +**priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] + +## Example + +```python +from bandwidth.models.message_callback_message import MessageCallbackMessage + +# TODO update the JSON string below +json = "{}" +# create an instance of MessageCallbackMessage from a JSON string +message_callback_message_instance = MessageCallbackMessage.from_json(json) +# print the JSON string representation of the object +print(MessageCallbackMessage.to_json()) + +# convert the object into a dict +message_callback_message_dict = message_callback_message_instance.to_dict() +# create an instance of MessageCallbackMessage from a dict +message_callback_message_from_dict = MessageCallbackMessage.from_dict(message_callback_message_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/MessageRequest.md b/docs/MessageRequest.md index bf2611d6..a9cfd908 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -7,12 +7,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **application_id** | **str** | The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. | **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] +**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] **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] -**expiration** | **datetime** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. | [optional] +**expiration** | **datetime** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. | [optional] ## Example diff --git a/docs/MessageStatusEnum.md b/docs/MessageStatusEnum.md index 869748f6..40c5cf6e 100644 --- a/docs/MessageStatusEnum.md +++ b/docs/MessageStatusEnum.md @@ -1,6 +1,6 @@ # MessageStatusEnum -The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. +The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. ## Enum diff --git a/docs/MessagesApi.md b/docs/MessagesApi.md index c4ba9ce6..2b283e4e 100644 --- a/docs/MessagesApi.md +++ b/docs/MessagesApi.md @@ -140,20 +140,20 @@ with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = bandwidth.MessagesApi(api_client) account_id = '9900000' # str | Your Bandwidth Account ID. - message_id = '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6' # str | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. (optional) - source_tn = '%2B15554443333' # str | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional) - destination_tn = '%2B15554443333' # str | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional) - message_status = bandwidth.MessageStatusEnum() # MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. (optional) + message_id = '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6' # str | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. (optional) + source_tn = '%2B15554443333' # str | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional) + destination_tn = '%2B15554443333' # str | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional) + message_status = bandwidth.MessageStatusEnum() # MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. (optional) message_direction = bandwidth.ListMessageDirectionEnum() # ListMessageDirectionEnum | The direction of the message. One of INBOUND OUTBOUND. (optional) - carrier_name = 'Verizon' # str | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). (optional) + carrier_name = 'Verizon' # str | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). (optional) message_type = bandwidth.MessageTypeEnum() # MessageTypeEnum | The type of message. Either sms or mms. (optional) error_code = 9902 # int | The error code of the message. (optional) - from_date_time = '2022-09-14T18:20:16.000Z' # str | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) - to_date_time = '2022-09-14T18:20:16.000Z' # str | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) + from_date_time = '2022-09-14T18:20:16.000Z' # str | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) + to_date_time = '2022-09-14T18:20:16.000Z' # str | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) campaign_id = 'CJEUMDK' # str | The campaign ID of the message. (optional) sort = 'sourceTn:desc' # str | The field and direction to sort by combined with a colon. Direction is either asc or desc. (optional) page_token = 'gdEewhcJLQRB5' # str | A base64 encoded value used for pagination of results. (optional) - limit = 50 # int | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional) + limit = 50 # int | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional) limit_total_count = true # bool | When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. (optional) try: @@ -173,20 +173,20 @@ with bandwidth.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_id** | **str**| Your Bandwidth Account ID. | - **message_id** | **str**| The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. | [optional] - **source_tn** | **str**| The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] - **destination_tn** | **str**| The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] - **message_status** | [**MessageStatusEnum**](.md)| The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | [optional] + **message_id** | **str**| The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. | [optional] + **source_tn** | **str**| The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] + **destination_tn** | **str**| The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] + **message_status** | [**MessageStatusEnum**](.md)| The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | [optional] **message_direction** | [**ListMessageDirectionEnum**](.md)| The direction of the message. One of INBOUND OUTBOUND. | [optional] - **carrier_name** | **str**| The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). | [optional] + **carrier_name** | **str**| The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). | [optional] **message_type** | [**MessageTypeEnum**](.md)| The type of message. Either sms or mms. | [optional] **error_code** | **int**| The error code of the message. | [optional] - **from_date_time** | **str**| The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] - **to_date_time** | **str**| The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] + **from_date_time** | **str**| The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] + **to_date_time** | **str**| The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] **campaign_id** | **str**| The campaign ID of the message. | [optional] **sort** | **str**| The field and direction to sort by combined with a colon. Direction is either asc or desc. | [optional] **page_token** | **str**| A base64 encoded value used for pagination of results. | [optional] - **limit** | **int**| The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] + **limit** | **int**| The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] **limit_total_count** | **bool**| When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. | [optional] ### Return type From 77ec60d30379b4bcf39d145a158f7554acd841d2 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 14 Jan 2025 11:20:57 -0500 Subject: [PATCH 2/8] fix spaces in docs --- bandwidth.yml | 30 ++++---- bandwidth/api/media_api.py | 12 ++-- bandwidth/api/messages_api.py | 96 ++++++++++++------------- bandwidth/models/message.py | 4 +- bandwidth/models/message_request.py | 6 +- bandwidth/models/message_status_enum.py | 2 +- docs/MediaApi.md | 4 +- docs/Message.md | 4 +- docs/MessageRequest.md | 6 +- docs/MessageStatusEnum.md | 2 +- docs/MessagesApi.md | 32 ++++----- 11 files changed, 99 insertions(+), 99 deletions(-) diff --git a/bandwidth.yml b/bandwidth.yml index 8725d1d6..87921dfa 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -1357,7 +1357,7 @@ components: example: default messageStatusEnum: type: string - description: > + description: >- The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. enum: @@ -1590,7 +1590,7 @@ components: example: 2024-12-02T20:15:57.278Z segmentCount: type: integer - description: > + description: >- The number of segments the original message from the user is broken into before sending over to carrier networks. example: 2 @@ -1613,7 +1613,7 @@ components: type: array items: type: string - description: > + description: >- The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to @@ -1660,7 +1660,7 @@ components: type: string from: type: string - description: > + 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. @@ -1681,7 +1681,7 @@ components: type: string format: uri maxLength: 4096 - description: > + description: >- A list of URLs to include as media attachments as part of the message. @@ -1700,7 +1700,7 @@ components: expiration: type: string format: date-time - description: > + description: >- A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a @@ -4891,7 +4891,7 @@ components: name: Cache-Control style: simple explode: false - description: > + description: >- General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. example: no-cache @@ -4909,7 +4909,7 @@ components: in: query name: messageId required: false - description: > + description: >- The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and @@ -4922,7 +4922,7 @@ components: in: query name: sourceTn required: false - description: > + description: >- The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. @@ -4934,7 +4934,7 @@ components: in: query name: destinationTn required: false - description: > + description: >- The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 @@ -4946,7 +4946,7 @@ components: in: query name: messageStatus required: false - description: > + description: >- The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. schema: @@ -4962,7 +4962,7 @@ components: in: query name: carrierName required: false - description: > + description: >- The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). @@ -4988,7 +4988,7 @@ components: in: query name: fromDateTime required: false - description: > + description: >- The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. example: 2022-09-14T18:20:16.000Z @@ -4998,7 +4998,7 @@ components: in: query name: toDateTime required: false - description: > + description: >- The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. example: 2022-09-14T18:20:16.000Z @@ -5034,7 +5034,7 @@ components: in: query name: limit required: false - description: > + description: >- The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. schema: diff --git a/bandwidth/api/media_api.py b/bandwidth/api/media_api.py index 47b9de62..38322248 100644 --- a/bandwidth/api/media_api.py +++ b/bandwidth/api/media_api.py @@ -951,7 +951,7 @@ def upload_media( media_id: Annotated[StrictStr, Field(description="Media ID to retrieve.")], body: Union[StrictBytes, StrictStr], content_type: Annotated[Optional[StrictStr], Field(description="The media type of the entity-body.")] = None, - cache_control: Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. ")] = None, + cache_control: Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -977,7 +977,7 @@ def upload_media( :type body: bytearray :param content_type: The media type of the entity-body. :type content_type: str - :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. :type cache_control: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1042,7 +1042,7 @@ def upload_media_with_http_info( media_id: Annotated[StrictStr, Field(description="Media ID to retrieve.")], body: Union[StrictBytes, StrictStr], content_type: Annotated[Optional[StrictStr], Field(description="The media type of the entity-body.")] = None, - cache_control: Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. ")] = None, + cache_control: Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1068,7 +1068,7 @@ def upload_media_with_http_info( :type body: bytearray :param content_type: The media type of the entity-body. :type content_type: str - :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. :type cache_control: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1133,7 +1133,7 @@ def upload_media_without_preload_content( media_id: Annotated[StrictStr, Field(description="Media ID to retrieve.")], body: Union[StrictBytes, StrictStr], content_type: Annotated[Optional[StrictStr], Field(description="The media type of the entity-body.")] = None, - cache_control: Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. ")] = None, + cache_control: Annotated[Optional[StrictStr], Field(description="General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1159,7 +1159,7 @@ def upload_media_without_preload_content( :type body: bytearray :param content_type: The media type of the entity-body. :type content_type: str - :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. + :param cache_control: General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. :type cache_control: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request diff --git a/bandwidth/api/messages_api.py b/bandwidth/api/messages_api.py index 207930b0..93af0c06 100644 --- a/bandwidth/api/messages_api.py +++ b/bandwidth/api/messages_api.py @@ -363,20 +363,20 @@ def _create_message_serialize( def list_messages( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], - message_id: Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. ")] = None, - source_tn: Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). ")] = None, - destination_tn: Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). ")] = None, - message_status: Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. ")] = None, + message_id: Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter.")] = None, + source_tn: Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, + destination_tn: Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, + message_status: Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.")] = None, message_direction: Annotated[Optional[ListMessageDirectionEnum], Field(description="The direction of the message. One of INBOUND OUTBOUND.")] = None, - carrier_name: Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). ")] = None, + carrier_name: Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T).")] = None, message_type: Annotated[Optional[MessageTypeEnum], Field(description="The type of message. Either sms or mms.")] = None, error_code: Annotated[Optional[StrictInt], Field(description="The error code of the message.")] = None, - from_date_time: Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. ")] = None, - to_date_time: Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. ")] = None, + from_date_time: Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, + to_date_time: Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, campaign_id: Annotated[Optional[StrictStr], Field(description="The campaign ID of the message.")] = None, sort: Annotated[Optional[StrictStr], Field(description="The field and direction to sort by combined with a colon. Direction is either asc or desc.")] = None, page_token: Annotated[Optional[StrictStr], Field(description="A base64 encoded value used for pagination of results.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. ")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.")] = None, limit_total_count: Annotated[Optional[StrictBool], Field(description="When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.")] = None, _request_timeout: Union[ None, @@ -397,25 +397,25 @@ def list_messages( :param account_id: Your Bandwidth Account ID. (required) :type account_id: str - :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. :type message_id: str - :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). :type source_tn: str - :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). :type destination_tn: str - :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. :type message_status: MessageStatusEnum :param message_direction: The direction of the message. One of INBOUND OUTBOUND. :type message_direction: ListMessageDirectionEnum - :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). :type carrier_name: str :param message_type: The type of message. Either sms or mms. :type message_type: MessageTypeEnum :param error_code: The error code of the message. :type error_code: int - :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. :type from_date_time: str - :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. :type to_date_time: str :param campaign_id: The campaign ID of the message. :type campaign_id: str @@ -423,7 +423,7 @@ def list_messages( :type sort: str :param page_token: A base64 encoded value used for pagination of results. :type page_token: str - :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. :type limit: int :param limit_total_count: When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. :type limit_total_count: bool @@ -497,20 +497,20 @@ def list_messages( def list_messages_with_http_info( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], - message_id: Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. ")] = None, - source_tn: Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). ")] = None, - destination_tn: Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). ")] = None, - message_status: Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. ")] = None, + message_id: Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter.")] = None, + source_tn: Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, + destination_tn: Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, + message_status: Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.")] = None, message_direction: Annotated[Optional[ListMessageDirectionEnum], Field(description="The direction of the message. One of INBOUND OUTBOUND.")] = None, - carrier_name: Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). ")] = None, + carrier_name: Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T).")] = None, message_type: Annotated[Optional[MessageTypeEnum], Field(description="The type of message. Either sms or mms.")] = None, error_code: Annotated[Optional[StrictInt], Field(description="The error code of the message.")] = None, - from_date_time: Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. ")] = None, - to_date_time: Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. ")] = None, + from_date_time: Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, + to_date_time: Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, campaign_id: Annotated[Optional[StrictStr], Field(description="The campaign ID of the message.")] = None, sort: Annotated[Optional[StrictStr], Field(description="The field and direction to sort by combined with a colon. Direction is either asc or desc.")] = None, page_token: Annotated[Optional[StrictStr], Field(description="A base64 encoded value used for pagination of results.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. ")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.")] = None, limit_total_count: Annotated[Optional[StrictBool], Field(description="When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.")] = None, _request_timeout: Union[ None, @@ -531,25 +531,25 @@ def list_messages_with_http_info( :param account_id: Your Bandwidth Account ID. (required) :type account_id: str - :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. :type message_id: str - :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). :type source_tn: str - :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). :type destination_tn: str - :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. :type message_status: MessageStatusEnum :param message_direction: The direction of the message. One of INBOUND OUTBOUND. :type message_direction: ListMessageDirectionEnum - :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). :type carrier_name: str :param message_type: The type of message. Either sms or mms. :type message_type: MessageTypeEnum :param error_code: The error code of the message. :type error_code: int - :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. :type from_date_time: str - :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. :type to_date_time: str :param campaign_id: The campaign ID of the message. :type campaign_id: str @@ -557,7 +557,7 @@ def list_messages_with_http_info( :type sort: str :param page_token: A base64 encoded value used for pagination of results. :type page_token: str - :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. :type limit: int :param limit_total_count: When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. :type limit_total_count: bool @@ -631,20 +631,20 @@ def list_messages_with_http_info( def list_messages_without_preload_content( self, account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], - message_id: Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. ")] = None, - source_tn: Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). ")] = None, - destination_tn: Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). ")] = None, - message_status: Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. ")] = None, + message_id: Annotated[Optional[StrictStr], Field(description="The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter.")] = None, + source_tn: Annotated[Optional[StrictStr], Field(description="The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, + destination_tn: Annotated[Optional[StrictStr], Field(description="The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919').")] = None, + message_status: Annotated[Optional[MessageStatusEnum], Field(description="The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED.")] = None, message_direction: Annotated[Optional[ListMessageDirectionEnum], Field(description="The direction of the message. One of INBOUND OUTBOUND.")] = None, - carrier_name: Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). ")] = None, + carrier_name: Annotated[Optional[StrictStr], Field(description="The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T).")] = None, message_type: Annotated[Optional[MessageTypeEnum], Field(description="The type of message. Either sms or mms.")] = None, error_code: Annotated[Optional[StrictInt], Field(description="The error code of the message.")] = None, - from_date_time: Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. ")] = None, - to_date_time: Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. ")] = None, + from_date_time: Annotated[Optional[StrictStr], Field(description="The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, + to_date_time: Annotated[Optional[StrictStr], Field(description="The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days.")] = None, campaign_id: Annotated[Optional[StrictStr], Field(description="The campaign ID of the message.")] = None, sort: Annotated[Optional[StrictStr], Field(description="The field and direction to sort by combined with a colon. Direction is either asc or desc.")] = None, page_token: Annotated[Optional[StrictStr], Field(description="A base64 encoded value used for pagination of results.")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. ")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000.")] = None, limit_total_count: Annotated[Optional[StrictBool], Field(description="When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results.")] = None, _request_timeout: Union[ None, @@ -665,25 +665,25 @@ def list_messages_without_preload_content( :param account_id: Your Bandwidth Account ID. (required) :type account_id: str - :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + :param message_id: The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. :type message_id: str - :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :param source_tn: The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). :type source_tn: str - :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + :param destination_tn: The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). :type destination_tn: str - :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + :param message_status: The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. :type message_status: MessageStatusEnum :param message_direction: The direction of the message. One of INBOUND OUTBOUND. :type message_direction: ListMessageDirectionEnum - :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + :param carrier_name: The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). :type carrier_name: str :param message_type: The type of message. Either sms or mms. :type message_type: MessageTypeEnum :param error_code: The error code of the message. :type error_code: int - :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :param from_date_time: The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. :type from_date_time: str - :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + :param to_date_time: The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. :type to_date_time: str :param campaign_id: The campaign ID of the message. :type campaign_id: str @@ -691,7 +691,7 @@ def list_messages_without_preload_content( :type sort: str :param page_token: A base64 encoded value used for pagination of results. :type page_token: str - :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + :param limit: The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. :type limit: int :param limit_total_count: When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. :type limit_total_count: bool diff --git a/bandwidth/models/message.py b/bandwidth/models/message.py index 52a5ed17..d69c72f3 100644 --- a/bandwidth/models/message.py +++ b/bandwidth/models/message.py @@ -34,11 +34,11 @@ class Message(BaseModel): owner: Optional[StrictStr] = Field(default=None, description="The Bandwidth phone number associated with the message.") application_id: Optional[StrictStr] = Field(default=None, description="The application ID associated with the message.", alias="applicationId") time: Optional[datetime] = Field(default=None, description="The datetime stamp of the message in ISO 8601") - segment_count: Optional[StrictInt] = Field(default=None, description="The number of segments the original message from the user is broken into before sending over to carrier networks. ", alias="segmentCount") + segment_count: Optional[StrictInt] = Field(default=None, description="The number of segments the original message from the user is broken into before sending over to carrier networks.", alias="segmentCount") direction: Optional[MessageDirectionEnum] = None to: Optional[List[StrictStr]] = Field(default=None, description="The phone number recipients of the message.") var_from: Optional[StrictStr] = Field(default=None, description="The phone number the message was sent from.", alias="from") - media: Optional[List[StrictStr]] = Field(default=None, description="The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. ") + media: Optional[List[StrictStr]] = Field(default=None, description="The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name.") text: Optional[StrictStr] = Field(default=None, description="The contents of the message.") tag: Optional[StrictStr] = Field(default=None, description="The custom string set by the user.") priority: Optional[PriorityEnum] = None diff --git a/bandwidth/models/message_request.py b/bandwidth/models/message_request.py index 3b722b7a..c323adeb 100644 --- a/bandwidth/models/message_request.py +++ b/bandwidth/models/message_request.py @@ -32,12 +32,12 @@ class MessageRequest(BaseModel): """ # noqa: E501 application_id: StrictStr = Field(description="The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard.", 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. ") + 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.") priority: Optional[PriorityEnum] = None - expiration: Optional[datetime] = Field(default=None, description="A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. ") + expiration: Optional[datetime] = Field(default=None, description="A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["applicationId", "to", "from", "text", "media", "tag", "priority", "expiration"] diff --git a/bandwidth/models/message_status_enum.py b/bandwidth/models/message_status_enum.py index 21c69eab..0c2e9c04 100644 --- a/bandwidth/models/message_status_enum.py +++ b/bandwidth/models/message_status_enum.py @@ -21,7 +21,7 @@ class MessageStatusEnum(str, Enum): """ - The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. """ """ diff --git a/docs/MediaApi.md b/docs/MediaApi.md index 08d5b702..6b25b7ab 100644 --- a/docs/MediaApi.md +++ b/docs/MediaApi.md @@ -314,7 +314,7 @@ with bandwidth.ApiClient(configuration) as api_client: media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' # str | Media ID to retrieve. body = None # bytearray | content_type = 'audio/wav' # str | The media type of the entity-body. (optional) - cache_control = 'no-cache' # str | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. (optional) + cache_control = 'no-cache' # str | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. (optional) try: # Upload Media @@ -334,7 +334,7 @@ Name | Type | Description | Notes **media_id** | **str**| Media ID to retrieve. | **body** | **bytearray**| | **content_type** | **str**| The media type of the entity-body. | [optional] - **cache_control** | **str**| General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. | [optional] + **cache_control** | **str**| General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. | [optional] ### Return type diff --git a/docs/Message.md b/docs/Message.md index 7521b5cb..ba5d87c2 100644 --- a/docs/Message.md +++ b/docs/Message.md @@ -9,11 +9,11 @@ Name | Type | Description | Notes **owner** | **str** | The Bandwidth phone number associated with the message. | [optional] **application_id** | **str** | The application ID associated with the message. | [optional] **time** | **datetime** | The datetime stamp of the message in ISO 8601 | [optional] -**segment_count** | **int** | The number of segments the original message from the user is broken into before sending over to carrier networks. | [optional] +**segment_count** | **int** | The number of segments the original message from the user is broken into before sending over to carrier networks. | [optional] **direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | [optional] **to** | **List[str]** | The phone number recipients of the message. | [optional] **var_from** | **str** | The phone number the message was sent from. | [optional] -**media** | **List[str]** | The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. | [optional] +**media** | **List[str]** | The list of media URLs sent in the message. Including a `filename` field in the `Content-Disposition` header of the media linked with a URL will set the displayed file name. This is a best practice to ensure that your media has a readable file name. | [optional] **text** | **str** | The contents of the message. | [optional] **tag** | **str** | The custom string set by the user. | [optional] **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md index a9cfd908..bf2611d6 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -7,12 +7,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **application_id** | **str** | The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. | **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] +**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] **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] -**expiration** | **datetime** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. | [optional] +**expiration** | **datetime** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. | [optional] ## Example diff --git a/docs/MessageStatusEnum.md b/docs/MessageStatusEnum.md index 40c5cf6e..869748f6 100644 --- a/docs/MessageStatusEnum.md +++ b/docs/MessageStatusEnum.md @@ -1,6 +1,6 @@ # MessageStatusEnum -The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. +The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. ## Enum diff --git a/docs/MessagesApi.md b/docs/MessagesApi.md index 2b283e4e..c4ba9ce6 100644 --- a/docs/MessagesApi.md +++ b/docs/MessagesApi.md @@ -140,20 +140,20 @@ with bandwidth.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = bandwidth.MessagesApi(api_client) account_id = '9900000' # str | Your Bandwidth Account ID. - message_id = '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6' # str | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. (optional) - source_tn = '%2B15554443333' # str | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional) - destination_tn = '%2B15554443333' # str | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional) - message_status = bandwidth.MessageStatusEnum() # MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. (optional) + message_id = '9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6' # str | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. (optional) + source_tn = '%2B15554443333' # str | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional) + destination_tn = '%2B15554443333' # str | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional) + message_status = bandwidth.MessageStatusEnum() # MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. (optional) message_direction = bandwidth.ListMessageDirectionEnum() # ListMessageDirectionEnum | The direction of the message. One of INBOUND OUTBOUND. (optional) - carrier_name = 'Verizon' # str | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). (optional) + carrier_name = 'Verizon' # str | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). (optional) message_type = bandwidth.MessageTypeEnum() # MessageTypeEnum | The type of message. Either sms or mms. (optional) error_code = 9902 # int | The error code of the message. (optional) - from_date_time = '2022-09-14T18:20:16.000Z' # str | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) - to_date_time = '2022-09-14T18:20:16.000Z' # str | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) + from_date_time = '2022-09-14T18:20:16.000Z' # str | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) + to_date_time = '2022-09-14T18:20:16.000Z' # str | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional) campaign_id = 'CJEUMDK' # str | The campaign ID of the message. (optional) sort = 'sourceTn:desc' # str | The field and direction to sort by combined with a colon. Direction is either asc or desc. (optional) page_token = 'gdEewhcJLQRB5' # str | A base64 encoded value used for pagination of results. (optional) - limit = 50 # int | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional) + limit = 50 # int | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional) limit_total_count = true # bool | When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. (optional) try: @@ -173,20 +173,20 @@ with bandwidth.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_id** | **str**| Your Bandwidth Account ID. | - **message_id** | **str**| The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. | [optional] - **source_tn** | **str**| The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] - **destination_tn** | **str**| The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] - **message_status** | [**MessageStatusEnum**](.md)| The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | [optional] + **message_id** | **str**| The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. | [optional] + **source_tn** | **str**| The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] + **destination_tn** | **str**| The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). | [optional] + **message_status** | [**MessageStatusEnum**](.md)| The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. | [optional] **message_direction** | [**ListMessageDirectionEnum**](.md)| The direction of the message. One of INBOUND OUTBOUND. | [optional] - **carrier_name** | **str**| The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). | [optional] + **carrier_name** | **str**| The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). | [optional] **message_type** | [**MessageTypeEnum**](.md)| The type of message. Either sms or mms. | [optional] **error_code** | **int**| The error code of the message. | [optional] - **from_date_time** | **str**| The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] - **to_date_time** | **str**| The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] + **from_date_time** | **str**| The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] + **to_date_time** | **str**| The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. | [optional] **campaign_id** | **str**| The campaign ID of the message. | [optional] **sort** | **str**| The field and direction to sort by combined with a colon. Direction is either asc or desc. | [optional] **page_token** | **str**| A base64 encoded value used for pagination of results. | [optional] - **limit** | **int**| The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] + **limit** | **int**| The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. | [optional] **limit_total_count** | **bool**| When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. | [optional] ### Return type From 77b476355b044e58312e0e0bc23bee2e614b9cdc Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 14 Jan 2025 11:21:04 -0500 Subject: [PATCH 3/8] remove unused models --- bandwidth/models/inbound_message_callback.py | 114 ---------------- .../inbound_message_callback_message.py | 126 ------------------ .../models/message_delivered_callback.py | 114 ---------------- .../message_delivered_callback_message.py | 126 ------------------ bandwidth/models/message_failed_callback.py | 116 ---------------- .../models/message_failed_callback_message.py | 126 ------------------ bandwidth/models/message_sending_callback.py | 114 ---------------- .../message_sending_callback_message.py | 126 ------------------ bandwidth/models/transcription_list.py | 109 --------------- 9 files changed, 1071 deletions(-) delete mode 100644 bandwidth/models/inbound_message_callback.py delete mode 100644 bandwidth/models/inbound_message_callback_message.py delete mode 100644 bandwidth/models/message_delivered_callback.py delete mode 100644 bandwidth/models/message_delivered_callback_message.py delete mode 100644 bandwidth/models/message_failed_callback.py delete mode 100644 bandwidth/models/message_failed_callback_message.py delete mode 100644 bandwidth/models/message_sending_callback.py delete mode 100644 bandwidth/models/message_sending_callback_message.py delete mode 100644 bandwidth/models/transcription_list.py diff --git a/bandwidth/models/inbound_message_callback.py b/bandwidth/models/inbound_message_callback.py deleted file mode 100644 index 6c7174d0..00000000 --- a/bandwidth/models/inbound_message_callback.py +++ /dev/null @@ -1,114 +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 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage -from typing import Optional, Set -from typing_extensions import Self - -class InboundMessageCallback(BaseModel): - """ - Inbound Message Callback - """ # noqa: E501 - time: datetime - type: StrictStr - to: StrictStr - description: StrictStr - message: InboundMessageCallbackMessage - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message"] - - 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 InboundMessageCallback 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 message - if self.message: - _dict['message'] = self.message.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 InboundMessageCallback from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "time": obj.get("time"), - "type": obj.get("type"), - "to": obj.get("to"), - "description": obj.get("description"), - "message": InboundMessageCallbackMessage.from_dict(obj["message"]) if obj.get("message") 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/inbound_message_callback_message.py b/bandwidth/models/inbound_message_callback_message.py deleted file mode 100644 index 21f633c5..00000000 --- a/bandwidth/models/inbound_message_callback_message.py +++ /dev/null @@ -1,126 +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 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from bandwidth.models.message_direction_enum import MessageDirectionEnum -from bandwidth.models.priority_enum import PriorityEnum -from typing import Optional, Set -from typing_extensions import Self - -class InboundMessageCallbackMessage(BaseModel): - """ - Inbound Message Callback Message Schema - """ # noqa: E501 - id: StrictStr - owner: StrictStr - application_id: StrictStr = Field(alias="applicationId") - time: datetime - segment_count: StrictInt = Field(alias="segmentCount") - direction: MessageDirectionEnum - to: List[StrictStr] - var_from: StrictStr = Field(alias="from") - text: StrictStr - tag: Optional[StrictStr] = None - media: Optional[List[StrictStr]] = None - priority: Optional[PriorityEnum] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"] - - 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 InboundMessageCallbackMessage 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 InboundMessageCallbackMessage 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"), - "owner": obj.get("owner"), - "applicationId": obj.get("applicationId"), - "time": obj.get("time"), - "segmentCount": obj.get("segmentCount"), - "direction": obj.get("direction"), - "to": obj.get("to"), - "from": obj.get("from"), - "text": obj.get("text"), - "tag": obj.get("tag"), - "media": obj.get("media"), - "priority": obj.get("priority") - }) - # 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/message_delivered_callback.py b/bandwidth/models/message_delivered_callback.py deleted file mode 100644 index cfcbdeb9..00000000 --- a/bandwidth/models/message_delivered_callback.py +++ /dev/null @@ -1,114 +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 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage -from typing import Optional, Set -from typing_extensions import Self - -class MessageDeliveredCallback(BaseModel): - """ - Message Delivered Callback - """ # noqa: E501 - time: datetime - type: StrictStr - to: StrictStr - description: StrictStr - message: MessageDeliveredCallbackMessage - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message"] - - 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 MessageDeliveredCallback 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 message - if self.message: - _dict['message'] = self.message.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 MessageDeliveredCallback from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "time": obj.get("time"), - "type": obj.get("type"), - "to": obj.get("to"), - "description": obj.get("description"), - "message": MessageDeliveredCallbackMessage.from_dict(obj["message"]) if obj.get("message") 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/message_delivered_callback_message.py b/bandwidth/models/message_delivered_callback_message.py deleted file mode 100644 index 6b004a0f..00000000 --- a/bandwidth/models/message_delivered_callback_message.py +++ /dev/null @@ -1,126 +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 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from bandwidth.models.message_direction_enum import MessageDirectionEnum -from bandwidth.models.priority_enum import PriorityEnum -from typing import Optional, Set -from typing_extensions import Self - -class MessageDeliveredCallbackMessage(BaseModel): - """ - Message Delivered Callback Message Schema - """ # noqa: E501 - id: StrictStr - owner: StrictStr - application_id: StrictStr = Field(alias="applicationId") - time: datetime - segment_count: StrictInt = Field(alias="segmentCount") - direction: MessageDirectionEnum - to: List[StrictStr] - var_from: StrictStr = Field(alias="from") - text: StrictStr - tag: StrictStr - media: Optional[List[StrictStr]] = None - priority: Optional[PriorityEnum] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"] - - 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 MessageDeliveredCallbackMessage 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 MessageDeliveredCallbackMessage 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"), - "owner": obj.get("owner"), - "applicationId": obj.get("applicationId"), - "time": obj.get("time"), - "segmentCount": obj.get("segmentCount"), - "direction": obj.get("direction"), - "to": obj.get("to"), - "from": obj.get("from"), - "text": obj.get("text"), - "tag": obj.get("tag"), - "media": obj.get("media"), - "priority": obj.get("priority") - }) - # 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/message_failed_callback.py b/bandwidth/models/message_failed_callback.py deleted file mode 100644 index b61bca1f..00000000 --- a/bandwidth/models/message_failed_callback.py +++ /dev/null @@ -1,116 +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 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage -from typing import Optional, Set -from typing_extensions import Self - -class MessageFailedCallback(BaseModel): - """ - Message Failed Callback - """ # noqa: E501 - time: datetime - type: StrictStr - to: StrictStr - description: StrictStr - message: MessageFailedCallbackMessage - error_code: StrictInt = Field(alias="errorCode") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message", "errorCode"] - - 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 MessageFailedCallback 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 message - if self.message: - _dict['message'] = self.message.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 MessageFailedCallback from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "time": obj.get("time"), - "type": obj.get("type"), - "to": obj.get("to"), - "description": obj.get("description"), - "message": MessageFailedCallbackMessage.from_dict(obj["message"]) if obj.get("message") is not None else None, - "errorCode": obj.get("errorCode") - }) - # 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/message_failed_callback_message.py b/bandwidth/models/message_failed_callback_message.py deleted file mode 100644 index a58445e4..00000000 --- a/bandwidth/models/message_failed_callback_message.py +++ /dev/null @@ -1,126 +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 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from bandwidth.models.message_direction_enum import MessageDirectionEnum -from bandwidth.models.priority_enum import PriorityEnum -from typing import Optional, Set -from typing_extensions import Self - -class MessageFailedCallbackMessage(BaseModel): - """ - Message Failed Callback Message Schema - """ # noqa: E501 - id: StrictStr - owner: StrictStr - application_id: StrictStr = Field(alias="applicationId") - time: datetime - segment_count: StrictInt = Field(alias="segmentCount") - direction: MessageDirectionEnum - to: List[StrictStr] - var_from: StrictStr = Field(alias="from") - text: StrictStr - tag: StrictStr - media: Optional[List[StrictStr]] = None - priority: Optional[PriorityEnum] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"] - - 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 MessageFailedCallbackMessage 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 MessageFailedCallbackMessage 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"), - "owner": obj.get("owner"), - "applicationId": obj.get("applicationId"), - "time": obj.get("time"), - "segmentCount": obj.get("segmentCount"), - "direction": obj.get("direction"), - "to": obj.get("to"), - "from": obj.get("from"), - "text": obj.get("text"), - "tag": obj.get("tag"), - "media": obj.get("media"), - "priority": obj.get("priority") - }) - # 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/message_sending_callback.py b/bandwidth/models/message_sending_callback.py deleted file mode 100644 index 4ab6d3d3..00000000 --- a/bandwidth/models/message_sending_callback.py +++ /dev/null @@ -1,114 +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 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage -from typing import Optional, Set -from typing_extensions import Self - -class MessageSendingCallback(BaseModel): - """ - Message Sending Callback - """ # noqa: E501 - time: datetime - type: StrictStr - to: StrictStr - description: StrictStr - message: MessageSendingCallbackMessage - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message"] - - 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 MessageSendingCallback 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 message - if self.message: - _dict['message'] = self.message.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 MessageSendingCallback from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "time": obj.get("time"), - "type": obj.get("type"), - "to": obj.get("to"), - "description": obj.get("description"), - "message": MessageSendingCallbackMessage.from_dict(obj["message"]) if obj.get("message") 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/message_sending_callback_message.py b/bandwidth/models/message_sending_callback_message.py deleted file mode 100644 index 8387e75c..00000000 --- a/bandwidth/models/message_sending_callback_message.py +++ /dev/null @@ -1,126 +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 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from bandwidth.models.message_direction_enum import MessageDirectionEnum -from bandwidth.models.priority_enum import PriorityEnum -from typing import Optional, Set -from typing_extensions import Self - -class MessageSendingCallbackMessage(BaseModel): - """ - Message Sending Callback Message Schema - """ # noqa: E501 - id: StrictStr - owner: StrictStr - application_id: StrictStr = Field(alias="applicationId") - time: datetime - segment_count: StrictInt = Field(alias="segmentCount") - direction: MessageDirectionEnum - to: List[StrictStr] - var_from: StrictStr = Field(alias="from") - text: StrictStr - tag: Optional[StrictStr] = None - media: List[StrictStr] - priority: Optional[PriorityEnum] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"] - - 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 MessageSendingCallbackMessage 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 MessageSendingCallbackMessage 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"), - "owner": obj.get("owner"), - "applicationId": obj.get("applicationId"), - "time": obj.get("time"), - "segmentCount": obj.get("segmentCount"), - "direction": obj.get("direction"), - "to": obj.get("to"), - "from": obj.get("from"), - "text": obj.get("text"), - "tag": obj.get("tag"), - "media": obj.get("media"), - "priority": obj.get("priority") - }) - # 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/transcription_list.py b/bandwidth/models/transcription_list.py deleted file mode 100644 index eaa10d13..00000000 --- a/bandwidth/models/transcription_list.py +++ /dev/null @@ -1,109 +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 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from bandwidth.models.transcription import Transcription -from typing import Optional, Set -from typing_extensions import Self - -class TranscriptionList(BaseModel): - """ - TranscriptionList - """ # noqa: E501 - transcripts: Optional[List[Transcription]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["transcripts"] - - 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 TranscriptionList 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 each item in transcripts (list) - _items = [] - if self.transcripts: - for _item in self.transcripts: - if _item: - _items.append(_item.to_dict()) - _dict['transcripts'] = _items - # 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 TranscriptionList from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "transcripts": [Transcription.from_dict(_item) for _item in obj["transcripts"]] if obj.get("transcripts") 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 - - From 226d348a3d67f1e8ad250232c4afb14897fe8cde Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 14 Jan 2025 11:25:39 -0500 Subject: [PATCH 4/8] update python versions in workflows --- .github/workflows/test-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index a9bba712..5062fed4 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -35,7 +35,7 @@ jobs: strategy: matrix: os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-latest] - python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] + python-version: [3.9, '3.10', '3.11', '3.12', '3.13'] fail-fast: false env: PYTHON_VERSION: ${{ matrix.python-version }} From 676d5b080e3f75deb81313b1a90dd66d9fea05cd Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 14 Jan 2025 11:28:39 -0500 Subject: [PATCH 5/8] remove old tests --- .../models/test_inbound_message_callback.py | 101 ----------------- .../test_inbound_message_callback_message.py | 82 -------------- .../models/test_message_delivered_callback.py | 101 ----------------- ...test_message_delivered_callback_message.py | 83 -------------- .../models/test_message_failed_callback.py | 104 ------------------ .../test_message_failed_callback_message.py | 84 -------------- 6 files changed, 555 deletions(-) delete mode 100644 test/unit/models/test_inbound_message_callback.py delete mode 100644 test/unit/models/test_inbound_message_callback_message.py delete mode 100644 test/unit/models/test_message_delivered_callback.py delete mode 100644 test/unit/models/test_message_delivered_callback_message.py delete mode 100644 test/unit/models/test_message_failed_callback.py delete mode 100644 test/unit/models/test_message_failed_callback_message.py diff --git a/test/unit/models/test_inbound_message_callback.py b/test/unit/models/test_inbound_message_callback.py deleted file mode 100644 index 08e91da8..00000000 --- a/test/unit/models/test_inbound_message_callback.py +++ /dev/null @@ -1,101 +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 datetime import datetime - -from bandwidth.models.inbound_message_callback import InboundMessageCallback -from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage - -class TestInboundMessageCallback(unittest.TestCase): - """InboundMessageCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> InboundMessageCallback: - """Test InboundMessageCallback - 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 InboundMessageCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-received', - to = '+15552223333', - description = 'Incoming message received', - message = InboundMessageCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ) - ) - else: - return InboundMessageCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-received', - to = '+15552223333', - description = 'Incoming message received', - message = InboundMessageCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ), - ) - - def testInboundMessageCallback(self): - """Test InboundMessageCallback""" - instance = self.make_instance(True) - assert instance is not None - assert isinstance(instance, InboundMessageCallback) - assert isinstance(instance.time, datetime) - assert instance.type == 'message-received' - assert instance.to == '+15552223333' - assert instance.description == 'Incoming message received' - assert isinstance(instance.message, InboundMessageCallbackMessage) - assert instance.message.id == '1661365814859loidf7mcwd4qacn7' - assert instance.message.owner == '+15553332222' - assert instance.message.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' - assert isinstance(instance.message.time, datetime) - assert instance.message.segment_count == 1 - assert instance.message.direction == 'in' - assert instance.message.to == ["+15552223333"] - assert instance.message.var_from == '+15553332222' - assert instance.message.text == 'Hello world' - assert instance.message.tag == 'custom string' - assert instance.message.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] - assert instance.message.priority == 'default' - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/models/test_inbound_message_callback_message.py b/test/unit/models/test_inbound_message_callback_message.py deleted file mode 100644 index c592fece..00000000 --- a/test/unit/models/test_inbound_message_callback_message.py +++ /dev/null @@ -1,82 +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 datetime import datetime - -from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage - -class TestInboundMessageCallbackMessage(unittest.TestCase): - """InboundMessageCallbackMessage unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> InboundMessageCallbackMessage: - """Test InboundMessageCallbackMessage - 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 InboundMessageCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default' - ) - else: - return InboundMessageCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - ) - - def testInboundMessageCallbackMessage(self): - """Test InboundMessageCallbackMessage""" - instance = self.make_instance(True) - assert instance is not None - assert isinstance(instance, InboundMessageCallbackMessage) - assert instance.id == '1661365814859loidf7mcwd4qacn7' - assert instance.owner == '+15553332222' - assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' - assert isinstance(instance.time, datetime) - assert instance.segment_count == 1 - assert instance.direction == 'in' - assert instance.to == ["+15552223333"] - assert instance.var_from == '+15553332222' - assert instance.text == 'Hello world' - assert instance.tag == 'custom string' - assert instance.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] - assert instance.priority == 'default' - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/models/test_message_delivered_callback.py b/test/unit/models/test_message_delivered_callback.py deleted file mode 100644 index c2b7fafd..00000000 --- a/test/unit/models/test_message_delivered_callback.py +++ /dev/null @@ -1,101 +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 datetime import datetime - -from bandwidth.models.message_delivered_callback import MessageDeliveredCallback -from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage - -class TestMessageDeliveredCallback(unittest.TestCase): - """MessageDeliveredCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> MessageDeliveredCallback: - """Test MessageDeliveredCallback - 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 MessageDeliveredCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-delivered', - to = '+15552223333', - description = 'Message delivered to carrier.', - message = MessageDeliveredCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ) - ) - else: - return MessageDeliveredCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-delivered', - to = '+15552223333', - description = 'Message delivered to carrier.', - message = MessageDeliveredCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ), - ) - - def testMessageDeliveredCallback(self): - """Test MessageDeliveredCallback""" - instance = self.make_instance(True) - assert instance is not None - assert isinstance(instance, MessageDeliveredCallback) - assert isinstance(instance.time, datetime) - assert instance.type == 'message-delivered' - assert instance.to == '+15552223333' - assert instance.description == 'Message delivered to carrier.' - assert isinstance(instance.message, MessageDeliveredCallbackMessage) - assert instance.message.id == '1661365814859loidf7mcwd4qacn7' - assert instance.message.owner == '+15553332222' - assert instance.message.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' - assert isinstance(instance.message.time, datetime) - assert instance.message.segment_count == 1 - assert instance.message.direction == 'in' - assert instance.message.to == ["+15552223333"] - assert instance.message.var_from == '+15553332222' - assert instance.message.text == 'Hello world' - assert instance.message.tag == 'custom string' - assert instance.message.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] - assert instance.message.priority == 'default' - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/models/test_message_delivered_callback_message.py b/test/unit/models/test_message_delivered_callback_message.py deleted file mode 100644 index 3f92aede..00000000 --- a/test/unit/models/test_message_delivered_callback_message.py +++ /dev/null @@ -1,83 +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 datetime import datetime - -from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage - -class TestMessageDeliveredCallbackMessage(unittest.TestCase): - """MessageDeliveredCallbackMessage unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> MessageDeliveredCallbackMessage: - """Test MessageDeliveredCallbackMessage - 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 MessageDeliveredCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default' - ) - else: - return MessageDeliveredCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - ) - - def testMessageDeliveredCallbackMessage(self): - """Test MessageDeliveredCallbackMessage""" - instance = self.make_instance(True) - assert instance is not None - assert isinstance(instance, MessageDeliveredCallbackMessage) - assert instance.id == '1661365814859loidf7mcwd4qacn7' - assert instance.owner == '+15553332222' - assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' - assert isinstance(instance.time, datetime) - assert instance.segment_count == 1 - assert instance.direction == 'in' - assert instance.to == ["+15552223333"] - assert instance.var_from == '+15553332222' - assert instance.text == 'Hello world' - assert instance.tag == 'custom string' - assert instance.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] - assert instance.priority == 'default' - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/models/test_message_failed_callback.py b/test/unit/models/test_message_failed_callback.py deleted file mode 100644 index dd96c182..00000000 --- a/test/unit/models/test_message_failed_callback.py +++ /dev/null @@ -1,104 +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 datetime import datetime - -from bandwidth.models.message_failed_callback import MessageFailedCallback -from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage - -class TestMessageFailedCallback(unittest.TestCase): - """MessageFailedCallback unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> MessageFailedCallback: - """Test MessageFailedCallback - 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 MessageFailedCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-failed', - to = '+15552223333', - description = 'rejected-unallocated-from-number', - message = MessageFailedCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ), - error_code = 9902 - ) - else: - return MessageFailedCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-failed', - to = '+15552223333', - description = 'rejected-unallocated-from-number', - message = MessageFailedCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ), - error_code = 9902, - ) - - def testMessageFailedCallback(self): - """Test MessageFailedCallback""" - instance = self.make_instance(True) - assert instance is not None - assert isinstance(instance, MessageFailedCallback) - assert isinstance(instance.time, datetime) - assert instance.type == 'message-failed' - assert instance.to == '+15552223333' - assert instance.description == 'rejected-unallocated-from-number' - assert isinstance(instance.message, MessageFailedCallbackMessage) - assert instance.message.id == '1661365814859loidf7mcwd4qacn7' - assert instance.message.owner == '+15553332222' - assert instance.message.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' - assert isinstance(instance.message.time, datetime) - assert instance.message.segment_count == 1 - assert instance.message.direction == 'in' - assert instance.message.to == ["+15552223333"] - assert instance.message.var_from == '+15553332222' - assert instance.message.text == 'Hello world' - assert instance.message.tag == 'custom string' - assert instance.message.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] - assert instance.message.priority == 'default' - assert instance.error_code == 9902 - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/models/test_message_failed_callback_message.py b/test/unit/models/test_message_failed_callback_message.py deleted file mode 100644 index 4c16e048..00000000 --- a/test/unit/models/test_message_failed_callback_message.py +++ /dev/null @@ -1,84 +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 datetime import datetime - -from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage - -class TestMessageFailedCallbackMessage(unittest.TestCase): - """MessageFailedCallbackMessage unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> MessageFailedCallbackMessage: - """Test MessageFailedCallbackMessage - 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 MessageFailedCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default' - ) - else: - return MessageFailedCallbackMessage( - id = '1661365814859loidf7mcwd4qacn7', - owner = '+15553332222', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', - segment_count = 1, - direction = 'in', - to = ["+15552223333"], - var_from = '+15553332222', - text = 'Hello world', - tag = 'custom string', - priority = 'default', - ) - - def testMessageFailedCallbackMessage(self): - """Test MessageFailedCallbackMessage""" - instance = self.make_instance(True) - assert instance is not None - assert isinstance(instance, MessageFailedCallbackMessage) - assert instance.id == '1661365814859loidf7mcwd4qacn7' - assert instance.owner == '+15553332222' - assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' - assert isinstance(instance.time, datetime) - assert instance.segment_count == 1 - assert instance.direction == 'in' - assert instance.to == ["+15552223333"] - assert instance.var_from == '+15553332222' - assert instance.text == 'Hello world' - assert instance.tag == 'custom string' - assert instance.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] - assert instance.priority == 'default' - -if __name__ == '__main__': - unittest.main() From b7113cf880dba9539e56bf8b2d90fb4e4515b328 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 14 Jan 2025 11:46:34 -0500 Subject: [PATCH 6/8] update tests --- test/unit/models/test_callback_type_enum.py | 41 ++++++++++++++ ...g_callback.py => test_message_callback.py} | 55 +++++++++---------- ...ge.py => test_message_callback_message.py} | 27 ++++----- 3 files changed, 80 insertions(+), 43 deletions(-) create mode 100644 test/unit/models/test_callback_type_enum.py rename test/unit/models/{test_message_sending_callback.py => test_message_callback.py} (65%) rename test/unit/models/{test_message_sending_callback_message.py => test_message_callback_message.py} (72%) diff --git a/test/unit/models/test_callback_type_enum.py b/test/unit/models/test_callback_type_enum.py new file mode 100644 index 00000000..d73d4a90 --- /dev/null +++ b/test/unit/models/test_callback_type_enum.py @@ -0,0 +1,41 @@ +# 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.callback_type_enum import CallbackTypeEnum + +class TestCallbackTypeEnum(unittest.TestCase): + """CallbackTypeEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCallbackTypeEnum(self): + """Test CallbackTypeEnum""" + received = CallbackTypeEnum('message-received') + sending = CallbackTypeEnum('message-sending') + delivered = CallbackTypeEnum('message-delivered') + failed = CallbackTypeEnum('message-failed') + assert received == 'message-received' + assert sending == 'message-sending' + assert delivered == 'message-delivered' + assert failed == 'message-failed' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_message_sending_callback.py b/test/unit/models/test_message_callback.py similarity index 65% rename from test/unit/models/test_message_sending_callback.py rename to test/unit/models/test_message_callback.py index 958a36d0..fd26d7b1 100644 --- a/test/unit/models/test_message_sending_callback.py +++ b/test/unit/models/test_message_callback.py @@ -14,13 +14,11 @@ import unittest -from datetime import datetime -from bandwidth.models.message_sending_callback import MessageSendingCallback -from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage +from bandwidth.models.message_callback import MessageCallback -class TestMessageSendingCallback(unittest.TestCase): - """MessageSendingCallback unit test stubs""" +class TestMessageCallback(unittest.TestCase): + """MessageCallback unit test stubs""" def setUp(self): pass @@ -28,62 +26,63 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> MessageSendingCallback: - """Test MessageSendingCallback + def make_instance(self, include_optional) -> MessageCallback: + """Test MessageCallback 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 MessageSendingCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-sending', + return MessageCallback( + time = '2024-12-02T20:15:57.278Z', + type = 'message-delivered', to = '+15552223333', - description = 'Message is sending to carrier', - message = MessageSendingCallbackMessage( + description = 'rejected-unallocated-from-number', + message = bandwidth.models.message_callback_message.messageCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', + time = '2024-12-02T20:15:57.666Z', segment_count = 1, direction = 'in', to = ["+15552223333"], - var_from = '+15553332222', + from = '+15553332222', text = 'Hello world', tag = 'custom string', media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ) + priority = 'default', ), + error_code = 4405 ) else: - return MessageSendingCallback( - time = '2016-09-14T18:20:16Z', - type = 'message-sending', + return MessageCallback( + time = '2024-12-02T20:15:57.278Z', + type = 'message-delivered', to = '+15552223333', - description = 'Message is sending to carrier', - message = MessageSendingCallbackMessage( + description = 'rejected-unallocated-from-number', + message = bandwidth.models.message_callback_message.messageCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', + time = '2024-12-02T20:15:57.666Z', segment_count = 1, direction = 'in', to = ["+15552223333"], - var_from = '+15553332222', + from = '+15553332222', text = 'Hello world', tag = 'custom string', media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority = 'default', ), ) - def testMessageSendingCallback(self): - """Test MessageSendingCallback""" + def testMessageCallback(self): + """Test MessageCallback""" instance = self.make_instance(True) assert instance is not None - assert isinstance(instance, MessageSendingCallback) + assert isinstance(instance, MessageCallback) assert isinstance(instance.time, datetime) - assert instance.type == 'message-sending' + assert instance.type == 'message-delivered' assert instance.to == '+15552223333' - assert instance.description == 'Message is sending to carrier' - assert isinstance(instance.message, MessageSendingCallbackMessage) + assert instance.description == 'rejected-unallocated-from-number' + assert isinstance(instance.message, MessageCallbackMessage) assert instance.message.id == '1661365814859loidf7mcwd4qacn7' assert instance.message.owner == '+15553332222' assert instance.message.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' diff --git a/test/unit/models/test_message_sending_callback_message.py b/test/unit/models/test_message_callback_message.py similarity index 72% rename from test/unit/models/test_message_sending_callback_message.py rename to test/unit/models/test_message_callback_message.py index 851e4643..4d11ef74 100644 --- a/test/unit/models/test_message_sending_callback_message.py +++ b/test/unit/models/test_message_callback_message.py @@ -14,12 +14,11 @@ import unittest -from datetime import datetime -from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage +from bandwidth.models.message_callback_message import MessageCallbackMessage -class TestMessageSendingCallbackMessage(unittest.TestCase): - """MessageSendingCallbackMessage unit test stubs""" +class TestMessageCallbackMessage(unittest.TestCase): + """MessageCallbackMessage unit test stubs""" def setUp(self): pass @@ -27,17 +26,17 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> MessageSendingCallbackMessage: - """Test MessageSendingCallbackMessage + def make_instance(self, include_optional) -> MessageCallbackMessage: + """Test MessageCallbackMessage 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 MessageSendingCallbackMessage( + return MessageCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', + time = '2024-12-02T20:15:57.666Z', segment_count = 1, direction = 'in', to = ["+15552223333"], @@ -48,25 +47,23 @@ def make_instance(self, include_optional) -> MessageSendingCallbackMessage: priority = 'default' ) else: - return MessageSendingCallbackMessage( + return MessageCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - time = '2016-09-14T18:20:16Z', + time = '2024-12-02T20:15:57.666Z', segment_count = 1, direction = 'in', to = ["+15552223333"], var_from = '+15553332222', text = 'Hello world', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], - priority = 'default', ) - def testMessageSendingCallbackMessage(self): - """Test MessageSendingCallbackMessage""" + def testMessageCallbackMessage(self): + """Test MessageCallbackMessage""" instance = self.make_instance(True) assert instance is not None - assert isinstance(instance, MessageSendingCallbackMessage) + assert isinstance(instance, MessageCallbackMessage) assert instance.id == '1661365814859loidf7mcwd4qacn7' assert instance.owner == '+15553332222' assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' From 843014e47c3c54b5a0bd05bb6273e7b232bac7de Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 14 Jan 2025 11:53:22 -0500 Subject: [PATCH 7/8] var_from --- test/unit/models/test_message_callback.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/models/test_message_callback.py b/test/unit/models/test_message_callback.py index fd26d7b1..f8f8cbbd 100644 --- a/test/unit/models/test_message_callback.py +++ b/test/unit/models/test_message_callback.py @@ -45,7 +45,7 @@ def make_instance(self, include_optional) -> MessageCallback: segment_count = 1, direction = 'in', to = ["+15552223333"], - from = '+15553332222', + var_from = '+15553332222', text = 'Hello world', tag = 'custom string', media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], @@ -66,7 +66,7 @@ def make_instance(self, include_optional) -> MessageCallback: segment_count = 1, direction = 'in', to = ["+15552223333"], - from = '+15553332222', + var_from = '+15553332222', text = 'Hello world', tag = 'custom string', media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], From c644bb18c7010dc6959cfbff7e2a2d42e8e00881 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 14 Jan 2025 12:06:29 -0500 Subject: [PATCH 8/8] fix tests? --- test/unit/models/test_message_callback.py | 6 ++++-- test/unit/models/test_message_callback_message.py | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/unit/models/test_message_callback.py b/test/unit/models/test_message_callback.py index f8f8cbbd..e2c4ae02 100644 --- a/test/unit/models/test_message_callback.py +++ b/test/unit/models/test_message_callback.py @@ -14,8 +14,10 @@ import unittest +from datetime import datetime from bandwidth.models.message_callback import MessageCallback +from bandwidth.models.message_callback_message import MessageCallbackMessage class TestMessageCallback(unittest.TestCase): """MessageCallback unit test stubs""" @@ -37,7 +39,7 @@ def make_instance(self, include_optional) -> MessageCallback: type = 'message-delivered', to = '+15552223333', description = 'rejected-unallocated-from-number', - message = bandwidth.models.message_callback_message.messageCallbackMessage( + message = MessageCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', @@ -58,7 +60,7 @@ def make_instance(self, include_optional) -> MessageCallback: type = 'message-delivered', to = '+15552223333', description = 'rejected-unallocated-from-number', - message = bandwidth.models.message_callback_message.messageCallbackMessage( + message = MessageCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', diff --git a/test/unit/models/test_message_callback_message.py b/test/unit/models/test_message_callback_message.py index 4d11ef74..950b7181 100644 --- a/test/unit/models/test_message_callback_message.py +++ b/test/unit/models/test_message_callback_message.py @@ -14,6 +14,7 @@ import unittest +from datetime import datetime from bandwidth.models.message_callback_message import MessageCallbackMessage