diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index ff6de818..21ce874e 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -35,8 +35,8 @@ bandwidth/models/call_transcription_detected_language_enum.py bandwidth/models/call_transcription_metadata.py bandwidth/models/call_transcription_response.py bandwidth/models/call_transcription_track_enum.py +bandwidth/models/callback.py bandwidth/models/callback_method_enum.py -bandwidth/models/callback_type_enum.py bandwidth/models/card_width_enum.py bandwidth/models/code_request.py bandwidth/models/conference.py @@ -55,16 +55,19 @@ bandwidth/models/create_call_response.py bandwidth/models/create_lookup_response.py bandwidth/models/create_message_request_error.py bandwidth/models/create_multi_channel_message_response.py -bandwidth/models/deferred_result.py bandwidth/models/disconnect_callback.py bandwidth/models/diversion.py bandwidth/models/dtmf_callback.py bandwidth/models/error.py bandwidth/models/error_object.py +bandwidth/models/error_source.py bandwidth/models/failure_webhook.py bandwidth/models/field_error.py bandwidth/models/file_format_enum.py bandwidth/models/gather_callback.py +bandwidth/models/inbound_callback.py +bandwidth/models/inbound_callback_message.py +bandwidth/models/inbound_callback_type_enum.py bandwidth/models/initiate_callback.py bandwidth/models/link.py bandwidth/models/links_object.py @@ -80,8 +83,6 @@ bandwidth/models/machine_detection_mode_enum.py bandwidth/models/machine_detection_result.py bandwidth/models/media.py bandwidth/models/message.py -bandwidth/models/message_callback.py -bandwidth/models/message_callback_message.py bandwidth/models/message_direction_enum.py bandwidth/models/message_request.py bandwidth/models/message_status_enum.py @@ -93,17 +94,17 @@ bandwidth/models/mfa_forbidden_request_error.py bandwidth/models/mfa_request_error.py bandwidth/models/mfa_unauthorized_request_error.py bandwidth/models/mms_message_content.py +bandwidth/models/mms_message_content_file.py bandwidth/models/multi_channel_action.py bandwidth/models/multi_channel_action_calendar_event.py -bandwidth/models/multi_channel_callback_data.py bandwidth/models/multi_channel_channel_list_object.py bandwidth/models/multi_channel_channel_list_object_content.py -bandwidth/models/multi_channel_message_callback_data.py +bandwidth/models/multi_channel_error.py bandwidth/models/multi_channel_message_channel_enum.py -bandwidth/models/multi_channel_message_data.py -bandwidth/models/multi_channel_message_direction_enum.py +bandwidth/models/multi_channel_message_content.py bandwidth/models/multi_channel_message_request.py -bandwidth/models/multi_channel_status_enum.py +bandwidth/models/multi_channel_message_response_data.py +bandwidth/models/multi_channel_message_response_data_channel_list_inner.py bandwidth/models/opt_in_workflow.py bandwidth/models/page_info.py bandwidth/models/priority_enum.py @@ -114,6 +115,7 @@ bandwidth/models/rbm_action_type_enum.py bandwidth/models/rbm_action_view_location.py bandwidth/models/rbm_card_content.py bandwidth/models/rbm_card_content_media.py +bandwidth/models/rbm_location_response.py bandwidth/models/rbm_media_height_enum.py bandwidth/models/rbm_message_carousel_card.py bandwidth/models/rbm_message_content_file.py @@ -121,6 +123,7 @@ bandwidth/models/rbm_message_content_rich_card.py bandwidth/models/rbm_message_content_text.py bandwidth/models/rbm_message_media.py bandwidth/models/rbm_standalone_card.py +bandwidth/models/rbm_suggestion_response.py bandwidth/models/recording_available_callback.py bandwidth/models/recording_complete_callback.py bandwidth/models/recording_state_enum.py @@ -130,6 +133,9 @@ bandwidth/models/redirect_callback.py bandwidth/models/redirect_method_enum.py bandwidth/models/sms_message_content.py bandwidth/models/standalone_card_orientation_enum.py +bandwidth/models/status_callback.py +bandwidth/models/status_callback_message.py +bandwidth/models/status_callback_type_enum.py bandwidth/models/stir_shaken.py bandwidth/models/telephone_number.py bandwidth/models/tfv_basic_authentication.py @@ -182,8 +188,8 @@ docs/CallTranscriptionDetectedLanguageEnum.md docs/CallTranscriptionMetadata.md docs/CallTranscriptionResponse.md docs/CallTranscriptionTrackEnum.md +docs/Callback.md docs/CallbackMethodEnum.md -docs/CallbackTypeEnum.md docs/CallsApi.md docs/CardWidthEnum.md docs/CodeRequest.md @@ -204,16 +210,19 @@ docs/CreateCallResponse.md docs/CreateLookupResponse.md docs/CreateMessageRequestError.md docs/CreateMultiChannelMessageResponse.md -docs/DeferredResult.md docs/DisconnectCallback.md docs/Diversion.md docs/DtmfCallback.md docs/Error.md docs/ErrorObject.md +docs/ErrorSource.md docs/FailureWebhook.md docs/FieldError.md docs/FileFormatEnum.md docs/GatherCallback.md +docs/InboundCallback.md +docs/InboundCallbackMessage.md +docs/InboundCallbackTypeEnum.md docs/InitiateCallback.md docs/Link.md docs/LinksObject.md @@ -231,8 +240,6 @@ docs/MachineDetectionResult.md docs/Media.md docs/MediaApi.md docs/Message.md -docs/MessageCallback.md -docs/MessageCallbackMessage.md docs/MessageDirectionEnum.md docs/MessageRequest.md docs/MessageStatusEnum.md @@ -245,18 +252,18 @@ docs/MfaForbiddenRequestError.md docs/MfaRequestError.md docs/MfaUnauthorizedRequestError.md docs/MmsMessageContent.md +docs/MmsMessageContentFile.md docs/MultiChannelAction.md docs/MultiChannelActionCalendarEvent.md docs/MultiChannelApi.md -docs/MultiChannelCallbackData.md docs/MultiChannelChannelListObject.md docs/MultiChannelChannelListObjectContent.md -docs/MultiChannelMessageCallbackData.md +docs/MultiChannelError.md docs/MultiChannelMessageChannelEnum.md -docs/MultiChannelMessageData.md -docs/MultiChannelMessageDirectionEnum.md +docs/MultiChannelMessageContent.md docs/MultiChannelMessageRequest.md -docs/MultiChannelStatusEnum.md +docs/MultiChannelMessageResponseData.md +docs/MultiChannelMessageResponseDataChannelListInner.md docs/OptInWorkflow.md docs/PageInfo.md docs/PhoneNumberLookupApi.md @@ -268,6 +275,7 @@ docs/RbmActionTypeEnum.md docs/RbmActionViewLocation.md docs/RbmCardContent.md docs/RbmCardContentMedia.md +docs/RbmLocationResponse.md docs/RbmMediaHeightEnum.md docs/RbmMessageCarouselCard.md docs/RbmMessageContentFile.md @@ -275,6 +283,7 @@ docs/RbmMessageContentRichCard.md docs/RbmMessageContentText.md docs/RbmMessageMedia.md docs/RbmStandaloneCard.md +docs/RbmSuggestionResponse.md docs/RecordingAvailableCallback.md docs/RecordingCompleteCallback.md docs/RecordingStateEnum.md @@ -286,6 +295,9 @@ docs/RedirectMethodEnum.md docs/SmsMessageContent.md docs/StandaloneCardOrientationEnum.md docs/StatisticsApi.md +docs/StatusCallback.md +docs/StatusCallbackMessage.md +docs/StatusCallbackTypeEnum.md docs/StirShaken.md docs/TelephoneNumber.md docs/TfvBasicAuthentication.md diff --git a/README.md b/README.md index 5d623508..b184faed 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ Class | Method | HTTP request | Description *RecordingsApi* | [**update_call_recording_state**](docs/RecordingsApi.md#update_call_recording_state) | **PUT** /accounts/{accountId}/calls/{callId}/recording | Update Recording *StatisticsApi* | [**get_statistics**](docs/StatisticsApi.md#get_statistics) | **GET** /accounts/{accountId}/statistics | Get Account Statistics *TollFreeVerificationApi* | [**create_webhook_subscription**](docs/TollFreeVerificationApi.md#create_webhook_subscription) | **POST** /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions | Create Webhook Subscription +*TollFreeVerificationApi* | [**delete_verification_request**](docs/TollFreeVerificationApi.md#delete_verification_request) | **DELETE** /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification | Delete a Toll-Free Verification Submission *TollFreeVerificationApi* | [**delete_webhook_subscription**](docs/TollFreeVerificationApi.md#delete_webhook_subscription) | **DELETE** /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id} | Delete Webhook Subscription *TollFreeVerificationApi* | [**get_toll_free_verification_status**](docs/TollFreeVerificationApi.md#get_toll_free_verification_status) | **GET** /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification | Get Toll-Free Verification Status *TollFreeVerificationApi* | [**list_toll_free_use_cases**](docs/TollFreeVerificationApi.md#list_toll_free_use_cases) | **GET** /tollFreeVerification/useCases | List Toll-Free Use Cases @@ -165,8 +166,8 @@ Class | Method | HTTP request | Description - [CallTranscriptionMetadata](docs/CallTranscriptionMetadata.md) - [CallTranscriptionResponse](docs/CallTranscriptionResponse.md) - [CallTranscriptionTrackEnum](docs/CallTranscriptionTrackEnum.md) + - [Callback](docs/Callback.md) - [CallbackMethodEnum](docs/CallbackMethodEnum.md) - - [CallbackTypeEnum](docs/CallbackTypeEnum.md) - [CardWidthEnum](docs/CardWidthEnum.md) - [CodeRequest](docs/CodeRequest.md) - [Conference](docs/Conference.md) @@ -185,16 +186,19 @@ Class | Method | HTTP request | Description - [CreateLookupResponse](docs/CreateLookupResponse.md) - [CreateMessageRequestError](docs/CreateMessageRequestError.md) - [CreateMultiChannelMessageResponse](docs/CreateMultiChannelMessageResponse.md) - - [DeferredResult](docs/DeferredResult.md) - [DisconnectCallback](docs/DisconnectCallback.md) - [Diversion](docs/Diversion.md) - [DtmfCallback](docs/DtmfCallback.md) - [Error](docs/Error.md) - [ErrorObject](docs/ErrorObject.md) + - [ErrorSource](docs/ErrorSource.md) - [FailureWebhook](docs/FailureWebhook.md) - [FieldError](docs/FieldError.md) - [FileFormatEnum](docs/FileFormatEnum.md) - [GatherCallback](docs/GatherCallback.md) + - [InboundCallback](docs/InboundCallback.md) + - [InboundCallbackMessage](docs/InboundCallbackMessage.md) + - [InboundCallbackTypeEnum](docs/InboundCallbackTypeEnum.md) - [InitiateCallback](docs/InitiateCallback.md) - [Link](docs/Link.md) - [LinksObject](docs/LinksObject.md) @@ -210,8 +214,6 @@ Class | Method | HTTP request | Description - [MachineDetectionResult](docs/MachineDetectionResult.md) - [Media](docs/Media.md) - [Message](docs/Message.md) - - [MessageCallback](docs/MessageCallback.md) - - [MessageCallbackMessage](docs/MessageCallbackMessage.md) - [MessageDirectionEnum](docs/MessageDirectionEnum.md) - [MessageRequest](docs/MessageRequest.md) - [MessageStatusEnum](docs/MessageStatusEnum.md) @@ -223,17 +225,17 @@ Class | Method | HTTP request | Description - [MfaRequestError](docs/MfaRequestError.md) - [MfaUnauthorizedRequestError](docs/MfaUnauthorizedRequestError.md) - [MmsMessageContent](docs/MmsMessageContent.md) + - [MmsMessageContentFile](docs/MmsMessageContentFile.md) - [MultiChannelAction](docs/MultiChannelAction.md) - [MultiChannelActionCalendarEvent](docs/MultiChannelActionCalendarEvent.md) - - [MultiChannelCallbackData](docs/MultiChannelCallbackData.md) - [MultiChannelChannelListObject](docs/MultiChannelChannelListObject.md) - [MultiChannelChannelListObjectContent](docs/MultiChannelChannelListObjectContent.md) - - [MultiChannelMessageCallbackData](docs/MultiChannelMessageCallbackData.md) + - [MultiChannelError](docs/MultiChannelError.md) - [MultiChannelMessageChannelEnum](docs/MultiChannelMessageChannelEnum.md) - - [MultiChannelMessageData](docs/MultiChannelMessageData.md) - - [MultiChannelMessageDirectionEnum](docs/MultiChannelMessageDirectionEnum.md) + - [MultiChannelMessageContent](docs/MultiChannelMessageContent.md) - [MultiChannelMessageRequest](docs/MultiChannelMessageRequest.md) - - [MultiChannelStatusEnum](docs/MultiChannelStatusEnum.md) + - [MultiChannelMessageResponseData](docs/MultiChannelMessageResponseData.md) + - [MultiChannelMessageResponseDataChannelListInner](docs/MultiChannelMessageResponseDataChannelListInner.md) - [OptInWorkflow](docs/OptInWorkflow.md) - [PageInfo](docs/PageInfo.md) - [PriorityEnum](docs/PriorityEnum.md) @@ -244,6 +246,7 @@ Class | Method | HTTP request | Description - [RbmActionViewLocation](docs/RbmActionViewLocation.md) - [RbmCardContent](docs/RbmCardContent.md) - [RbmCardContentMedia](docs/RbmCardContentMedia.md) + - [RbmLocationResponse](docs/RbmLocationResponse.md) - [RbmMediaHeightEnum](docs/RbmMediaHeightEnum.md) - [RbmMessageCarouselCard](docs/RbmMessageCarouselCard.md) - [RbmMessageContentFile](docs/RbmMessageContentFile.md) @@ -251,6 +254,7 @@ Class | Method | HTTP request | Description - [RbmMessageContentText](docs/RbmMessageContentText.md) - [RbmMessageMedia](docs/RbmMessageMedia.md) - [RbmStandaloneCard](docs/RbmStandaloneCard.md) + - [RbmSuggestionResponse](docs/RbmSuggestionResponse.md) - [RecordingAvailableCallback](docs/RecordingAvailableCallback.md) - [RecordingCompleteCallback](docs/RecordingCompleteCallback.md) - [RecordingStateEnum](docs/RecordingStateEnum.md) @@ -260,6 +264,9 @@ Class | Method | HTTP request | Description - [RedirectMethodEnum](docs/RedirectMethodEnum.md) - [SmsMessageContent](docs/SmsMessageContent.md) - [StandaloneCardOrientationEnum](docs/StandaloneCardOrientationEnum.md) + - [StatusCallback](docs/StatusCallback.md) + - [StatusCallbackMessage](docs/StatusCallbackMessage.md) + - [StatusCallbackTypeEnum](docs/StatusCallbackTypeEnum.md) - [StirShaken](docs/StirShaken.md) - [TelephoneNumber](docs/TelephoneNumber.md) - [TfvBasicAuthentication](docs/TfvBasicAuthentication.md) diff --git a/bandwidth.yml b/bandwidth.yml index 03769645..4b3681cb 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -223,6 +223,8 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '405': + $ref: '#/components/responses/messagingMethodNotAllowedError' '406': $ref: '#/components/responses/messagingNotAcceptableError' '415': @@ -250,24 +252,26 @@ paths: '202': $ref: '#/components/responses/createMultiChannelMessageResponse' '400': - $ref: '#/components/responses/createMessageBadRequestError' + $ref: '#/components/responses/multiChannelBadRequestError' '401': - $ref: '#/components/responses/messagingUnauthorizedError' + $ref: '#/components/responses/multiChannelUnauthorizedError' '403': - $ref: '#/components/responses/messagingForbiddenError' + $ref: '#/components/responses/multiChannelForbiddenError' '404': - $ref: '#/components/responses/messagingNotFoundError' + $ref: '#/components/responses/multiChannelNotFoundError' + '405': + $ref: '#/components/responses/multiChannelMethodNotAllowedError' '406': - $ref: '#/components/responses/messagingNotAcceptableError' + $ref: '#/components/responses/multiChannelNotAcceptableError' '415': - $ref: '#/components/responses/messagingInvalidMediaTypeError' + $ref: '#/components/responses/multiChannelInvalidMediaTypeError' '429': - $ref: '#/components/responses/messagingTooManyRequestsError' + $ref: '#/components/responses/multiChannelTooManyRequestsError' '500': - $ref: '#/components/responses/messagingInternalServerError' + $ref: '#/components/responses/multiChannelInternalServerError' callbacks: - multiChannelCallback: - $ref: '#/components/callbacks/multiChannelMessageCallback' + statusCallback: + $ref: '#/components/callbacks/statusCallback' x-badges: - name: Beta color: '#076EA8' @@ -1471,6 +1475,34 @@ paths: callbacks: tfVerificationStatus: $ref: '#/components/callbacks/tfVerificationStatus' + delete: + description: Delete a toll-free verification submission for a toll-free number. + operationId: deleteVerificationRequest + parameters: + - $ref: '#/components/parameters/accountId' + - $ref: '#/components/parameters/tfPhoneNumberPathParam' + responses: + '204': + $ref: '#/components/responses/noContentResponse' + '400': + $ref: '#/components/responses/tfvBadRequestResponse' + '401': + $ref: '#/components/responses/tfvUnauthorizedResponse' + '403': + $ref: '#/components/responses/tfvForbiddenResponse' + '404': + $ref: '#/components/responses/tfvNotFoundResponse' + '405': + $ref: '#/components/responses/tfvNotAllowedResponse' + '429': + $ref: '#/components/responses/tfvTooManyRequestsResponse' + '500': + $ref: '#/components/responses/tfvServerErrorResponse' + '503': + $ref: '#/components/responses/tfvServiceUnavailableResponse' + summary: Delete a Toll-Free Verification Submission + tags: + - Toll-Free Verification servers: *ref_4 /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions: get: @@ -1554,7 +1586,7 @@ paths: - $ref: '#/components/parameters/webhookSubscriptionIdPathParam' responses: '204': - description: No Content + $ref: '#/components/responses/noContentResponse' '400': $ref: '#/components/responses/tfvBadRequestResponse' '401': @@ -1639,24 +1671,12 @@ components: The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. example: 93de2206-9669-4e07-948d-329f4b722ee2 - 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: The priority specified by the user. + description: >- + Specifies the message's sending priority with respect to other messages + in your account. For best results and optimal throughput, reserve the + 'high' priority setting for critical messages only. enum: - default - high @@ -1753,9 +1773,7 @@ components: messageType: $ref: '#/components/schemas/messageTypeEnum' segmentCount: - type: integer - description: The number of segments the message was sent as. - example: 1 + $ref: '#/components/schemas/segmentCount' errorCode: type: integer description: The numeric error code of the message. @@ -1863,6 +1881,12 @@ components: type: integer mediaName: type: string + segmentCount: + type: integer + description: >- + The number of segments the user's message is broken into before sending + over carrier networks. + example: 1 tag: title: Tag type: string @@ -1870,14 +1894,6 @@ components: A custom string that will be included in callback events of the message. Max 1024 characters. example: custom string - deferredResult: - title: DeferredResult - type: object - properties: - result: - type: object - setOrExpired: - type: boolean expiration: type: string format: date-time @@ -1887,6 +1903,16 @@ components: 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. example: '2021-02-01T11:29:18-05:00' + carrierName: + type: string + description: >- + The name of the Authorized Message Provider (AMP) that handled this + message. + + In the US, this is the carrier that the message was sent to. + + This field is present only when this account feature has been enabled. + example: AT&T message: title: Message type: object @@ -1900,20 +1926,14 @@ components: description: The Bandwidth phone number associated with the message. example: '+15554443333' applicationId: - type: string - description: The application ID associated with the message. - example: 93de2206-9669-4e07-948d-329f4b722ee2 + $ref: '#/components/schemas/applicationId' time: type: string format: date-time description: The datetime stamp of the message in ISO 8601 example: 2024-12-02T20:15:57.278Z segmentCount: - type: integer - description: >- - The number of segments the original message from the user is broken - into before sending over to carrier networks. - example: 2 + $ref: '#/components/schemas/segmentCount' direction: $ref: '#/components/schemas/messageDirectionEnum' to: @@ -1945,9 +1965,7 @@ components: description: The contents of the message. example: Hello world tag: - type: string - description: The custom string set by the user. - example: custom tag + $ref: '#/components/schemas/tag' priority: $ref: '#/components/schemas/priorityEnum' expiration: @@ -1961,11 +1979,7 @@ components: - from properties: applicationId: - type: string - description: >- - The ID of the Application your from number is associated with in the - Bandwidth Phone Number Dashboard. - example: 93de2206-9669-4e07-948d-329f4b722ee2 + $ref: '#/components/schemas/applicationId' to: uniqueItems: true type: array @@ -2021,12 +2035,69 @@ components: type: array items: $ref: '#/components/schemas/link' + example: [] + data: + $ref: '#/components/schemas/multiChannelMessageResponseData' + errors: + type: array + items: + $ref: '#/components/schemas/errorObject' + example: [] + multiChannelError: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + example: [] data: - $ref: '#/components/schemas/multiChannelMessageData' + type: object + nullable: true + example: null errors: type: array items: $ref: '#/components/schemas/errorObject' + link: + type: object + properties: + rel: + type: string + href: + type: string + errorObject: + type: object + properties: + type: + description: A concise summary of the error used for categorization. + type: string + description: + description: A detailed explanation of the error. + type: string + source: + $ref: '#/components/schemas/errorSource' + required: + - type + - description + - source + errorSource: + title: Error Source + type: object + description: Specifies relevant sources of the error, if any. + properties: + parameter: + type: string + description: The relevant URI query parameter causing the error + field: + type: string + description: The request body field that led to the error + header: + type: string + description: The header field that contributed to the error + reference: + type: string + description: A resource ID or path linked to the error multiChannelMessageChannelEnum: description: The channel of the multi-channel message. type: string @@ -2035,12 +2106,6 @@ components: - SMS - MMS example: RBM - multiChannelMessageDirectionEnum: - type: string - enum: - - INBOUND - - OUTBOUND - example: OUTBOUND multiChannelSenderId: type: string description: The sender ID of the message. This could be an alphanumeric sender ID. @@ -2049,6 +2114,14 @@ components: type: string description: The phone number the message should be sent to in E164 format. example: '+15552223333' + multiChannelDestinations: + uniqueItems: true + type: array + description: The destination phone number(s) of the message, in E164 format. + example: + - '+15554443333' + items: + type: string rbmMessageContentText: title: RBM Text type: object @@ -2090,6 +2163,26 @@ components: maxLength: 1000 required: - fileUrl + mmsMessageContentFile: + title: MMS Media File + type: object + properties: + fileUrl: + type: string + format: uri + description: >- + The URL of a media attachment. + + + For MMS, the API limits file size to 3.5MB. Specific carriers and + channels may have a smaller limit that could cause a large file to + fail, see + [here](https://support.bandwidth.com/hc/en-us/articles/360014235473-What-are-the-MMS-file-size-limits) + for more details. + example: https://dev.bandwidth.com/images/bandwidth-logo.png + maxLength: 1000 + required: + - fileUrl rbmMessageMedia: title: RBM Media type: object @@ -2198,7 +2291,9 @@ components: text: $ref: '#/components/schemas/messageText' media: - $ref: '#/components/schemas/messageMedia' + type: array + items: + $ref: '#/components/schemas/mmsMessageContentFile' rbmMessageContentRichCard: title: RBM Rich Card oneOf: @@ -2220,7 +2315,7 @@ components: description: Displayed text for user to click maxLength: 25 example: Hello world - rbmActionPostBackData: + rbmActionPostbackData: title: Post Back Data type: string format: byte @@ -2234,11 +2329,11 @@ components: $ref: '#/components/schemas/rbmActionTypeEnum' text: $ref: '#/components/schemas/rbmActionText' - postBackData: - $ref: '#/components/schemas/rbmActionPostBackData' + postbackData: + $ref: '#/components/schemas/rbmActionPostbackData' required: - text - - postBackData + - postbackData - type rbmActionDial: allOf: @@ -2342,14 +2437,6 @@ components: CREATE_CALENDAR_EVENT: '#/components/schemas/multiChannelActionCalendarEvent' OPEN_URL: '#/components/schemas/rbmActionOpenUrl' REQUEST_LOCATION: '#/components/schemas/rbmActionBase' - multiChannelStatusEnum: - type: string - enum: - - QUEUED - - SENDING - - DELIVERED - - FAILED - example: DELIVERED multiChannelChannelListObject: type: object properties: @@ -2396,141 +2483,250 @@ components: required: - to - channelList - multiChannelMessageCallbackData: - type: object - properties: - messageId: - $ref: '#/components/schemas/messageId' - status: - $ref: '#/components/schemas/multiChannelStatusEnum' - direction: - $ref: '#/components/schemas/multiChannelMessageDirectionEnum' - from: - $ref: '#/components/schemas/multiChannelSenderId' - to: - $ref: '#/components/schemas/multiChannelDestination' - applicationId: - $ref: '#/components/schemas/applicationId' - channel: - $ref: '#/components/schemas/multiChannelMessageChannelEnum' - tag: - $ref: '#/components/schemas/tag' - multiChannelMessageData: + multiChannelMessageResponseData: + description: The data returned in a multichannel message response. type: object properties: messageId: $ref: '#/components/schemas/messageId' - status: - $ref: '#/components/schemas/multiChannelStatusEnum' time: description: The time the message was received by the Bandwidth API. type: string format: date-time example: 2025-01-01T18:20:16.000Z direction: - $ref: '#/components/schemas/multiChannelMessageDirectionEnum' - from: - $ref: '#/components/schemas/multiChannelSenderId' + $ref: '#/components/schemas/messageDirectionEnum' to: - $ref: '#/components/schemas/multiChannelDestination' - applicationId: - $ref: '#/components/schemas/applicationId' - channel: - $ref: '#/components/schemas/multiChannelMessageChannelEnum' + $ref: '#/components/schemas/multiChannelDestinations' + channelList: + type: array + description: >- + A list of message bodies. The messages will be attempted in the + order they are listed. Once a message sends successfully, the others + will be ignored. + items: + allOf: + - $ref: '#/components/schemas/multiChannelChannelListObject' + - type: object + properties: + owner: + type: string + description: >- + The Bandwidth senderId associated with the message. + Identical to 'from'. + required: + - owner + maxItems: 4 tag: $ref: '#/components/schemas/tag' - multiChannelCallbackData: + priority: + $ref: '#/components/schemas/priorityEnum' + expiration: + $ref: '#/components/schemas/expiration' + required: + - messageId + - time + - direction + - to + - channelList + multiChannelMessageContent: + description: The structure of the content field of a multichannel message. type: object properties: - time: - description: The time of the callback event. - type: string - format: date-time - example: 2025-01-01T18:20:16.000Z - type: - $ref: '#/components/schemas/multiChannelStatusEnum' - to: - $ref: '#/components/schemas/multiChannelDestination' - description: + text: type: string - example: Incoming message received - message: - $ref: '#/components/schemas/multiChannelMessageCallbackData' - link: + media: + $ref: '#/components/schemas/rbmMessageContentFile' + rbmSuggestionResponse: type: object properties: - rel: - type: string - href: + text: type: string - errorObject: + description: The text associated with the suggestion response. + example: Yes, I would like to proceed + postbackData: + $ref: '#/components/schemas/rbmActionPostbackData' + rbmLocationResponse: type: object properties: - code: + latitude: type: string - message: + format: double + description: The latitude of the client's location. + example: '37.7749' + longitude: type: string - messageCallback: - description: Message Callback Schema + format: double + description: The longitude of the client's location. + example: '-122.4194' + callback: + description: >- + Callbacks are divided into two types based on direction of the related + message: + + - `statusCallback` indicates status of an outbound MT SMS, MMS, or RBM + message. + + - `inboundCallback` indicates an inbound MO message or a multichannel + message client's response to a suggestion or location request. + type: object + oneOf: + - $ref: '#/components/schemas/statusCallback' + - $ref: '#/components/schemas/inboundCallback' + discriminator: + propertyName: type + mapping: + message-sent: '#/components/schemas/statusCallback' + message-delivered: '#/components/schemas/statusCallback' + message-failed: '#/components/schemas/statusCallback' + message-read: '#/components/schemas/statusCallback' + message-received: '#/components/schemas/inboundCallback' + request-location-response: '#/components/schemas/inboundCallback' + suggestion-response: '#/components/schemas/inboundCallback' + statusCallback: type: object + description: >- + Represents a status callback for an outbound MT SMS or MMS or RBM + message. properties: time: type: string format: date-time example: 2024-12-02T20:15:57.278Z + eventTime: + type: string + description: >- + Represents the time at which the message was read, for + `message-read` callbacks. + format: date-time + example: 2024-12-02T20:15:58.278Z type: - $ref: '#/components/schemas/callbackTypeEnum' + $ref: '#/components/schemas/statusCallbackTypeEnum' to: type: string + description: >- + The destination phone number the message was sent to. + + For status callbacks, this the the Bandwidth user's client phone + number. example: '+15552223333' description: type: string description: A detailed description of the event described by the callback. - example: rejected-unallocated-from-number + example: Message delivered to carrier. message: - $ref: '#/components/schemas/messageCallbackMessage' + $ref: '#/components/schemas/statusCallbackMessage' errorCode: type: integer description: Optional error code, applicable only when type is `message-failed`. - nullable: true example: 4405 carrierName: + $ref: '#/components/schemas/carrierName' + required: + - time + - type + - to + - description + - message + inboundCallback: + type: object + description: Represents an inbound callback. + properties: + time: type: string - description: >- - The name of the Authorized Message Provider (AMP) that handled this - message. In the US, this is the carrier that the message was sent - to. - nullable: true - example: AT&T + format: date-time + example: 2024-12-02T20:15:57.278Z + type: + $ref: '#/components/schemas/inboundCallbackTypeEnum' + to: + type: string + description: > + The destination phone number the message was sent to. + + For inbound callbacks, this is the Bandwidth number or alphanumeric + identifier that received the message. + example: '+15552223333' + description: + type: string + description: A detailed description of the event described by the callback. + example: Incoming message received + message: + $ref: '#/components/schemas/inboundCallbackMessage' + carrierName: + $ref: '#/components/schemas/carrierName' required: - time - type - to - description - message - messageCallbackMessage: - description: Message payload schema within a MessageCallback + statusCallbackTypeEnum: + type: string + description: >- + The possible status callbacks when sending an MT SMS or MMS or RBM + message: + + - `message-sending` indicates that Bandwidth is sending the message to + the upstream provider. + + - `message-delivered` indicates that the message was successfully sent. + + - `message-failed` indicates that the message could not be sent to the + intended recipient. + + - `message-read` indicates that the RBM message was read by the + recipient. + enum: + - message-sending + - message-delivered + - message-failed + - message-read + example: message-delivered + inboundCallbackTypeEnum: + type: string + description: >- + The possible inbound callback types originating from MO messages or + multichannel message client responses: + + - `message-received` indicates an MO message from a Bandwidth user's + client to a Bandwidth number. + + - `request-location-response` indicates a response to a location request + sent by the Bandwidth user's client after receiving an RBM message. + + - `suggestion-response` indicates a response to a suggestion sent by the + Bandwidth user's client after receiving an RBM message. + enum: + - message-received + - request-location-response + - suggestion-response + example: message-received + statusCallbackMessage: + description: Message payload schema within a callback type: object properties: id: type: string + description: A unique identifier of the message. example: 1661365814859loidf7mcwd4qacn7 owner: type: string + description: >- + The Bandwidth phone number or alphanumeric identifier associated + with the message. example: '+15553332222' applicationId: - type: string - example: 93de2206-9669-4e07-948d-329f4b722ee2 + $ref: '#/components/schemas/applicationId' time: type: string format: date-time example: 2024-12-02T20:15:57.666Z segmentCount: - type: integer - example: 1 + $ref: '#/components/schemas/segmentCount' direction: $ref: '#/components/schemas/messageDirectionEnum' to: + description: The phone number recipients of the message. uniqueItems: true type: array items: @@ -2539,17 +2735,18 @@ components: - '+15552223333' from: type: string + description: >- + The Bandwidth phone number or alphanumeric identifier the message + was sent from. example: '+15553332222' text: type: string example: Hello world tag: - type: string - example: custom string + $ref: '#/components/schemas/tag' media: type: array - description: Optional media, applicable only for mms - nullable: true + description: Optional media, not applicable for sms items: type: string format: uri @@ -2558,6 +2755,28 @@ components: - https://dev.bandwidth.com/images/github_logo.png priority: $ref: '#/components/schemas/priorityEnum' + channel: + $ref: '#/components/schemas/multiChannelMessageChannelEnum' + required: + - id + - owner + - applicationId + - time + - segmentCount + - direction + - to + - from + inboundCallbackMessage: + allOf: + - $ref: '#/components/schemas/statusCallbackMessage' + - type: object + properties: + content: + $ref: '#/components/schemas/multiChannelMessageContent' + suggestionResponse: + $ref: '#/components/schemas/rbmSuggestionResponse' + locationResponse: + $ref: '#/components/schemas/rbmLocationResponse' required: - id - owner @@ -2567,7 +2786,6 @@ components: - direction - to - from - - text callbackMethodEnum: type: string nullable: true @@ -5954,6 +6172,12 @@ components: application/json: schema: $ref: '#/components/schemas/messagingRequestError' + messagingMethodNotAllowedError: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/messagingRequestError' messagingInvalidMediaTypeError: description: Unsupported Media Type content: @@ -5972,6 +6196,120 @@ components: application/json: schema: $ref: '#/components/schemas/messagingRequestError' + multiChannelBadRequestError: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: request-validation + description: >- + The 'channelList[0].from' field must contain exactly one + telephone number + source: + field: channelList[0].from + multiChannelNotAcceptableError: + description: Not Acceptable + multiChannelUnauthorizedError: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: unauthorized + description: Authentication Failed + source: {} + multiChannelForbiddenError: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: forbidden + description: Access Denied + source: {} + multiChannelNotFoundError: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: forbidden + description: Resource not found. + source: {} + multiChannelMethodNotAllowedError: + description: Method Not Allowed + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: method-not-allowed + description: Method 'PUT' not supported for this resource. + source: {} + multiChannelInvalidMediaTypeError: + description: Unsupported Media Type + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: unsupported-content-type + description: >- + Content-Type 'application/xml;charset=UTF-8' is not supported. + Please use 'application/json' + source: + header: Content-Type + multiChannelTooManyRequestsError: + description: Too Many Requests + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: rate-limit-exceeded + description: >- + You have exceeded your rate limit for this endpoint. Please + retry later. + source: {} + multiChannelInternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelError' + example: + links: [] + data: null + errors: + - type: internal-server-error + description: Internal server error. No further information available + source: {} createCallResponse: description: Created headers: @@ -6373,6 +6711,8 @@ components: example: description: Cannot process request. type: bad request + noContentResponse: + description: No Content tfvPostBadRequestResponse: description: Bad Request content: @@ -7506,17 +7846,30 @@ components: post: requestBody: required: true - 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". + description: >- +

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

The payload type will be one of message-received, + suggestion-response, or + location-request-response. + +

Note that suggestion-response and + location-request-response callback types are + pertinent only for RBM messages sent from the + /messages/multiChannel endpoint.

Please visit Webhooks

content: application/json: schema: - $ref: '#/components/schemas/messageCallback' + $ref: '#/components/schemas/inboundCallback' examples: smsMessageReceivedCallback: $ref: '#/components/examples/smsMessageReceivedCallbackExample' @@ -7525,24 +7878,26 @@ components: responses: '200': description: OK + '202': + description: Accepted statusCallback: '{statusCallbackUrl}': post: requestBody: required: true - description: > + 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". + information regarding a message sent (MT) + from your message-enabled Bandwidth telephone number. +

The payload type will be one of message-sending, message-delivered, message-failed or message-read. +

Note that message-read callbacks are pertinent only for RBM messages sent from the /messages/multiChannel endpoint.

Please visit Webhooks

content: application/json: schema: - $ref: '#/components/schemas/messageCallback' + $ref: '#/components/schemas/statusCallback' examples: messageSendingCallback: $ref: '#/components/examples/messageSendingCallbackExample' @@ -7558,19 +7913,8 @@ components: responses: '200': description: OK - multiChannelMessageCallback: - '{multiChannelMessageCallbackUrl}': - post: - requestBody: - required: true - description: Status Callback Payload - content: - application/json: - schema: - $ref: '#/components/schemas/multiChannelCallbackData' - responses: - '204': - description: No Content + '202': + description: Accepted tfVerificationStatus: your_url.com/webhookService: post: @@ -7594,7 +7938,7 @@ components: $ref: '#/components/requestBodies/verificationWebhookRequest' responses: '204': - description: No Content + $ref: '#/components/responses/noContentResponse' '400': $ref: '#/components/responses/tfvBadRequestResponse' '401': diff --git a/bandwidth/__init__.py b/bandwidth/__init__.py index 104043fb..3bc9eb78 100644 --- a/bandwidth/__init__.py +++ b/bandwidth/__init__.py @@ -58,8 +58,8 @@ from bandwidth.models.call_transcription_metadata import CallTranscriptionMetadata from bandwidth.models.call_transcription_response import CallTranscriptionResponse from bandwidth.models.call_transcription_track_enum import CallTranscriptionTrackEnum +from bandwidth.models.callback import Callback from bandwidth.models.callback_method_enum import CallbackMethodEnum -from bandwidth.models.callback_type_enum import CallbackTypeEnum from bandwidth.models.card_width_enum import CardWidthEnum from bandwidth.models.code_request import CodeRequest from bandwidth.models.conference import Conference @@ -78,16 +78,19 @@ from bandwidth.models.create_lookup_response import CreateLookupResponse from bandwidth.models.create_message_request_error import CreateMessageRequestError from bandwidth.models.create_multi_channel_message_response import CreateMultiChannelMessageResponse -from bandwidth.models.deferred_result import DeferredResult from bandwidth.models.disconnect_callback import DisconnectCallback from bandwidth.models.diversion import Diversion from bandwidth.models.dtmf_callback import DtmfCallback from bandwidth.models.error import Error from bandwidth.models.error_object import ErrorObject +from bandwidth.models.error_source import ErrorSource from bandwidth.models.failure_webhook import FailureWebhook 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_callback import InboundCallback +from bandwidth.models.inbound_callback_message import InboundCallbackMessage +from bandwidth.models.inbound_callback_type_enum import InboundCallbackTypeEnum from bandwidth.models.initiate_callback import InitiateCallback from bandwidth.models.link import Link from bandwidth.models.links_object import LinksObject @@ -103,8 +106,6 @@ from bandwidth.models.machine_detection_result import MachineDetectionResult from bandwidth.models.media import Media from bandwidth.models.message import Message -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_request import MessageRequest from bandwidth.models.message_status_enum import MessageStatusEnum @@ -116,17 +117,17 @@ from bandwidth.models.mfa_request_error import MfaRequestError from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError from bandwidth.models.mms_message_content import MmsMessageContent +from bandwidth.models.mms_message_content_file import MmsMessageContentFile from bandwidth.models.multi_channel_action import MultiChannelAction from bandwidth.models.multi_channel_action_calendar_event import MultiChannelActionCalendarEvent -from bandwidth.models.multi_channel_callback_data import MultiChannelCallbackData from bandwidth.models.multi_channel_channel_list_object import MultiChannelChannelListObject from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent -from bandwidth.models.multi_channel_message_callback_data import MultiChannelMessageCallbackData +from bandwidth.models.multi_channel_error import MultiChannelError from bandwidth.models.multi_channel_message_channel_enum import MultiChannelMessageChannelEnum -from bandwidth.models.multi_channel_message_data import MultiChannelMessageData -from bandwidth.models.multi_channel_message_direction_enum import MultiChannelMessageDirectionEnum +from bandwidth.models.multi_channel_message_content import MultiChannelMessageContent from bandwidth.models.multi_channel_message_request import MultiChannelMessageRequest -from bandwidth.models.multi_channel_status_enum import MultiChannelStatusEnum +from bandwidth.models.multi_channel_message_response_data import MultiChannelMessageResponseData +from bandwidth.models.multi_channel_message_response_data_channel_list_inner import MultiChannelMessageResponseDataChannelListInner from bandwidth.models.opt_in_workflow import OptInWorkflow from bandwidth.models.page_info import PageInfo from bandwidth.models.priority_enum import PriorityEnum @@ -137,6 +138,7 @@ from bandwidth.models.rbm_action_view_location import RbmActionViewLocation from bandwidth.models.rbm_card_content import RbmCardContent from bandwidth.models.rbm_card_content_media import RbmCardContentMedia +from bandwidth.models.rbm_location_response import RbmLocationResponse from bandwidth.models.rbm_media_height_enum import RbmMediaHeightEnum from bandwidth.models.rbm_message_carousel_card import RbmMessageCarouselCard from bandwidth.models.rbm_message_content_file import RbmMessageContentFile @@ -144,6 +146,7 @@ from bandwidth.models.rbm_message_content_text import RbmMessageContentText from bandwidth.models.rbm_message_media import RbmMessageMedia from bandwidth.models.rbm_standalone_card import RbmStandaloneCard +from bandwidth.models.rbm_suggestion_response import RbmSuggestionResponse from bandwidth.models.recording_available_callback import RecordingAvailableCallback from bandwidth.models.recording_complete_callback import RecordingCompleteCallback from bandwidth.models.recording_state_enum import RecordingStateEnum @@ -153,6 +156,9 @@ from bandwidth.models.redirect_method_enum import RedirectMethodEnum from bandwidth.models.sms_message_content import SmsMessageContent from bandwidth.models.standalone_card_orientation_enum import StandaloneCardOrientationEnum +from bandwidth.models.status_callback import StatusCallback +from bandwidth.models.status_callback_message import StatusCallbackMessage +from bandwidth.models.status_callback_type_enum import StatusCallbackTypeEnum from bandwidth.models.stir_shaken import StirShaken from bandwidth.models.telephone_number import TelephoneNumber from bandwidth.models.tfv_basic_authentication import TfvBasicAuthentication diff --git a/bandwidth/api/messages_api.py b/bandwidth/api/messages_api.py index 246a21d6..a1f9128a 100644 --- a/bandwidth/api/messages_api.py +++ b/bandwidth/api/messages_api.py @@ -108,6 +108,7 @@ def create_message( '401': "MessagingRequestError", '403': "MessagingRequestError", '404': "MessagingRequestError", + '405': "MessagingRequestError", '406': "MessagingRequestError", '415': "MessagingRequestError", '429': "MessagingRequestError", @@ -187,6 +188,7 @@ def create_message_with_http_info( '401': "MessagingRequestError", '403': "MessagingRequestError", '404': "MessagingRequestError", + '405': "MessagingRequestError", '406': "MessagingRequestError", '415': "MessagingRequestError", '429': "MessagingRequestError", @@ -266,6 +268,7 @@ def create_message_without_preload_content( '401': "MessagingRequestError", '403': "MessagingRequestError", '404': "MessagingRequestError", + '405': "MessagingRequestError", '406': "MessagingRequestError", '415': "MessagingRequestError", '429': "MessagingRequestError", diff --git a/bandwidth/api/multi_channel_api.py b/bandwidth/api/multi_channel_api.py index aee15eb1..703d1a2e 100644 --- a/bandwidth/api/multi_channel_api.py +++ b/bandwidth/api/multi_channel_api.py @@ -99,14 +99,15 @@ def create_multi_channel_message( _response_types_map: Dict[str, Optional[str]] = { '202': "CreateMultiChannelMessageResponse", - '400': "CreateMessageRequestError", - '401': "MessagingRequestError", - '403': "MessagingRequestError", - '404': "MessagingRequestError", - '406': "MessagingRequestError", - '415': "MessagingRequestError", - '429': "MessagingRequestError", - '500': "MessagingRequestError", + '400': "MultiChannelError", + '401': "MultiChannelError", + '403': "MultiChannelError", + '404': "MultiChannelError", + '405': "MultiChannelError", + '406': None, + '415': "MultiChannelError", + '429': "MultiChannelError", + '500': "MultiChannelError", } response_data = self.api_client.call_api( *_param, @@ -178,14 +179,15 @@ def create_multi_channel_message_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '202': "CreateMultiChannelMessageResponse", - '400': "CreateMessageRequestError", - '401': "MessagingRequestError", - '403': "MessagingRequestError", - '404': "MessagingRequestError", - '406': "MessagingRequestError", - '415': "MessagingRequestError", - '429': "MessagingRequestError", - '500': "MessagingRequestError", + '400': "MultiChannelError", + '401': "MultiChannelError", + '403': "MultiChannelError", + '404': "MultiChannelError", + '405': "MultiChannelError", + '406': None, + '415': "MultiChannelError", + '429': "MultiChannelError", + '500': "MultiChannelError", } response_data = self.api_client.call_api( *_param, @@ -257,14 +259,15 @@ def create_multi_channel_message_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '202': "CreateMultiChannelMessageResponse", - '400': "CreateMessageRequestError", - '401': "MessagingRequestError", - '403': "MessagingRequestError", - '404': "MessagingRequestError", - '406': "MessagingRequestError", - '415': "MessagingRequestError", - '429': "MessagingRequestError", - '500': "MessagingRequestError", + '400': "MultiChannelError", + '401': "MultiChannelError", + '403': "MultiChannelError", + '404': "MultiChannelError", + '405': "MultiChannelError", + '406': None, + '415': "MultiChannelError", + '429': "MultiChannelError", + '500': "MultiChannelError", } response_data = self.api_client.call_api( *_param, diff --git a/bandwidth/api/toll_free_verification_api.py b/bandwidth/api/toll_free_verification_api.py index 88677d18..bdde9268 100644 --- a/bandwidth/api/toll_free_verification_api.py +++ b/bandwidth/api/toll_free_verification_api.py @@ -361,6 +361,309 @@ def _create_webhook_subscription_serialize( + @validate_call + def delete_verification_request( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + phone_number: Annotated[str, Field(min_length=12, strict=True, max_length=12, description="Valid Toll-Free telephone number in E.164 format.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> None: + """Delete a Toll-Free Verification Submission + + Delete a toll-free verification submission for a toll-free number. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param phone_number: Valid Toll-Free telephone number in E.164 format. (required) + :type phone_number: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_verification_request_serialize( + account_id=account_id, + phone_number=phone_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "TfvError", + '401': "TfvError", + '403': "TfvError", + '404': "TfvError", + '405': "TfvError", + '429': "TfvError", + '500': "TfvError", + '503': "TfvError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_verification_request_with_http_info( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + phone_number: Annotated[str, Field(min_length=12, strict=True, max_length=12, description="Valid Toll-Free telephone number in E.164 format.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[None]: + """Delete a Toll-Free Verification Submission + + Delete a toll-free verification submission for a toll-free number. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param phone_number: Valid Toll-Free telephone number in E.164 format. (required) + :type phone_number: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_verification_request_serialize( + account_id=account_id, + phone_number=phone_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "TfvError", + '401': "TfvError", + '403': "TfvError", + '404': "TfvError", + '405': "TfvError", + '429': "TfvError", + '500': "TfvError", + '503': "TfvError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_verification_request_without_preload_content( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + phone_number: Annotated[str, Field(min_length=12, strict=True, max_length=12, description="Valid Toll-Free telephone number in E.164 format.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """Delete a Toll-Free Verification Submission + + Delete a toll-free verification submission for a toll-free number. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param phone_number: Valid Toll-Free telephone number in E.164 format. (required) + :type phone_number: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_verification_request_serialize( + account_id=account_id, + phone_number=phone_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "TfvError", + '401': "TfvError", + '403': "TfvError", + '404': "TfvError", + '405': "TfvError", + '429': "TfvError", + '500': "TfvError", + '503': "TfvError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_verification_request_serialize( + self, + account_id, + phone_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://api.bandwidth.com/api/v2' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if account_id is not None: + _path_params['accountId'] = account_id + if phone_number is not None: + _path_params['phoneNumber'] = phone_number + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'Basic' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def delete_webhook_subscription( self, diff --git a/bandwidth/models/__init__.py b/bandwidth/models/__init__.py index 4d66be19..e196281b 100644 --- a/bandwidth/models/__init__.py +++ b/bandwidth/models/__init__.py @@ -31,8 +31,8 @@ from bandwidth.models.call_transcription_metadata import CallTranscriptionMetadata from bandwidth.models.call_transcription_response import CallTranscriptionResponse from bandwidth.models.call_transcription_track_enum import CallTranscriptionTrackEnum +from bandwidth.models.callback import Callback from bandwidth.models.callback_method_enum import CallbackMethodEnum -from bandwidth.models.callback_type_enum import CallbackTypeEnum from bandwidth.models.card_width_enum import CardWidthEnum from bandwidth.models.code_request import CodeRequest from bandwidth.models.conference import Conference @@ -51,16 +51,19 @@ from bandwidth.models.create_lookup_response import CreateLookupResponse from bandwidth.models.create_message_request_error import CreateMessageRequestError from bandwidth.models.create_multi_channel_message_response import CreateMultiChannelMessageResponse -from bandwidth.models.deferred_result import DeferredResult from bandwidth.models.disconnect_callback import DisconnectCallback from bandwidth.models.diversion import Diversion from bandwidth.models.dtmf_callback import DtmfCallback from bandwidth.models.error import Error from bandwidth.models.error_object import ErrorObject +from bandwidth.models.error_source import ErrorSource from bandwidth.models.failure_webhook import FailureWebhook 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_callback import InboundCallback +from bandwidth.models.inbound_callback_message import InboundCallbackMessage +from bandwidth.models.inbound_callback_type_enum import InboundCallbackTypeEnum from bandwidth.models.initiate_callback import InitiateCallback from bandwidth.models.link import Link from bandwidth.models.links_object import LinksObject @@ -76,8 +79,6 @@ from bandwidth.models.machine_detection_result import MachineDetectionResult from bandwidth.models.media import Media from bandwidth.models.message import Message -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_request import MessageRequest from bandwidth.models.message_status_enum import MessageStatusEnum @@ -89,17 +90,17 @@ from bandwidth.models.mfa_request_error import MfaRequestError from bandwidth.models.mfa_unauthorized_request_error import MfaUnauthorizedRequestError from bandwidth.models.mms_message_content import MmsMessageContent +from bandwidth.models.mms_message_content_file import MmsMessageContentFile from bandwidth.models.multi_channel_action import MultiChannelAction from bandwidth.models.multi_channel_action_calendar_event import MultiChannelActionCalendarEvent -from bandwidth.models.multi_channel_callback_data import MultiChannelCallbackData from bandwidth.models.multi_channel_channel_list_object import MultiChannelChannelListObject from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent -from bandwidth.models.multi_channel_message_callback_data import MultiChannelMessageCallbackData +from bandwidth.models.multi_channel_error import MultiChannelError from bandwidth.models.multi_channel_message_channel_enum import MultiChannelMessageChannelEnum -from bandwidth.models.multi_channel_message_data import MultiChannelMessageData -from bandwidth.models.multi_channel_message_direction_enum import MultiChannelMessageDirectionEnum +from bandwidth.models.multi_channel_message_content import MultiChannelMessageContent from bandwidth.models.multi_channel_message_request import MultiChannelMessageRequest -from bandwidth.models.multi_channel_status_enum import MultiChannelStatusEnum +from bandwidth.models.multi_channel_message_response_data import MultiChannelMessageResponseData +from bandwidth.models.multi_channel_message_response_data_channel_list_inner import MultiChannelMessageResponseDataChannelListInner from bandwidth.models.opt_in_workflow import OptInWorkflow from bandwidth.models.page_info import PageInfo from bandwidth.models.priority_enum import PriorityEnum @@ -110,6 +111,7 @@ from bandwidth.models.rbm_action_view_location import RbmActionViewLocation from bandwidth.models.rbm_card_content import RbmCardContent from bandwidth.models.rbm_card_content_media import RbmCardContentMedia +from bandwidth.models.rbm_location_response import RbmLocationResponse from bandwidth.models.rbm_media_height_enum import RbmMediaHeightEnum from bandwidth.models.rbm_message_carousel_card import RbmMessageCarouselCard from bandwidth.models.rbm_message_content_file import RbmMessageContentFile @@ -117,6 +119,7 @@ from bandwidth.models.rbm_message_content_text import RbmMessageContentText from bandwidth.models.rbm_message_media import RbmMessageMedia from bandwidth.models.rbm_standalone_card import RbmStandaloneCard +from bandwidth.models.rbm_suggestion_response import RbmSuggestionResponse from bandwidth.models.recording_available_callback import RecordingAvailableCallback from bandwidth.models.recording_complete_callback import RecordingCompleteCallback from bandwidth.models.recording_state_enum import RecordingStateEnum @@ -126,6 +129,9 @@ from bandwidth.models.redirect_method_enum import RedirectMethodEnum from bandwidth.models.sms_message_content import SmsMessageContent from bandwidth.models.standalone_card_orientation_enum import StandaloneCardOrientationEnum +from bandwidth.models.status_callback import StatusCallback +from bandwidth.models.status_callback_message import StatusCallbackMessage +from bandwidth.models.status_callback_type_enum import StatusCallbackTypeEnum from bandwidth.models.stir_shaken import StirShaken from bandwidth.models.telephone_number import TelephoneNumber from bandwidth.models.tfv_basic_authentication import TfvBasicAuthentication diff --git a/bandwidth/models/callback.py b/bandwidth/models/callback.py new file mode 100644 index 00000000..ab99804d --- /dev/null +++ b/bandwidth/models/callback.py @@ -0,0 +1,141 @@ +# 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 +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from bandwidth.models.inbound_callback import InboundCallback +from bandwidth.models.status_callback import StatusCallback +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +CALLBACK_ONE_OF_SCHEMAS = ["InboundCallback", "StatusCallback"] + +class Callback(BaseModel): + """ + Callbacks are divided into two types based on direction of the related message: - `statusCallback` indicates status of an outbound MT SMS, MMS, or RBM message. - `inboundCallback` indicates an inbound MO message or a multichannel message client's response to a suggestion or location request. + """ + # data type: StatusCallback + oneof_schema_1_validator: Optional[StatusCallback] = None + # data type: InboundCallback + oneof_schema_2_validator: Optional[InboundCallback] = None + actual_instance: Optional[Union[InboundCallback, StatusCallback]] = None + one_of_schemas: Set[str] = { "InboundCallback", "StatusCallback" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = Callback.model_construct() + error_messages = [] + match = 0 + # validate data type: StatusCallback + if not isinstance(v, StatusCallback): + error_messages.append(f"Error! Input type `{type(v)}` is not `StatusCallback`") + else: + match += 1 + # validate data type: InboundCallback + if not isinstance(v, InboundCallback): + error_messages.append(f"Error! Input type `{type(v)}` is not `InboundCallback`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in Callback with oneOf schemas: InboundCallback, StatusCallback. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in Callback with oneOf schemas: InboundCallback, StatusCallback. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into StatusCallback + try: + instance.actual_instance = StatusCallback.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into InboundCallback + try: + instance.actual_instance = InboundCallback.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into Callback with oneOf schemas: InboundCallback, StatusCallback. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into Callback with oneOf schemas: InboundCallback, StatusCallback. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], InboundCallback, StatusCallback]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/bandwidth/models/create_multi_channel_message_response.py b/bandwidth/models/create_multi_channel_message_response.py index 770a19df..b7889893 100644 --- a/bandwidth/models/create_multi_channel_message_response.py +++ b/bandwidth/models/create_multi_channel_message_response.py @@ -22,7 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional from bandwidth.models.error_object import ErrorObject from bandwidth.models.link import Link -from bandwidth.models.multi_channel_message_data import MultiChannelMessageData +from bandwidth.models.multi_channel_message_response_data import MultiChannelMessageResponseData from typing import Optional, Set from typing_extensions import Self @@ -31,7 +31,7 @@ class CreateMultiChannelMessageResponse(BaseModel): CreateMultiChannelMessageResponse """ # noqa: E501 links: Optional[List[Link]] = None - data: Optional[MultiChannelMessageData] = None + data: Optional[MultiChannelMessageResponseData] = None errors: Optional[List[ErrorObject]] = None additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["links", "data", "errors"] @@ -112,7 +112,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "links": [Link.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, - "data": MultiChannelMessageData.from_dict(obj["data"]) if obj.get("data") is not None else None, + "data": MultiChannelMessageResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None, "errors": [ErrorObject.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None }) # store additional fields in additional_properties diff --git a/bandwidth/models/error_object.py b/bandwidth/models/error_object.py index 1cd0fc7c..d86e29b2 100644 --- a/bandwidth/models/error_object.py +++ b/bandwidth/models/error_object.py @@ -18,8 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from bandwidth.models.error_source import ErrorSource from typing import Optional, Set from typing_extensions import Self @@ -27,10 +28,11 @@ class ErrorObject(BaseModel): """ ErrorObject """ # noqa: E501 - code: Optional[StrictStr] = None - message: Optional[StrictStr] = None + type: StrictStr = Field(description="A concise summary of the error used for categorization.") + description: StrictStr = Field(description="A detailed explanation of the error.") + source: ErrorSource additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message"] + __properties: ClassVar[List[str]] = ["type", "description", "source"] model_config = ConfigDict( populate_by_name=True, @@ -73,6 +75,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict['source'] = self.source.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -90,8 +95,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message") + "type": obj.get("type"), + "description": obj.get("description"), + "source": ErrorSource.from_dict(obj["source"]) if obj.get("source") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/error_source.py b/bandwidth/models/error_source.py new file mode 100644 index 00000000..2e5b80e2 --- /dev/null +++ b/bandwidth/models/error_source.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ErrorSource(BaseModel): + """ + Specifies relevant sources of the error, if any. + """ # noqa: E501 + parameter: Optional[StrictStr] = Field(default=None, description="The relevant URI query parameter causing the error") + var_field: Optional[StrictStr] = Field(default=None, description="The request body field that led to the error", alias="field") + header: Optional[StrictStr] = Field(default=None, description="The header field that contributed to the error") + reference: Optional[StrictStr] = Field(default=None, description="A resource ID or path linked to the error") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["parameter", "field", "header", "reference"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorSource 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 ErrorSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "parameter": obj.get("parameter"), + "field": obj.get("field"), + "header": obj.get("header"), + "reference": obj.get("reference") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/multi_channel_callback_data.py b/bandwidth/models/inbound_callback.py similarity index 71% rename from bandwidth/models/multi_channel_callback_data.py rename to bandwidth/models/inbound_callback.py index edada9c1..f9875945 100644 --- a/bandwidth/models/multi_channel_callback_data.py +++ b/bandwidth/models/inbound_callback.py @@ -21,22 +21,23 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from bandwidth.models.multi_channel_message_callback_data import MultiChannelMessageCallbackData -from bandwidth.models.multi_channel_status_enum import MultiChannelStatusEnum +from bandwidth.models.inbound_callback_message import InboundCallbackMessage +from bandwidth.models.inbound_callback_type_enum import InboundCallbackTypeEnum from typing import Optional, Set from typing_extensions import Self -class MultiChannelCallbackData(BaseModel): +class InboundCallback(BaseModel): """ - MultiChannelCallbackData + Represents an inbound callback. """ # noqa: E501 - time: Optional[datetime] = Field(default=None, description="The time of the callback event.") - type: Optional[MultiChannelStatusEnum] = None - to: Optional[StrictStr] = Field(default=None, description="The phone number the message should be sent to in E164 format.") - description: Optional[StrictStr] = None - message: Optional[MultiChannelMessageCallbackData] = None + time: datetime + type: InboundCallbackTypeEnum + to: StrictStr = Field(description="The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. ") + description: StrictStr = Field(description="A detailed description of the event described by the callback.") + message: InboundCallbackMessage + carrier_name: Optional[StrictStr] = Field(default=None, description="The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled.", alias="carrierName") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message"] + __properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message", "carrierName"] model_config = ConfigDict( populate_by_name=True, @@ -56,7 +57,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MultiChannelCallbackData from a JSON string""" + """Create an instance of InboundCallback from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -91,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of MultiChannelCallbackData from a dict""" + """Create an instance of InboundCallback from a dict""" if obj is None: return None @@ -103,7 +104,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "type": obj.get("type"), "to": obj.get("to"), "description": obj.get("description"), - "message": MultiChannelMessageCallbackData.from_dict(obj["message"]) if obj.get("message") is not None else None + "message": InboundCallbackMessage.from_dict(obj["message"]) if obj.get("message") is not None else None, + "carrierName": obj.get("carrierName") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/inbound_callback_message.py b/bandwidth/models/inbound_callback_message.py new file mode 100644 index 00000000..8cd209ed --- /dev/null +++ b/bandwidth/models/inbound_callback_message.py @@ -0,0 +1,147 @@ +# 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.multi_channel_message_channel_enum import MultiChannelMessageChannelEnum +from bandwidth.models.multi_channel_message_content import MultiChannelMessageContent +from bandwidth.models.priority_enum import PriorityEnum +from bandwidth.models.rbm_location_response import RbmLocationResponse +from bandwidth.models.rbm_suggestion_response import RbmSuggestionResponse +from typing import Optional, Set +from typing_extensions import Self + +class InboundCallbackMessage(BaseModel): + """ + InboundCallbackMessage + """ # noqa: E501 + id: StrictStr = Field(description="A unique identifier of the message.") + owner: StrictStr = Field(description="The Bandwidth phone number or alphanumeric identifier associated with the message.") + application_id: StrictStr = Field(description="The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.", alias="applicationId") + time: datetime + segment_count: StrictInt = Field(description="The number of segments the user's message is broken into before sending over carrier networks.", alias="segmentCount") + direction: MessageDirectionEnum + to: List[StrictStr] = Field(description="The phone number recipients of the message.") + var_from: StrictStr = Field(description="The Bandwidth phone number or alphanumeric identifier the message was sent from.", alias="from") + text: Optional[StrictStr] = None + tag: Optional[StrictStr] = Field(default=None, description="A custom string that will be included in callback events of the message. Max 1024 characters.") + media: Optional[List[StrictStr]] = Field(default=None, description="Optional media, not applicable for sms") + priority: Optional[PriorityEnum] = None + channel: Optional[MultiChannelMessageChannelEnum] = None + content: Optional[MultiChannelMessageContent] = None + suggestion_response: Optional[RbmSuggestionResponse] = Field(default=None, alias="suggestionResponse") + location_response: Optional[RbmLocationResponse] = Field(default=None, alias="locationResponse") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority", "channel", "content", "suggestionResponse", "locationResponse"] + + 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 InboundCallbackMessage 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 content + if self.content: + _dict['content'] = self.content.to_dict() + # override the default output from pydantic by calling `to_dict()` of suggestion_response + if self.suggestion_response: + _dict['suggestionResponse'] = self.suggestion_response.to_dict() + # override the default output from pydantic by calling `to_dict()` of location_response + if self.location_response: + _dict['locationResponse'] = self.location_response.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 InboundCallbackMessage 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"), + "channel": obj.get("channel"), + "content": MultiChannelMessageContent.from_dict(obj["content"]) if obj.get("content") is not None else None, + "suggestionResponse": RbmSuggestionResponse.from_dict(obj["suggestionResponse"]) if obj.get("suggestionResponse") is not None else None, + "locationResponse": RbmLocationResponse.from_dict(obj["locationResponse"]) if obj.get("locationResponse") 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_callback_type_enum.py b/bandwidth/models/inbound_callback_type_enum.py new file mode 100644 index 00000000..5efb01c4 --- /dev/null +++ b/bandwidth/models/inbound_callback_type_enum.py @@ -0,0 +1,39 @@ +# 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 InboundCallbackTypeEnum(str, Enum): + """ + The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. + """ + + """ + allowed enum values + """ + MESSAGE_MINUS_RECEIVED = 'message-received' + REQUEST_MINUS_LOCATION_MINUS_RESPONSE = 'request-location-response' + SUGGESTION_MINUS_RESPONSE = 'suggestion-response' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of InboundCallbackTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/bandwidth/models/list_message_item.py b/bandwidth/models/list_message_item.py index aa0511a7..6a6b4903 100644 --- a/bandwidth/models/list_message_item.py +++ b/bandwidth/models/list_message_item.py @@ -38,7 +38,7 @@ class ListMessageItem(BaseModel): message_status: Optional[MessageStatusEnum] = Field(default=None, alias="messageStatus") message_direction: Optional[ListMessageDirectionEnum] = Field(default=None, alias="messageDirection") message_type: Optional[MessageTypeEnum] = Field(default=None, alias="messageType") - segment_count: Optional[StrictInt] = Field(default=None, description="The number of segments the message was sent as.", alias="segmentCount") + segment_count: Optional[StrictInt] = Field(default=None, description="The number of segments the user's message is broken into before sending over carrier networks.", alias="segmentCount") error_code: Optional[StrictInt] = Field(default=None, description="The numeric error code of the message.", alias="errorCode") receive_time: Optional[datetime] = Field(default=None, description="The ISO 8601 datetime of the message.", alias="receiveTime") carrier_name: Optional[StrictStr] = Field(default=None, description="The name of the carrier. Not currently supported for MMS coming soon.", alias="carrierName") diff --git a/bandwidth/models/message.py b/bandwidth/models/message.py index f2a45e85..b42cae7a 100644 --- a/bandwidth/models/message.py +++ b/bandwidth/models/message.py @@ -32,15 +32,15 @@ class Message(BaseModel): """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="The id of the message.") 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") + application_id: Optional[StrictStr] = Field(default=None, description="The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.", 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 user's message is broken into before sending over 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.") 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.") + 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.") additional_properties: Dict[str, Any] = {} diff --git a/bandwidth/models/message_request.py b/bandwidth/models/message_request.py index 670ce462..acfd9400 100644 --- a/bandwidth/models/message_request.py +++ b/bandwidth/models/message_request.py @@ -30,7 +30,7 @@ class MessageRequest(BaseModel): """ MessageRequest """ # 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") + application_id: StrictStr = Field(description="The ID of the Application your from number or senderId 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") 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.") diff --git a/bandwidth/models/mms_message_content.py b/bandwidth/models/mms_message_content.py index a5859946..d4c9cab9 100644 --- a/bandwidth/models/mms_message_content.py +++ b/bandwidth/models/mms_message_content.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from bandwidth.models.mms_message_content_file import MmsMessageContentFile from typing import Optional, Set from typing_extensions import Self @@ -29,7 +30,7 @@ class MmsMessageContent(BaseModel): MmsMessageContent """ # noqa: E501 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[MmsMessageContentFile]] = None additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["text", "media"] @@ -74,6 +75,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in media (list) + _items = [] + if self.media: + for _item_media in self.media: + if _item_media: + _items.append(_item_media.to_dict()) + _dict['media'] = _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(): @@ -92,7 +100,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "text": obj.get("text"), - "media": obj.get("media") + "media": [MmsMessageContentFile.from_dict(_item) for _item in obj["media"]] if obj.get("media") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/mms_message_content_file.py b/bandwidth/models/mms_message_content_file.py new file mode 100644 index 00000000..fe43088b --- /dev/null +++ b/bandwidth/models/mms_message_content_file.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class MmsMessageContentFile(BaseModel): + """ + MmsMessageContentFile + """ # noqa: E501 + file_url: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The URL of a media attachment. For MMS, the API limits file size to 3.5MB. Specific carriers and channels may have a smaller limit that could cause a large file to fail, see [here](https://support.bandwidth.com/hc/en-us/articles/360014235473-What-are-the-MMS-file-size-limits) for more details.", alias="fileUrl") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["fileUrl"] + + 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 MmsMessageContentFile 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 MmsMessageContentFile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fileUrl": obj.get("fileUrl") + }) + # 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/multi_channel_action_calendar_event.py b/bandwidth/models/multi_channel_action_calendar_event.py index 0c03e285..1a1d82cb 100644 --- a/bandwidth/models/multi_channel_action_calendar_event.py +++ b/bandwidth/models/multi_channel_action_calendar_event.py @@ -32,13 +32,13 @@ class MultiChannelActionCalendarEvent(BaseModel): """ # noqa: E501 type: RbmActionTypeEnum text: Annotated[str, Field(strict=True, max_length=25)] = Field(description="Displayed text for user to click") - post_back_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postBackData") + postback_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData") title: Annotated[str, Field(strict=True, max_length=100)] = Field(description="The title of the event.") start_time: datetime = Field(description="The start time of the event.", alias="startTime") end_time: datetime = Field(description="The end time of the event.", alias="endTime") description: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="The description of the event.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "text", "postBackData", "title", "startTime", "endTime", "description"] + __properties: ClassVar[List[str]] = ["type", "text", "postbackData", "title", "startTime", "endTime", "description"] model_config = ConfigDict( populate_by_name=True, @@ -100,7 +100,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "type": obj.get("type"), "text": obj.get("text"), - "postBackData": obj.get("postBackData"), + "postbackData": obj.get("postbackData"), "title": obj.get("title"), "startTime": obj.get("startTime"), "endTime": obj.get("endTime"), diff --git a/bandwidth/models/multi_channel_error.py b/bandwidth/models/multi_channel_error.py new file mode 100644 index 00000000..54397d7e --- /dev/null +++ b/bandwidth/models/multi_channel_error.py @@ -0,0 +1,126 @@ +# 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.error_object import ErrorObject +from bandwidth.models.link import Link +from typing import Optional, Set +from typing_extensions import Self + +class MultiChannelError(BaseModel): + """ + MultiChannelError + """ # noqa: E501 + links: Optional[List[Link]] = None + data: Optional[Dict[str, Any]] = None + errors: Optional[List[ErrorObject]] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["links", "data", "errors"] + + 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 MultiChannelError 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 links (list) + _items = [] + if self.links: + for _item_links in self.links: + if _item_links: + _items.append(_item_links.to_dict()) + _dict['links'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) + _dict['errors'] = _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 + + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MultiChannelError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "links": [Link.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "data": obj.get("data"), + "errors": [ErrorObject.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/tag.py b/bandwidth/models/multi_channel_message_content.py similarity index 77% rename from bandwidth/models/tag.py rename to bandwidth/models/multi_channel_message_content.py index b8b839a3..92145804 100644 --- a/bandwidth/models/tag.py +++ b/bandwidth/models/multi_channel_message_content.py @@ -20,17 +20,18 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from bandwidth.models.rbm_message_content_file import RbmMessageContentFile from typing import Optional, Set from typing_extensions import Self -class Tag(BaseModel): +class MultiChannelMessageContent(BaseModel): """ - Tag + The structure of the content field of a multichannel message. """ # noqa: E501 - key: Optional[StrictStr] = None - value: Optional[StrictStr] = None + text: Optional[StrictStr] = None + media: Optional[RbmMessageContentFile] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["key", "value"] + __properties: ClassVar[List[str]] = ["text", "media"] model_config = ConfigDict( populate_by_name=True, @@ -50,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Tag from a JSON string""" + """Create an instance of MultiChannelMessageContent from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,6 +74,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of media + if self.media: + _dict['media'] = self.media.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(): @@ -82,7 +86,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Tag from a dict""" + """Create an instance of MultiChannelMessageContent from a dict""" if obj is None: return None @@ -90,8 +94,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "key": obj.get("key"), - "value": obj.get("value") + "text": obj.get("text"), + "media": RbmMessageContentFile.from_dict(obj["media"]) if obj.get("media") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/multi_channel_message_direction_enum.py b/bandwidth/models/multi_channel_message_direction_enum.py deleted file mode 100644 index a1210b69..00000000 --- a/bandwidth/models/multi_channel_message_direction_enum.py +++ /dev/null @@ -1,38 +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 json -from enum import Enum -from typing_extensions import Self - - -class MultiChannelMessageDirectionEnum(str, Enum): - """ - MultiChannelMessageDirectionEnum - """ - - """ - allowed enum values - """ - INBOUND = 'INBOUND' - OUTBOUND = 'OUTBOUND' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of MultiChannelMessageDirectionEnum from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/bandwidth/models/multi_channel_message_data.py b/bandwidth/models/multi_channel_message_response_data.py similarity index 57% rename from bandwidth/models/multi_channel_message_data.py rename to bandwidth/models/multi_channel_message_response_data.py index 2ce16950..459c0eda 100644 --- a/bandwidth/models/multi_channel_message_data.py +++ b/bandwidth/models/multi_channel_message_response_data.py @@ -21,27 +21,27 @@ from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from bandwidth.models.multi_channel_message_channel_enum import MultiChannelMessageChannelEnum -from bandwidth.models.multi_channel_message_direction_enum import MultiChannelMessageDirectionEnum -from bandwidth.models.multi_channel_status_enum import MultiChannelStatusEnum +from typing_extensions import Annotated +from bandwidth.models.message_direction_enum import MessageDirectionEnum +from bandwidth.models.multi_channel_message_response_data_channel_list_inner import MultiChannelMessageResponseDataChannelListInner +from bandwidth.models.priority_enum import PriorityEnum from typing import Optional, Set from typing_extensions import Self -class MultiChannelMessageData(BaseModel): +class MultiChannelMessageResponseData(BaseModel): """ - MultiChannelMessageData + The data returned in a multichannel message response. """ # noqa: E501 - message_id: Optional[StrictStr] = Field(default=None, description="The ID of the message.", alias="messageId") - status: Optional[MultiChannelStatusEnum] = None - time: Optional[datetime] = Field(default=None, description="The time the message was received by the Bandwidth API.") - direction: Optional[MultiChannelMessageDirectionEnum] = None - var_from: Optional[StrictStr] = Field(default=None, description="The sender ID of the message. This could be an alphanumeric sender ID.", alias="from") - to: Optional[StrictStr] = Field(default=None, description="The phone number the message should be sent to in E164 format.") - application_id: Optional[StrictStr] = Field(default=None, description="The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.", alias="applicationId") - channel: Optional[MultiChannelMessageChannelEnum] = None + message_id: StrictStr = Field(description="The ID of the message.", alias="messageId") + time: datetime = Field(description="The time the message was received by the Bandwidth API.") + direction: MessageDirectionEnum + to: List[StrictStr] = Field(description="The destination phone number(s) of the message, in E164 format.") + channel_list: Annotated[List[MultiChannelMessageResponseDataChannelListInner], Field(max_length=4)] = Field(description="A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored.", alias="channelList") 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.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["messageId", "status", "time", "direction", "from", "to", "applicationId", "channel", "tag"] + __properties: ClassVar[List[str]] = ["messageId", "time", "direction", "to", "channelList", "tag", "priority", "expiration"] model_config = ConfigDict( populate_by_name=True, @@ -61,7 +61,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MultiChannelMessageData from a JSON string""" + """Create an instance of MultiChannelMessageResponseData from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -84,6 +84,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in channel_list (list) + _items = [] + if self.channel_list: + for _item_channel_list in self.channel_list: + if _item_channel_list: + _items.append(_item_channel_list.to_dict()) + _dict['channelList'] = _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(): @@ -93,7 +100,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of MultiChannelMessageData from a dict""" + """Create an instance of MultiChannelMessageResponseData from a dict""" if obj is None: return None @@ -102,14 +109,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "messageId": obj.get("messageId"), - "status": obj.get("status"), "time": obj.get("time"), "direction": obj.get("direction"), - "from": obj.get("from"), "to": obj.get("to"), - "applicationId": obj.get("applicationId"), - "channel": obj.get("channel"), - "tag": obj.get("tag") + "channelList": [MultiChannelMessageResponseDataChannelListInner.from_dict(_item) for _item in obj["channelList"]] if obj.get("channelList") is not None else None, + "tag": obj.get("tag"), + "priority": obj.get("priority"), + "expiration": obj.get("expiration") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/multi_channel_message_callback_data.py b/bandwidth/models/multi_channel_message_response_data_channel_list_inner.py similarity index 62% rename from bandwidth/models/multi_channel_message_callback_data.py rename to bandwidth/models/multi_channel_message_response_data_channel_list_inner.py index db5ffa08..1d5cbb7e 100644 --- a/bandwidth/models/multi_channel_message_callback_data.py +++ b/bandwidth/models/multi_channel_message_response_data_channel_list_inner.py @@ -19,27 +19,23 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List +from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent from bandwidth.models.multi_channel_message_channel_enum import MultiChannelMessageChannelEnum -from bandwidth.models.multi_channel_message_direction_enum import MultiChannelMessageDirectionEnum -from bandwidth.models.multi_channel_status_enum import MultiChannelStatusEnum from typing import Optional, Set from typing_extensions import Self -class MultiChannelMessageCallbackData(BaseModel): +class MultiChannelMessageResponseDataChannelListInner(BaseModel): """ - MultiChannelMessageCallbackData + MultiChannelMessageResponseDataChannelListInner """ # noqa: E501 - message_id: Optional[StrictStr] = Field(default=None, description="The ID of the message.", alias="messageId") - status: Optional[MultiChannelStatusEnum] = None - direction: Optional[MultiChannelMessageDirectionEnum] = None - var_from: Optional[StrictStr] = Field(default=None, description="The sender ID of the message. This could be an alphanumeric sender ID.", alias="from") - to: Optional[StrictStr] = Field(default=None, description="The phone number the message should be sent to in E164 format.") - application_id: Optional[StrictStr] = Field(default=None, description="The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.", alias="applicationId") - channel: Optional[MultiChannelMessageChannelEnum] = None - tag: Optional[StrictStr] = Field(default=None, description="A custom string that will be included in callback events of the message. Max 1024 characters.") + var_from: StrictStr = Field(description="The sender ID of the message. This could be an alphanumeric sender ID.", alias="from") + application_id: StrictStr = Field(description="The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.", alias="applicationId") + channel: MultiChannelMessageChannelEnum + content: MultiChannelChannelListObjectContent + owner: StrictStr = Field(description="The Bandwidth senderId associated with the message. Identical to 'from'.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["messageId", "status", "direction", "from", "to", "applicationId", "channel", "tag"] + __properties: ClassVar[List[str]] = ["from", "applicationId", "channel", "content", "owner"] model_config = ConfigDict( populate_by_name=True, @@ -59,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MultiChannelMessageCallbackData from a JSON string""" + """Create an instance of MultiChannelMessageResponseDataChannelListInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -82,6 +78,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of content + if self.content: + _dict['content'] = self.content.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(): @@ -91,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of MultiChannelMessageCallbackData from a dict""" + """Create an instance of MultiChannelMessageResponseDataChannelListInner from a dict""" if obj is None: return None @@ -99,14 +98,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "messageId": obj.get("messageId"), - "status": obj.get("status"), - "direction": obj.get("direction"), "from": obj.get("from"), - "to": obj.get("to"), "applicationId": obj.get("applicationId"), "channel": obj.get("channel"), - "tag": obj.get("tag") + "content": MultiChannelChannelListObjectContent.from_dict(obj["content"]) if obj.get("content") is not None else None, + "owner": obj.get("owner") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/multi_channel_status_enum.py b/bandwidth/models/multi_channel_status_enum.py deleted file mode 100644 index 40404225..00000000 --- a/bandwidth/models/multi_channel_status_enum.py +++ /dev/null @@ -1,40 +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 json -from enum import Enum -from typing_extensions import Self - - -class MultiChannelStatusEnum(str, Enum): - """ - MultiChannelStatusEnum - """ - - """ - allowed enum values - """ - QUEUED = 'QUEUED' - SENDING = 'SENDING' - DELIVERED = 'DELIVERED' - FAILED = 'FAILED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of MultiChannelStatusEnum from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/bandwidth/models/priority_enum.py b/bandwidth/models/priority_enum.py index 8eb4bec2..20e47ad8 100644 --- a/bandwidth/models/priority_enum.py +++ b/bandwidth/models/priority_enum.py @@ -21,7 +21,7 @@ class PriorityEnum(str, Enum): """ - The priority specified by the user. + Specifies the message's sending priority with respect to other messages in your account. For best results and optimal throughput, reserve the 'high' priority setting for critical messages only. """ """ diff --git a/bandwidth/models/rbm_action_base.py b/bandwidth/models/rbm_action_base.py index 7025c2aa..ab5464ab 100644 --- a/bandwidth/models/rbm_action_base.py +++ b/bandwidth/models/rbm_action_base.py @@ -31,9 +31,9 @@ class RbmActionBase(BaseModel): """ # noqa: E501 type: RbmActionTypeEnum text: Annotated[str, Field(strict=True, max_length=25)] = Field(description="Displayed text for user to click") - post_back_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postBackData") + postback_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "text", "postBackData"] + __properties: ClassVar[List[str]] = ["type", "text", "postbackData"] model_config = ConfigDict( populate_by_name=True, @@ -95,7 +95,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "type": obj.get("type"), "text": obj.get("text"), - "postBackData": obj.get("postBackData") + "postbackData": obj.get("postbackData") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/rbm_action_dial.py b/bandwidth/models/rbm_action_dial.py index fbe1c436..45eb04a3 100644 --- a/bandwidth/models/rbm_action_dial.py +++ b/bandwidth/models/rbm_action_dial.py @@ -31,10 +31,10 @@ class RbmActionDial(BaseModel): """ # noqa: E501 type: RbmActionTypeEnum text: Annotated[str, Field(strict=True, max_length=25)] = Field(description="Displayed text for user to click") - post_back_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postBackData") + postback_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData") phone_number: StrictStr = Field(description="The phone number to dial. Must be E164 format.", alias="phoneNumber") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "text", "postBackData", "phoneNumber"] + __properties: ClassVar[List[str]] = ["type", "text", "postbackData", "phoneNumber"] model_config = ConfigDict( populate_by_name=True, @@ -96,7 +96,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "type": obj.get("type"), "text": obj.get("text"), - "postBackData": obj.get("postBackData"), + "postbackData": obj.get("postbackData"), "phoneNumber": obj.get("phoneNumber") }) # store additional fields in additional_properties diff --git a/bandwidth/models/rbm_action_open_url.py b/bandwidth/models/rbm_action_open_url.py index cab89620..8ea946e6 100644 --- a/bandwidth/models/rbm_action_open_url.py +++ b/bandwidth/models/rbm_action_open_url.py @@ -31,10 +31,10 @@ class RbmActionOpenUrl(BaseModel): """ # noqa: E501 type: RbmActionTypeEnum text: Annotated[str, Field(strict=True, max_length=25)] = Field(description="Displayed text for user to click") - post_back_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postBackData") + postback_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData") url: Annotated[str, Field(strict=True, max_length=2048)] = Field(description="The URL to open in browser.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "text", "postBackData", "url"] + __properties: ClassVar[List[str]] = ["type", "text", "postbackData", "url"] model_config = ConfigDict( populate_by_name=True, @@ -96,7 +96,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "type": obj.get("type"), "text": obj.get("text"), - "postBackData": obj.get("postBackData"), + "postbackData": obj.get("postbackData"), "url": obj.get("url") }) # store additional fields in additional_properties diff --git a/bandwidth/models/rbm_action_view_location.py b/bandwidth/models/rbm_action_view_location.py index b435831c..8a215b17 100644 --- a/bandwidth/models/rbm_action_view_location.py +++ b/bandwidth/models/rbm_action_view_location.py @@ -31,12 +31,12 @@ class RbmActionViewLocation(BaseModel): """ # noqa: E501 type: RbmActionTypeEnum text: Annotated[str, Field(strict=True, max_length=25)] = Field(description="Displayed text for user to click") - post_back_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postBackData") + postback_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData") latitude: StrictStr = Field(description="The latitude of the location.") longitude: StrictStr = Field(description="The longitude of the location.") label: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="The label of the location.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "text", "postBackData", "latitude", "longitude", "label"] + __properties: ClassVar[List[str]] = ["type", "text", "postbackData", "latitude", "longitude", "label"] model_config = ConfigDict( populate_by_name=True, @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "type": obj.get("type"), "text": obj.get("text"), - "postBackData": obj.get("postBackData"), + "postbackData": obj.get("postbackData"), "latitude": obj.get("latitude"), "longitude": obj.get("longitude"), "label": obj.get("label") diff --git a/bandwidth/models/deferred_result.py b/bandwidth/models/rbm_location_response.py similarity index 80% rename from bandwidth/models/deferred_result.py rename to bandwidth/models/rbm_location_response.py index 699cd537..4382e163 100644 --- a/bandwidth/models/deferred_result.py +++ b/bandwidth/models/rbm_location_response.py @@ -18,19 +18,19 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class DeferredResult(BaseModel): +class RbmLocationResponse(BaseModel): """ - DeferredResult + RbmLocationResponse """ # noqa: E501 - result: Optional[Dict[str, Any]] = None - set_or_expired: Optional[StrictBool] = Field(default=None, alias="setOrExpired") + latitude: Optional[StrictStr] = Field(default=None, description="The latitude of the client's location.") + longitude: Optional[StrictStr] = Field(default=None, description="The longitude of the client's location.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["result", "setOrExpired"] + __properties: ClassVar[List[str]] = ["latitude", "longitude"] model_config = ConfigDict( populate_by_name=True, @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeferredResult from a JSON string""" + """Create an instance of RbmLocationResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -82,7 +82,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DeferredResult from a dict""" + """Create an instance of RbmLocationResponse from a dict""" if obj is None: return None @@ -90,8 +90,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "result": obj.get("result"), - "setOrExpired": obj.get("setOrExpired") + "latitude": obj.get("latitude"), + "longitude": obj.get("longitude") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/rbm_suggestion_response.py b/bandwidth/models/rbm_suggestion_response.py new file mode 100644 index 00000000..b8de63ac --- /dev/null +++ b/bandwidth/models/rbm_suggestion_response.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class RbmSuggestionResponse(BaseModel): + """ + RbmSuggestionResponse + """ # noqa: E501 + text: Optional[StrictStr] = Field(default=None, description="The text associated with the suggestion response.") + postback_data: Optional[Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]]] = Field(default=None, description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["text", "postbackData"] + + 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 RbmSuggestionResponse 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 RbmSuggestionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "text": obj.get("text"), + "postbackData": obj.get("postbackData") + }) + # 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.py b/bandwidth/models/status_callback.py similarity index 74% rename from bandwidth/models/message_callback.py rename to bandwidth/models/status_callback.py index f3afa89d..2a726876 100644 --- a/bandwidth/models/message_callback.py +++ b/bandwidth/models/status_callback.py @@ -21,24 +21,25 @@ 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 bandwidth.models.status_callback_message import StatusCallbackMessage +from bandwidth.models.status_callback_type_enum import StatusCallbackTypeEnum from typing import Optional, Set from typing_extensions import Self -class MessageCallback(BaseModel): +class StatusCallback(BaseModel): """ - Message Callback Schema + Represents a status callback for an outbound MT SMS or MMS or RBM message. """ # noqa: E501 time: datetime - type: CallbackTypeEnum - to: StrictStr + event_time: Optional[datetime] = Field(default=None, description="Represents the time at which the message was read, for `message-read` callbacks.", alias="eventTime") + type: StatusCallbackTypeEnum + to: StrictStr = Field(description="The destination phone number the message was sent to. For status callbacks, this the the Bandwidth user's client phone number.") description: StrictStr = Field(description="A detailed description of the event described by the callback.") - message: MessageCallbackMessage + message: StatusCallbackMessage error_code: Optional[StrictInt] = Field(default=None, description="Optional error code, applicable only when type is `message-failed`.", alias="errorCode") - carrier_name: Optional[StrictStr] = Field(default=None, description="The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to.", alias="carrierName") + carrier_name: Optional[StrictStr] = Field(default=None, description="The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled.", alias="carrierName") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message", "errorCode", "carrierName"] + __properties: ClassVar[List[str]] = ["time", "eventTime", "type", "to", "description", "message", "errorCode", "carrierName"] model_config = ConfigDict( populate_by_name=True, @@ -58,7 +59,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MessageCallback from a JSON string""" + """Create an instance of StatusCallback from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -89,21 +90,11 @@ def to_dict(self) -> Dict[str, Any]: 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 - - # set to None if carrier_name (nullable) is None - # and model_fields_set contains the field - if self.carrier_name is None and "carrier_name" in self.model_fields_set: - _dict['carrierName'] = None - return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of MessageCallback from a dict""" + """Create an instance of StatusCallback from a dict""" if obj is None: return None @@ -112,10 +103,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "time": obj.get("time"), + "eventTime": obj.get("eventTime"), "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, + "message": StatusCallbackMessage.from_dict(obj["message"]) if obj.get("message") is not None else None, "errorCode": obj.get("errorCode"), "carrierName": obj.get("carrierName") }) diff --git a/bandwidth/models/message_callback_message.py b/bandwidth/models/status_callback_message.py similarity index 70% rename from bandwidth/models/message_callback_message.py rename to bandwidth/models/status_callback_message.py index 6cdb17b7..b37f537d 100644 --- a/bandwidth/models/message_callback_message.py +++ b/bandwidth/models/status_callback_message.py @@ -22,28 +22,30 @@ 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.multi_channel_message_channel_enum import MultiChannelMessageChannelEnum from bandwidth.models.priority_enum import PriorityEnum from typing import Optional, Set from typing_extensions import Self -class MessageCallbackMessage(BaseModel): +class StatusCallbackMessage(BaseModel): """ - Message payload schema within a MessageCallback + Message payload schema within a callback """ # noqa: E501 - id: StrictStr - owner: StrictStr - application_id: StrictStr = Field(alias="applicationId") + id: StrictStr = Field(description="A unique identifier of the message.") + owner: StrictStr = Field(description="The Bandwidth phone number or alphanumeric identifier associated with the message.") + application_id: StrictStr = Field(description="The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard.", alias="applicationId") time: datetime - segment_count: StrictInt = Field(alias="segmentCount") + segment_count: StrictInt = Field(description="The number of segments the user's message is broken into before sending over carrier networks.", 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") + to: List[StrictStr] = Field(description="The phone number recipients of the message.") + var_from: StrictStr = Field(description="The Bandwidth phone number or alphanumeric identifier the message was sent from.", alias="from") + text: Optional[StrictStr] = None + tag: Optional[StrictStr] = Field(default=None, description="A custom string that will be included in callback events of the message. Max 1024 characters.") + media: Optional[List[StrictStr]] = Field(default=None, description="Optional media, not applicable for sms") priority: Optional[PriorityEnum] = None + channel: Optional[MultiChannelMessageChannelEnum] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority"] + __properties: ClassVar[List[str]] = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "text", "tag", "media", "priority", "channel"] model_config = ConfigDict( populate_by_name=True, @@ -63,7 +65,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MessageCallbackMessage from a JSON string""" + """Create an instance of StatusCallbackMessage from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -91,16 +93,11 @@ def to_dict(self) -> Dict[str, Any]: 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""" + """Create an instance of StatusCallbackMessage from a dict""" if obj is None: return None @@ -119,7 +116,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "text": obj.get("text"), "tag": obj.get("tag"), "media": obj.get("media"), - "priority": obj.get("priority") + "priority": obj.get("priority"), + "channel": obj.get("channel") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/bandwidth/models/callback_type_enum.py b/bandwidth/models/status_callback_type_enum.py similarity index 54% rename from bandwidth/models/callback_type_enum.py rename to bandwidth/models/status_callback_type_enum.py index 7b1f9919..e81ce35c 100644 --- a/bandwidth/models/callback_type_enum.py +++ b/bandwidth/models/status_callback_type_enum.py @@ -19,22 +19,22 @@ from typing_extensions import Self -class CallbackTypeEnum(str, Enum): +class StatusCallbackTypeEnum(str, Enum): """ - Indicates the type of the callback: - `message-received` for inbound callbacks. - One of `message-sending`, `message-delivered`, `message-failed` for status callbacks. + The possible status callbacks when sending an MT SMS or MMS or RBM message: - `message-sending` indicates that Bandwidth is sending the message to the upstream provider. - `message-delivered` indicates that the message was successfully sent. - `message-failed` indicates that the message could not be sent to the intended recipient. - `message-read` indicates that the RBM message was read by the recipient. """ """ allowed enum values """ - MESSAGE_MINUS_RECEIVED = 'message-received' MESSAGE_MINUS_SENDING = 'message-sending' MESSAGE_MINUS_DELIVERED = 'message-delivered' MESSAGE_MINUS_FAILED = 'message-failed' + MESSAGE_MINUS_READ = 'message-read' @classmethod def from_json(cls, json_str: str) -> Self: - """Create an instance of CallbackTypeEnum from a JSON string""" + """Create an instance of StatusCallbackTypeEnum from a JSON string""" return cls(json.loads(json_str)) diff --git a/docs/Callback.md b/docs/Callback.md new file mode 100644 index 00000000..f9923bf8 --- /dev/null +++ b/docs/Callback.md @@ -0,0 +1,37 @@ +# Callback + +Callbacks are divided into two types based on direction of the related message: - `statusCallback` indicates status of an outbound MT SMS, MMS, or RBM message. - `inboundCallback` indicates an inbound MO message or a multichannel message client's response to a suggestion or location request. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **datetime** | | +**event_time** | **datetime** | Represents the time at which the message was read, for `message-read` callbacks. | [optional] +**type** | [**InboundCallbackTypeEnum**](InboundCallbackTypeEnum.md) | | +**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | +**description** | **str** | A detailed description of the event described by the callback. | +**message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | +**error_code** | **int** | Optional error code, applicable only when type is `message-failed`. | [optional] +**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] + +## Example + +```python +from bandwidth.models.callback import Callback + +# TODO update the JSON string below +json = "{}" +# create an instance of Callback from a JSON string +callback_instance = Callback.from_json(json) +# print the JSON string representation of the object +print(Callback.to_json()) + +# convert the object into a dict +callback_dict = callback_instance.to_dict() +# create an instance of Callback from a dict +callback_from_dict = Callback.from_dict(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/CallbackTypeEnum.md b/docs/CallbackTypeEnum.md deleted file mode 100644 index 0d071f57..00000000 --- a/docs/CallbackTypeEnum.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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/CreateMultiChannelMessageResponse.md b/docs/CreateMultiChannelMessageResponse.md index 657c59bb..01ee8d13 100644 --- a/docs/CreateMultiChannelMessageResponse.md +++ b/docs/CreateMultiChannelMessageResponse.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **links** | [**List[Link]**](Link.md) | | [optional] -**data** | [**MultiChannelMessageData**](MultiChannelMessageData.md) | | [optional] +**data** | [**MultiChannelMessageResponseData**](MultiChannelMessageResponseData.md) | | [optional] **errors** | [**List[ErrorObject]**](ErrorObject.md) | | [optional] ## Example diff --git a/docs/DeferredResult.md b/docs/DeferredResult.md deleted file mode 100644 index cff65d98..00000000 --- a/docs/DeferredResult.md +++ /dev/null @@ -1,30 +0,0 @@ -# DeferredResult - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **object** | | [optional] -**set_or_expired** | **bool** | | [optional] - -## Example - -```python -from bandwidth.models.deferred_result import DeferredResult - -# TODO update the JSON string below -json = "{}" -# create an instance of DeferredResult from a JSON string -deferred_result_instance = DeferredResult.from_json(json) -# print the JSON string representation of the object -print(DeferredResult.to_json()) - -# convert the object into a dict -deferred_result_dict = deferred_result_instance.to_dict() -# create an instance of DeferredResult from a dict -deferred_result_from_dict = DeferredResult.from_dict(deferred_result_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/ErrorObject.md b/docs/ErrorObject.md index 27dc1268..2104a0a5 100644 --- a/docs/ErrorObject.md +++ b/docs/ErrorObject.md @@ -5,8 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **str** | | [optional] -**message** | **str** | | [optional] +**type** | **str** | A concise summary of the error used for categorization. | +**description** | **str** | A detailed explanation of the error. | +**source** | [**ErrorSource**](ErrorSource.md) | | ## Example diff --git a/docs/ErrorSource.md b/docs/ErrorSource.md new file mode 100644 index 00000000..e0a2f56c --- /dev/null +++ b/docs/ErrorSource.md @@ -0,0 +1,33 @@ +# ErrorSource + +Specifies relevant sources of the error, if any. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parameter** | **str** | The relevant URI query parameter causing the error | [optional] +**var_field** | **str** | The request body field that led to the error | [optional] +**header** | **str** | The header field that contributed to the error | [optional] +**reference** | **str** | A resource ID or path linked to the error | [optional] + +## Example + +```python +from bandwidth.models.error_source import ErrorSource + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorSource from a JSON string +error_source_instance = ErrorSource.from_json(json) +# print the JSON string representation of the object +print(ErrorSource.to_json()) + +# convert the object into a dict +error_source_dict = error_source_instance.to_dict() +# create an instance of ErrorSource from a dict +error_source_from_dict = ErrorSource.from_dict(error_source_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InboundCallback.md b/docs/InboundCallback.md new file mode 100644 index 00000000..ad9e2f47 --- /dev/null +++ b/docs/InboundCallback.md @@ -0,0 +1,35 @@ +# InboundCallback + +Represents an inbound callback. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **datetime** | | +**type** | [**InboundCallbackTypeEnum**](InboundCallbackTypeEnum.md) | | +**to** | **str** | The destination phone number the message was sent to. For inbound callbacks, this is the Bandwidth number or alphanumeric identifier that received the message. | +**description** | **str** | A detailed description of the event described by the callback. | +**message** | [**InboundCallbackMessage**](InboundCallbackMessage.md) | | +**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] + +## Example + +```python +from bandwidth.models.inbound_callback import InboundCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of InboundCallback from a JSON string +inbound_callback_instance = InboundCallback.from_json(json) +# print the JSON string representation of the object +print(InboundCallback.to_json()) + +# convert the object into a dict +inbound_callback_dict = inbound_callback_instance.to_dict() +# create an instance of InboundCallback from a dict +inbound_callback_from_dict = InboundCallback.from_dict(inbound_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/InboundCallbackMessage.md b/docs/InboundCallbackMessage.md new file mode 100644 index 00000000..bd2cc324 --- /dev/null +++ b/docs/InboundCallbackMessage.md @@ -0,0 +1,44 @@ +# InboundCallbackMessage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique identifier of the message. | +**owner** | **str** | The Bandwidth phone number or alphanumeric identifier associated with the message. | +**application_id** | **str** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | +**time** | **datetime** | | +**segment_count** | **int** | The number of segments the user's message is broken into before sending over carrier networks. | +**direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | +**to** | **List[str]** | The phone number recipients of the message. | +**var_from** | **str** | The Bandwidth phone number or alphanumeric identifier the message was sent from. | +**text** | **str** | | [optional] +**tag** | **str** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] +**media** | **List[str]** | Optional media, not applicable for sms | [optional] +**priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] +**channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | [optional] +**content** | [**MultiChannelMessageContent**](MultiChannelMessageContent.md) | | [optional] +**suggestion_response** | [**RbmSuggestionResponse**](RbmSuggestionResponse.md) | | [optional] +**location_response** | [**RbmLocationResponse**](RbmLocationResponse.md) | | [optional] + +## Example + +```python +from bandwidth.models.inbound_callback_message import InboundCallbackMessage + +# TODO update the JSON string below +json = "{}" +# create an instance of InboundCallbackMessage from a JSON string +inbound_callback_message_instance = InboundCallbackMessage.from_json(json) +# print the JSON string representation of the object +print(InboundCallbackMessage.to_json()) + +# convert the object into a dict +inbound_callback_message_dict = inbound_callback_message_instance.to_dict() +# create an instance of InboundCallbackMessage from a dict +inbound_callback_message_from_dict = InboundCallbackMessage.from_dict(inbound_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/InboundCallbackTypeEnum.md b/docs/InboundCallbackTypeEnum.md new file mode 100644 index 00000000..690a01f6 --- /dev/null +++ b/docs/InboundCallbackTypeEnum.md @@ -0,0 +1,15 @@ +# InboundCallbackTypeEnum + +The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `request-location-response` indicates a response to a location request sent by the Bandwidth user's client after receiving an RBM message. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message. + +## Enum + +* `MESSAGE_MINUS_RECEIVED` (value: `'message-received'`) + +* `REQUEST_MINUS_LOCATION_MINUS_RESPONSE` (value: `'request-location-response'`) + +* `SUGGESTION_MINUS_RESPONSE` (value: `'suggestion-response'`) + +[[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/InboundMessageCallback.md b/docs/InboundMessageCallback.md deleted file mode 100644 index 357061fb..00000000 --- a/docs/InboundMessageCallback.md +++ /dev/null @@ -1,34 +0,0 @@ -# InboundMessageCallback - -Inbound Message Callback - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**time** | **datetime** | | -**type** | **str** | | -**to** | **str** | | -**description** | **str** | | -**message** | [**InboundMessageCallbackMessage**](InboundMessageCallbackMessage.md) | | - -## Example - -```python -from bandwidth.models.inbound_message_callback import InboundMessageCallback - -# TODO update the JSON string below -json = "{}" -# create an instance of InboundMessageCallback from a JSON string -inbound_message_callback_instance = InboundMessageCallback.from_json(json) -# print the JSON string representation of the object -print(InboundMessageCallback.to_json()) - -# convert the object into a dict -inbound_message_callback_dict = inbound_message_callback_instance.to_dict() -# create an instance of InboundMessageCallback from a dict -inbound_message_callback_from_dict = InboundMessageCallback.from_dict(inbound_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/InboundMessageCallbackMessage.md b/docs/InboundMessageCallbackMessage.md deleted file mode 100644 index b95f6b25..00000000 --- a/docs/InboundMessageCallbackMessage.md +++ /dev/null @@ -1,41 +0,0 @@ -# InboundMessageCallbackMessage - -Inbound Message Callback Message Schema - -## 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] -**priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] - -## Example - -```python -from bandwidth.models.inbound_message_callback_message import InboundMessageCallbackMessage - -# TODO update the JSON string below -json = "{}" -# create an instance of InboundMessageCallbackMessage from a JSON string -inbound_message_callback_message_instance = InboundMessageCallbackMessage.from_json(json) -# print the JSON string representation of the object -print(InboundMessageCallbackMessage.to_json()) - -# convert the object into a dict -inbound_message_callback_message_dict = inbound_message_callback_message_instance.to_dict() -# create an instance of InboundMessageCallbackMessage from a dict -inbound_message_callback_message_from_dict = InboundMessageCallbackMessage.from_dict(inbound_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/ListMessageItem.md b/docs/ListMessageItem.md index 4dff0c1b..dae8e437 100644 --- a/docs/ListMessageItem.md +++ b/docs/ListMessageItem.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **message_status** | [**MessageStatusEnum**](MessageStatusEnum.md) | | [optional] **message_direction** | [**ListMessageDirectionEnum**](ListMessageDirectionEnum.md) | | [optional] **message_type** | [**MessageTypeEnum**](MessageTypeEnum.md) | | [optional] -**segment_count** | **int** | The number of segments the message was sent as. | [optional] +**segment_count** | **int** | The number of segments the user's message is broken into before sending over carrier networks. | [optional] **error_code** | **int** | The numeric error code of the message. | [optional] **receive_time** | **datetime** | The ISO 8601 datetime of the message. | [optional] **carrier_name** | **str** | The name of the carrier. Not currently supported for MMS coming soon. | [optional] diff --git a/docs/Message.md b/docs/Message.md index 40229f78..cf83eb00 100644 --- a/docs/Message.md +++ b/docs/Message.md @@ -7,15 +7,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The id of the message. | [optional] **owner** | **str** | The Bandwidth phone number associated with the message. | [optional] -**application_id** | **str** | The application ID associated with the message. | [optional] +**application_id** | **str** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | [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 user's message is broken into before sending over 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] **text** | **str** | The contents of the message. | [optional] -**tag** | **str** | The custom string set by the user. | [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. | [optional] diff --git a/docs/MessageCallback.md b/docs/MessageCallback.md deleted file mode 100644 index de2577d1..00000000 --- a/docs/MessageCallback.md +++ /dev/null @@ -1,36 +0,0 @@ -# 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] -**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. | [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 deleted file mode 100644 index a0c97fed..00000000 --- a/docs/MessageCallbackMessage.md +++ /dev/null @@ -1,41 +0,0 @@ -# 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/MessageDeliveredCallback.md b/docs/MessageDeliveredCallback.md deleted file mode 100644 index 8dcfb718..00000000 --- a/docs/MessageDeliveredCallback.md +++ /dev/null @@ -1,34 +0,0 @@ -# MessageDeliveredCallback - -Message Delivered Callback - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**time** | **datetime** | | -**type** | **str** | | -**to** | **str** | | -**description** | **str** | | -**message** | [**MessageDeliveredCallbackMessage**](MessageDeliveredCallbackMessage.md) | | - -## Example - -```python -from bandwidth.models.message_delivered_callback import MessageDeliveredCallback - -# TODO update the JSON string below -json = "{}" -# create an instance of MessageDeliveredCallback from a JSON string -message_delivered_callback_instance = MessageDeliveredCallback.from_json(json) -# print the JSON string representation of the object -print(MessageDeliveredCallback.to_json()) - -# convert the object into a dict -message_delivered_callback_dict = message_delivered_callback_instance.to_dict() -# create an instance of MessageDeliveredCallback from a dict -message_delivered_callback_from_dict = MessageDeliveredCallback.from_dict(message_delivered_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/MessageDeliveredCallbackMessage.md b/docs/MessageDeliveredCallbackMessage.md deleted file mode 100644 index 880c5a22..00000000 --- a/docs/MessageDeliveredCallbackMessage.md +++ /dev/null @@ -1,41 +0,0 @@ -# MessageDeliveredCallbackMessage - -Message Delivered Callback Message Schema - -## 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** | | -**media** | **List[str]** | | [optional] -**priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] - -## Example - -```python -from bandwidth.models.message_delivered_callback_message import MessageDeliveredCallbackMessage - -# TODO update the JSON string below -json = "{}" -# create an instance of MessageDeliveredCallbackMessage from a JSON string -message_delivered_callback_message_instance = MessageDeliveredCallbackMessage.from_json(json) -# print the JSON string representation of the object -print(MessageDeliveredCallbackMessage.to_json()) - -# convert the object into a dict -message_delivered_callback_message_dict = message_delivered_callback_message_instance.to_dict() -# create an instance of MessageDeliveredCallbackMessage from a dict -message_delivered_callback_message_from_dict = MessageDeliveredCallbackMessage.from_dict(message_delivered_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/MessageFailedCallback.md b/docs/MessageFailedCallback.md deleted file mode 100644 index 3cbb78f0..00000000 --- a/docs/MessageFailedCallback.md +++ /dev/null @@ -1,35 +0,0 @@ -# MessageFailedCallback - -Message Failed Callback - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**time** | **datetime** | | -**type** | **str** | | -**to** | **str** | | -**description** | **str** | | -**message** | [**MessageFailedCallbackMessage**](MessageFailedCallbackMessage.md) | | -**error_code** | **int** | | - -## Example - -```python -from bandwidth.models.message_failed_callback import MessageFailedCallback - -# TODO update the JSON string below -json = "{}" -# create an instance of MessageFailedCallback from a JSON string -message_failed_callback_instance = MessageFailedCallback.from_json(json) -# print the JSON string representation of the object -print(MessageFailedCallback.to_json()) - -# convert the object into a dict -message_failed_callback_dict = message_failed_callback_instance.to_dict() -# create an instance of MessageFailedCallback from a dict -message_failed_callback_from_dict = MessageFailedCallback.from_dict(message_failed_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/MessageFailedCallbackMessage.md b/docs/MessageFailedCallbackMessage.md deleted file mode 100644 index 25f77fe7..00000000 --- a/docs/MessageFailedCallbackMessage.md +++ /dev/null @@ -1,41 +0,0 @@ -# MessageFailedCallbackMessage - -Message Failed Callback Message Schema - -## 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** | | -**media** | **List[str]** | | [optional] -**priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] - -## Example - -```python -from bandwidth.models.message_failed_callback_message import MessageFailedCallbackMessage - -# TODO update the JSON string below -json = "{}" -# create an instance of MessageFailedCallbackMessage from a JSON string -message_failed_callback_message_instance = MessageFailedCallbackMessage.from_json(json) -# print the JSON string representation of the object -print(MessageFailedCallbackMessage.to_json()) - -# convert the object into a dict -message_failed_callback_message_dict = message_failed_callback_message_instance.to_dict() -# create an instance of MessageFailedCallbackMessage from a dict -message_failed_callback_message_from_dict = MessageFailedCallbackMessage.from_dict(message_failed_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 49168deb..fae515d8 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**application_id** | **str** | The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard. | +**application_id** | **str** | The ID of the Application your from number or senderId 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. | **text** | **str** | The contents of the text message. Must be 2048 characters or less. | [optional] diff --git a/docs/MessageSendingCallback.md b/docs/MessageSendingCallback.md deleted file mode 100644 index 26fd7915..00000000 --- a/docs/MessageSendingCallback.md +++ /dev/null @@ -1,34 +0,0 @@ -# MessageSendingCallback - -Message Sending Callback - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**time** | **datetime** | | -**type** | **str** | | -**to** | **str** | | -**description** | **str** | | -**message** | [**MessageSendingCallbackMessage**](MessageSendingCallbackMessage.md) | | - -## Example - -```python -from bandwidth.models.message_sending_callback import MessageSendingCallback - -# TODO update the JSON string below -json = "{}" -# create an instance of MessageSendingCallback from a JSON string -message_sending_callback_instance = MessageSendingCallback.from_json(json) -# print the JSON string representation of the object -print(MessageSendingCallback.to_json()) - -# convert the object into a dict -message_sending_callback_dict = message_sending_callback_instance.to_dict() -# create an instance of MessageSendingCallback from a dict -message_sending_callback_from_dict = MessageSendingCallback.from_dict(message_sending_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/MessageSendingCallbackMessage.md b/docs/MessageSendingCallbackMessage.md deleted file mode 100644 index 9aca3fdb..00000000 --- a/docs/MessageSendingCallbackMessage.md +++ /dev/null @@ -1,41 +0,0 @@ -# MessageSendingCallbackMessage - -Message Sending Callback Message Schema - -## 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]** | | -**priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] - -## Example - -```python -from bandwidth.models.message_sending_callback_message import MessageSendingCallbackMessage - -# TODO update the JSON string below -json = "{}" -# create an instance of MessageSendingCallbackMessage from a JSON string -message_sending_callback_message_instance = MessageSendingCallbackMessage.from_json(json) -# print the JSON string representation of the object -print(MessageSendingCallbackMessage.to_json()) - -# convert the object into a dict -message_sending_callback_message_dict = message_sending_callback_message_instance.to_dict() -# create an instance of MessageSendingCallbackMessage from a dict -message_sending_callback_message_from_dict = MessageSendingCallbackMessage.from_dict(message_sending_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/MessagesApi.md b/docs/MessagesApi.md index c4ba9ce6..cdf868ce 100644 --- a/docs/MessagesApi.md +++ b/docs/MessagesApi.md @@ -91,6 +91,7 @@ Name | Type | Description | Notes **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | +**405** | Method Not Allowed | - | **406** | Not Acceptable | - | **415** | Unsupported Media Type | - | **429** | Too Many Requests | - | diff --git a/docs/MmsMessageContent.md b/docs/MmsMessageContent.md index 9f7cd447..78f143d0 100644 --- a/docs/MmsMessageContent.md +++ b/docs/MmsMessageContent.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **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[MmsMessageContentFile]**](MmsMessageContentFile.md) | | [optional] ## Example diff --git a/docs/MmsMessageContentFile.md b/docs/MmsMessageContentFile.md new file mode 100644 index 00000000..184372d2 --- /dev/null +++ b/docs/MmsMessageContentFile.md @@ -0,0 +1,29 @@ +# MmsMessageContentFile + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file_url** | **str** | The URL of a media attachment. For MMS, the API limits file size to 3.5MB. Specific carriers and channels may have a smaller limit that could cause a large file to fail, see [here](https://support.bandwidth.com/hc/en-us/articles/360014235473-What-are-the-MMS-file-size-limits) for more details. | + +## Example + +```python +from bandwidth.models.mms_message_content_file import MmsMessageContentFile + +# TODO update the JSON string below +json = "{}" +# create an instance of MmsMessageContentFile from a JSON string +mms_message_content_file_instance = MmsMessageContentFile.from_json(json) +# print the JSON string representation of the object +print(MmsMessageContentFile.to_json()) + +# convert the object into a dict +mms_message_content_file_dict = mms_message_content_file_instance.to_dict() +# create an instance of MmsMessageContentFile from a dict +mms_message_content_file_from_dict = MmsMessageContentFile.from_dict(mms_message_content_file_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/MultiChannelAction.md b/docs/MultiChannelAction.md index 006092cc..580c7470 100644 --- a/docs/MultiChannelAction.md +++ b/docs/MultiChannelAction.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | **text** | **str** | Displayed text for user to click | -**post_back_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | +**postback_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | **phone_number** | **str** | The phone number to dial. Must be E164 format. | **latitude** | **float** | The latitude of the location. | **longitude** | **float** | The longitude of the location. | diff --git a/docs/MultiChannelActionCalendarEvent.md b/docs/MultiChannelActionCalendarEvent.md index c7436d2e..5f12d364 100644 --- a/docs/MultiChannelActionCalendarEvent.md +++ b/docs/MultiChannelActionCalendarEvent.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | **text** | **str** | Displayed text for user to click | -**post_back_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | +**postback_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | **title** | **str** | The title of the event. | **start_time** | **datetime** | The start time of the event. | **end_time** | **datetime** | The end time of the event. | diff --git a/docs/MultiChannelApi.md b/docs/MultiChannelApi.md index d82a9f13..0d7713b1 100644 --- a/docs/MultiChannelApi.md +++ b/docs/MultiChannelApi.md @@ -90,6 +90,7 @@ Name | Type | Description | Notes **401** | Unauthorized | - | **403** | Forbidden | - | **404** | Not Found | - | +**405** | Method Not Allowed | - | **406** | Not Acceptable | - | **415** | Unsupported Media Type | - | **429** | Too Many Requests | - | diff --git a/docs/MultiChannelCallbackData.md b/docs/MultiChannelCallbackData.md deleted file mode 100644 index 5d6cd314..00000000 --- a/docs/MultiChannelCallbackData.md +++ /dev/null @@ -1,33 +0,0 @@ -# MultiChannelCallbackData - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**time** | **datetime** | The time of the callback event. | [optional] -**type** | [**MultiChannelStatusEnum**](MultiChannelStatusEnum.md) | | [optional] -**to** | **str** | The phone number the message should be sent to in E164 format. | [optional] -**description** | **str** | | [optional] -**message** | [**MultiChannelMessageCallbackData**](MultiChannelMessageCallbackData.md) | | [optional] - -## Example - -```python -from bandwidth.models.multi_channel_callback_data import MultiChannelCallbackData - -# TODO update the JSON string below -json = "{}" -# create an instance of MultiChannelCallbackData from a JSON string -multi_channel_callback_data_instance = MultiChannelCallbackData.from_json(json) -# print the JSON string representation of the object -print(MultiChannelCallbackData.to_json()) - -# convert the object into a dict -multi_channel_callback_data_dict = multi_channel_callback_data_instance.to_dict() -# create an instance of MultiChannelCallbackData from a dict -multi_channel_callback_data_from_dict = MultiChannelCallbackData.from_dict(multi_channel_callback_data_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/MultiChannelChannelListObjectContent.md b/docs/MultiChannelChannelListObjectContent.md index 32c1d8f4..55b0270e 100644 --- a/docs/MultiChannelChannelListObjectContent.md +++ b/docs/MultiChannelChannelListObjectContent.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **text** | **str** | The contents of the text message. Must be 2048 characters or less. | **suggestions** | [**List[MultiChannelAction]**](MultiChannelAction.md) | An array of suggested actions for the recipient. | [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. | +**media** | [**List[MmsMessageContentFile]**](MmsMessageContentFile.md) | | **orientation** | [**StandaloneCardOrientationEnum**](StandaloneCardOrientationEnum.md) | | **thumbnail_image_alignment** | [**ThumbnailAlignmentEnum**](ThumbnailAlignmentEnum.md) | | **card_content** | [**RbmCardContent**](RbmCardContent.md) | | diff --git a/docs/MultiChannelError.md b/docs/MultiChannelError.md new file mode 100644 index 00000000..bcf65759 --- /dev/null +++ b/docs/MultiChannelError.md @@ -0,0 +1,31 @@ +# MultiChannelError + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**List[Link]**](Link.md) | | [optional] +**data** | **object** | | [optional] +**errors** | [**List[ErrorObject]**](ErrorObject.md) | | [optional] + +## Example + +```python +from bandwidth.models.multi_channel_error import MultiChannelError + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiChannelError from a JSON string +multi_channel_error_instance = MultiChannelError.from_json(json) +# print the JSON string representation of the object +print(MultiChannelError.to_json()) + +# convert the object into a dict +multi_channel_error_dict = multi_channel_error_instance.to_dict() +# create an instance of MultiChannelError from a dict +multi_channel_error_from_dict = MultiChannelError.from_dict(multi_channel_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MultiChannelMessageCallbackData.md b/docs/MultiChannelMessageCallbackData.md deleted file mode 100644 index 462689da..00000000 --- a/docs/MultiChannelMessageCallbackData.md +++ /dev/null @@ -1,36 +0,0 @@ -# MultiChannelMessageCallbackData - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**message_id** | **str** | The ID of the message. | [optional] -**status** | [**MultiChannelStatusEnum**](MultiChannelStatusEnum.md) | | [optional] -**direction** | [**MultiChannelMessageDirectionEnum**](MultiChannelMessageDirectionEnum.md) | | [optional] -**var_from** | **str** | The sender ID of the message. This could be an alphanumeric sender ID. | [optional] -**to** | **str** | The phone number the message should be sent to in E164 format. | [optional] -**application_id** | **str** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | [optional] -**channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | [optional] -**tag** | **str** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] - -## Example - -```python -from bandwidth.models.multi_channel_message_callback_data import MultiChannelMessageCallbackData - -# TODO update the JSON string below -json = "{}" -# create an instance of MultiChannelMessageCallbackData from a JSON string -multi_channel_message_callback_data_instance = MultiChannelMessageCallbackData.from_json(json) -# print the JSON string representation of the object -print(MultiChannelMessageCallbackData.to_json()) - -# convert the object into a dict -multi_channel_message_callback_data_dict = multi_channel_message_callback_data_instance.to_dict() -# create an instance of MultiChannelMessageCallbackData from a dict -multi_channel_message_callback_data_from_dict = MultiChannelMessageCallbackData.from_dict(multi_channel_message_callback_data_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/MultiChannelMessageContent.md b/docs/MultiChannelMessageContent.md new file mode 100644 index 00000000..fc720db0 --- /dev/null +++ b/docs/MultiChannelMessageContent.md @@ -0,0 +1,31 @@ +# MultiChannelMessageContent + +The structure of the content field of a multichannel message. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**text** | **str** | | [optional] +**media** | [**RbmMessageContentFile**](RbmMessageContentFile.md) | | [optional] + +## Example + +```python +from bandwidth.models.multi_channel_message_content import MultiChannelMessageContent + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiChannelMessageContent from a JSON string +multi_channel_message_content_instance = MultiChannelMessageContent.from_json(json) +# print the JSON string representation of the object +print(MultiChannelMessageContent.to_json()) + +# convert the object into a dict +multi_channel_message_content_dict = multi_channel_message_content_instance.to_dict() +# create an instance of MultiChannelMessageContent from a dict +multi_channel_message_content_from_dict = MultiChannelMessageContent.from_dict(multi_channel_message_content_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/MultiChannelMessageData.md b/docs/MultiChannelMessageData.md deleted file mode 100644 index 7b704070..00000000 --- a/docs/MultiChannelMessageData.md +++ /dev/null @@ -1,37 +0,0 @@ -# MultiChannelMessageData - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**message_id** | **str** | The ID of the message. | [optional] -**status** | [**MultiChannelStatusEnum**](MultiChannelStatusEnum.md) | | [optional] -**time** | **datetime** | The time the message was received by the Bandwidth API. | [optional] -**direction** | [**MultiChannelMessageDirectionEnum**](MultiChannelMessageDirectionEnum.md) | | [optional] -**var_from** | **str** | The sender ID of the message. This could be an alphanumeric sender ID. | [optional] -**to** | **str** | The phone number the message should be sent to in E164 format. | [optional] -**application_id** | **str** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | [optional] -**channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | [optional] -**tag** | **str** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] - -## Example - -```python -from bandwidth.models.multi_channel_message_data import MultiChannelMessageData - -# TODO update the JSON string below -json = "{}" -# create an instance of MultiChannelMessageData from a JSON string -multi_channel_message_data_instance = MultiChannelMessageData.from_json(json) -# print the JSON string representation of the object -print(MultiChannelMessageData.to_json()) - -# convert the object into a dict -multi_channel_message_data_dict = multi_channel_message_data_instance.to_dict() -# create an instance of MultiChannelMessageData from a dict -multi_channel_message_data_from_dict = MultiChannelMessageData.from_dict(multi_channel_message_data_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/MultiChannelMessageDirectionEnum.md b/docs/MultiChannelMessageDirectionEnum.md deleted file mode 100644 index ffcef62c..00000000 --- a/docs/MultiChannelMessageDirectionEnum.md +++ /dev/null @@ -1,12 +0,0 @@ -# MultiChannelMessageDirectionEnum - - -## Enum - -* `INBOUND` (value: `'INBOUND'`) - -* `OUTBOUND` (value: `'OUTBOUND'`) - -[[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/MultiChannelMessageResponseData.md b/docs/MultiChannelMessageResponseData.md new file mode 100644 index 00000000..3f153054 --- /dev/null +++ b/docs/MultiChannelMessageResponseData.md @@ -0,0 +1,37 @@ +# MultiChannelMessageResponseData + +The data returned in a multichannel message response. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message_id** | **str** | The ID of the message. | +**time** | **datetime** | The time the message was received by the Bandwidth API. | +**direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | +**to** | **List[str]** | The destination phone number(s) of the message, in E164 format. | +**channel_list** | [**List[MultiChannelMessageResponseDataChannelListInner]**](MultiChannelMessageResponseDataChannelListInner.md) | A list of message bodies. The messages will be attempted in the order they are listed. Once a message sends successfully, the others will be ignored. | +**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. | [optional] + +## Example + +```python +from bandwidth.models.multi_channel_message_response_data import MultiChannelMessageResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiChannelMessageResponseData from a JSON string +multi_channel_message_response_data_instance = MultiChannelMessageResponseData.from_json(json) +# print the JSON string representation of the object +print(MultiChannelMessageResponseData.to_json()) + +# convert the object into a dict +multi_channel_message_response_data_dict = multi_channel_message_response_data_instance.to_dict() +# create an instance of MultiChannelMessageResponseData from a dict +multi_channel_message_response_data_from_dict = MultiChannelMessageResponseData.from_dict(multi_channel_message_response_data_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/MultiChannelMessageResponseDataChannelListInner.md b/docs/MultiChannelMessageResponseDataChannelListInner.md new file mode 100644 index 00000000..15f5e344 --- /dev/null +++ b/docs/MultiChannelMessageResponseDataChannelListInner.md @@ -0,0 +1,33 @@ +# MultiChannelMessageResponseDataChannelListInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_from** | **str** | The sender ID of the message. This could be an alphanumeric sender ID. | +**application_id** | **str** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | +**channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | +**content** | [**MultiChannelChannelListObjectContent**](MultiChannelChannelListObjectContent.md) | | +**owner** | **str** | The Bandwidth senderId associated with the message. Identical to 'from'. | + +## Example + +```python +from bandwidth.models.multi_channel_message_response_data_channel_list_inner import MultiChannelMessageResponseDataChannelListInner + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiChannelMessageResponseDataChannelListInner from a JSON string +multi_channel_message_response_data_channel_list_inner_instance = MultiChannelMessageResponseDataChannelListInner.from_json(json) +# print the JSON string representation of the object +print(MultiChannelMessageResponseDataChannelListInner.to_json()) + +# convert the object into a dict +multi_channel_message_response_data_channel_list_inner_dict = multi_channel_message_response_data_channel_list_inner_instance.to_dict() +# create an instance of MultiChannelMessageResponseDataChannelListInner from a dict +multi_channel_message_response_data_channel_list_inner_from_dict = MultiChannelMessageResponseDataChannelListInner.from_dict(multi_channel_message_response_data_channel_list_inner_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/MultiChannelStatusEnum.md b/docs/MultiChannelStatusEnum.md deleted file mode 100644 index 364825df..00000000 --- a/docs/MultiChannelStatusEnum.md +++ /dev/null @@ -1,16 +0,0 @@ -# MultiChannelStatusEnum - - -## Enum - -* `QUEUED` (value: `'QUEUED'`) - -* `SENDING` (value: `'SENDING'`) - -* `DELIVERED` (value: `'DELIVERED'`) - -* `FAILED` (value: `'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/PriorityEnum.md b/docs/PriorityEnum.md index d95a2053..0cc17b75 100644 --- a/docs/PriorityEnum.md +++ b/docs/PriorityEnum.md @@ -1,6 +1,6 @@ # PriorityEnum -The priority specified by the user. +Specifies the message's sending priority with respect to other messages in your account. For best results and optimal throughput, reserve the 'high' priority setting for critical messages only. ## Enum diff --git a/docs/RbmActionBase.md b/docs/RbmActionBase.md index 7f3c21ec..7c946cc6 100644 --- a/docs/RbmActionBase.md +++ b/docs/RbmActionBase.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | **text** | **str** | Displayed text for user to click | -**post_back_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | +**postback_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | ## Example diff --git a/docs/RbmActionDial.md b/docs/RbmActionDial.md index a14d5274..56bba04f 100644 --- a/docs/RbmActionDial.md +++ b/docs/RbmActionDial.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | **text** | **str** | Displayed text for user to click | -**post_back_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | +**postback_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | **phone_number** | **str** | The phone number to dial. Must be E164 format. | ## Example diff --git a/docs/RbmActionOpenUrl.md b/docs/RbmActionOpenUrl.md index 1cce31c8..8f864050 100644 --- a/docs/RbmActionOpenUrl.md +++ b/docs/RbmActionOpenUrl.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | **text** | **str** | Displayed text for user to click | -**post_back_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | +**postback_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | **url** | **str** | The URL to open in browser. | ## Example diff --git a/docs/RbmActionViewLocation.md b/docs/RbmActionViewLocation.md index 54185177..353c2427 100644 --- a/docs/RbmActionViewLocation.md +++ b/docs/RbmActionViewLocation.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | **text** | **str** | Displayed text for user to click | -**post_back_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | +**postback_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | **latitude** | **float** | The latitude of the location. | **longitude** | **float** | The longitude of the location. | **label** | **str** | The label of the location. | [optional] diff --git a/docs/RbmLocationResponse.md b/docs/RbmLocationResponse.md new file mode 100644 index 00000000..ac80333b --- /dev/null +++ b/docs/RbmLocationResponse.md @@ -0,0 +1,30 @@ +# RbmLocationResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**latitude** | **float** | The latitude of the client's location. | [optional] +**longitude** | **float** | The longitude of the client's location. | [optional] + +## Example + +```python +from bandwidth.models.rbm_location_response import RbmLocationResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmLocationResponse from a JSON string +rbm_location_response_instance = RbmLocationResponse.from_json(json) +# print the JSON string representation of the object +print(RbmLocationResponse.to_json()) + +# convert the object into a dict +rbm_location_response_dict = rbm_location_response_instance.to_dict() +# create an instance of RbmLocationResponse from a dict +rbm_location_response_from_dict = RbmLocationResponse.from_dict(rbm_location_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RbmSuggestionResponse.md b/docs/RbmSuggestionResponse.md new file mode 100644 index 00000000..fb688489 --- /dev/null +++ b/docs/RbmSuggestionResponse.md @@ -0,0 +1,30 @@ +# RbmSuggestionResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**text** | **str** | The text associated with the suggestion response. | [optional] +**postback_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | [optional] + +## Example + +```python +from bandwidth.models.rbm_suggestion_response import RbmSuggestionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmSuggestionResponse from a JSON string +rbm_suggestion_response_instance = RbmSuggestionResponse.from_json(json) +# print the JSON string representation of the object +print(RbmSuggestionResponse.to_json()) + +# convert the object into a dict +rbm_suggestion_response_dict = rbm_suggestion_response_instance.to_dict() +# create an instance of RbmSuggestionResponse from a dict +rbm_suggestion_response_from_dict = RbmSuggestionResponse.from_dict(rbm_suggestion_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StatusCallback.md b/docs/StatusCallback.md new file mode 100644 index 00000000..953741e1 --- /dev/null +++ b/docs/StatusCallback.md @@ -0,0 +1,37 @@ +# StatusCallback + +Represents a status callback for an outbound MT SMS or MMS or RBM message. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time** | **datetime** | | +**event_time** | **datetime** | Represents the time at which the message was read, for `message-read` callbacks. | [optional] +**type** | [**StatusCallbackTypeEnum**](StatusCallbackTypeEnum.md) | | +**to** | **str** | The destination phone number the message was sent to. For status callbacks, this the the Bandwidth user's client phone number. | +**description** | **str** | A detailed description of the event described by the callback. | +**message** | [**StatusCallbackMessage**](StatusCallbackMessage.md) | | +**error_code** | **int** | Optional error code, applicable only when type is `message-failed`. | [optional] +**carrier_name** | **str** | The name of the Authorized Message Provider (AMP) that handled this message. In the US, this is the carrier that the message was sent to. This field is present only when this account feature has been enabled. | [optional] + +## Example + +```python +from bandwidth.models.status_callback import StatusCallback + +# TODO update the JSON string below +json = "{}" +# create an instance of StatusCallback from a JSON string +status_callback_instance = StatusCallback.from_json(json) +# print the JSON string representation of the object +print(StatusCallback.to_json()) + +# convert the object into a dict +status_callback_dict = status_callback_instance.to_dict() +# create an instance of StatusCallback from a dict +status_callback_from_dict = StatusCallback.from_dict(status_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/StatusCallbackMessage.md b/docs/StatusCallbackMessage.md new file mode 100644 index 00000000..562a0c72 --- /dev/null +++ b/docs/StatusCallbackMessage.md @@ -0,0 +1,42 @@ +# StatusCallbackMessage + +Message payload schema within a callback + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique identifier of the message. | +**owner** | **str** | The Bandwidth phone number or alphanumeric identifier associated with the message. | +**application_id** | **str** | The ID of the Application your from number or senderId is associated with in the Bandwidth Phone Number Dashboard. | +**time** | **datetime** | | +**segment_count** | **int** | The number of segments the user's message is broken into before sending over carrier networks. | +**direction** | [**MessageDirectionEnum**](MessageDirectionEnum.md) | | +**to** | **List[str]** | The phone number recipients of the message. | +**var_from** | **str** | The Bandwidth phone number or alphanumeric identifier the message was sent from. | +**text** | **str** | | [optional] +**tag** | **str** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] +**media** | **List[str]** | Optional media, not applicable for sms | [optional] +**priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] +**channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | [optional] + +## Example + +```python +from bandwidth.models.status_callback_message import StatusCallbackMessage + +# TODO update the JSON string below +json = "{}" +# create an instance of StatusCallbackMessage from a JSON string +status_callback_message_instance = StatusCallbackMessage.from_json(json) +# print the JSON string representation of the object +print(StatusCallbackMessage.to_json()) + +# convert the object into a dict +status_callback_message_dict = status_callback_message_instance.to_dict() +# create an instance of StatusCallbackMessage from a dict +status_callback_message_from_dict = StatusCallbackMessage.from_dict(status_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/StatusCallbackTypeEnum.md b/docs/StatusCallbackTypeEnum.md new file mode 100644 index 00000000..eac1b1a9 --- /dev/null +++ b/docs/StatusCallbackTypeEnum.md @@ -0,0 +1,17 @@ +# StatusCallbackTypeEnum + +The possible status callbacks when sending an MT SMS or MMS or RBM message: - `message-sending` indicates that Bandwidth is sending the message to the upstream provider. - `message-delivered` indicates that the message was successfully sent. - `message-failed` indicates that the message could not be sent to the intended recipient. - `message-read` indicates that the RBM message was read by the recipient. + +## Enum + +* `MESSAGE_MINUS_SENDING` (value: `'message-sending'`) + +* `MESSAGE_MINUS_DELIVERED` (value: `'message-delivered'`) + +* `MESSAGE_MINUS_FAILED` (value: `'message-failed'`) + +* `MESSAGE_MINUS_READ` (value: `'message-read'`) + +[[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/Tag.md b/docs/Tag.md deleted file mode 100644 index 73c866b4..00000000 --- a/docs/Tag.md +++ /dev/null @@ -1,30 +0,0 @@ -# Tag - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**key** | **str** | | [optional] -**value** | **str** | | [optional] - -## Example - -```python -from bandwidth.models.tag import Tag - -# TODO update the JSON string below -json = "{}" -# create an instance of Tag from a JSON string -tag_instance = Tag.from_json(json) -# print the JSON string representation of the object -print(Tag.to_json()) - -# convert the object into a dict -tag_dict = tag_instance.to_dict() -# create an instance of Tag from a dict -tag_from_dict = Tag.from_dict(tag_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/TollFreeVerificationApi.md b/docs/TollFreeVerificationApi.md index c6cb94e5..8305498e 100644 --- a/docs/TollFreeVerificationApi.md +++ b/docs/TollFreeVerificationApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- [**create_webhook_subscription**](TollFreeVerificationApi.md#create_webhook_subscription) | **POST** /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions | Create Webhook Subscription +[**delete_verification_request**](TollFreeVerificationApi.md#delete_verification_request) | **DELETE** /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification | Delete a Toll-Free Verification Submission [**delete_webhook_subscription**](TollFreeVerificationApi.md#delete_webhook_subscription) | **DELETE** /accounts/{accountId}/tollFreeVerification/webhooks/subscriptions/{id} | Delete Webhook Subscription [**get_toll_free_verification_status**](TollFreeVerificationApi.md#get_toll_free_verification_status) | **GET** /accounts/{accountId}/phoneNumbers/{phoneNumber}/tollFreeVerification | Get Toll-Free Verification Status [**list_toll_free_use_cases**](TollFreeVerificationApi.md#list_toll_free_use_cases) | **GET** /tollFreeVerification/useCases | List Toll-Free Use Cases @@ -104,6 +105,92 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_verification_request** +> delete_verification_request(account_id, phone_number) + +Delete a Toll-Free Verification Submission + +Delete a toll-free verification submission for a toll-free number. + +### Example + +* Basic Authentication (Basic): + +```python +import bandwidth +from bandwidth.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = bandwidth.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: Basic +configuration = bandwidth.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with bandwidth.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = bandwidth.TollFreeVerificationApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + phone_number = '+18885555555' # str | Valid Toll-Free telephone number in E.164 format. + + try: + # Delete a Toll-Free Verification Submission + api_instance.delete_verification_request(account_id, phone_number) + except Exception as e: + print("Exception when calling TollFreeVerificationApi->delete_verification_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_id** | **str**| Your Bandwidth Account ID. | + **phone_number** | **str**| Valid Toll-Free telephone number in E.164 format. | + +### Return type + +void (empty response body) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Cannot find the requested resource. | - | +**405** | Method Not Allowed | - | +**429** | Too Many Requests | - | +**500** | Internal Server Error | - | +**503** | Service Unavailable | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **delete_webhook_subscription** > delete_webhook_subscription(account_id, id) diff --git a/docs/TranscriptionList.md b/docs/TranscriptionList.md deleted file mode 100644 index 2a2fb1a8..00000000 --- a/docs/TranscriptionList.md +++ /dev/null @@ -1,29 +0,0 @@ -# TranscriptionList - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**transcripts** | [**List[Transcription]**](Transcription.md) | | [optional] - -## Example - -```python -from bandwidth.models.transcription_list import TranscriptionList - -# TODO update the JSON string below -json = "{}" -# create an instance of TranscriptionList from a JSON string -transcription_list_instance = TranscriptionList.from_json(json) -# print the JSON string representation of the object -print(TranscriptionList.to_json()) - -# convert the object into a dict -transcription_list_dict = transcription_list_instance.to_dict() -# create an instance of TranscriptionList from a dict -transcription_list_form_dict = transcription_list.from_dict(transcription_list_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/TranscriptionMetadata.md b/docs/TranscriptionMetadata.md deleted file mode 100644 index 9eb89018..00000000 --- a/docs/TranscriptionMetadata.md +++ /dev/null @@ -1,33 +0,0 @@ -# TranscriptionMetadata - -If the recording was transcribed, metadata about the transcription - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | The unique transcription ID | [optional] -**status** | **str** | The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values. | [optional] -**completed_time** | **str** | The time that the transcription was completed | [optional] -**url** | **str** | The URL of the [transcription](#operation/getCallTranscription) | [optional] - -## Example - -```python -from bandwidth.models.transcription_metadata import TranscriptionMetadata - -# TODO update the JSON string below -json = "{}" -# create an instance of TranscriptionMetadata from a JSON string -transcription_metadata_instance = TranscriptionMetadata.from_json(json) -# print the JSON string representation of the object -print(TranscriptionMetadata.to_json()) - -# convert the object into a dict -transcription_metadata_dict = transcription_metadata_instance.to_dict() -# create an instance of TranscriptionMetadata from a dict -transcription_metadata_form_dict = transcription_metadata.from_dict(transcription_metadata_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/test/smoke/test_toll_free_verification_api.py b/test/smoke/test_toll_free_verification_api.py index 95a66a67..474b9204 100644 --- a/test/smoke/test_toll_free_verification_api.py +++ b/test/smoke/test_toll_free_verification_api.py @@ -54,6 +54,13 @@ def test_get_toll_free_verification_status(self) -> None: """ pass + def test_delete_verification_request(self) -> None: + """Test case for delete_verification_request + + Delete Verification Request + """ + pass + def test_list_toll_free_use_cases(self) -> None: """Test case for list_toll_free_use_cases diff --git a/test/unit/api/test_toll_free_verification_api.py b/test/unit/api/test_toll_free_verification_api.py index b9d57165..56bfce19 100644 --- a/test/unit/api/test_toll_free_verification_api.py +++ b/test/unit/api/test_toll_free_verification_api.py @@ -135,6 +135,15 @@ def test_get_toll_free_verification_status(self) -> None: assert_that(response.data.created_date_time, instance_of(datetime)) assert_that(response.data.modified_date_time, instance_of(datetime)) + def test_delete_verification_request(self) -> None: + """Test case for delete_verification_request + + Delete Verification Request + """ + response = self.tfv_api_instance.delete_verification_request_with_http_info(BW_ACCOUNT_ID, self.tf_phone_number) + + assert_that(response.status_code, equal_to(204)) + def test_list_toll_free_use_cases(self) -> None: """Test case for list_toll_free_use_cases diff --git a/test/unit/models/test_call_transcription.py b/test/unit/models/test_call_transcription.py index 322df88e..a5e646b2 100644 --- a/test/unit/models/test_call_transcription.py +++ b/test/unit/models/test_call_transcription.py @@ -31,7 +31,6 @@ def make_instance(self, include_optional) -> CallTranscription: include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - instance = CallTranscription() if include_optional: return CallTranscription( detected_language = 'en-US', diff --git a/test/unit/models/test_callback.py b/test/unit/models/test_callback.py new file mode 100644 index 00000000..8fa590f7 --- /dev/null +++ b/test/unit/models/test_callback.py @@ -0,0 +1,91 @@ +# 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 import Callback +from bandwidth.models.inbound_callback import InboundCallback +from bandwidth.models.inbound_callback_message import InboundCallbackMessage +from bandwidth.models.status_callback import StatusCallback +from bandwidth.models.status_callback_message import StatusCallbackMessage + +class TestCallback(unittest.TestCase): + """Callback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Callback: + """Test Callback + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + + def testCallback(self): + """Test Callback""" + inbound_callback = Callback(InboundCallback( + time = '2024-12-02T20:15:57.278Z', + type = 'message-received', + to = '+15552223333', + description = 'Incoming message received', + message = InboundCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2024-12-02T20:15:57.666Z', + segment_count = 1, + direction = 'in', + to = ['+15552223333'], + var_from = '+15553332222', + ), + carrier_name = 'AT&T' + )) + status_callback = Callback(StatusCallback( + time = '2024-12-02T20:15:57.278Z', + event_time = '2024-12-02T20:15:58.278Z', + type = 'message-delivered', + to = '+15552223333', + description = 'Message delivered to carrier.', + message = StatusCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2024-12-02T20:15:57.666Z', + 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', + channel = 'RBM', ), + error_code = 4405, + carrier_name = 'AT&T' + )) + + assert inbound_callback is not None + assert isinstance(inbound_callback, Callback) + assert isinstance(inbound_callback.actual_instance, InboundCallback) + assert status_callback is not None + assert isinstance(status_callback, Callback) + assert isinstance(status_callback.actual_instance, StatusCallback) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_callback_type_enum.py b/test/unit/models/test_callback_type_enum.py deleted file mode 100644 index d73d4a90..00000000 --- a/test/unit/models/test_callback_type_enum.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from bandwidth.models.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_create_multi_channel_message_response.py b/test/unit/models/test_create_multi_channel_message_response.py deleted file mode 100644 index 6e23da25..00000000 --- a/test/unit/models/test_create_multi_channel_message_response.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from bandwidth.models.create_multi_channel_message_response import CreateMultiChannelMessageResponse -from bandwidth.models.link import Link -from bandwidth.models.multi_channel_message_data import MultiChannelMessageData -from bandwidth.models.error_object import ErrorObject - -class TestCreateMultiChannelMessageResponse(unittest.TestCase): - """CreateMultiChannelMessageResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> CreateMultiChannelMessageResponse: - """Test CreateMultiChannelMessageResponse - 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 CreateMultiChannelMessageResponse( - links = [ - Link( - rel = 'rel', - href = 'href', ) - ], - data = MultiChannelMessageData( - message_id = '1589228074636lm4k2je7j7jklbn2', - status = 'DELIVERED', - time = '2025-01-01T18:20:16Z', - direction = 'OUTBOUND', - var_from = 'BandwidthRBM', - to = '+15552223333', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - channel = 'RBM', - tag = 'custom string', ), - errors = [ - ErrorObject( - code = 'code', - message = 'message', ) - ] - ) - else: - return CreateMultiChannelMessageResponse( - ) - - def testCreateMultiChannelMessageResponse(self): - """Test CreateMultiChannelMessageResponse""" - instance = self.make_instance(True) - assert instance is not None - assert isinstance(instance, CreateMultiChannelMessageResponse) - assert isinstance(instance.links, list) - assert isinstance(instance.data, MultiChannelMessageData) - assert isinstance(instance.errors, list) - assert isinstance(instance.links[0], Link) - assert isinstance(instance.data, MultiChannelMessageData) - assert isinstance(instance.errors[0], ErrorObject) - assert instance.data.message_id == '1589228074636lm4k2je7j7jklbn2' - assert instance.data.status == 'DELIVERED' - assert instance.data.direction == 'OUTBOUND' - assert instance.data.var_from == 'BandwidthRBM' - assert instance.data.to == '+15552223333' - assert instance.data.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' - assert instance.data.channel == 'RBM' - assert instance.data.tag == 'custom string' - assert instance.errors[0].code == 'code' - assert instance.errors[0].message == 'message' - assert instance.links[0].rel == 'rel' - assert instance.links[0].href == 'href' - - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/models/test_error_object.py b/test/unit/models/test_error_object.py index 3007fba8..268b1e0f 100644 --- a/test/unit/models/test_error_object.py +++ b/test/unit/models/test_error_object.py @@ -16,6 +16,7 @@ import unittest from bandwidth.models.error_object import ErrorObject +from bandwidth.models.error_source import ErrorSource class TestErrorObject(unittest.TestCase): """ErrorObject unit test stubs""" @@ -33,8 +34,14 @@ def make_instance(self, include_optional) -> ErrorObject: optional params are included """ if include_optional: return ErrorObject( - code = 'code', - message = 'message' + type = 'type', + description = 'description', + source = ErrorSource( + parameter = 'parameter', + var_field = 'var_field', + header = 'header', + reference = 'reference' + ) ) else: return ErrorObject( @@ -45,8 +52,13 @@ def testErrorObject(self): instance = self.make_instance(True) assert instance is not None assert isinstance(instance, ErrorObject) - assert instance.code == 'code' - assert instance.message == 'message' + assert instance.type == 'type' + assert instance.description == 'description' + assert isinstance(instance.source, ErrorSource) + assert instance.source.parameter == 'parameter' + assert instance.source.var_field == 'var_field' + assert instance.source.header == 'header' + assert instance.source.reference == 'reference' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_error_source.py b/test/unit/models/test_error_source.py new file mode 100644 index 00000000..ffd6990c --- /dev/null +++ b/test/unit/models/test_error_source.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.error_source import ErrorSource + +class TestErrorSource(unittest.TestCase): + """ErrorSource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ErrorSource: + """Test ErrorSource + 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 ErrorSource( + parameter = 'parameter', + var_field = 'var_field', + header = 'header', + reference = 'reference' + ) + else: + return ErrorSource( + ) + + def testErrorSource(self): + """Test ErrorSource""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, ErrorSource) + assert instance.parameter == 'parameter' + assert instance.var_field == 'var_field' + assert instance.header == 'header' + assert instance.reference == 'reference' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_inbound_callback.py b/test/unit/models/test_inbound_callback.py new file mode 100644 index 00000000..a08a7984 --- /dev/null +++ b/test/unit/models/test_inbound_callback.py @@ -0,0 +1,83 @@ +# 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_callback import InboundCallback +from bandwidth.models.inbound_callback_message import InboundCallbackMessage + +class TestInboundCallback(unittest.TestCase): + """InboundCallback unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InboundCallback: + """Test InboundCallback + 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 InboundCallback( + time = '2024-12-02T20:15:57.278Z', + type = 'message-received', + to = '+15552223333', + description = 'Incoming message received', + message = InboundCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2024-12-02T20:15:57.666Z', + segment_count = 1, + direction = 'in', + to = ['+15552223333'], + var_from = '+15553332222', + ), + carrier_name = 'AT&T' + ) + else: + return InboundCallback( + time = '2024-12-02T20:15:57.278Z', + type = 'message-received', + to = '+15552223333', + description = 'Incoming message received', + message = None, + ) + + def testInboundCallback(self): + """Test InboundCallback""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, InboundCallback) + assert isinstance(instance.time, datetime) + assert instance.type == 'message-received' + assert instance.to == '+15552223333' + assert instance.description == 'Incoming message received' + assert isinstance(instance.message, InboundCallbackMessage) + 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' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_inbound_callback_message.py b/test/unit/models/test_inbound_callback_message.py new file mode 100644 index 00000000..d57b43ec --- /dev/null +++ b/test/unit/models/test_inbound_callback_message.py @@ -0,0 +1,100 @@ +# 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_callback_message import InboundCallbackMessage +from bandwidth.models.multi_channel_message_content import MultiChannelMessageContent +from bandwidth.models.rbm_location_response import RbmLocationResponse +from bandwidth.models.rbm_suggestion_response import RbmSuggestionResponse +from bandwidth.models.rbm_message_content_file import RbmMessageContentFile + +class TestInboundCallbackMessage(unittest.TestCase): + """InboundCallbackMessage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InboundCallbackMessage: + """Test InboundCallbackMessage + 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 InboundCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2024-12-02T20:15:57.666Z', + 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', + channel = 'RBM', + content = MultiChannelMessageContent( + text = '', + media = RbmMessageContentFile( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', ), ), + suggestion_response = RbmSuggestionResponse( + text = 'Yes, I would like to proceed', + postback_data = '[B@5d4a34ff', ), + location_response = RbmLocationResponse( + latitude = '37.7749', + longitude = '-122.4194', ) + ) + else: + return InboundCallbackMessage( + id = '1661365814859loidf7mcwd4qacn7', + owner = '+15553332222', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + time = '2024-12-02T20:15:57.666Z', + segment_count = 1, + direction = 'in', + to = ['+15552223333'], + var_from = '+15553332222', + ) + + def testInboundCallbackMessage(self): + """Test InboundCallbackMessage""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, InboundCallbackMessage) + 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 isinstance(instance.media, list) + assert len(instance.media) > 0 + assert isinstance(instance.content, MultiChannelMessageContent) + assert isinstance(instance.suggestion_response, RbmSuggestionResponse) + assert isinstance(instance.location_response, RbmLocationResponse) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_inbound_callback_type_enum.py b/test/unit/models/test_inbound_callback_type_enum.py new file mode 100644 index 00000000..e88ef079 --- /dev/null +++ b/test/unit/models/test_inbound_callback_type_enum.py @@ -0,0 +1,39 @@ +# 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.inbound_callback_type_enum import InboundCallbackTypeEnum + +class TestInboundCallbackTypeEnum(unittest.TestCase): + """InboundCallbackTypeEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInboundCallbackTypeEnum(self): + """Test InboundCallbackTypeEnum""" + message_received = InboundCallbackTypeEnum('message-received') + request_location_response = InboundCallbackTypeEnum('request-location-response') + suggestion_response = InboundCallbackTypeEnum('suggestion-response') + assert message_received == 'message-received' + assert request_location_response == 'request-location-response' + assert suggestion_response == 'suggestion-response' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_mms_message_content.py b/test/unit/models/test_mms_message_content.py index 0bc4c952..98c2a21e 100644 --- a/test/unit/models/test_mms_message_content.py +++ b/test/unit/models/test_mms_message_content.py @@ -16,6 +16,7 @@ import unittest from bandwidth.models.mms_message_content import MmsMessageContent +from bandwidth.models.mms_message_content_file import MmsMessageContentFile class TestMmsMessageContent(unittest.TestCase): """MmsMessageContent unit test stubs""" @@ -34,7 +35,7 @@ def make_instance(self, include_optional) -> MmsMessageContent: if include_optional: return MmsMessageContent( text = 'Hello world', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] + media = [MmsMessageContentFile(fileUrl="https://image.com/image.png")] ) else: return MmsMessageContent( @@ -46,7 +47,7 @@ def testMmsMessageContent(self): assert instance is not None assert isinstance(instance, MmsMessageContent) assert instance.text == 'Hello world' - assert instance.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] + assert instance.media == [MmsMessageContentFile(fileUrl="https://image.com/image.png")] if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_mms_message_content_file.py b/test/unit/models/test_mms_message_content_file.py new file mode 100644 index 00000000..14f827aa --- /dev/null +++ b/test/unit/models/test_mms_message_content_file.py @@ -0,0 +1,51 @@ +# 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.mms_message_content_file import MmsMessageContentFile + +class TestMmsMessageContentFile(unittest.TestCase): + """MmsMessageContentFile unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MmsMessageContentFile: + """Test MmsMessageContentFile + 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 MmsMessageContentFile( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png' + ) + else: + return MmsMessageContentFile( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + ) + + def testMmsMessageContentFile(self): + """Test MmsMessageContentFile""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MmsMessageContentFile) + assert instance.file_url == 'https://dev.bandwidth.com/images/bandwidth-logo.png' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_multi_channel_action.py b/test/unit/models/test_multi_channel_action.py index 6f7ec1c7..72e2fe5a 100644 --- a/test/unit/models/test_multi_channel_action.py +++ b/test/unit/models/test_multi_channel_action.py @@ -42,18 +42,18 @@ def testMultiChannelAction(self): model_rbm_action_base = MultiChannelAction(RbmActionBase( type='REPLY', text='Hello world', - post_back_data='[B@32298473' + postback_data='[B@32298473' )) model_rbm_action_dial = MultiChannelAction(RbmActionDial( type='DIAL_PHONE', text='Hello world', - post_back_data='[B@32298473', + postback_data='[B@32298473', phone_number='1234567890' )) model_rbm_action_view_location = MultiChannelAction(RbmActionViewLocation( type='SHOW_LOCATION', text='Hello world', - post_back_data='[B@32298473', + postback_data='[B@32298473', latitude='37.7749', longitude='-122.4194', label='San Francisco' @@ -61,7 +61,7 @@ def testMultiChannelAction(self): model_multi_channel_action_calendar_event = MultiChannelAction(MultiChannelActionCalendarEvent( type = 'CREATE_CALENDAR_EVENT', text = 'Hello world', - post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', title = 'Meeting with John', start_time = '2022-09-14T18:20:16Z', end_time = '2022-09-14T18:20:16Z', @@ -70,7 +70,7 @@ def testMultiChannelAction(self): model_rbm_action_open_url = MultiChannelAction(RbmActionOpenUrl( type='OPEN_URL', text='Hello world', - post_back_data='[B@32298473', + postback_data='[B@32298473', url='https://www.example.com' )) diff --git a/test/unit/models/test_multi_channel_action_calendar_event.py b/test/unit/models/test_multi_channel_action_calendar_event.py index 0ba6b65e..39ba975b 100644 --- a/test/unit/models/test_multi_channel_action_calendar_event.py +++ b/test/unit/models/test_multi_channel_action_calendar_event.py @@ -36,7 +36,7 @@ def make_instance(self, include_optional) -> MultiChannelActionCalendarEvent: return MultiChannelActionCalendarEvent( type = 'REPLY', text = 'Hello world', - post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', title = 'Meeting with John', start_time = '2022-09-14T18:20:16Z', end_time = '2022-09-14T18:20:16Z', @@ -46,7 +46,7 @@ def make_instance(self, include_optional) -> MultiChannelActionCalendarEvent: return MultiChannelActionCalendarEvent( type = 'REPLY', text = 'Hello world', - post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', title = 'Meeting with John', start_time = '2022-09-14T18:20:16Z', end_time = '2022-09-14T18:20:16Z', @@ -59,7 +59,7 @@ def testMultiChannelActionCalendarEvent(self): assert isinstance(instance, MultiChannelActionCalendarEvent) assert instance.type == 'REPLY' assert instance.text == 'Hello world' - assert instance.post_back_data == 'U0dWc2JHOGdkMjl5YkdRPQ==' + assert instance.postback_data == 'U0dWc2JHOGdkMjl5YkdRPQ==' assert instance.title == 'Meeting with John' assert isinstance(instance.start_time, datetime) assert isinstance(instance.end_time, datetime) diff --git a/test/unit/models/test_multi_channel_callback_data.py b/test/unit/models/test_multi_channel_callback_data.py deleted file mode 100644 index cc977d55..00000000 --- a/test/unit/models/test_multi_channel_callback_data.py +++ /dev/null @@ -1,76 +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.multi_channel_callback_data import MultiChannelCallbackData -from bandwidth.models.multi_channel_message_callback_data import MultiChannelMessageCallbackData - -class TestMultiChannelCallbackData(unittest.TestCase): - """MultiChannelCallbackData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> MultiChannelCallbackData: - """Test MultiChannelCallbackData - 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 MultiChannelCallbackData( - time = '2025-01-01T18:20:16Z', - type = 'DELIVERED', - to = '+15552223333', - description = 'Incoming message received', - message = MultiChannelMessageCallbackData( - message_id = '1589228074636lm4k2je7j7jklbn2', - status = 'DELIVERED', - direction = 'OUTBOUND', - var_from = 'BandwidthRBM', - to = '+15552223333', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - channel = 'RBM', - tag = 'custom string', ) - ) - else: - return MultiChannelCallbackData( - ) - - def testMultiChannelCallbackData(self): - """Test MultiChannelCallbackData""" - instance = self.make_instance(True) - assert instance is not None - assert isinstance(instance, MultiChannelCallbackData) - assert isinstance(instance.message, MultiChannelMessageCallbackData) - assert isinstance(instance.time, datetime) - assert instance.type == 'DELIVERED' - assert instance.to == '+15552223333' - assert instance.description == 'Incoming message received' - assert instance.message.message_id == '1589228074636lm4k2je7j7jklbn2' - assert instance.message.status == 'DELIVERED' - assert instance.message.direction == 'OUTBOUND' - assert instance.message.var_from == 'BandwidthRBM' - assert instance.message.to == '+15552223333' - assert instance.message.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' - assert instance.message.channel == 'RBM' - assert instance.message.tag == 'custom string' - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/models/test_multi_channel_channel_list_object_content.py b/test/unit/models/test_multi_channel_channel_list_object_content.py index aee17472..a3ea9b38 100644 --- a/test/unit/models/test_multi_channel_channel_list_object_content.py +++ b/test/unit/models/test_multi_channel_channel_list_object_content.py @@ -27,6 +27,7 @@ from bandwidth.models.rbm_standalone_card import RbmStandaloneCard from bandwidth.models.rbm_card_content import RbmCardContent from bandwidth.models.rbm_message_content_file import RbmMessageContentFile +from bandwidth.models.mms_message_content_file import MmsMessageContentFile class TestMultiChannelChannelListObjectContent(unittest.TestCase): @@ -54,7 +55,7 @@ def testMultiChannelChannelListObjectContent(self): RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] @@ -82,7 +83,7 @@ def testMultiChannelChannelListObjectContent(self): RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] @@ -92,7 +93,7 @@ def testMultiChannelChannelListObjectContent(self): RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] @@ -103,7 +104,7 @@ def testMultiChannelChannelListObjectContent(self): )) model_mms_message_content = MultiChannelChannelListObjectContent(MmsMessageContent( text = 'Hello world', - media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] + media = [MmsMessageContentFile(fileUrl="https://image.com/image.png")] )) assert model_rbm_message_content_text is not None diff --git a/test/unit/models/test_multi_channel_error.py b/test/unit/models/test_multi_channel_error.py new file mode 100644 index 00000000..7fbcf95c --- /dev/null +++ b/test/unit/models/test_multi_channel_error.py @@ -0,0 +1,72 @@ +# 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.multi_channel_error import MultiChannelError +from bandwidth.models.error_object import ErrorObject +from bandwidth.models.error_source import ErrorSource + +class TestMultiChannelError(unittest.TestCase): + """MultiChannelError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultiChannelError: + """Test MultiChannelError + 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 MultiChannelError( + links = [], + data = None, + errors = [ + ErrorObject( + type = 'type', + description = 'description', + source = ErrorSource( + parameter = 'parameter', + var_field = 'field', + header = 'header', + reference = 'reference', ), ) + ] + ) + else: + return MultiChannelError( + ) + + def testMultiChannelError(self): + """Test MultiChannelError""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MultiChannelError) + assert isinstance(instance.errors, list) + assert len(instance.errors) > 0 + assert isinstance(instance.errors[0], ErrorObject) + assert instance.errors[0].type == 'type' + assert instance.errors[0].description == 'description' + assert isinstance(instance.errors[0].source, ErrorSource) + assert instance.errors[0].source.parameter == 'parameter' + assert instance.errors[0].source.var_field == 'field' + assert instance.errors[0].source.header == 'header' + assert instance.errors[0].source.reference == 'reference' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_multi_channel_message_callback_data.py b/test/unit/models/test_multi_channel_message_callback_data.py deleted file mode 100644 index f0ad1ae9..00000000 --- a/test/unit/models/test_multi_channel_message_callback_data.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from bandwidth.models.multi_channel_message_callback_data import MultiChannelMessageCallbackData - -class TestMultiChannelMessageCallbackData(unittest.TestCase): - """MultiChannelMessageCallbackData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> MultiChannelMessageCallbackData: - """Test MultiChannelMessageCallbackData - 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 MultiChannelMessageCallbackData( - message_id = '1589228074636lm4k2je7j7jklbn2', - status = 'DELIVERED', - direction = 'OUTBOUND', - var_from = 'BandwidthRBM', - to = '+15552223333', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - channel = 'RBM', - tag = 'custom string' - ) - else: - return MultiChannelMessageCallbackData( - ) - - def testMultiChannelMessageCallbackData(self): - """Test MultiChannelMessageCallbackData""" - instance = self.make_instance(True) - assert instance is not None - assert isinstance(instance, MultiChannelMessageCallbackData) - assert instance.message_id == '1589228074636lm4k2je7j7jklbn2' - assert instance.status == 'DELIVERED' - assert instance.direction == 'OUTBOUND' - assert instance.var_from == 'BandwidthRBM' - assert instance.to == '+15552223333' - assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' - assert instance.channel == 'RBM' - assert instance.tag == 'custom string' - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/models/test_multi_channel_message_content.py b/test/unit/models/test_multi_channel_message_content.py new file mode 100644 index 00000000..9635a28b --- /dev/null +++ b/test/unit/models/test_multi_channel_message_content.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.multi_channel_message_content import MultiChannelMessageContent +from bandwidth.models.rbm_message_content_file import RbmMessageContentFile + +class TestMultiChannelMessageContent(unittest.TestCase): + """MultiChannelMessageContent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultiChannelMessageContent: + """Test MultiChannelMessageContent + 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 MultiChannelMessageContent( + text = '', + media = RbmMessageContentFile( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', ) + ) + else: + return MultiChannelMessageContent( + ) + + def testMultiChannelMessageContent(self): + """Test MultiChannelMessageContent""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MultiChannelMessageContent) + assert instance.text == '' + assert isinstance(instance.media, RbmMessageContentFile) + assert instance.media.file_url == 'https://dev.bandwidth.com/images/bandwidth-logo.png' + assert instance.media.thumbnail_url == 'https://dev.bandwidth.com/images/bandwidth-logo.png' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_multi_channel_message_data.py b/test/unit/models/test_multi_channel_message_data.py deleted file mode 100644 index 8f2ab0b9..00000000 --- a/test/unit/models/test_multi_channel_message_data.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from bandwidth.models.multi_channel_message_data import MultiChannelMessageData - -class TestMultiChannelMessageData(unittest.TestCase): - """MultiChannelMessageData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> MultiChannelMessageData: - """Test MultiChannelMessageData - 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 MultiChannelMessageData( - message_id = '1589228074636lm4k2je7j7jklbn2', - status = 'DELIVERED', - time = '2025-01-01T18:20:16Z', - direction = 'OUTBOUND', - var_from = 'BandwidthRBM', - to = '+15552223333', - application_id = '93de2206-9669-4e07-948d-329f4b722ee2', - channel = 'RBM', - tag = 'custom string' - ) - else: - return MultiChannelMessageData( - ) - - def testMultiChannelMessageData(self): - """Test MultiChannelMessageData""" - instance = self.make_instance(True) - assert instance is not None - assert isinstance(instance, MultiChannelMessageData) - assert instance.message_id == '1589228074636lm4k2je7j7jklbn2' - assert instance.status == 'DELIVERED' - assert instance.direction == 'OUTBOUND' - assert instance.var_from == 'BandwidthRBM' - assert instance.to == '+15552223333' - assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' - assert instance.channel == 'RBM' - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/models/test_multi_channel_message_direction_enum.py b/test/unit/models/test_multi_channel_message_direction_enum.py deleted file mode 100644 index fc82bd3c..00000000 --- a/test/unit/models/test_multi_channel_message_direction_enum.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from bandwidth.models.multi_channel_message_direction_enum import MultiChannelMessageDirectionEnum - -class TestMultiChannelMessageDirectionEnum(unittest.TestCase): - """MultiChannelMessageDirectionEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMultiChannelMessageDirectionEnum(self): - """Test MultiChannelMessageDirectionEnum""" - inbound = MultiChannelMessageDirectionEnum('INBOUND') - outbound = MultiChannelMessageDirectionEnum('OUTBOUND') - assert inbound == 'INBOUND' - assert outbound == 'OUTBOUND' - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/models/test_multi_channel_message_response_data.py b/test/unit/models/test_multi_channel_message_response_data.py new file mode 100644 index 00000000..1aa6c2bb --- /dev/null +++ b/test/unit/models/test_multi_channel_message_response_data.py @@ -0,0 +1,81 @@ +# 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.multi_channel_message_response_data import MultiChannelMessageResponseData +from bandwidth.models.multi_channel_message_response_data_channel_list_inner import MultiChannelMessageResponseDataChannelListInner +from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent + +class TestMultiChannelMessageResponseData(unittest.TestCase): + """MultiChannelMessageResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultiChannelMessageResponseData: + """Test MultiChannelMessageResponseData + 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 MultiChannelMessageResponseData( + message_id = '1589228074636lm4k2je7j7jklbn2', + time = '2025-01-01T18:20:16Z', + direction = 'in', + to = ["+15554443333"], + channel_list = [ + MultiChannelMessageResponseDataChannelListInner( + var_from = 'BandwidthRBM', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + channel = 'RBM', + content = MultiChannelChannelListObjectContent(), + owner = 'owner', + )], + tag = 'custom string', + priority = 'default', + expiration = '2021-02-01T11:29:18-05:00' + ) + else: + return MultiChannelMessageResponseData( + message_id = '1589228074636lm4k2je7j7jklbn2', + time = '2025-01-01T18:20:16Z', + direction = 'in', + to = ["+15554443333"], + channel_list = [], + ) + + def testMultiChannelMessageResponseData(self): + """Test MultiChannelMessageResponseData""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MultiChannelMessageResponseData) + assert instance.message_id == '1589228074636lm4k2je7j7jklbn2' + assert isinstance(instance.time, datetime) + assert instance.direction == 'in' + assert instance.to == ["+15554443333"] + assert isinstance(instance.channel_list, list) + assert len(instance.channel_list) > 0 + assert isinstance(instance.channel_list[0], MultiChannelMessageResponseDataChannelListInner) + assert instance.tag == 'custom string' + assert instance.priority == 'default' + assert isinstance(instance.expiration, datetime) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_multi_channel_message_response_data_channel_list_inner.py b/test/unit/models/test_multi_channel_message_response_data_channel_list_inner.py new file mode 100644 index 00000000..a4917345 --- /dev/null +++ b/test/unit/models/test_multi_channel_message_response_data_channel_list_inner.py @@ -0,0 +1,64 @@ +# 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.multi_channel_message_response_data_channel_list_inner import MultiChannelMessageResponseDataChannelListInner +from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent + +class TestMultiChannelMessageResponseDataChannelListInner(unittest.TestCase): + """MultiChannelMessageResponseDataChannelListInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultiChannelMessageResponseDataChannelListInner: + """Test MultiChannelMessageResponseDataChannelListInner + 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 MultiChannelMessageResponseDataChannelListInner( + var_from = 'BandwidthRBM', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + channel = 'RBM', + content = MultiChannelChannelListObjectContent(), + owner = 'owner' + ) + else: + return MultiChannelMessageResponseDataChannelListInner( + var_from = 'BandwidthRBM', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + channel = 'RBM', + content = MultiChannelChannelListObjectContent(), + owner = 'owner', + ) + + def testMultiChannelMessageResponseDataChannelListInner(self): + """Test MultiChannelMessageResponseDataChannelListInner""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MultiChannelMessageResponseDataChannelListInner) + assert instance.var_from == 'BandwidthRBM' + assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' + assert instance.channel == 'RBM' + assert isinstance(instance.content, MultiChannelChannelListObjectContent) + assert instance.owner == 'owner' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_multi_channel_status_enum.py b/test/unit/models/test_multi_channel_status_enum.py deleted file mode 100644 index 50714209..00000000 --- a/test/unit/models/test_multi_channel_status_enum.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - Bandwidth - - Bandwidth's Communication APIs - - The version of the OpenAPI document: 1.0.0 - Contact: letstalk@bandwidth.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from bandwidth.models.multi_channel_status_enum import MultiChannelStatusEnum - -class TestMultiChannelStatusEnum(unittest.TestCase): - """MultiChannelStatusEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMultiChannelStatusEnum(self): - """Test MultiChannelStatusEnum""" - queued = MultiChannelStatusEnum('QUEUED') - sending = MultiChannelStatusEnum('SENDING') - delivered = MultiChannelStatusEnum('DELIVERED') - failed = MultiChannelStatusEnum('FAILED') - assert queued == 'QUEUED' - assert sending == 'SENDING' - assert delivered == 'DELIVERED' - assert failed == 'FAILED' - -if __name__ == '__main__': - unittest.main() diff --git a/test/unit/models/test_rbm_action_base.py b/test/unit/models/test_rbm_action_base.py index 2b6fe0a1..e67e750a 100644 --- a/test/unit/models/test_rbm_action_base.py +++ b/test/unit/models/test_rbm_action_base.py @@ -35,13 +35,13 @@ def make_instance(self, include_optional) -> RbmActionBase: return RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) else: return RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473', + postback_data = '[B@32298473', ) def testRbmActionBase(self): @@ -51,7 +51,7 @@ def testRbmActionBase(self): assert isinstance(instance, RbmActionBase) assert instance.type == 'REPLY' assert instance.text == 'Hello world' - assert instance.post_back_data == '[B@32298473' + assert instance.postback_data == '[B@32298473' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_rbm_action_dial.py b/test/unit/models/test_rbm_action_dial.py index 54d09295..49ef346d 100644 --- a/test/unit/models/test_rbm_action_dial.py +++ b/test/unit/models/test_rbm_action_dial.py @@ -35,14 +35,14 @@ def make_instance(self, include_optional) -> RbmActionDial: return RbmActionDial( type = 'REPLY', text = 'Hello world', - post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', phone_number = '+15552223333' ) else: return RbmActionDial( type = 'REPLY', text = 'Hello world', - post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', phone_number = '+15552223333', ) @@ -53,7 +53,7 @@ def testRbmActionDial(self): assert isinstance(instance, RbmActionDial) assert instance.type == 'REPLY' assert instance.text == 'Hello world' - assert instance.post_back_data == 'U0dWc2JHOGdkMjl5YkdRPQ==' + assert instance.postback_data == 'U0dWc2JHOGdkMjl5YkdRPQ==' assert instance.phone_number == '+15552223333' if __name__ == '__main__': diff --git a/test/unit/models/test_rbm_action_open_url.py b/test/unit/models/test_rbm_action_open_url.py index 198a8011..9e27c51f 100644 --- a/test/unit/models/test_rbm_action_open_url.py +++ b/test/unit/models/test_rbm_action_open_url.py @@ -35,14 +35,14 @@ def make_instance(self, include_optional) -> RbmActionOpenUrl: return RbmActionOpenUrl( type = 'REPLY', text = 'Hello world', - post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', url = 'https://dev.bandwidth.com' ) else: return RbmActionOpenUrl( type = 'REPLY', text = 'Hello world', - post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', url = 'https://dev.bandwidth.com', ) @@ -53,7 +53,7 @@ def testRbmActionOpenUrl(self): assert isinstance(instance, RbmActionOpenUrl) assert instance.type == 'REPLY' assert instance.text == 'Hello world' - assert instance.post_back_data == 'U0dWc2JHOGdkMjl5YkdRPQ==' + assert instance.postback_data == 'U0dWc2JHOGdkMjl5YkdRPQ==' assert instance.url == 'https://dev.bandwidth.com' if __name__ == '__main__': diff --git a/test/unit/models/test_rbm_action_view_location.py b/test/unit/models/test_rbm_action_view_location.py index 49fc9141..bae4d0b0 100644 --- a/test/unit/models/test_rbm_action_view_location.py +++ b/test/unit/models/test_rbm_action_view_location.py @@ -35,7 +35,7 @@ def make_instance(self, include_optional) -> RbmActionViewLocation: return RbmActionViewLocation( type = 'REPLY', text = 'Hello world', - post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', latitude = '37.7749', longitude = '-122.4194', label = 'San Francisco' @@ -44,7 +44,7 @@ def make_instance(self, include_optional) -> RbmActionViewLocation: return RbmActionViewLocation( type = 'REPLY', text = 'Hello world', - post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + postback_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', latitude = '37.7749', longitude = '-122.4194', ) @@ -56,7 +56,7 @@ def testRbmActionViewLocation(self): assert isinstance(instance, RbmActionViewLocation) assert instance.type == 'REPLY' assert instance.text == 'Hello world' - assert instance.post_back_data == 'U0dWc2JHOGdkMjl5YkdRPQ==' + assert instance.postback_data == 'U0dWc2JHOGdkMjl5YkdRPQ==' assert instance.latitude == '37.7749' assert instance.longitude == '-122.4194' assert instance.label == 'San Francisco' diff --git a/test/unit/models/test_rbm_card_content.py b/test/unit/models/test_rbm_card_content.py index 050223c8..a06164a7 100644 --- a/test/unit/models/test_rbm_card_content.py +++ b/test/unit/models/test_rbm_card_content.py @@ -48,7 +48,7 @@ def make_instance(self, include_optional) -> RbmCardContent: RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] diff --git a/test/unit/models/test_deferred_result.py b/test/unit/models/test_rbm_location_response.py similarity index 52% rename from test/unit/models/test_deferred_result.py rename to test/unit/models/test_rbm_location_response.py index da6490ae..432b1999 100644 --- a/test/unit/models/test_deferred_result.py +++ b/test/unit/models/test_rbm_location_response.py @@ -15,10 +15,10 @@ import unittest -from bandwidth.models.deferred_result import DeferredResult +from bandwidth.models.rbm_location_response import RbmLocationResponse -class TestDeferredResult(unittest.TestCase): - """DeferredResult unit test stubs""" +class TestRbmLocationResponse(unittest.TestCase): + """RbmLocationResponse unit test stubs""" def setUp(self): pass @@ -26,27 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> DeferredResult: - """Test DeferredResult + def make_instance(self, include_optional) -> RbmLocationResponse: + """Test RbmLocationResponse 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 DeferredResult( - result = None, - set_or_expired = True + return RbmLocationResponse( + latitude = '37.7749', + longitude = '-122.4194' ) else: - return DeferredResult( + return RbmLocationResponse( ) - def testDeferredResult(self): - """Test DeferredResult""" + def testRbmLocationResponse(self): + """Test RbmLocationResponse""" instance = self.make_instance(True) assert instance is not None - assert isinstance(instance, DeferredResult) - assert instance.result is None - assert instance.set_or_expired == True + assert isinstance(instance, RbmLocationResponse) + assert instance.latitude == '37.7749' + assert instance.longitude == '-122.4194' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_rbm_message_carousel_card.py b/test/unit/models/test_rbm_message_carousel_card.py index f44defd6..e8df3999 100644 --- a/test/unit/models/test_rbm_message_carousel_card.py +++ b/test/unit/models/test_rbm_message_carousel_card.py @@ -52,7 +52,7 @@ def make_instance(self, include_optional) -> RbmMessageCarouselCard: RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ], @@ -63,7 +63,7 @@ def make_instance(self, include_optional) -> RbmMessageCarouselCard: RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] @@ -85,7 +85,7 @@ def make_instance(self, include_optional) -> RbmMessageCarouselCard: RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ], @@ -96,7 +96,7 @@ def make_instance(self, include_optional) -> RbmMessageCarouselCard: RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] diff --git a/test/unit/models/test_rbm_message_content_rich_card.py b/test/unit/models/test_rbm_message_content_rich_card.py index cf3b33fc..6275004d 100644 --- a/test/unit/models/test_rbm_message_content_rich_card.py +++ b/test/unit/models/test_rbm_message_content_rich_card.py @@ -56,7 +56,7 @@ def testRbmMessageContentRichCard(self): RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] @@ -66,7 +66,7 @@ def testRbmMessageContentRichCard(self): RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] @@ -87,7 +87,7 @@ def testRbmMessageContentRichCard(self): RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ], @@ -98,7 +98,7 @@ def testRbmMessageContentRichCard(self): RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] diff --git a/test/unit/models/test_rbm_message_content_text.py b/test/unit/models/test_rbm_message_content_text.py index fe3492a1..b5f33a12 100644 --- a/test/unit/models/test_rbm_message_content_text.py +++ b/test/unit/models/test_rbm_message_content_text.py @@ -41,7 +41,7 @@ def make_instance(self, include_optional) -> RbmMessageContentText: RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] diff --git a/test/unit/models/test_rbm_message_media.py b/test/unit/models/test_rbm_message_media.py index f2258aa8..88ce0bf4 100644 --- a/test/unit/models/test_rbm_message_media.py +++ b/test/unit/models/test_rbm_message_media.py @@ -45,7 +45,7 @@ def make_instance(self, include_optional) -> RbmMessageMedia: RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] diff --git a/test/unit/models/test_rbm_standalone_card.py b/test/unit/models/test_rbm_standalone_card.py index 54b2e7b0..1e87da8e 100644 --- a/test/unit/models/test_rbm_standalone_card.py +++ b/test/unit/models/test_rbm_standalone_card.py @@ -52,7 +52,7 @@ def make_instance(self, include_optional) -> RbmStandaloneCard: RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] @@ -62,7 +62,7 @@ def make_instance(self, include_optional) -> RbmStandaloneCard: RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] @@ -80,7 +80,7 @@ def make_instance(self, include_optional) -> RbmStandaloneCard: RbmActionBase( type = 'REPLY', text = 'Hello world', - post_back_data = '[B@32298473' + postback_data = '[B@32298473' ) ) ] diff --git a/test/unit/models/test_tag.py b/test/unit/models/test_rbm_suggestion_response.py similarity index 50% rename from test/unit/models/test_tag.py rename to test/unit/models/test_rbm_suggestion_response.py index 5c5bd978..0579c4fc 100644 --- a/test/unit/models/test_tag.py +++ b/test/unit/models/test_rbm_suggestion_response.py @@ -15,10 +15,10 @@ import unittest -from bandwidth.models.tag import Tag +from bandwidth.models.rbm_suggestion_response import RbmSuggestionResponse -class TestTag(unittest.TestCase): - """Tag unit test stubs""" +class TestRbmSuggestionResponse(unittest.TestCase): + """RbmSuggestionResponse unit test stubs""" def setUp(self): pass @@ -26,27 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> Tag: - """Test Tag + def make_instance(self, include_optional) -> RbmSuggestionResponse: + """Test RbmSuggestionResponse 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 Tag( - key = '', - value = '' + return RbmSuggestionResponse( + text = 'Yes, I would like to proceed', + postback_data = '[B@5d4a34ff' ) else: - return Tag( + return RbmSuggestionResponse( ) - def testTag(self): - """Test Tag""" + def testRbmSuggestionResponse(self): + """Test RbmSuggestionResponse""" instance = self.make_instance(True) assert instance is not None - assert isinstance(instance, Tag) - assert instance.key == '' - assert instance.value == '' + assert isinstance(instance, RbmSuggestionResponse) + assert instance.text == 'Yes, I would like to proceed' + assert instance.postback_data == '[B@5d4a34ff' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_message_callback.py b/test/unit/models/test_status_callback.py similarity index 57% rename from test/unit/models/test_message_callback.py rename to test/unit/models/test_status_callback.py index 495fed8f..33ae20c9 100644 --- a/test/unit/models/test_message_callback.py +++ b/test/unit/models/test_status_callback.py @@ -16,11 +16,11 @@ import unittest from datetime import datetime -from bandwidth.models.message_callback import MessageCallback -from bandwidth.models.message_callback_message import MessageCallbackMessage +from bandwidth.models.status_callback import StatusCallback +from bandwidth.models.status_callback_message import StatusCallbackMessage -class TestMessageCallback(unittest.TestCase): - """MessageCallback unit test stubs""" +class TestStatusCallback(unittest.TestCase): + """StatusCallback unit test stubs""" def setUp(self): pass @@ -28,18 +28,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> MessageCallback: - """Test MessageCallback + def make_instance(self, include_optional) -> StatusCallback: + """Test StatusCallback 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 MessageCallback( + return StatusCallback( time = '2024-12-02T20:15:57.278Z', + event_time = '2024-12-02T20:15:58.278Z', type = 'message-delivered', to = '+15552223333', - description = 'rejected-unallocated-from-number', - message = MessageCallbackMessage( + description = 'Message delivered to carrier.', + message = StatusCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', @@ -51,17 +52,18 @@ def make_instance(self, include_optional) -> MessageCallback: 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', + channel = 'RBM', ), error_code = 4405, - carrier_name = "AT&T" + carrier_name = 'AT&T' ) else: - return MessageCallback( + return StatusCallback( time = '2024-12-02T20:15:57.278Z', type = 'message-delivered', to = '+15552223333', - description = 'rejected-unallocated-from-number', - message = MessageCallbackMessage( + description = 'Message delivered to carrier.', + message = StatusCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', @@ -73,33 +75,24 @@ def make_instance(self, include_optional) -> MessageCallback: 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', + channel = 'RBM', ), ) - def testMessageCallback(self): - """Test MessageCallback""" + + def testStatusCallback(self): + """Test StatusCallback""" instance = self.make_instance(True) assert instance is not None - assert isinstance(instance, MessageCallback) + assert isinstance(instance, StatusCallback) assert isinstance(instance.time, datetime) + assert isinstance(instance.event_time, datetime) assert instance.type == 'message-delivered' assert instance.to == '+15552223333' - 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' - 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.description == 'Message delivered to carrier.' + assert isinstance(instance.message, StatusCallbackMessage) assert instance.error_code == 4405 - assert instance.carrier_name == "AT&T" + assert instance.carrier_name == 'AT&T' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_message_callback_message.py b/test/unit/models/test_status_callback_message.py similarity index 77% rename from test/unit/models/test_message_callback_message.py rename to test/unit/models/test_status_callback_message.py index 950b7181..97e879cc 100644 --- a/test/unit/models/test_message_callback_message.py +++ b/test/unit/models/test_status_callback_message.py @@ -16,10 +16,10 @@ import unittest from datetime import datetime -from bandwidth.models.message_callback_message import MessageCallbackMessage +from bandwidth.models.status_callback_message import StatusCallbackMessage -class TestMessageCallbackMessage(unittest.TestCase): - """MessageCallbackMessage unit test stubs""" +class TestStatusCallbackMessage(unittest.TestCase): + """StatusCallbackMessage unit test stubs""" def setUp(self): pass @@ -27,13 +27,13 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> MessageCallbackMessage: - """Test MessageCallbackMessage + def make_instance(self, include_optional) -> StatusCallbackMessage: + """Test StatusCallbackMessage 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 MessageCallbackMessage( + return StatusCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', @@ -45,10 +45,11 @@ def make_instance(self, include_optional) -> MessageCallbackMessage: 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', + channel = 'RBM' ) else: - return MessageCallbackMessage( + return StatusCallbackMessage( id = '1661365814859loidf7mcwd4qacn7', owner = '+15553332222', application_id = '93de2206-9669-4e07-948d-329f4b722ee2', @@ -57,14 +58,13 @@ def make_instance(self, include_optional) -> MessageCallbackMessage: direction = 'in', to = ["+15552223333"], var_from = '+15553332222', - text = 'Hello world', ) - def testMessageCallbackMessage(self): - """Test MessageCallbackMessage""" + def testStatusCallbackMessage(self): + """Test StatusCallbackMessage""" instance = self.make_instance(True) assert instance is not None - assert isinstance(instance, MessageCallbackMessage) + assert isinstance(instance, StatusCallbackMessage) assert instance.id == '1661365814859loidf7mcwd4qacn7' assert instance.owner == '+15553332222' assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' @@ -75,8 +75,9 @@ def testMessageCallbackMessage(self): 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.media == ["https://dev.bandwidth.com/images/bandwidth-logo.png", "https://dev.bandwidth.com/images/github_logo.png"] assert instance.priority == 'default' + assert instance.channel == 'RBM' if __name__ == '__main__': unittest.main() diff --git a/test/unit/models/test_status_callback_type_enum.py b/test/unit/models/test_status_callback_type_enum.py new file mode 100644 index 00000000..69cacae9 --- /dev/null +++ b/test/unit/models/test_status_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.status_callback_type_enum import StatusCallbackTypeEnum + +class TestStatusCallbackTypeEnum(unittest.TestCase): + """StatusCallbackTypeEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStatusCallbackTypeEnum(self): + """Test StatusCallbackTypeEnum""" + message_sending = StatusCallbackTypeEnum('message-sending') + message_delivered = StatusCallbackTypeEnum('message-delivered') + message_failed = StatusCallbackTypeEnum('message-failed') + message_read = StatusCallbackTypeEnum('message-read') + assert message_sending == 'message-sending' + assert message_delivered == 'message-delivered' + assert message_failed == 'message-failed' + assert message_read == 'message-read' + +if __name__ == '__main__': + unittest.main()