From 364e48d448df4949aacdc8fb9a8b7c9b098b5a20 Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Tue, 22 Apr 2025 14:07:10 +0000 Subject: [PATCH 1/7] Generate SDK with OpenAPI Generator Version --- .openapi-generator/FILES | 70 +- README.md | 35 +- bandwidth.yml | 632 ++++++++++++++++-- bandwidth/__init__.py | 35 +- bandwidth/api/__init__.py | 1 + bandwidth/api/multi_channel_api.py | 356 ++++++++++ bandwidth/models/__init__.py | 34 +- bandwidth/models/card_width_enum.py | 38 ++ .../create_multi_channel_message_response.py | 125 ++++ bandwidth/models/error_object.py | 103 +++ bandwidth/models/link.py | 103 +++ bandwidth/models/message.py | 2 +- bandwidth/models/message_request.py | 2 +- bandwidth/models/mms_message_content.py | 104 +++ bandwidth/models/multi_channel_action.py | 183 +++++ .../multi_channel_action_calendar_event.py | 116 ++++ .../models/multi_channel_callback_data.py | 115 ++++ .../multi_channel_channel_list_object.py | 112 ++++ ...lti_channel_channel_list_object_content.py | 180 +++++ .../multi_channel_message_callback_data.py | 118 ++++ .../multi_channel_message_channel_enum.py | 39 ++ .../models/multi_channel_message_data.py | 121 ++++ .../multi_channel_message_direction_enum.py | 38 ++ .../models/multi_channel_message_request.py | 120 ++++ bandwidth/models/multi_channel_status_enum.py | 40 ++ bandwidth/models/priority_enum.py | 2 +- bandwidth/models/rbm_action_base.py | 107 +++ bandwidth/models/rbm_action_dial.py | 109 +++ bandwidth/models/rbm_action_open_url.py | 109 +++ bandwidth/models/rbm_action_type_enum.py | 42 ++ bandwidth/models/rbm_action_view_location.py | 113 ++++ bandwidth/models/rbm_card_content.py | 120 ++++ bandwidth/models/rbm_card_content_media.py | 107 +++ bandwidth/models/rbm_media_height_enum.py | 39 ++ bandwidth/models/rbm_message_carousel_card.py | 123 ++++ bandwidth/models/rbm_message_content_file.py | 104 +++ .../models/rbm_message_content_rich_card.py | 138 ++++ bandwidth/models/rbm_message_content_text.py | 112 ++++ bandwidth/models/rbm_message_media.py | 116 ++++ bandwidth/models/rbm_standalone_card.py | 122 ++++ bandwidth/models/sms_message_content.py | 102 +++ .../standalone_card_orientation_enum.py | 38 ++ bandwidth/models/thumbnail_alignment_enum.py | 38 ++ docs/CardWidthEnum.md | 12 + docs/CreateMultiChannelMessageResponse.md | 31 + docs/ErrorObject.md | 30 + docs/Link.md | 30 + docs/Message.md | 2 +- docs/MessageRequest.md | 2 +- docs/MmsMessageContent.md | 30 + docs/MultiChannelAction.md | 40 ++ docs/MultiChannelActionCalendarEvent.md | 35 + docs/MultiChannelApi.md | 99 +++ docs/MultiChannelCallbackData.md | 33 + docs/MultiChannelChannelListObject.md | 32 + docs/MultiChannelChannelListObjectContent.md | 37 + docs/MultiChannelMessageCallbackData.md | 36 + docs/MultiChannelMessageChannelEnum.md | 15 + docs/MultiChannelMessageData.md | 37 + docs/MultiChannelMessageDirectionEnum.md | 12 + docs/MultiChannelMessageRequest.md | 34 + docs/MultiChannelStatusEnum.md | 16 + docs/PriorityEnum.md | 2 +- docs/RbmActionBase.md | 31 + docs/RbmActionDial.md | 32 + docs/RbmActionOpenUrl.md | 32 + docs/RbmActionTypeEnum.md | 20 + docs/RbmActionViewLocation.md | 34 + docs/RbmCardContent.md | 32 + docs/RbmCardContentMedia.md | 31 + docs/RbmMediaHeightEnum.md | 15 + docs/RbmMessageCarouselCard.md | 31 + docs/RbmMessageContentFile.md | 30 + docs/RbmMessageContentRichCard.md | 34 + docs/RbmMessageContentText.md | 30 + docs/RbmMessageMedia.md | 30 + docs/RbmStandaloneCard.md | 32 + docs/SmsMessageContent.md | 29 + docs/StandaloneCardOrientationEnum.md | 12 + docs/ThumbnailAlignmentEnum.md | 13 + 80 files changed, 5429 insertions(+), 67 deletions(-) create mode 100644 bandwidth/api/multi_channel_api.py create mode 100644 bandwidth/models/card_width_enum.py create mode 100644 bandwidth/models/create_multi_channel_message_response.py create mode 100644 bandwidth/models/error_object.py create mode 100644 bandwidth/models/link.py create mode 100644 bandwidth/models/mms_message_content.py create mode 100644 bandwidth/models/multi_channel_action.py create mode 100644 bandwidth/models/multi_channel_action_calendar_event.py create mode 100644 bandwidth/models/multi_channel_callback_data.py create mode 100644 bandwidth/models/multi_channel_channel_list_object.py create mode 100644 bandwidth/models/multi_channel_channel_list_object_content.py create mode 100644 bandwidth/models/multi_channel_message_callback_data.py create mode 100644 bandwidth/models/multi_channel_message_channel_enum.py create mode 100644 bandwidth/models/multi_channel_message_data.py create mode 100644 bandwidth/models/multi_channel_message_direction_enum.py create mode 100644 bandwidth/models/multi_channel_message_request.py create mode 100644 bandwidth/models/multi_channel_status_enum.py create mode 100644 bandwidth/models/rbm_action_base.py create mode 100644 bandwidth/models/rbm_action_dial.py create mode 100644 bandwidth/models/rbm_action_open_url.py create mode 100644 bandwidth/models/rbm_action_type_enum.py create mode 100644 bandwidth/models/rbm_action_view_location.py create mode 100644 bandwidth/models/rbm_card_content.py create mode 100644 bandwidth/models/rbm_card_content_media.py create mode 100644 bandwidth/models/rbm_media_height_enum.py create mode 100644 bandwidth/models/rbm_message_carousel_card.py create mode 100644 bandwidth/models/rbm_message_content_file.py create mode 100644 bandwidth/models/rbm_message_content_rich_card.py create mode 100644 bandwidth/models/rbm_message_content_text.py create mode 100644 bandwidth/models/rbm_message_media.py create mode 100644 bandwidth/models/rbm_standalone_card.py create mode 100644 bandwidth/models/sms_message_content.py create mode 100644 bandwidth/models/standalone_card_orientation_enum.py create mode 100644 bandwidth/models/thumbnail_alignment_enum.py create mode 100644 docs/CardWidthEnum.md create mode 100644 docs/CreateMultiChannelMessageResponse.md create mode 100644 docs/ErrorObject.md create mode 100644 docs/Link.md create mode 100644 docs/MmsMessageContent.md create mode 100644 docs/MultiChannelAction.md create mode 100644 docs/MultiChannelActionCalendarEvent.md create mode 100644 docs/MultiChannelApi.md create mode 100644 docs/MultiChannelCallbackData.md create mode 100644 docs/MultiChannelChannelListObject.md create mode 100644 docs/MultiChannelChannelListObjectContent.md create mode 100644 docs/MultiChannelMessageCallbackData.md create mode 100644 docs/MultiChannelMessageChannelEnum.md create mode 100644 docs/MultiChannelMessageData.md create mode 100644 docs/MultiChannelMessageDirectionEnum.md create mode 100644 docs/MultiChannelMessageRequest.md create mode 100644 docs/MultiChannelStatusEnum.md create mode 100644 docs/RbmActionBase.md create mode 100644 docs/RbmActionDial.md create mode 100644 docs/RbmActionOpenUrl.md create mode 100644 docs/RbmActionTypeEnum.md create mode 100644 docs/RbmActionViewLocation.md create mode 100644 docs/RbmCardContent.md create mode 100644 docs/RbmCardContentMedia.md create mode 100644 docs/RbmMediaHeightEnum.md create mode 100644 docs/RbmMessageCarouselCard.md create mode 100644 docs/RbmMessageContentFile.md create mode 100644 docs/RbmMessageContentRichCard.md create mode 100644 docs/RbmMessageContentText.md create mode 100644 docs/RbmMessageMedia.md create mode 100644 docs/RbmStandaloneCard.md create mode 100644 docs/SmsMessageContent.md create mode 100644 docs/StandaloneCardOrientationEnum.md create mode 100644 docs/ThumbnailAlignmentEnum.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 200e71e2..f013b950 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -8,6 +8,7 @@ bandwidth/api/conferences_api.py bandwidth/api/media_api.py bandwidth/api/messages_api.py bandwidth/api/mfa_api.py +bandwidth/api/multi_channel_api.py bandwidth/api/phone_number_lookup_api.py bandwidth/api/recordings_api.py bandwidth/api/statistics_api.py @@ -35,6 +36,7 @@ bandwidth/models/call_transcription_response.py bandwidth/models/call_transcription_track_enum.py bandwidth/models/callback_method_enum.py bandwidth/models/callback_type_enum.py +bandwidth/models/card_width_enum.py bandwidth/models/code_request.py bandwidth/models/conference.py bandwidth/models/conference_completed_callback.py @@ -51,16 +53,19 @@ bandwidth/models/create_call.py 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/failure_webhook.py bandwidth/models/field_error.py bandwidth/models/file_format_enum.py bandwidth/models/gather_callback.py bandwidth/models/initiate_callback.py +bandwidth/models/link.py bandwidth/models/links_object.py bandwidth/models/list_message_direction_enum.py bandwidth/models/list_message_item.py @@ -86,9 +91,35 @@ bandwidth/models/messaging_request_error.py 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/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_message_channel_enum.py +bandwidth/models/multi_channel_message_data.py +bandwidth/models/multi_channel_message_direction_enum.py +bandwidth/models/multi_channel_message_request.py +bandwidth/models/multi_channel_status_enum.py bandwidth/models/opt_in_workflow.py bandwidth/models/page_info.py bandwidth/models/priority_enum.py +bandwidth/models/rbm_action_base.py +bandwidth/models/rbm_action_dial.py +bandwidth/models/rbm_action_open_url.py +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_media_height_enum.py +bandwidth/models/rbm_message_carousel_card.py +bandwidth/models/rbm_message_content_file.py +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/recording_available_callback.py bandwidth/models/recording_complete_callback.py bandwidth/models/recording_state_enum.py @@ -96,8 +127,9 @@ bandwidth/models/recording_transcription_metadata.py bandwidth/models/recording_transcriptions.py 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/stir_shaken.py -bandwidth/models/tag.py bandwidth/models/telephone_number.py bandwidth/models/tfv_basic_authentication.py bandwidth/models/tfv_callback_status_enum.py @@ -106,6 +138,7 @@ bandwidth/models/tfv_status.py bandwidth/models/tfv_status_enum.py bandwidth/models/tfv_submission_info.py bandwidth/models/tfv_submission_wrapper.py +bandwidth/models/thumbnail_alignment_enum.py bandwidth/models/tn_lookup_request_error.py bandwidth/models/transcribe_recording.py bandwidth/models/transcription.py @@ -150,6 +183,7 @@ docs/CallTranscriptionTrackEnum.md docs/CallbackMethodEnum.md docs/CallbackTypeEnum.md docs/CallsApi.md +docs/CardWidthEnum.md docs/CodeRequest.md docs/Conference.md docs/ConferenceCompletedCallback.md @@ -167,16 +201,19 @@ docs/CreateCall.md 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/FailureWebhook.md docs/FieldError.md docs/FileFormatEnum.md docs/GatherCallback.md docs/InitiateCallback.md +docs/Link.md docs/LinksObject.md docs/ListMessageDirectionEnum.md docs/ListMessageItem.md @@ -205,10 +242,37 @@ docs/MessagingRequestError.md docs/MfaForbiddenRequestError.md docs/MfaRequestError.md docs/MfaUnauthorizedRequestError.md +docs/MmsMessageContent.md +docs/MultiChannelAction.md +docs/MultiChannelActionCalendarEvent.md +docs/MultiChannelApi.md +docs/MultiChannelCallbackData.md +docs/MultiChannelChannelListObject.md +docs/MultiChannelChannelListObjectContent.md +docs/MultiChannelMessageCallbackData.md +docs/MultiChannelMessageChannelEnum.md +docs/MultiChannelMessageData.md +docs/MultiChannelMessageDirectionEnum.md +docs/MultiChannelMessageRequest.md +docs/MultiChannelStatusEnum.md docs/OptInWorkflow.md docs/PageInfo.md docs/PhoneNumberLookupApi.md docs/PriorityEnum.md +docs/RbmActionBase.md +docs/RbmActionDial.md +docs/RbmActionOpenUrl.md +docs/RbmActionTypeEnum.md +docs/RbmActionViewLocation.md +docs/RbmCardContent.md +docs/RbmCardContentMedia.md +docs/RbmMediaHeightEnum.md +docs/RbmMessageCarouselCard.md +docs/RbmMessageContentFile.md +docs/RbmMessageContentRichCard.md +docs/RbmMessageContentText.md +docs/RbmMessageMedia.md +docs/RbmStandaloneCard.md docs/RecordingAvailableCallback.md docs/RecordingCompleteCallback.md docs/RecordingStateEnum.md @@ -217,9 +281,10 @@ docs/RecordingTranscriptions.md docs/RecordingsApi.md docs/RedirectCallback.md docs/RedirectMethodEnum.md +docs/SmsMessageContent.md +docs/StandaloneCardOrientationEnum.md docs/StatisticsApi.md docs/StirShaken.md -docs/Tag.md docs/TelephoneNumber.md docs/TfvBasicAuthentication.md docs/TfvCallbackStatusEnum.md @@ -228,6 +293,7 @@ docs/TfvStatus.md docs/TfvStatusEnum.md docs/TfvSubmissionInfo.md docs/TfvSubmissionWrapper.md +docs/ThumbnailAlignmentEnum.md docs/TnLookupRequestError.md docs/TollFreeVerificationApi.md docs/TranscribeRecording.md diff --git a/README.md b/README.md index 666dd554..2cd27437 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,7 @@ Class | Method | HTTP request | Description *MediaApi* | [**upload_media**](docs/MediaApi.md#upload_media) | **PUT** /users/{accountId}/media/{mediaId} | Upload Media *MessagesApi* | [**create_message**](docs/MessagesApi.md#create_message) | **POST** /users/{accountId}/messages | Create Message *MessagesApi* | [**list_messages**](docs/MessagesApi.md#list_messages) | **GET** /users/{accountId}/messages | List Messages +*MultiChannelApi* | [**create_multi_channel_message**](docs/MultiChannelApi.md#create_multi_channel_message) | **POST** /users/{accountId}/messages/multiChannel | Create Multi-Channel Message *PhoneNumberLookupApi* | [**create_lookup**](docs/PhoneNumberLookupApi.md#create_lookup) | **POST** /accounts/{accountId}/tnlookup | Create Lookup *PhoneNumberLookupApi* | [**get_lookup_status**](docs/PhoneNumberLookupApi.md#get_lookup_status) | **GET** /accounts/{accountId}/tnlookup/{requestId} | Get Lookup Request Status *RecordingsApi* | [**delete_recording**](docs/RecordingsApi.md#delete_recording) | **DELETE** /accounts/{accountId}/calls/{callId}/recordings/{recordingId} | Delete Recording @@ -165,6 +166,7 @@ Class | Method | HTTP request | Description - [CallTranscriptionTrackEnum](docs/CallTranscriptionTrackEnum.md) - [CallbackMethodEnum](docs/CallbackMethodEnum.md) - [CallbackTypeEnum](docs/CallbackTypeEnum.md) + - [CardWidthEnum](docs/CardWidthEnum.md) - [CodeRequest](docs/CodeRequest.md) - [Conference](docs/Conference.md) - [ConferenceCompletedCallback](docs/ConferenceCompletedCallback.md) @@ -181,16 +183,19 @@ Class | Method | HTTP request | Description - [CreateCallResponse](docs/CreateCallResponse.md) - [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) - [FailureWebhook](docs/FailureWebhook.md) - [FieldError](docs/FieldError.md) - [FileFormatEnum](docs/FileFormatEnum.md) - [GatherCallback](docs/GatherCallback.md) - [InitiateCallback](docs/InitiateCallback.md) + - [Link](docs/Link.md) - [LinksObject](docs/LinksObject.md) - [ListMessageDirectionEnum](docs/ListMessageDirectionEnum.md) - [ListMessageItem](docs/ListMessageItem.md) @@ -216,9 +221,35 @@ Class | Method | HTTP request | Description - [MfaForbiddenRequestError](docs/MfaForbiddenRequestError.md) - [MfaRequestError](docs/MfaRequestError.md) - [MfaUnauthorizedRequestError](docs/MfaUnauthorizedRequestError.md) + - [MmsMessageContent](docs/MmsMessageContent.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) + - [MultiChannelMessageChannelEnum](docs/MultiChannelMessageChannelEnum.md) + - [MultiChannelMessageData](docs/MultiChannelMessageData.md) + - [MultiChannelMessageDirectionEnum](docs/MultiChannelMessageDirectionEnum.md) + - [MultiChannelMessageRequest](docs/MultiChannelMessageRequest.md) + - [MultiChannelStatusEnum](docs/MultiChannelStatusEnum.md) - [OptInWorkflow](docs/OptInWorkflow.md) - [PageInfo](docs/PageInfo.md) - [PriorityEnum](docs/PriorityEnum.md) + - [RbmActionBase](docs/RbmActionBase.md) + - [RbmActionDial](docs/RbmActionDial.md) + - [RbmActionOpenUrl](docs/RbmActionOpenUrl.md) + - [RbmActionTypeEnum](docs/RbmActionTypeEnum.md) + - [RbmActionViewLocation](docs/RbmActionViewLocation.md) + - [RbmCardContent](docs/RbmCardContent.md) + - [RbmCardContentMedia](docs/RbmCardContentMedia.md) + - [RbmMediaHeightEnum](docs/RbmMediaHeightEnum.md) + - [RbmMessageCarouselCard](docs/RbmMessageCarouselCard.md) + - [RbmMessageContentFile](docs/RbmMessageContentFile.md) + - [RbmMessageContentRichCard](docs/RbmMessageContentRichCard.md) + - [RbmMessageContentText](docs/RbmMessageContentText.md) + - [RbmMessageMedia](docs/RbmMessageMedia.md) + - [RbmStandaloneCard](docs/RbmStandaloneCard.md) - [RecordingAvailableCallback](docs/RecordingAvailableCallback.md) - [RecordingCompleteCallback](docs/RecordingCompleteCallback.md) - [RecordingStateEnum](docs/RecordingStateEnum.md) @@ -226,8 +257,9 @@ Class | Method | HTTP request | Description - [RecordingTranscriptions](docs/RecordingTranscriptions.md) - [RedirectCallback](docs/RedirectCallback.md) - [RedirectMethodEnum](docs/RedirectMethodEnum.md) + - [SmsMessageContent](docs/SmsMessageContent.md) + - [StandaloneCardOrientationEnum](docs/StandaloneCardOrientationEnum.md) - [StirShaken](docs/StirShaken.md) - - [Tag](docs/Tag.md) - [TelephoneNumber](docs/TelephoneNumber.md) - [TfvBasicAuthentication](docs/TfvBasicAuthentication.md) - [TfvCallbackStatusEnum](docs/TfvCallbackStatusEnum.md) @@ -236,6 +268,7 @@ Class | Method | HTTP request | Description - [TfvStatusEnum](docs/TfvStatusEnum.md) - [TfvSubmissionInfo](docs/TfvSubmissionInfo.md) - [TfvSubmissionWrapper](docs/TfvSubmissionWrapper.md) + - [ThumbnailAlignmentEnum](docs/ThumbnailAlignmentEnum.md) - [TnLookupRequestError](docs/TnLookupRequestError.md) - [TranscribeRecording](docs/TranscribeRecording.md) - [Transcription](docs/Transcription.md) diff --git a/bandwidth.yml b/bandwidth.yml index 8f3d160b..0a0121cd 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -12,6 +12,7 @@ security: tags: - name: Messages - name: Media + - name: Multi-Channel - name: Calls - name: Conferences - name: Recordings @@ -234,6 +235,43 @@ paths: statusCallback: $ref: '#/components/callbacks/statusCallback' servers: *ref_0 + /users/{accountId}/messages/multiChannel: + post: + summary: Create Multi-Channel Message + description: Endpoint for sending Multi-Channel messages. + operationId: createMultiChannelMessage + parameters: + - $ref: '#/components/parameters/accountId' + tags: + - Multi-Channel + requestBody: + $ref: '#/components/requestBodies/createMultiChannelMessageRequest' + responses: + '202': + $ref: '#/components/responses/createMultiChannelMessageResponse' + '400': + $ref: '#/components/responses/createMessageBadRequestError' + '401': + $ref: '#/components/responses/messagingUnauthorizedError' + '403': + $ref: '#/components/responses/messagingForbiddenError' + '404': + $ref: '#/components/responses/messagingNotFoundError' + '406': + $ref: '#/components/responses/messagingNotAcceptableError' + '415': + $ref: '#/components/responses/messagingInvalidMediaTypeError' + '429': + $ref: '#/components/responses/messagingTooManyRequestsError' + '500': + $ref: '#/components/responses/messagingInternalServerError' + callbacks: + multiChannelCallback: + $ref: '#/components/callbacks/multiChannelMessageCallback' + x-badges: + - name: Beta + color: '#076EA8' + servers: *ref_0 /accounts/{accountId}/calls: post: tags: @@ -1595,6 +1633,12 @@ paths: servers: *ref_4 components: schemas: + applicationId: + type: string + description: >- + 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: @@ -1612,10 +1656,7 @@ components: example: message-delivered priorityEnum: type: string - description: |- - The priority specified by the user. - - Not supported on MMS. + description: The priority specified by the user. enum: - default - high @@ -1808,6 +1849,10 @@ components: required: - type - description + messageId: + type: string + description: The ID of the message. + example: 1589228074636lm4k2je7j7jklbn2 media: title: Media type: object @@ -1820,12 +1865,11 @@ components: type: string tag: title: Tag - type: object - properties: - key: - type: string - value: - type: string + type: string + description: >- + A custom string that will be included in callback events of the message. + Max 1024 characters. + example: custom string deferredResult: title: DeferredResult type: object @@ -1834,6 +1878,15 @@ components: type: object setOrExpired: type: boolean + expiration: + type: string + format: date-time + 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. + example: '2021-02-01T11:29:18-05:00' message: title: Message type: object @@ -1898,10 +1951,7 @@ components: priority: $ref: '#/components/schemas/priorityEnum' expiration: - type: string - format: date-time - description: The expiration date-time set by the user. - example: '2021-02-01T11:29:18-05:00' + $ref: '#/components/schemas/expiration' messageRequest: title: MessageRequest type: object @@ -1937,44 +1987,489 @@ components: plus +, underscore _ and ampersand &. Alphanumeric Sender IDs must contain at least one letter. example: '+15551113333' + text: + $ref: '#/components/schemas/messageText' + media: + $ref: '#/components/schemas/messageMedia' + tag: + $ref: '#/components/schemas/tag' + priority: + $ref: '#/components/schemas/priorityEnum' + expiration: + $ref: '#/components/schemas/expiration' + messageText: + type: string + description: The contents of the text message. Must be 2048 characters or less. + maxLength: 2048 + example: Hello world + messageMedia: + type: array + items: + type: string + format: uri + maxLength: 4096 + description: |- + A list of URLs to include as media attachments as part of the message. + Each URL can be at most 4096 characters. + example: + - https://dev.bandwidth.com/images/bandwidth-logo.png + - https://dev.bandwidth.com/images/github_logo.png + createMultiChannelMessageResponse: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/link' + data: + $ref: '#/components/schemas/multiChannelMessageData' + errors: + type: array + items: + $ref: '#/components/schemas/errorObject' + multiChannelMessageChannelEnum: + description: The channel of the multi-channel message. + type: string + enum: + - RBM + - 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. + example: BandwidthRBM + multiChannelDestination: + type: string + description: The phone number the message should be sent to in E164 format. + example: '+15552223333' + rbmMessageContentText: + title: RBM Text + type: object + properties: text: type: string - description: The contents of the text message. Must be 2048 characters or less. - maxLength: 2048 + description: >- + The text associated with the message. Must be 3270 characters or + less + maxLength: 3270 example: Hello world + suggestions: + $ref: '#/components/schemas/multiChannelFullActions' + required: + - text + rbmMediaHeightEnum: + type: string + description: The height of the media. + enum: + - SHORT + - MEDIUM + - TALL + example: SHORT + rbmMessageContentFile: + title: RBM Rich Media File + type: object + properties: + fileUrl: + type: string + format: uri + description: The URL of the media file. 100MB is the maximum file size. + example: https://dev.bandwidth.com/images/bandwidth-logo.png + maxLength: 1000 + thumbnailUrl: + type: string + format: uri + description: The URL of the thumbnail image. Applies only to video file media. + example: https://dev.bandwidth.com/images/bandwidth-logo.png + maxLength: 1000 + required: + - fileUrl + rbmMessageMedia: + title: RBM Media + type: object + properties: media: + $ref: '#/components/schemas/rbmMessageContentFile' + suggestions: + $ref: '#/components/schemas/multiChannelFullActions' + required: + - media + rbmCardContent: + type: object + properties: + title: + type: string + description: The title of the card. Must be 200 characters or less. + maxLength: 200 + example: Bandwidth + description: + type: string + description: The description of the card. Must be 2000 characters or less. + maxLength: 2000 + example: Bandwidth is a communications platform as a service (CPaaS) company. + media: + allOf: + - $ref: '#/components/schemas/rbmMessageContentFile' + - type: object + properties: + height: + $ref: '#/components/schemas/rbmMediaHeightEnum' + required: + - height + suggestions: + description: >- + An array of suggested actions for the recipient that will be + displayed on the rich card. type: array items: - type: string - format: uri - maxLength: 4096 + $ref: '#/components/schemas/multiChannelAction' + maxItems: 4 + rbmStandaloneCard: + title: Standalone Card + type: object + properties: + orientation: + $ref: '#/components/schemas/standaloneCardOrientationEnum' + thumbnailImageAlignment: + $ref: '#/components/schemas/thumbnailAlignmentEnum' + cardContent: + $ref: '#/components/schemas/rbmCardContent' + suggestions: + $ref: '#/components/schemas/multiChannelFullActions' + required: + - orientation + - thumbnailImageAlignment + - cardContent + standaloneCardOrientationEnum: + type: string + enum: + - HORIZONTAL + - VERTICAL + example: VERTICAL + thumbnailAlignmentEnum: + type: string + description: >- + The alignment of the thumbnail image in the card. Only applicable if the + card using horizontal orientation. + enum: + - LEFT + - RIGHT + example: LEFT + rbmMessageCarouselCard: + title: Carousel + type: object + properties: + cardWidth: + $ref: '#/components/schemas/cardWidthEnum' + cardContents: + type: array + items: + $ref: '#/components/schemas/rbmCardContent' + maxItems: 10 + suggestions: + $ref: '#/components/schemas/multiChannelFullActions' + required: + - cardContents + - cardWidth + cardWidthEnum: + type: string + enum: + - SMALL + - MEDIUM + example: SMALL + smsMessageContent: + title: SMS Text + type: object + properties: + text: + $ref: '#/components/schemas/messageText' + required: + - text + mmsMessageContent: + title: MMS Message + type: object + properties: + text: + $ref: '#/components/schemas/messageText' + media: + $ref: '#/components/schemas/messageMedia' + rbmMessageContentRichCard: + title: RBM Rich Card + oneOf: + - $ref: '#/components/schemas/rbmStandaloneCard' + - $ref: '#/components/schemas/rbmMessageCarouselCard' + rbmActionTypeEnum: + type: string + enum: + - REPLY + - DIAL_PHONE + - SHOW_LOCATION + - CREATE_CALENDAR_EVENT + - OPEN_URL + - REQUEST_LOCATION + example: REPLY + rbmActionText: + title: Text + type: string + description: Displayed text for user to click + maxLength: 25 + example: Hello world + rbmActionPostBackData: + title: Post Back Data + type: string + format: byte + description: Base64 payload the customer receives when the reply is clicked. + maxLength: 2048 + example: SGVsbG8gd29ybGQ= + rbmActionBase: + type: object + properties: + type: + $ref: '#/components/schemas/rbmActionTypeEnum' + text: + $ref: '#/components/schemas/rbmActionText' + postBackData: + $ref: '#/components/schemas/rbmActionPostBackData' + required: + - text + - postBackData + - type + rbmActionDial: + allOf: + - $ref: '#/components/schemas/rbmActionBase' + - title: Dial Phone + type: object + properties: + phoneNumber: + type: string + description: The phone number to dial. Must be E164 format. + example: '+15552223333' + required: + - phoneNumber + rbmActionViewLocation: + allOf: + - $ref: '#/components/schemas/rbmActionBase' + - title: Show Location + type: object + properties: + latitude: + type: string + format: double + description: The latitude of the location. + example: '37.7749' + longitude: + type: string + format: double + description: The longitude of the location. + example: '-122.4194' + label: + type: string + description: The label of the location. + example: San Francisco + maxLength: 100 + required: + - latitude + - longitude + multiChannelActionCalendarEvent: + allOf: + - $ref: '#/components/schemas/rbmActionBase' + - title: Calendar Event + type: object + properties: + title: + type: string + description: The title of the event. + example: Meeting with John + maxLength: 100 + startTime: + type: string + format: date-time + description: The start time of the event. + example: 2022-09-14T18:20:16.000Z + endTime: + type: string + format: date-time + description: The end time of the event. + example: 2022-09-14T18:20:16.000Z + description: + type: string + description: The description of the event. + example: Discuss the new project + maxLength: 500 + required: + - title + - startTime + - endTime + rbmActionOpenUrl: + allOf: + - $ref: '#/components/schemas/rbmActionBase' + - title: Open URL + type: object + properties: + url: + type: string + format: uri + description: The URL to open in browser. + example: https://dev.bandwidth.com + maxLength: 2048 + required: + - url + multiChannelFullActions: + type: array + description: An array of suggested actions for the recipient. + items: + $ref: '#/components/schemas/multiChannelAction' + maxItems: 11 + multiChannelAction: + oneOf: + - $ref: '#/components/schemas/rbmActionBase' + - $ref: '#/components/schemas/rbmActionDial' + - $ref: '#/components/schemas/rbmActionViewLocation' + - $ref: '#/components/schemas/multiChannelActionCalendarEvent' + - $ref: '#/components/schemas/rbmActionOpenUrl' + discriminator: + propertyName: type + mapping: + REPLY: '#/components/schemas/rbmActionBase' + DIAL_PHONE: '#/components/schemas/rbmActionDial' + SHOW_LOCATION: '#/components/schemas/rbmActionViewLocation' + 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: + from: + $ref: '#/components/schemas/multiChannelSenderId' + applicationId: + $ref: '#/components/schemas/applicationId' + channel: + $ref: '#/components/schemas/multiChannelMessageChannelEnum' + content: + description: The content of the message. + oneOf: + - $ref: '#/components/schemas/rbmMessageContentText' + - $ref: '#/components/schemas/rbmMessageMedia' + - $ref: '#/components/schemas/rbmMessageContentRichCard' + - $ref: '#/components/schemas/smsMessageContent' + - $ref: '#/components/schemas/mmsMessageContent' + required: + - from + - applicationId + - channel + - content + multiChannelMessageRequest: + description: Multi-Channel Message Request + type: object + properties: + to: + $ref: '#/components/schemas/multiChannelDestination' + channelList: + type: array description: >- - A list of URLs to include as media attachments as part of the - message. - - Each URL can be at most 4096 characters. - example: - - https://dev.bandwidth.com/images/bandwidth-logo.png - - https://dev.bandwidth.com/images/github_logo.png + 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: + $ref: '#/components/schemas/multiChannelChannelListObject' + maxItems: 4 tag: - type: string - description: >- - A custom string that will be included in callback events of the - message. Max 1024 characters. - example: custom string + $ref: '#/components/schemas/tag' priority: $ref: '#/components/schemas/priorityEnum' expiration: + $ref: '#/components/schemas/expiration' + 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: + 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 - description: >- - A string with the date/time value that the message will - automatically expire by. This must be a valid RFC-3339 value, e.g., - 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a - date-time in the future. - - Not supported on MMS. - example: '2021-02-01T11:29:18-05:00' + example: 2025-01-01T18:20:16.000Z + 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' + multiChannelCallbackData: + 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: + type: string + example: Incoming message received + message: + $ref: '#/components/schemas/multiChannelMessageCallbackData' + link: + type: object + properties: + rel: + type: string + href: + type: string + errorObject: + type: object + properties: + code: + type: string + message: + type: string messageCallback: description: Message Callback Schema type: object @@ -2796,7 +3291,7 @@ components: type: object properties: applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' accountId: $ref: '#/components/schemas/accountId' callId: @@ -3404,7 +3899,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3441,7 +3936,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3481,7 +3976,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3662,7 +4157,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3702,7 +4197,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3742,7 +4237,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3786,7 +4281,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3820,7 +4315,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3856,7 +4351,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3906,7 +4401,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3956,7 +4451,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3994,7 +4489,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -4047,7 +4542,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -4086,7 +4581,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -4132,7 +4627,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -4188,7 +4683,7 @@ components: type: string description: The user account associated with the call. example: '9900000' - applicationId: + applicationId1: type: string description: The id of the application associated with the call. example: 04e88489-df02-4e34-a0ee-27a91849555f @@ -5318,6 +5813,12 @@ components: application/json: schema: $ref: '#/components/schemas/message' + createMultiChannelMessageResponse: + description: Accepted + content: + application/json: + schema: + $ref: '#/components/schemas/createMultiChannelMessageResponse' listMessagesResponse: description: OK content: @@ -6577,6 +7078,12 @@ components: schema: $ref: '#/components/schemas/messageRequest' required: true + createMultiChannelMessageRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/multiChannelMessageRequest' + required: true uploadMediaRequest: content: application/json: @@ -6978,6 +7485,19 @@ 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 tfVerificationStatus: your_url.com/webhookService: post: diff --git a/bandwidth/__init__.py b/bandwidth/__init__.py index 90e1b7a4..3cfa826e 100644 --- a/bandwidth/__init__.py +++ b/bandwidth/__init__.py @@ -23,6 +23,7 @@ from bandwidth.api.mfa_api import MFAApi from bandwidth.api.media_api import MediaApi from bandwidth.api.messages_api import MessagesApi +from bandwidth.api.multi_channel_api import MultiChannelApi from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi from bandwidth.api.recordings_api import RecordingsApi from bandwidth.api.statistics_api import StatisticsApi @@ -58,6 +59,7 @@ from bandwidth.models.call_transcription_track_enum import CallTranscriptionTrackEnum from bandwidth.models.callback_method_enum import CallbackMethodEnum from bandwidth.models.callback_type_enum import CallbackTypeEnum +from bandwidth.models.card_width_enum import CardWidthEnum from bandwidth.models.code_request import CodeRequest from bandwidth.models.conference import Conference from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback @@ -74,16 +76,19 @@ from bandwidth.models.create_call_response import CreateCallResponse 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.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.initiate_callback import InitiateCallback +from bandwidth.models.link import Link from bandwidth.models.links_object import LinksObject from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum from bandwidth.models.list_message_item import ListMessageItem @@ -109,9 +114,35 @@ from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError 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.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_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_request import MultiChannelMessageRequest +from bandwidth.models.multi_channel_status_enum import MultiChannelStatusEnum from bandwidth.models.opt_in_workflow import OptInWorkflow from bandwidth.models.page_info import PageInfo from bandwidth.models.priority_enum import PriorityEnum +from bandwidth.models.rbm_action_base import RbmActionBase +from bandwidth.models.rbm_action_dial import RbmActionDial +from bandwidth.models.rbm_action_open_url import RbmActionOpenUrl +from bandwidth.models.rbm_action_type_enum import RbmActionTypeEnum +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_media_height_enum import RbmMediaHeightEnum +from bandwidth.models.rbm_message_carousel_card import RbmMessageCarouselCard +from bandwidth.models.rbm_message_content_file import RbmMessageContentFile +from bandwidth.models.rbm_message_content_rich_card import RbmMessageContentRichCard +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.recording_available_callback import RecordingAvailableCallback from bandwidth.models.recording_complete_callback import RecordingCompleteCallback from bandwidth.models.recording_state_enum import RecordingStateEnum @@ -119,8 +150,9 @@ from bandwidth.models.recording_transcriptions import RecordingTranscriptions from bandwidth.models.redirect_callback import RedirectCallback from bandwidth.models.redirect_method_enum import RedirectMethodEnum +from bandwidth.models.sms_message_content import SmsMessageContent +from bandwidth.models.standalone_card_orientation_enum import StandaloneCardOrientationEnum from bandwidth.models.stir_shaken import StirShaken -from bandwidth.models.tag import Tag from bandwidth.models.telephone_number import TelephoneNumber from bandwidth.models.tfv_basic_authentication import TfvBasicAuthentication from bandwidth.models.tfv_callback_status_enum import TfvCallbackStatusEnum @@ -129,6 +161,7 @@ from bandwidth.models.tfv_status_enum import TfvStatusEnum from bandwidth.models.tfv_submission_info import TfvSubmissionInfo from bandwidth.models.tfv_submission_wrapper import TfvSubmissionWrapper +from bandwidth.models.thumbnail_alignment_enum import ThumbnailAlignmentEnum from bandwidth.models.tn_lookup_request_error import TnLookupRequestError from bandwidth.models.transcribe_recording import TranscribeRecording from bandwidth.models.transcription import Transcription diff --git a/bandwidth/api/__init__.py b/bandwidth/api/__init__.py index 60b8fcc5..feb7cec3 100644 --- a/bandwidth/api/__init__.py +++ b/bandwidth/api/__init__.py @@ -6,6 +6,7 @@ from bandwidth.api.mfa_api import MFAApi from bandwidth.api.media_api import MediaApi from bandwidth.api.messages_api import MessagesApi +from bandwidth.api.multi_channel_api import MultiChannelApi from bandwidth.api.phone_number_lookup_api import PhoneNumberLookupApi from bandwidth.api.recordings_api import RecordingsApi from bandwidth.api.statistics_api import StatisticsApi diff --git a/bandwidth/api/multi_channel_api.py b/bandwidth/api/multi_channel_api.py new file mode 100644 index 00000000..aee15eb1 --- /dev/null +++ b/bandwidth/api/multi_channel_api.py @@ -0,0 +1,356 @@ +# 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from bandwidth.models.create_multi_channel_message_response import CreateMultiChannelMessageResponse +from bandwidth.models.multi_channel_message_request import MultiChannelMessageRequest + +from bandwidth.api_client import ApiClient, RequestSerialized +from bandwidth.api_response import ApiResponse +from bandwidth.rest import RESTResponseType + + +class MultiChannelApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_multi_channel_message( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + multi_channel_message_request: MultiChannelMessageRequest, + _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, + ) -> CreateMultiChannelMessageResponse: + """Create Multi-Channel Message + + Endpoint for sending Multi-Channel messages. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param multi_channel_message_request: (required) + :type multi_channel_message_request: MultiChannelMessageRequest + :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._create_multi_channel_message_serialize( + account_id=account_id, + multi_channel_message_request=multi_channel_message_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _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", + } + 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 create_multi_channel_message_with_http_info( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + multi_channel_message_request: MultiChannelMessageRequest, + _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[CreateMultiChannelMessageResponse]: + """Create Multi-Channel Message + + Endpoint for sending Multi-Channel messages. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param multi_channel_message_request: (required) + :type multi_channel_message_request: MultiChannelMessageRequest + :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._create_multi_channel_message_serialize( + account_id=account_id, + multi_channel_message_request=multi_channel_message_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _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", + } + 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 create_multi_channel_message_without_preload_content( + self, + account_id: Annotated[StrictStr, Field(description="Your Bandwidth Account ID.")], + multi_channel_message_request: MultiChannelMessageRequest, + _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: + """Create Multi-Channel Message + + Endpoint for sending Multi-Channel messages. + + :param account_id: Your Bandwidth Account ID. (required) + :type account_id: str + :param multi_channel_message_request: (required) + :type multi_channel_message_request: MultiChannelMessageRequest + :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._create_multi_channel_message_serialize( + account_id=account_id, + multi_channel_message_request=multi_channel_message_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _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", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_multi_channel_message_serialize( + self, + account_id, + multi_channel_message_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://messaging.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 + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if multi_channel_message_request is not None: + _body_params = multi_channel_message_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'Basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/users/{accountId}/messages/multiChannel', + 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 + ) + + diff --git a/bandwidth/models/__init__.py b/bandwidth/models/__init__.py index adb1705b..ef4ea3a1 100644 --- a/bandwidth/models/__init__.py +++ b/bandwidth/models/__init__.py @@ -32,6 +32,7 @@ from bandwidth.models.call_transcription_track_enum import CallTranscriptionTrackEnum from bandwidth.models.callback_method_enum import CallbackMethodEnum from bandwidth.models.callback_type_enum import CallbackTypeEnum +from bandwidth.models.card_width_enum import CardWidthEnum from bandwidth.models.code_request import CodeRequest from bandwidth.models.conference import Conference from bandwidth.models.conference_completed_callback import ConferenceCompletedCallback @@ -48,16 +49,19 @@ from bandwidth.models.create_call_response import CreateCallResponse 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.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.initiate_callback import InitiateCallback +from bandwidth.models.link import Link from bandwidth.models.links_object import LinksObject from bandwidth.models.list_message_direction_enum import ListMessageDirectionEnum from bandwidth.models.list_message_item import ListMessageItem @@ -83,9 +87,35 @@ from bandwidth.models.mfa_forbidden_request_error import MfaForbiddenRequestError 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.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_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_request import MultiChannelMessageRequest +from bandwidth.models.multi_channel_status_enum import MultiChannelStatusEnum from bandwidth.models.opt_in_workflow import OptInWorkflow from bandwidth.models.page_info import PageInfo from bandwidth.models.priority_enum import PriorityEnum +from bandwidth.models.rbm_action_base import RbmActionBase +from bandwidth.models.rbm_action_dial import RbmActionDial +from bandwidth.models.rbm_action_open_url import RbmActionOpenUrl +from bandwidth.models.rbm_action_type_enum import RbmActionTypeEnum +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_media_height_enum import RbmMediaHeightEnum +from bandwidth.models.rbm_message_carousel_card import RbmMessageCarouselCard +from bandwidth.models.rbm_message_content_file import RbmMessageContentFile +from bandwidth.models.rbm_message_content_rich_card import RbmMessageContentRichCard +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.recording_available_callback import RecordingAvailableCallback from bandwidth.models.recording_complete_callback import RecordingCompleteCallback from bandwidth.models.recording_state_enum import RecordingStateEnum @@ -93,8 +123,9 @@ from bandwidth.models.recording_transcriptions import RecordingTranscriptions from bandwidth.models.redirect_callback import RedirectCallback from bandwidth.models.redirect_method_enum import RedirectMethodEnum +from bandwidth.models.sms_message_content import SmsMessageContent +from bandwidth.models.standalone_card_orientation_enum import StandaloneCardOrientationEnum from bandwidth.models.stir_shaken import StirShaken -from bandwidth.models.tag import Tag from bandwidth.models.telephone_number import TelephoneNumber from bandwidth.models.tfv_basic_authentication import TfvBasicAuthentication from bandwidth.models.tfv_callback_status_enum import TfvCallbackStatusEnum @@ -103,6 +134,7 @@ from bandwidth.models.tfv_status_enum import TfvStatusEnum from bandwidth.models.tfv_submission_info import TfvSubmissionInfo from bandwidth.models.tfv_submission_wrapper import TfvSubmissionWrapper +from bandwidth.models.thumbnail_alignment_enum import ThumbnailAlignmentEnum from bandwidth.models.tn_lookup_request_error import TnLookupRequestError from bandwidth.models.transcribe_recording import TranscribeRecording from bandwidth.models.transcription import Transcription diff --git a/bandwidth/models/card_width_enum.py b/bandwidth/models/card_width_enum.py new file mode 100644 index 00000000..433e4de1 --- /dev/null +++ b/bandwidth/models/card_width_enum.py @@ -0,0 +1,38 @@ +# 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 CardWidthEnum(str, Enum): + """ + CardWidthEnum + """ + + """ + allowed enum values + """ + SMALL = 'SMALL' + MEDIUM = 'MEDIUM' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CardWidthEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/bandwidth/models/create_multi_channel_message_response.py b/bandwidth/models/create_multi_channel_message_response.py new file mode 100644 index 00000000..770a19df --- /dev/null +++ b/bandwidth/models/create_multi_channel_message_response.py @@ -0,0 +1,125 @@ +# 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 bandwidth.models.multi_channel_message_data import MultiChannelMessageData +from typing import Optional, Set +from typing_extensions import Self + +class CreateMultiChannelMessageResponse(BaseModel): + """ + CreateMultiChannelMessageResponse + """ # noqa: E501 + links: Optional[List[Link]] = None + data: Optional[MultiChannelMessageData] = 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 CreateMultiChannelMessageResponse 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 data + if self.data: + _dict['data'] = self.data.to_dict() + # 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 + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateMultiChannelMessageResponse 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": MultiChannelMessageData.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 + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/error_object.py b/bandwidth/models/error_object.py new file mode 100644 index 00000000..1cd0fc7c --- /dev/null +++ b/bandwidth/models/error_object.py @@ -0,0 +1,103 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ErrorObject(BaseModel): + """ + ErrorObject + """ # noqa: E501 + code: Optional[StrictStr] = None + message: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorObject 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 ErrorObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message") + }) + # 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/link.py b/bandwidth/models/link.py new file mode 100644 index 00000000..1e5d64e6 --- /dev/null +++ b/bandwidth/models/link.py @@ -0,0 +1,103 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Link(BaseModel): + """ + Link + """ # noqa: E501 + rel: Optional[StrictStr] = None + href: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["rel", "href"] + + 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 Link 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 Link from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "rel": obj.get("rel"), + "href": obj.get("href") + }) + # 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.py b/bandwidth/models/message.py index d69c72f3..f2a45e85 100644 --- a/bandwidth/models/message.py +++ b/bandwidth/models/message.py @@ -42,7 +42,7 @@ class Message(BaseModel): text: Optional[StrictStr] = Field(default=None, description="The contents of the message.") tag: Optional[StrictStr] = Field(default=None, description="The custom string set by the user.") priority: Optional[PriorityEnum] = None - expiration: Optional[datetime] = Field(default=None, description="The expiration date-time set by the user.") + 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]] = ["id", "owner", "applicationId", "time", "segmentCount", "direction", "to", "from", "media", "text", "tag", "priority", "expiration"] diff --git a/bandwidth/models/message_request.py b/bandwidth/models/message_request.py index c323adeb..670ce462 100644 --- a/bandwidth/models/message_request.py +++ b/bandwidth/models/message_request.py @@ -37,7 +37,7 @@ class MessageRequest(BaseModel): media: Optional[List[Annotated[str, Field(strict=True, max_length=4096)]]] = Field(default=None, description="A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters.") tag: Optional[StrictStr] = Field(default=None, description="A custom string that will be included in callback events of the message. Max 1024 characters.") priority: Optional[PriorityEnum] = None - expiration: Optional[datetime] = Field(default=None, description="A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS.") + expiration: Optional[datetime] = Field(default=None, description="A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["applicationId", "to", "from", "text", "media", "tag", "priority", "expiration"] diff --git a/bandwidth/models/mms_message_content.py b/bandwidth/models/mms_message_content.py new file mode 100644 index 00000000..a5859946 --- /dev/null +++ b/bandwidth/models/mms_message_content.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 +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +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.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["text", "media"] + + 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 MmsMessageContent 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 MmsMessageContent 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"), + "media": obj.get("media") + }) + # 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.py b/bandwidth/models/multi_channel_action.py new file mode 100644 index 00000000..a0a02651 --- /dev/null +++ b/bandwidth/models/multi_channel_action.py @@ -0,0 +1,183 @@ +# 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.multi_channel_action_calendar_event import MultiChannelActionCalendarEvent +from bandwidth.models.rbm_action_base import RbmActionBase +from bandwidth.models.rbm_action_dial import RbmActionDial +from bandwidth.models.rbm_action_open_url import RbmActionOpenUrl +from bandwidth.models.rbm_action_view_location import RbmActionViewLocation +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +MULTICHANNELACTION_ONE_OF_SCHEMAS = ["MultiChannelActionCalendarEvent", "RbmActionBase", "RbmActionDial", "RbmActionOpenUrl", "RbmActionViewLocation"] + +class MultiChannelAction(BaseModel): + """ + MultiChannelAction + """ + # data type: RbmActionBase + oneof_schema_1_validator: Optional[RbmActionBase] = None + # data type: RbmActionDial + oneof_schema_2_validator: Optional[RbmActionDial] = None + # data type: RbmActionViewLocation + oneof_schema_3_validator: Optional[RbmActionViewLocation] = None + # data type: MultiChannelActionCalendarEvent + oneof_schema_4_validator: Optional[MultiChannelActionCalendarEvent] = None + # data type: RbmActionOpenUrl + oneof_schema_5_validator: Optional[RbmActionOpenUrl] = None + actual_instance: Optional[Union[MultiChannelActionCalendarEvent, RbmActionBase, RbmActionDial, RbmActionOpenUrl, RbmActionViewLocation]] = None + one_of_schemas: Set[str] = { "MultiChannelActionCalendarEvent", "RbmActionBase", "RbmActionDial", "RbmActionOpenUrl", "RbmActionViewLocation" } + + 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 = MultiChannelAction.model_construct() + error_messages = [] + match = 0 + # validate data type: RbmActionBase + if not isinstance(v, RbmActionBase): + error_messages.append(f"Error! Input type `{type(v)}` is not `RbmActionBase`") + else: + match += 1 + # validate data type: RbmActionDial + if not isinstance(v, RbmActionDial): + error_messages.append(f"Error! Input type `{type(v)}` is not `RbmActionDial`") + else: + match += 1 + # validate data type: RbmActionViewLocation + if not isinstance(v, RbmActionViewLocation): + error_messages.append(f"Error! Input type `{type(v)}` is not `RbmActionViewLocation`") + else: + match += 1 + # validate data type: MultiChannelActionCalendarEvent + if not isinstance(v, MultiChannelActionCalendarEvent): + error_messages.append(f"Error! Input type `{type(v)}` is not `MultiChannelActionCalendarEvent`") + else: + match += 1 + # validate data type: RbmActionOpenUrl + if not isinstance(v, RbmActionOpenUrl): + error_messages.append(f"Error! Input type `{type(v)}` is not `RbmActionOpenUrl`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in MultiChannelAction with oneOf schemas: MultiChannelActionCalendarEvent, RbmActionBase, RbmActionDial, RbmActionOpenUrl, RbmActionViewLocation. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in MultiChannelAction with oneOf schemas: MultiChannelActionCalendarEvent, RbmActionBase, RbmActionDial, RbmActionOpenUrl, RbmActionViewLocation. 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 RbmActionBase + try: + instance.actual_instance = RbmActionBase.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RbmActionDial + try: + instance.actual_instance = RbmActionDial.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RbmActionViewLocation + try: + instance.actual_instance = RbmActionViewLocation.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into MultiChannelActionCalendarEvent + try: + instance.actual_instance = MultiChannelActionCalendarEvent.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RbmActionOpenUrl + try: + instance.actual_instance = RbmActionOpenUrl.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 MultiChannelAction with oneOf schemas: MultiChannelActionCalendarEvent, RbmActionBase, RbmActionDial, RbmActionOpenUrl, RbmActionViewLocation. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into MultiChannelAction with oneOf schemas: MultiChannelActionCalendarEvent, RbmActionBase, RbmActionDial, RbmActionOpenUrl, RbmActionViewLocation. 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], MultiChannelActionCalendarEvent, RbmActionBase, RbmActionDial, RbmActionOpenUrl, RbmActionViewLocation]]: + """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/multi_channel_action_calendar_event.py b/bandwidth/models/multi_channel_action_calendar_event.py new file mode 100644 index 00000000..0c03e285 --- /dev/null +++ b/bandwidth/models/multi_channel_action_calendar_event.py @@ -0,0 +1,116 @@ +# 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 +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from bandwidth.models.rbm_action_type_enum import RbmActionTypeEnum +from typing import Optional, Set +from typing_extensions import Self + +class MultiChannelActionCalendarEvent(BaseModel): + """ + MultiChannelActionCalendarEvent + """ # 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") + 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"] + + 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 MultiChannelActionCalendarEvent 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 MultiChannelActionCalendarEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "text": obj.get("text"), + "postBackData": obj.get("postBackData"), + "title": obj.get("title"), + "startTime": obj.get("startTime"), + "endTime": obj.get("endTime"), + "description": obj.get("description") + }) + # 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/multi_channel_callback_data.py new file mode 100644 index 00000000..edada9c1 --- /dev/null +++ b/bandwidth/models/multi_channel_callback_data.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from 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 typing import Optional, Set +from typing_extensions import Self + +class MultiChannelCallbackData(BaseModel): + """ + MultiChannelCallbackData + """ # 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 + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["time", "type", "to", "description", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MultiChannelCallbackData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of message + if self.message: + _dict['message'] = self.message.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MultiChannelCallbackData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "time": obj.get("time"), + "type": obj.get("type"), + "to": obj.get("to"), + "description": obj.get("description"), + "message": MultiChannelMessageCallbackData.from_dict(obj["message"]) if obj.get("message") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/multi_channel_channel_list_object.py b/bandwidth/models/multi_channel_channel_list_object.py new file mode 100644 index 00000000..e6829850 --- /dev/null +++ b/bandwidth/models/multi_channel_channel_list_object.py @@ -0,0 +1,112 @@ +# 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 +from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent +from bandwidth.models.multi_channel_message_channel_enum import MultiChannelMessageChannelEnum +from typing import Optional, Set +from typing_extensions import Self + +class MultiChannelChannelListObject(BaseModel): + """ + MultiChannelChannelListObject + """ # noqa: E501 + 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 + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["from", "applicationId", "channel", "content"] + + 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 MultiChannelChannelListObject 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() + # 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 MultiChannelChannelListObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "from": obj.get("from"), + "applicationId": obj.get("applicationId"), + "channel": obj.get("channel"), + "content": MultiChannelChannelListObjectContent.from_dict(obj["content"]) if obj.get("content") 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/multi_channel_channel_list_object_content.py b/bandwidth/models/multi_channel_channel_list_object_content.py new file mode 100644 index 00000000..c2da1383 --- /dev/null +++ b/bandwidth/models/multi_channel_channel_list_object_content.py @@ -0,0 +1,180 @@ +# 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.mms_message_content import MmsMessageContent +from bandwidth.models.rbm_message_content_rich_card import RbmMessageContentRichCard +from bandwidth.models.rbm_message_content_text import RbmMessageContentText +from bandwidth.models.rbm_message_media import RbmMessageMedia +from bandwidth.models.sms_message_content import SmsMessageContent +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +MULTICHANNELCHANNELLISTOBJECTCONTENT_ONE_OF_SCHEMAS = ["MmsMessageContent", "RbmMessageContentRichCard", "RbmMessageContentText", "RbmMessageMedia", "SmsMessageContent"] + +class MultiChannelChannelListObjectContent(BaseModel): + """ + The content of the message. + """ + # data type: RbmMessageContentText + oneof_schema_1_validator: Optional[RbmMessageContentText] = None + # data type: RbmMessageMedia + oneof_schema_2_validator: Optional[RbmMessageMedia] = None + # data type: RbmMessageContentRichCard + oneof_schema_3_validator: Optional[RbmMessageContentRichCard] = None + # data type: SmsMessageContent + oneof_schema_4_validator: Optional[SmsMessageContent] = None + # data type: MmsMessageContent + oneof_schema_5_validator: Optional[MmsMessageContent] = None + actual_instance: Optional[Union[MmsMessageContent, RbmMessageContentRichCard, RbmMessageContentText, RbmMessageMedia, SmsMessageContent]] = None + one_of_schemas: Set[str] = { "MmsMessageContent", "RbmMessageContentRichCard", "RbmMessageContentText", "RbmMessageMedia", "SmsMessageContent" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + 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 = MultiChannelChannelListObjectContent.model_construct() + error_messages = [] + match = 0 + # validate data type: RbmMessageContentText + if not isinstance(v, RbmMessageContentText): + error_messages.append(f"Error! Input type `{type(v)}` is not `RbmMessageContentText`") + else: + match += 1 + # validate data type: RbmMessageMedia + if not isinstance(v, RbmMessageMedia): + error_messages.append(f"Error! Input type `{type(v)}` is not `RbmMessageMedia`") + else: + match += 1 + # validate data type: RbmMessageContentRichCard + if not isinstance(v, RbmMessageContentRichCard): + error_messages.append(f"Error! Input type `{type(v)}` is not `RbmMessageContentRichCard`") + else: + match += 1 + # validate data type: SmsMessageContent + if not isinstance(v, SmsMessageContent): + error_messages.append(f"Error! Input type `{type(v)}` is not `SmsMessageContent`") + else: + match += 1 + # validate data type: MmsMessageContent + if not isinstance(v, MmsMessageContent): + error_messages.append(f"Error! Input type `{type(v)}` is not `MmsMessageContent`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in MultiChannelChannelListObjectContent with oneOf schemas: MmsMessageContent, RbmMessageContentRichCard, RbmMessageContentText, RbmMessageMedia, SmsMessageContent. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in MultiChannelChannelListObjectContent with oneOf schemas: MmsMessageContent, RbmMessageContentRichCard, RbmMessageContentText, RbmMessageMedia, SmsMessageContent. 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 RbmMessageContentText + try: + instance.actual_instance = RbmMessageContentText.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RbmMessageMedia + try: + instance.actual_instance = RbmMessageMedia.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RbmMessageContentRichCard + try: + instance.actual_instance = RbmMessageContentRichCard.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SmsMessageContent + try: + instance.actual_instance = SmsMessageContent.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into MmsMessageContent + try: + instance.actual_instance = MmsMessageContent.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 MultiChannelChannelListObjectContent with oneOf schemas: MmsMessageContent, RbmMessageContentRichCard, RbmMessageContentText, RbmMessageMedia, SmsMessageContent. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into MultiChannelChannelListObjectContent with oneOf schemas: MmsMessageContent, RbmMessageContentRichCard, RbmMessageContentText, RbmMessageMedia, SmsMessageContent. 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], MmsMessageContent, RbmMessageContentRichCard, RbmMessageContentText, RbmMessageMedia, SmsMessageContent]]: + """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/multi_channel_message_callback_data.py b/bandwidth/models/multi_channel_message_callback_data.py new file mode 100644 index 00000000..db5ffa08 --- /dev/null +++ b/bandwidth/models/multi_channel_message_callback_data.py @@ -0,0 +1,118 @@ +# 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 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): + """ + MultiChannelMessageCallbackData + """ # 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.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["messageId", "status", "direction", "from", "to", "applicationId", "channel", "tag"] + + 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 MultiChannelMessageCallbackData 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 MultiChannelMessageCallbackData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + 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") + }) + # 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_message_channel_enum.py b/bandwidth/models/multi_channel_message_channel_enum.py new file mode 100644 index 00000000..f00c6e6e --- /dev/null +++ b/bandwidth/models/multi_channel_message_channel_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 MultiChannelMessageChannelEnum(str, Enum): + """ + The channel of the multi-channel message. + """ + + """ + allowed enum values + """ + RBM = 'RBM' + SMS = 'SMS' + MMS = 'MMS' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of MultiChannelMessageChannelEnum 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_data.py new file mode 100644 index 00000000..2ce16950 --- /dev/null +++ b/bandwidth/models/multi_channel_message_data.py @@ -0,0 +1,121 @@ +# 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, 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 import Optional, Set +from typing_extensions import Self + +class MultiChannelMessageData(BaseModel): + """ + MultiChannelMessageData + """ # 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 + tag: Optional[StrictStr] = Field(default=None, description="A custom string that will be included in callback events of the message. Max 1024 characters.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["messageId", "status", "time", "direction", "from", "to", "applicationId", "channel", "tag"] + + 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 MultiChannelMessageData 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 MultiChannelMessageData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _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") + }) + # 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_message_direction_enum.py b/bandwidth/models/multi_channel_message_direction_enum.py new file mode 100644 index 00000000..a1210b69 --- /dev/null +++ b/bandwidth/models/multi_channel_message_direction_enum.py @@ -0,0 +1,38 @@ +# 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_request.py b/bandwidth/models/multi_channel_message_request.py new file mode 100644 index 00000000..407d10b3 --- /dev/null +++ b/bandwidth/models/multi_channel_message_request.py @@ -0,0 +1,120 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from bandwidth.models.multi_channel_channel_list_object import MultiChannelChannelListObject +from bandwidth.models.priority_enum import PriorityEnum +from typing import Optional, Set +from typing_extensions import Self + +class MultiChannelMessageRequest(BaseModel): + """ + Multi-Channel Message Request + """ # noqa: E501 + to: StrictStr = Field(description="The phone number the message should be sent to in E164 format.") + channel_list: Annotated[List[MultiChannelChannelListObject], 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]] = ["to", "channelList", "tag", "priority", "expiration"] + + 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 MultiChannelMessageRequest 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 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(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MultiChannelMessageRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "to": obj.get("to"), + "channelList": [MultiChannelChannelListObject.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(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/bandwidth/models/multi_channel_status_enum.py b/bandwidth/models/multi_channel_status_enum.py new file mode 100644 index 00000000..40404225 --- /dev/null +++ b/bandwidth/models/multi_channel_status_enum.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class 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 0508e489..8eb4bec2 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. Not supported on MMS. + The priority specified by the user. """ """ diff --git a/bandwidth/models/rbm_action_base.py b/bandwidth/models/rbm_action_base.py new file mode 100644 index 00000000..7025c2aa --- /dev/null +++ b/bandwidth/models/rbm_action_base.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 +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from bandwidth.models.rbm_action_type_enum import RbmActionTypeEnum +from typing import Optional, Set +from typing_extensions import Self + +class RbmActionBase(BaseModel): + """ + RbmActionBase + """ # 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") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "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 RbmActionBase 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 RbmActionBase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "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/rbm_action_dial.py b/bandwidth/models/rbm_action_dial.py new file mode 100644 index 00000000..fbe1c436 --- /dev/null +++ b/bandwidth/models/rbm_action_dial.py @@ -0,0 +1,109 @@ +# 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, Union +from typing_extensions import Annotated +from bandwidth.models.rbm_action_type_enum import RbmActionTypeEnum +from typing import Optional, Set +from typing_extensions import Self + +class RbmActionDial(BaseModel): + """ + RbmActionDial + """ # 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") + 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"] + + 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 RbmActionDial 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 RbmActionDial from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "text": obj.get("text"), + "postBackData": obj.get("postBackData"), + "phoneNumber": obj.get("phoneNumber") + }) + # 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/rbm_action_open_url.py b/bandwidth/models/rbm_action_open_url.py new file mode 100644 index 00000000..cab89620 --- /dev/null +++ b/bandwidth/models/rbm_action_open_url.py @@ -0,0 +1,109 @@ +# 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, Union +from typing_extensions import Annotated +from bandwidth.models.rbm_action_type_enum import RbmActionTypeEnum +from typing import Optional, Set +from typing_extensions import Self + +class RbmActionOpenUrl(BaseModel): + """ + RbmActionOpenUrl + """ # 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") + 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"] + + 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 RbmActionOpenUrl 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 RbmActionOpenUrl from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "text": obj.get("text"), + "postBackData": obj.get("postBackData"), + "url": obj.get("url") + }) + # 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/rbm_action_type_enum.py b/bandwidth/models/rbm_action_type_enum.py new file mode 100644 index 00000000..42543cb7 --- /dev/null +++ b/bandwidth/models/rbm_action_type_enum.py @@ -0,0 +1,42 @@ +# 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 RbmActionTypeEnum(str, Enum): + """ + RbmActionTypeEnum + """ + + """ + allowed enum values + """ + REPLY = 'REPLY' + DIAL_PHONE = 'DIAL_PHONE' + SHOW_LOCATION = 'SHOW_LOCATION' + CREATE_CALENDAR_EVENT = 'CREATE_CALENDAR_EVENT' + OPEN_URL = 'OPEN_URL' + REQUEST_LOCATION = 'REQUEST_LOCATION' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of RbmActionTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/bandwidth/models/rbm_action_view_location.py b/bandwidth/models/rbm_action_view_location.py new file mode 100644 index 00000000..b435831c --- /dev/null +++ b/bandwidth/models/rbm_action_view_location.py @@ -0,0 +1,113 @@ +# 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 bandwidth.models.rbm_action_type_enum import RbmActionTypeEnum +from typing import Optional, Set +from typing_extensions import Self + +class RbmActionViewLocation(BaseModel): + """ + RbmActionViewLocation + """ # 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") + 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"] + + 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 RbmActionViewLocation 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 RbmActionViewLocation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "text": obj.get("text"), + "postBackData": obj.get("postBackData"), + "latitude": obj.get("latitude"), + "longitude": obj.get("longitude"), + "label": obj.get("label") + }) + # 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/rbm_card_content.py b/bandwidth/models/rbm_card_content.py new file mode 100644 index 00000000..a8888b08 --- /dev/null +++ b/bandwidth/models/rbm_card_content.py @@ -0,0 +1,120 @@ +# 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, Optional +from typing_extensions import Annotated +from bandwidth.models.multi_channel_action import MultiChannelAction +from bandwidth.models.rbm_card_content_media import RbmCardContentMedia +from typing import Optional, Set +from typing_extensions import Self + +class RbmCardContent(BaseModel): + """ + RbmCardContent + """ # noqa: E501 + title: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="The title of the card. Must be 200 characters or less.") + description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = Field(default=None, description="The description of the card. Must be 2000 characters or less.") + media: Optional[RbmCardContentMedia] = None + suggestions: Optional[Annotated[List[MultiChannelAction], Field(max_length=4)]] = Field(default=None, description="An array of suggested actions for the recipient that will be displayed on the rich card.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "description", "media", "suggestions"] + + 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 RbmCardContent 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 media + if self.media: + _dict['media'] = self.media.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in suggestions (list) + _items = [] + if self.suggestions: + for _item_suggestions in self.suggestions: + if _item_suggestions: + _items.append(_item_suggestions.to_dict()) + _dict['suggestions'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RbmCardContent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "description": obj.get("description"), + "media": RbmCardContentMedia.from_dict(obj["media"]) if obj.get("media") is not None else None, + "suggestions": [MultiChannelAction.from_dict(_item) for _item in obj["suggestions"]] if obj.get("suggestions") 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/rbm_card_content_media.py b/bandwidth/models/rbm_card_content_media.py new file mode 100644 index 00000000..f8f3c92a --- /dev/null +++ b/bandwidth/models/rbm_card_content_media.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 +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from bandwidth.models.rbm_media_height_enum import RbmMediaHeightEnum +from typing import Optional, Set +from typing_extensions import Self + +class RbmCardContentMedia(BaseModel): + """ + RbmCardContentMedia + """ # noqa: E501 + file_url: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The URL of the media file. 100MB is the maximum file size.", alias="fileUrl") + thumbnail_url: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The URL of the thumbnail image. Applies only to video file media.", alias="thumbnailUrl") + height: RbmMediaHeightEnum + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["fileUrl", "thumbnailUrl", "height"] + + 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 RbmCardContentMedia 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 RbmCardContentMedia 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"), + "thumbnailUrl": obj.get("thumbnailUrl"), + "height": obj.get("height") + }) + # 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/rbm_media_height_enum.py b/bandwidth/models/rbm_media_height_enum.py new file mode 100644 index 00000000..f2436d5b --- /dev/null +++ b/bandwidth/models/rbm_media_height_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 RbmMediaHeightEnum(str, Enum): + """ + The height of the media. + """ + + """ + allowed enum values + """ + SHORT = 'SHORT' + MEDIUM = 'MEDIUM' + TALL = 'TALL' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of RbmMediaHeightEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/bandwidth/models/rbm_message_carousel_card.py b/bandwidth/models/rbm_message_carousel_card.py new file mode 100644 index 00000000..7bf9ed39 --- /dev/null +++ b/bandwidth/models/rbm_message_carousel_card.py @@ -0,0 +1,123 @@ +# 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, Optional +from typing_extensions import Annotated +from bandwidth.models.card_width_enum import CardWidthEnum +from bandwidth.models.multi_channel_action import MultiChannelAction +from bandwidth.models.rbm_card_content import RbmCardContent +from typing import Optional, Set +from typing_extensions import Self + +class RbmMessageCarouselCard(BaseModel): + """ + RbmMessageCarouselCard + """ # noqa: E501 + card_width: CardWidthEnum = Field(alias="cardWidth") + card_contents: Annotated[List[RbmCardContent], Field(max_length=10)] = Field(alias="cardContents") + suggestions: Optional[Annotated[List[MultiChannelAction], Field(max_length=11)]] = Field(default=None, description="An array of suggested actions for the recipient.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["cardWidth", "cardContents", "suggestions"] + + 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 RbmMessageCarouselCard 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 card_contents (list) + _items = [] + if self.card_contents: + for _item_card_contents in self.card_contents: + if _item_card_contents: + _items.append(_item_card_contents.to_dict()) + _dict['cardContents'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in suggestions (list) + _items = [] + if self.suggestions: + for _item_suggestions in self.suggestions: + if _item_suggestions: + _items.append(_item_suggestions.to_dict()) + _dict['suggestions'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RbmMessageCarouselCard from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cardWidth": obj.get("cardWidth"), + "cardContents": [RbmCardContent.from_dict(_item) for _item in obj["cardContents"]] if obj.get("cardContents") is not None else None, + "suggestions": [MultiChannelAction.from_dict(_item) for _item in obj["suggestions"]] if obj.get("suggestions") 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/rbm_message_content_file.py b/bandwidth/models/rbm_message_content_file.py new file mode 100644 index 00000000..da8b5618 --- /dev/null +++ b/bandwidth/models/rbm_message_content_file.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 +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class RbmMessageContentFile(BaseModel): + """ + RbmMessageContentFile + """ # noqa: E501 + file_url: Annotated[str, Field(strict=True, max_length=1000)] = Field(description="The URL of the media file. 100MB is the maximum file size.", alias="fileUrl") + thumbnail_url: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="The URL of the thumbnail image. Applies only to video file media.", alias="thumbnailUrl") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["fileUrl", "thumbnailUrl"] + + 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 RbmMessageContentFile 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 RbmMessageContentFile 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"), + "thumbnailUrl": obj.get("thumbnailUrl") + }) + # 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/rbm_message_content_rich_card.py b/bandwidth/models/rbm_message_content_rich_card.py new file mode 100644 index 00000000..ef4e5dee --- /dev/null +++ b/bandwidth/models/rbm_message_content_rich_card.py @@ -0,0 +1,138 @@ +# 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.rbm_message_carousel_card import RbmMessageCarouselCard +from bandwidth.models.rbm_standalone_card import RbmStandaloneCard +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +RBMMESSAGECONTENTRICHCARD_ONE_OF_SCHEMAS = ["RbmMessageCarouselCard", "RbmStandaloneCard"] + +class RbmMessageContentRichCard(BaseModel): + """ + RbmMessageContentRichCard + """ + # data type: RbmStandaloneCard + oneof_schema_1_validator: Optional[RbmStandaloneCard] = None + # data type: RbmMessageCarouselCard + oneof_schema_2_validator: Optional[RbmMessageCarouselCard] = None + actual_instance: Optional[Union[RbmMessageCarouselCard, RbmStandaloneCard]] = None + one_of_schemas: Set[str] = { "RbmMessageCarouselCard", "RbmStandaloneCard" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + 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 = RbmMessageContentRichCard.model_construct() + error_messages = [] + match = 0 + # validate data type: RbmStandaloneCard + if not isinstance(v, RbmStandaloneCard): + error_messages.append(f"Error! Input type `{type(v)}` is not `RbmStandaloneCard`") + else: + match += 1 + # validate data type: RbmMessageCarouselCard + if not isinstance(v, RbmMessageCarouselCard): + error_messages.append(f"Error! Input type `{type(v)}` is not `RbmMessageCarouselCard`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in RbmMessageContentRichCard with oneOf schemas: RbmMessageCarouselCard, RbmStandaloneCard. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in RbmMessageContentRichCard with oneOf schemas: RbmMessageCarouselCard, RbmStandaloneCard. 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 RbmStandaloneCard + try: + instance.actual_instance = RbmStandaloneCard.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into RbmMessageCarouselCard + try: + instance.actual_instance = RbmMessageCarouselCard.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 RbmMessageContentRichCard with oneOf schemas: RbmMessageCarouselCard, RbmStandaloneCard. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into RbmMessageContentRichCard with oneOf schemas: RbmMessageCarouselCard, RbmStandaloneCard. 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], RbmMessageCarouselCard, RbmStandaloneCard]]: + """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/rbm_message_content_text.py b/bandwidth/models/rbm_message_content_text.py new file mode 100644 index 00000000..be793795 --- /dev/null +++ b/bandwidth/models/rbm_message_content_text.py @@ -0,0 +1,112 @@ +# 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, Optional +from typing_extensions import Annotated +from bandwidth.models.multi_channel_action import MultiChannelAction +from typing import Optional, Set +from typing_extensions import Self + +class RbmMessageContentText(BaseModel): + """ + RbmMessageContentText + """ # noqa: E501 + text: Annotated[str, Field(strict=True, max_length=3270)] = Field(description="The text associated with the message. Must be 3270 characters or less") + suggestions: Optional[Annotated[List[MultiChannelAction], Field(max_length=11)]] = Field(default=None, description="An array of suggested actions for the recipient.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["text", "suggestions"] + + 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 RbmMessageContentText 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 suggestions (list) + _items = [] + if self.suggestions: + for _item_suggestions in self.suggestions: + if _item_suggestions: + _items.append(_item_suggestions.to_dict()) + _dict['suggestions'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RbmMessageContentText 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"), + "suggestions": [MultiChannelAction.from_dict(_item) for _item in obj["suggestions"]] if obj.get("suggestions") 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/rbm_message_media.py b/bandwidth/models/rbm_message_media.py new file mode 100644 index 00000000..259bb0e9 --- /dev/null +++ b/bandwidth/models/rbm_message_media.py @@ -0,0 +1,116 @@ +# 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, Optional +from typing_extensions import Annotated +from bandwidth.models.multi_channel_action import MultiChannelAction +from bandwidth.models.rbm_message_content_file import RbmMessageContentFile +from typing import Optional, Set +from typing_extensions import Self + +class RbmMessageMedia(BaseModel): + """ + RbmMessageMedia + """ # noqa: E501 + media: RbmMessageContentFile + suggestions: Optional[Annotated[List[MultiChannelAction], Field(max_length=11)]] = Field(default=None, description="An array of suggested actions for the recipient.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["media", "suggestions"] + + 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 RbmMessageMedia 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 media + if self.media: + _dict['media'] = self.media.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in suggestions (list) + _items = [] + if self.suggestions: + for _item_suggestions in self.suggestions: + if _item_suggestions: + _items.append(_item_suggestions.to_dict()) + _dict['suggestions'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RbmMessageMedia from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "media": RbmMessageContentFile.from_dict(obj["media"]) if obj.get("media") is not None else None, + "suggestions": [MultiChannelAction.from_dict(_item) for _item in obj["suggestions"]] if obj.get("suggestions") 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/rbm_standalone_card.py b/bandwidth/models/rbm_standalone_card.py new file mode 100644 index 00000000..f316aa0f --- /dev/null +++ b/bandwidth/models/rbm_standalone_card.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from bandwidth.models.multi_channel_action import MultiChannelAction +from bandwidth.models.rbm_card_content import RbmCardContent +from bandwidth.models.standalone_card_orientation_enum import StandaloneCardOrientationEnum +from bandwidth.models.thumbnail_alignment_enum import ThumbnailAlignmentEnum +from typing import Optional, Set +from typing_extensions import Self + +class RbmStandaloneCard(BaseModel): + """ + RbmStandaloneCard + """ # noqa: E501 + orientation: StandaloneCardOrientationEnum + thumbnail_image_alignment: ThumbnailAlignmentEnum = Field(alias="thumbnailImageAlignment") + card_content: RbmCardContent = Field(alias="cardContent") + suggestions: Optional[Annotated[List[MultiChannelAction], Field(max_length=11)]] = Field(default=None, description="An array of suggested actions for the recipient.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["orientation", "thumbnailImageAlignment", "cardContent", "suggestions"] + + 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 RbmStandaloneCard 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 card_content + if self.card_content: + _dict['cardContent'] = self.card_content.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in suggestions (list) + _items = [] + if self.suggestions: + for _item_suggestions in self.suggestions: + if _item_suggestions: + _items.append(_item_suggestions.to_dict()) + _dict['suggestions'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RbmStandaloneCard from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "orientation": obj.get("orientation"), + "thumbnailImageAlignment": obj.get("thumbnailImageAlignment"), + "cardContent": RbmCardContent.from_dict(obj["cardContent"]) if obj.get("cardContent") is not None else None, + "suggestions": [MultiChannelAction.from_dict(_item) for _item in obj["suggestions"]] if obj.get("suggestions") 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/sms_message_content.py b/bandwidth/models/sms_message_content.py new file mode 100644 index 00000000..a9681c44 --- /dev/null +++ b/bandwidth/models/sms_message_content.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 SmsMessageContent(BaseModel): + """ + SmsMessageContent + """ # noqa: E501 + text: Annotated[str, Field(strict=True, max_length=2048)] = Field(description="The contents of the text message. Must be 2048 characters or less.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["text"] + + 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 SmsMessageContent 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 SmsMessageContent 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") + }) + # 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/standalone_card_orientation_enum.py b/bandwidth/models/standalone_card_orientation_enum.py new file mode 100644 index 00000000..026e045c --- /dev/null +++ b/bandwidth/models/standalone_card_orientation_enum.py @@ -0,0 +1,38 @@ +# 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 StandaloneCardOrientationEnum(str, Enum): + """ + StandaloneCardOrientationEnum + """ + + """ + allowed enum values + """ + HORIZONTAL = 'HORIZONTAL' + VERTICAL = 'VERTICAL' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of StandaloneCardOrientationEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/bandwidth/models/thumbnail_alignment_enum.py b/bandwidth/models/thumbnail_alignment_enum.py new file mode 100644 index 00000000..0c019895 --- /dev/null +++ b/bandwidth/models/thumbnail_alignment_enum.py @@ -0,0 +1,38 @@ +# 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 ThumbnailAlignmentEnum(str, Enum): + """ + The alignment of the thumbnail image in the card. Only applicable if the card using horizontal orientation. + """ + + """ + allowed enum values + """ + LEFT = 'LEFT' + RIGHT = 'RIGHT' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ThumbnailAlignmentEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/docs/CardWidthEnum.md b/docs/CardWidthEnum.md new file mode 100644 index 00000000..273053dd --- /dev/null +++ b/docs/CardWidthEnum.md @@ -0,0 +1,12 @@ +# CardWidthEnum + + +## Enum + +* `SMALL` (value: `'SMALL'`) + +* `MEDIUM` (value: `'MEDIUM'`) + +[[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 new file mode 100644 index 00000000..657c59bb --- /dev/null +++ b/docs/CreateMultiChannelMessageResponse.md @@ -0,0 +1,31 @@ +# CreateMultiChannelMessageResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**links** | [**List[Link]**](Link.md) | | [optional] +**data** | [**MultiChannelMessageData**](MultiChannelMessageData.md) | | [optional] +**errors** | [**List[ErrorObject]**](ErrorObject.md) | | [optional] + +## Example + +```python +from bandwidth.models.create_multi_channel_message_response import CreateMultiChannelMessageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateMultiChannelMessageResponse from a JSON string +create_multi_channel_message_response_instance = CreateMultiChannelMessageResponse.from_json(json) +# print the JSON string representation of the object +print(CreateMultiChannelMessageResponse.to_json()) + +# convert the object into a dict +create_multi_channel_message_response_dict = create_multi_channel_message_response_instance.to_dict() +# create an instance of CreateMultiChannelMessageResponse from a dict +create_multi_channel_message_response_from_dict = CreateMultiChannelMessageResponse.from_dict(create_multi_channel_message_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/ErrorObject.md b/docs/ErrorObject.md new file mode 100644 index 00000000..27dc1268 --- /dev/null +++ b/docs/ErrorObject.md @@ -0,0 +1,30 @@ +# ErrorObject + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | | [optional] +**message** | **str** | | [optional] + +## Example + +```python +from bandwidth.models.error_object import ErrorObject + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorObject from a JSON string +error_object_instance = ErrorObject.from_json(json) +# print the JSON string representation of the object +print(ErrorObject.to_json()) + +# convert the object into a dict +error_object_dict = error_object_instance.to_dict() +# create an instance of ErrorObject from a dict +error_object_from_dict = ErrorObject.from_dict(error_object_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/Link.md b/docs/Link.md new file mode 100644 index 00000000..d37afaca --- /dev/null +++ b/docs/Link.md @@ -0,0 +1,30 @@ +# Link + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rel** | **str** | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from bandwidth.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print(Link.to_json()) + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_from_dict = Link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Message.md b/docs/Message.md index ba5d87c2..40229f78 100644 --- a/docs/Message.md +++ b/docs/Message.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **text** | **str** | The contents of the message. | [optional] **tag** | **str** | The custom string set by the user. | [optional] **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] -**expiration** | **datetime** | The expiration date-time set by the user. | [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 diff --git a/docs/MessageRequest.md b/docs/MessageRequest.md index bf2611d6..49168deb 100644 --- a/docs/MessageRequest.md +++ b/docs/MessageRequest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **media** | **List[str]** | A list of URLs to include as media attachments as part of the message. Each URL can be at most 4096 characters. | [optional] **tag** | **str** | A custom string that will be included in callback events of the message. Max 1024 characters. | [optional] **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] -**expiration** | **datetime** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. Not supported on MMS. | [optional] +**expiration** | **datetime** | A string with the date/time value that the message will automatically expire by. This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. Must be a date-time in the future. | [optional] ## Example diff --git a/docs/MmsMessageContent.md b/docs/MmsMessageContent.md new file mode 100644 index 00000000..9f7cd447 --- /dev/null +++ b/docs/MmsMessageContent.md @@ -0,0 +1,30 @@ +# MmsMessageContent + + +## Properties + +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] + +## Example + +```python +from bandwidth.models.mms_message_content import MmsMessageContent + +# TODO update the JSON string below +json = "{}" +# create an instance of MmsMessageContent from a JSON string +mms_message_content_instance = MmsMessageContent.from_json(json) +# print the JSON string representation of the object +print(MmsMessageContent.to_json()) + +# convert the object into a dict +mms_message_content_dict = mms_message_content_instance.to_dict() +# create an instance of MmsMessageContent from a dict +mms_message_content_from_dict = MmsMessageContent.from_dict(mms_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/MultiChannelAction.md b/docs/MultiChannelAction.md new file mode 100644 index 00000000..006092cc --- /dev/null +++ b/docs/MultiChannelAction.md @@ -0,0 +1,40 @@ +# MultiChannelAction + + +## Properties + +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. | +**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. | +**label** | **str** | The label of the location. | [optional] +**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. | +**description** | **str** | The description of the event. | [optional] +**url** | **str** | The URL to open in browser. | + +## Example + +```python +from bandwidth.models.multi_channel_action import MultiChannelAction + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiChannelAction from a JSON string +multi_channel_action_instance = MultiChannelAction.from_json(json) +# print the JSON string representation of the object +print(MultiChannelAction.to_json()) + +# convert the object into a dict +multi_channel_action_dict = multi_channel_action_instance.to_dict() +# create an instance of MultiChannelAction from a dict +multi_channel_action_from_dict = MultiChannelAction.from_dict(multi_channel_action_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/MultiChannelActionCalendarEvent.md b/docs/MultiChannelActionCalendarEvent.md new file mode 100644 index 00000000..c7436d2e --- /dev/null +++ b/docs/MultiChannelActionCalendarEvent.md @@ -0,0 +1,35 @@ +# MultiChannelActionCalendarEvent + + +## Properties + +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. | +**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. | +**description** | **str** | The description of the event. | [optional] + +## Example + +```python +from bandwidth.models.multi_channel_action_calendar_event import MultiChannelActionCalendarEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiChannelActionCalendarEvent from a JSON string +multi_channel_action_calendar_event_instance = MultiChannelActionCalendarEvent.from_json(json) +# print the JSON string representation of the object +print(MultiChannelActionCalendarEvent.to_json()) + +# convert the object into a dict +multi_channel_action_calendar_event_dict = multi_channel_action_calendar_event_instance.to_dict() +# create an instance of MultiChannelActionCalendarEvent from a dict +multi_channel_action_calendar_event_from_dict = MultiChannelActionCalendarEvent.from_dict(multi_channel_action_calendar_event_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/MultiChannelApi.md b/docs/MultiChannelApi.md new file mode 100644 index 00000000..d82a9f13 --- /dev/null +++ b/docs/MultiChannelApi.md @@ -0,0 +1,99 @@ +# bandwidth.MultiChannelApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_multi_channel_message**](MultiChannelApi.md#create_multi_channel_message) | **POST** /users/{accountId}/messages/multiChannel | Create Multi-Channel Message + + +# **create_multi_channel_message** +> CreateMultiChannelMessageResponse create_multi_channel_message(account_id, multi_channel_message_request) + +Create Multi-Channel Message + +Endpoint for sending Multi-Channel messages. + +### Example + +* Basic Authentication (Basic): + +```python +import bandwidth +from bandwidth.models.create_multi_channel_message_response import CreateMultiChannelMessageResponse +from bandwidth.models.multi_channel_message_request import MultiChannelMessageRequest +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.MultiChannelApi(api_client) + account_id = '9900000' # str | Your Bandwidth Account ID. + multi_channel_message_request = bandwidth.MultiChannelMessageRequest() # MultiChannelMessageRequest | + + try: + # Create Multi-Channel Message + api_response = api_instance.create_multi_channel_message(account_id, multi_channel_message_request) + print("The response of MultiChannelApi->create_multi_channel_message:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MultiChannelApi->create_multi_channel_message: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_id** | **str**| Your Bandwidth Account ID. | + **multi_channel_message_request** | [**MultiChannelMessageRequest**](MultiChannelMessageRequest.md)| | + +### Return type + +[**CreateMultiChannelMessageResponse**](CreateMultiChannelMessageResponse.md) + +### Authorization + +[Basic](../README.md#Basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Accepted | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**406** | Not Acceptable | - | +**415** | Unsupported Media Type | - | +**429** | Too Many Requests | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/MultiChannelCallbackData.md b/docs/MultiChannelCallbackData.md new file mode 100644 index 00000000..5d6cd314 --- /dev/null +++ b/docs/MultiChannelCallbackData.md @@ -0,0 +1,33 @@ +# 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/MultiChannelChannelListObject.md b/docs/MultiChannelChannelListObject.md new file mode 100644 index 00000000..87296ec1 --- /dev/null +++ b/docs/MultiChannelChannelListObject.md @@ -0,0 +1,32 @@ +# MultiChannelChannelListObject + + +## 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) | | + +## Example + +```python +from bandwidth.models.multi_channel_channel_list_object import MultiChannelChannelListObject + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiChannelChannelListObject from a JSON string +multi_channel_channel_list_object_instance = MultiChannelChannelListObject.from_json(json) +# print the JSON string representation of the object +print(MultiChannelChannelListObject.to_json()) + +# convert the object into a dict +multi_channel_channel_list_object_dict = multi_channel_channel_list_object_instance.to_dict() +# create an instance of MultiChannelChannelListObject from a dict +multi_channel_channel_list_object_from_dict = MultiChannelChannelListObject.from_dict(multi_channel_channel_list_object_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 new file mode 100644 index 00000000..32c1d8f4 --- /dev/null +++ b/docs/MultiChannelChannelListObjectContent.md @@ -0,0 +1,37 @@ +# MultiChannelChannelListObjectContent + +The content of the message. + +## Properties + +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. | +**orientation** | [**StandaloneCardOrientationEnum**](StandaloneCardOrientationEnum.md) | | +**thumbnail_image_alignment** | [**ThumbnailAlignmentEnum**](ThumbnailAlignmentEnum.md) | | +**card_content** | [**RbmCardContent**](RbmCardContent.md) | | +**card_width** | [**CardWidthEnum**](CardWidthEnum.md) | | +**card_contents** | [**List[RbmCardContent]**](RbmCardContent.md) | | + +## Example + +```python +from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiChannelChannelListObjectContent from a JSON string +multi_channel_channel_list_object_content_instance = MultiChannelChannelListObjectContent.from_json(json) +# print the JSON string representation of the object +print(MultiChannelChannelListObjectContent.to_json()) + +# convert the object into a dict +multi_channel_channel_list_object_content_dict = multi_channel_channel_list_object_content_instance.to_dict() +# create an instance of MultiChannelChannelListObjectContent from a dict +multi_channel_channel_list_object_content_from_dict = MultiChannelChannelListObjectContent.from_dict(multi_channel_channel_list_object_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/MultiChannelMessageCallbackData.md b/docs/MultiChannelMessageCallbackData.md new file mode 100644 index 00000000..462689da --- /dev/null +++ b/docs/MultiChannelMessageCallbackData.md @@ -0,0 +1,36 @@ +# 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/MultiChannelMessageChannelEnum.md b/docs/MultiChannelMessageChannelEnum.md new file mode 100644 index 00000000..3a6215c7 --- /dev/null +++ b/docs/MultiChannelMessageChannelEnum.md @@ -0,0 +1,15 @@ +# MultiChannelMessageChannelEnum + +The channel of the multi-channel message. + +## Enum + +* `RBM` (value: `'RBM'`) + +* `SMS` (value: `'SMS'`) + +* `MMS` (value: `'MMS'`) + +[[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 new file mode 100644 index 00000000..7b704070 --- /dev/null +++ b/docs/MultiChannelMessageData.md @@ -0,0 +1,37 @@ +# 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 new file mode 100644 index 00000000..ffcef62c --- /dev/null +++ b/docs/MultiChannelMessageDirectionEnum.md @@ -0,0 +1,12 @@ +# 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/MultiChannelMessageRequest.md b/docs/MultiChannelMessageRequest.md new file mode 100644 index 00000000..d1b71a8f --- /dev/null +++ b/docs/MultiChannelMessageRequest.md @@ -0,0 +1,34 @@ +# MultiChannelMessageRequest + +Multi-Channel Message Request + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**to** | **str** | The phone number the message should be sent to in E164 format. | +**channel_list** | [**List[MultiChannelChannelListObject]**](MultiChannelChannelListObject.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_request import MultiChannelMessageRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of MultiChannelMessageRequest from a JSON string +multi_channel_message_request_instance = MultiChannelMessageRequest.from_json(json) +# print the JSON string representation of the object +print(MultiChannelMessageRequest.to_json()) + +# convert the object into a dict +multi_channel_message_request_dict = multi_channel_message_request_instance.to_dict() +# create an instance of MultiChannelMessageRequest from a dict +multi_channel_message_request_from_dict = MultiChannelMessageRequest.from_dict(multi_channel_message_request_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 new file mode 100644 index 00000000..364825df --- /dev/null +++ b/docs/MultiChannelStatusEnum.md @@ -0,0 +1,16 @@ +# 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 818eee74..d95a2053 100644 --- a/docs/PriorityEnum.md +++ b/docs/PriorityEnum.md @@ -1,6 +1,6 @@ # PriorityEnum -The priority specified by the user. Not supported on MMS. +The priority specified by the user. ## Enum diff --git a/docs/RbmActionBase.md b/docs/RbmActionBase.md new file mode 100644 index 00000000..7f3c21ec --- /dev/null +++ b/docs/RbmActionBase.md @@ -0,0 +1,31 @@ +# RbmActionBase + + +## Properties + +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. | + +## Example + +```python +from bandwidth.models.rbm_action_base import RbmActionBase + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmActionBase from a JSON string +rbm_action_base_instance = RbmActionBase.from_json(json) +# print the JSON string representation of the object +print(RbmActionBase.to_json()) + +# convert the object into a dict +rbm_action_base_dict = rbm_action_base_instance.to_dict() +# create an instance of RbmActionBase from a dict +rbm_action_base_from_dict = RbmActionBase.from_dict(rbm_action_base_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/RbmActionDial.md b/docs/RbmActionDial.md new file mode 100644 index 00000000..a14d5274 --- /dev/null +++ b/docs/RbmActionDial.md @@ -0,0 +1,32 @@ +# RbmActionDial + + +## Properties + +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. | +**phone_number** | **str** | The phone number to dial. Must be E164 format. | + +## Example + +```python +from bandwidth.models.rbm_action_dial import RbmActionDial + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmActionDial from a JSON string +rbm_action_dial_instance = RbmActionDial.from_json(json) +# print the JSON string representation of the object +print(RbmActionDial.to_json()) + +# convert the object into a dict +rbm_action_dial_dict = rbm_action_dial_instance.to_dict() +# create an instance of RbmActionDial from a dict +rbm_action_dial_from_dict = RbmActionDial.from_dict(rbm_action_dial_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/RbmActionOpenUrl.md b/docs/RbmActionOpenUrl.md new file mode 100644 index 00000000..1cce31c8 --- /dev/null +++ b/docs/RbmActionOpenUrl.md @@ -0,0 +1,32 @@ +# RbmActionOpenUrl + + +## Properties + +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. | +**url** | **str** | The URL to open in browser. | + +## Example + +```python +from bandwidth.models.rbm_action_open_url import RbmActionOpenUrl + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmActionOpenUrl from a JSON string +rbm_action_open_url_instance = RbmActionOpenUrl.from_json(json) +# print the JSON string representation of the object +print(RbmActionOpenUrl.to_json()) + +# convert the object into a dict +rbm_action_open_url_dict = rbm_action_open_url_instance.to_dict() +# create an instance of RbmActionOpenUrl from a dict +rbm_action_open_url_from_dict = RbmActionOpenUrl.from_dict(rbm_action_open_url_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/RbmActionTypeEnum.md b/docs/RbmActionTypeEnum.md new file mode 100644 index 00000000..e293ff4c --- /dev/null +++ b/docs/RbmActionTypeEnum.md @@ -0,0 +1,20 @@ +# RbmActionTypeEnum + + +## Enum + +* `REPLY` (value: `'REPLY'`) + +* `DIAL_PHONE` (value: `'DIAL_PHONE'`) + +* `SHOW_LOCATION` (value: `'SHOW_LOCATION'`) + +* `CREATE_CALENDAR_EVENT` (value: `'CREATE_CALENDAR_EVENT'`) + +* `OPEN_URL` (value: `'OPEN_URL'`) + +* `REQUEST_LOCATION` (value: `'REQUEST_LOCATION'`) + +[[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/RbmActionViewLocation.md b/docs/RbmActionViewLocation.md new file mode 100644 index 00000000..54185177 --- /dev/null +++ b/docs/RbmActionViewLocation.md @@ -0,0 +1,34 @@ +# RbmActionViewLocation + + +## Properties + +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. | +**latitude** | **float** | The latitude of the location. | +**longitude** | **float** | The longitude of the location. | +**label** | **str** | The label of the location. | [optional] + +## Example + +```python +from bandwidth.models.rbm_action_view_location import RbmActionViewLocation + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmActionViewLocation from a JSON string +rbm_action_view_location_instance = RbmActionViewLocation.from_json(json) +# print the JSON string representation of the object +print(RbmActionViewLocation.to_json()) + +# convert the object into a dict +rbm_action_view_location_dict = rbm_action_view_location_instance.to_dict() +# create an instance of RbmActionViewLocation from a dict +rbm_action_view_location_from_dict = RbmActionViewLocation.from_dict(rbm_action_view_location_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/RbmCardContent.md b/docs/RbmCardContent.md new file mode 100644 index 00000000..44bde90a --- /dev/null +++ b/docs/RbmCardContent.md @@ -0,0 +1,32 @@ +# RbmCardContent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | The title of the card. Must be 200 characters or less. | [optional] +**description** | **str** | The description of the card. Must be 2000 characters or less. | [optional] +**media** | [**RbmCardContentMedia**](RbmCardContentMedia.md) | | [optional] +**suggestions** | [**List[MultiChannelAction]**](MultiChannelAction.md) | An array of suggested actions for the recipient that will be displayed on the rich card. | [optional] + +## Example + +```python +from bandwidth.models.rbm_card_content import RbmCardContent + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmCardContent from a JSON string +rbm_card_content_instance = RbmCardContent.from_json(json) +# print the JSON string representation of the object +print(RbmCardContent.to_json()) + +# convert the object into a dict +rbm_card_content_dict = rbm_card_content_instance.to_dict() +# create an instance of RbmCardContent from a dict +rbm_card_content_from_dict = RbmCardContent.from_dict(rbm_card_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/RbmCardContentMedia.md b/docs/RbmCardContentMedia.md new file mode 100644 index 00000000..c4542f6a --- /dev/null +++ b/docs/RbmCardContentMedia.md @@ -0,0 +1,31 @@ +# RbmCardContentMedia + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file_url** | **str** | The URL of the media file. 100MB is the maximum file size. | +**thumbnail_url** | **str** | The URL of the thumbnail image. Applies only to video file media. | [optional] +**height** | [**RbmMediaHeightEnum**](RbmMediaHeightEnum.md) | | + +## Example + +```python +from bandwidth.models.rbm_card_content_media import RbmCardContentMedia + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmCardContentMedia from a JSON string +rbm_card_content_media_instance = RbmCardContentMedia.from_json(json) +# print the JSON string representation of the object +print(RbmCardContentMedia.to_json()) + +# convert the object into a dict +rbm_card_content_media_dict = rbm_card_content_media_instance.to_dict() +# create an instance of RbmCardContentMedia from a dict +rbm_card_content_media_from_dict = RbmCardContentMedia.from_dict(rbm_card_content_media_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/RbmMediaHeightEnum.md b/docs/RbmMediaHeightEnum.md new file mode 100644 index 00000000..f203015e --- /dev/null +++ b/docs/RbmMediaHeightEnum.md @@ -0,0 +1,15 @@ +# RbmMediaHeightEnum + +The height of the media. + +## Enum + +* `SHORT` (value: `'SHORT'`) + +* `MEDIUM` (value: `'MEDIUM'`) + +* `TALL` (value: `'TALL'`) + +[[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/RbmMessageCarouselCard.md b/docs/RbmMessageCarouselCard.md new file mode 100644 index 00000000..d2e584f7 --- /dev/null +++ b/docs/RbmMessageCarouselCard.md @@ -0,0 +1,31 @@ +# RbmMessageCarouselCard + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**card_width** | [**CardWidthEnum**](CardWidthEnum.md) | | +**card_contents** | [**List[RbmCardContent]**](RbmCardContent.md) | | +**suggestions** | [**List[MultiChannelAction]**](MultiChannelAction.md) | An array of suggested actions for the recipient. | [optional] + +## Example + +```python +from bandwidth.models.rbm_message_carousel_card import RbmMessageCarouselCard + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmMessageCarouselCard from a JSON string +rbm_message_carousel_card_instance = RbmMessageCarouselCard.from_json(json) +# print the JSON string representation of the object +print(RbmMessageCarouselCard.to_json()) + +# convert the object into a dict +rbm_message_carousel_card_dict = rbm_message_carousel_card_instance.to_dict() +# create an instance of RbmMessageCarouselCard from a dict +rbm_message_carousel_card_from_dict = RbmMessageCarouselCard.from_dict(rbm_message_carousel_card_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/RbmMessageContentFile.md b/docs/RbmMessageContentFile.md new file mode 100644 index 00000000..8a81a7c1 --- /dev/null +++ b/docs/RbmMessageContentFile.md @@ -0,0 +1,30 @@ +# RbmMessageContentFile + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file_url** | **str** | The URL of the media file. 100MB is the maximum file size. | +**thumbnail_url** | **str** | The URL of the thumbnail image. Applies only to video file media. | [optional] + +## Example + +```python +from bandwidth.models.rbm_message_content_file import RbmMessageContentFile + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmMessageContentFile from a JSON string +rbm_message_content_file_instance = RbmMessageContentFile.from_json(json) +# print the JSON string representation of the object +print(RbmMessageContentFile.to_json()) + +# convert the object into a dict +rbm_message_content_file_dict = rbm_message_content_file_instance.to_dict() +# create an instance of RbmMessageContentFile from a dict +rbm_message_content_file_from_dict = RbmMessageContentFile.from_dict(rbm_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/RbmMessageContentRichCard.md b/docs/RbmMessageContentRichCard.md new file mode 100644 index 00000000..cc6941a6 --- /dev/null +++ b/docs/RbmMessageContentRichCard.md @@ -0,0 +1,34 @@ +# RbmMessageContentRichCard + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**orientation** | [**StandaloneCardOrientationEnum**](StandaloneCardOrientationEnum.md) | | +**thumbnail_image_alignment** | [**ThumbnailAlignmentEnum**](ThumbnailAlignmentEnum.md) | | +**card_content** | [**RbmCardContent**](RbmCardContent.md) | | +**suggestions** | [**List[MultiChannelAction]**](MultiChannelAction.md) | An array of suggested actions for the recipient. | [optional] +**card_width** | [**CardWidthEnum**](CardWidthEnum.md) | | +**card_contents** | [**List[RbmCardContent]**](RbmCardContent.md) | | + +## Example + +```python +from bandwidth.models.rbm_message_content_rich_card import RbmMessageContentRichCard + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmMessageContentRichCard from a JSON string +rbm_message_content_rich_card_instance = RbmMessageContentRichCard.from_json(json) +# print the JSON string representation of the object +print(RbmMessageContentRichCard.to_json()) + +# convert the object into a dict +rbm_message_content_rich_card_dict = rbm_message_content_rich_card_instance.to_dict() +# create an instance of RbmMessageContentRichCard from a dict +rbm_message_content_rich_card_from_dict = RbmMessageContentRichCard.from_dict(rbm_message_content_rich_card_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/RbmMessageContentText.md b/docs/RbmMessageContentText.md new file mode 100644 index 00000000..197f6edf --- /dev/null +++ b/docs/RbmMessageContentText.md @@ -0,0 +1,30 @@ +# RbmMessageContentText + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**text** | **str** | The text associated with the message. Must be 3270 characters or less | +**suggestions** | [**List[MultiChannelAction]**](MultiChannelAction.md) | An array of suggested actions for the recipient. | [optional] + +## Example + +```python +from bandwidth.models.rbm_message_content_text import RbmMessageContentText + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmMessageContentText from a JSON string +rbm_message_content_text_instance = RbmMessageContentText.from_json(json) +# print the JSON string representation of the object +print(RbmMessageContentText.to_json()) + +# convert the object into a dict +rbm_message_content_text_dict = rbm_message_content_text_instance.to_dict() +# create an instance of RbmMessageContentText from a dict +rbm_message_content_text_from_dict = RbmMessageContentText.from_dict(rbm_message_content_text_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/RbmMessageMedia.md b/docs/RbmMessageMedia.md new file mode 100644 index 00000000..d6ffe448 --- /dev/null +++ b/docs/RbmMessageMedia.md @@ -0,0 +1,30 @@ +# RbmMessageMedia + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**media** | [**RbmMessageContentFile**](RbmMessageContentFile.md) | | +**suggestions** | [**List[MultiChannelAction]**](MultiChannelAction.md) | An array of suggested actions for the recipient. | [optional] + +## Example + +```python +from bandwidth.models.rbm_message_media import RbmMessageMedia + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmMessageMedia from a JSON string +rbm_message_media_instance = RbmMessageMedia.from_json(json) +# print the JSON string representation of the object +print(RbmMessageMedia.to_json()) + +# convert the object into a dict +rbm_message_media_dict = rbm_message_media_instance.to_dict() +# create an instance of RbmMessageMedia from a dict +rbm_message_media_from_dict = RbmMessageMedia.from_dict(rbm_message_media_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/RbmStandaloneCard.md b/docs/RbmStandaloneCard.md new file mode 100644 index 00000000..ca2c9d7d --- /dev/null +++ b/docs/RbmStandaloneCard.md @@ -0,0 +1,32 @@ +# RbmStandaloneCard + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**orientation** | [**StandaloneCardOrientationEnum**](StandaloneCardOrientationEnum.md) | | +**thumbnail_image_alignment** | [**ThumbnailAlignmentEnum**](ThumbnailAlignmentEnum.md) | | +**card_content** | [**RbmCardContent**](RbmCardContent.md) | | +**suggestions** | [**List[MultiChannelAction]**](MultiChannelAction.md) | An array of suggested actions for the recipient. | [optional] + +## Example + +```python +from bandwidth.models.rbm_standalone_card import RbmStandaloneCard + +# TODO update the JSON string below +json = "{}" +# create an instance of RbmStandaloneCard from a JSON string +rbm_standalone_card_instance = RbmStandaloneCard.from_json(json) +# print the JSON string representation of the object +print(RbmStandaloneCard.to_json()) + +# convert the object into a dict +rbm_standalone_card_dict = rbm_standalone_card_instance.to_dict() +# create an instance of RbmStandaloneCard from a dict +rbm_standalone_card_from_dict = RbmStandaloneCard.from_dict(rbm_standalone_card_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/SmsMessageContent.md b/docs/SmsMessageContent.md new file mode 100644 index 00000000..7fe2551d --- /dev/null +++ b/docs/SmsMessageContent.md @@ -0,0 +1,29 @@ +# SmsMessageContent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**text** | **str** | The contents of the text message. Must be 2048 characters or less. | + +## Example + +```python +from bandwidth.models.sms_message_content import SmsMessageContent + +# TODO update the JSON string below +json = "{}" +# create an instance of SmsMessageContent from a JSON string +sms_message_content_instance = SmsMessageContent.from_json(json) +# print the JSON string representation of the object +print(SmsMessageContent.to_json()) + +# convert the object into a dict +sms_message_content_dict = sms_message_content_instance.to_dict() +# create an instance of SmsMessageContent from a dict +sms_message_content_from_dict = SmsMessageContent.from_dict(sms_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/StandaloneCardOrientationEnum.md b/docs/StandaloneCardOrientationEnum.md new file mode 100644 index 00000000..5838879a --- /dev/null +++ b/docs/StandaloneCardOrientationEnum.md @@ -0,0 +1,12 @@ +# StandaloneCardOrientationEnum + + +## Enum + +* `HORIZONTAL` (value: `'HORIZONTAL'`) + +* `VERTICAL` (value: `'VERTICAL'`) + +[[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/ThumbnailAlignmentEnum.md b/docs/ThumbnailAlignmentEnum.md new file mode 100644 index 00000000..21b2e5ea --- /dev/null +++ b/docs/ThumbnailAlignmentEnum.md @@ -0,0 +1,13 @@ +# ThumbnailAlignmentEnum + +The alignment of the thumbnail image in the card. Only applicable if the card using horizontal orientation. + +## Enum + +* `LEFT` (value: `'LEFT'`) + +* `RIGHT` (value: `'RIGHT'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + From 2408a9f7d37b182549d3180107b5daafae0b1d16 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Thu, 8 May 2025 16:36:26 -0400 Subject: [PATCH 2/7] enum unit tests --- test/unit/models/test_card_width_enum.py | 37 +++++++++++++++ ...test_multi_channel_message_channel_enum.py | 39 ++++++++++++++++ ...st_multi_channel_message_direction_enum.py | 37 +++++++++++++++ .../models/test_multi_channel_status_enum.py | 41 +++++++++++++++++ test/unit/models/test_rbm_action_type_enum.py | 45 +++++++++++++++++++ .../unit/models/test_rbm_media_height_enum.py | 39 ++++++++++++++++ .../test_standalone_card_orientation_enum.py | 37 +++++++++++++++ .../models/test_thumbnail_alignment_enum.py | 37 +++++++++++++++ 8 files changed, 312 insertions(+) create mode 100644 test/unit/models/test_card_width_enum.py create mode 100644 test/unit/models/test_multi_channel_message_channel_enum.py create mode 100644 test/unit/models/test_multi_channel_message_direction_enum.py create mode 100644 test/unit/models/test_multi_channel_status_enum.py create mode 100644 test/unit/models/test_rbm_action_type_enum.py create mode 100644 test/unit/models/test_rbm_media_height_enum.py create mode 100644 test/unit/models/test_standalone_card_orientation_enum.py create mode 100644 test/unit/models/test_thumbnail_alignment_enum.py diff --git a/test/unit/models/test_card_width_enum.py b/test/unit/models/test_card_width_enum.py new file mode 100644 index 00000000..d6ba49bc --- /dev/null +++ b/test/unit/models/test_card_width_enum.py @@ -0,0 +1,37 @@ +# 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.card_width_enum import CardWidthEnum + +class TestCardWidthEnum(unittest.TestCase): + """CardWidthEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCardWidthEnum(self): + """Test CardWidthEnum""" + small = CardWidthEnum('SMALL') + medium = CardWidthEnum('MEDIUM') + assert small == 'SMALL' + assert medium == 'MEDIUM' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_multi_channel_message_channel_enum.py b/test/unit/models/test_multi_channel_message_channel_enum.py new file mode 100644 index 00000000..89e83207 --- /dev/null +++ b/test/unit/models/test_multi_channel_message_channel_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.multi_channel_message_channel_enum import MultiChannelMessageChannelEnum + +class TestMultiChannelMessageChannelEnum(unittest.TestCase): + """MultiChannelMessageChannelEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMultiChannelMessageChannelEnum(self): + """Test MultiChannelMessageChannelEnum""" + rbm = MultiChannelMessageChannelEnum('RBM') + sms = MultiChannelMessageChannelEnum('SMS') + mms = MultiChannelMessageChannelEnum('MMS') + assert rbm == 'RBM' + assert sms == 'SMS' + assert mms == 'MMS' + +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 new file mode 100644 index 00000000..fc82bd3c --- /dev/null +++ b/test/unit/models/test_multi_channel_message_direction_enum.py @@ -0,0 +1,37 @@ +# 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_status_enum.py b/test/unit/models/test_multi_channel_status_enum.py new file mode 100644 index 00000000..50714209 --- /dev/null +++ b/test/unit/models/test_multi_channel_status_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.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_type_enum.py b/test/unit/models/test_rbm_action_type_enum.py new file mode 100644 index 00000000..af1754ac --- /dev/null +++ b/test/unit/models/test_rbm_action_type_enum.py @@ -0,0 +1,45 @@ +# 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.rbm_action_type_enum import RbmActionTypeEnum + +class TestRbmActionTypeEnum(unittest.TestCase): + """RbmActionTypeEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testRbmActionTypeEnum(self): + """Test RbmActionTypeEnum""" + reply = RbmActionTypeEnum('REPLY') + dial_phone = RbmActionTypeEnum('DIAL_PHONE') + show_location = RbmActionTypeEnum('SHOW_LOCATION') + create_calendar_event = RbmActionTypeEnum('CREATE_CALENDAR_EVENT') + open_url = RbmActionTypeEnum('OPEN_URL') + request_location = RbmActionTypeEnum('REQUEST_LOCATION') + assert reply == 'REPLY' + assert dial_phone == 'DIAL_PHONE' + assert show_location == 'SHOW_LOCATION' + assert create_calendar_event == 'CREATE_CALENDAR_EVENT' + assert open_url == 'OPEN_URL' + assert request_location == 'REQUEST_LOCATION' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_rbm_media_height_enum.py b/test/unit/models/test_rbm_media_height_enum.py new file mode 100644 index 00000000..ab4f99a7 --- /dev/null +++ b/test/unit/models/test_rbm_media_height_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.rbm_media_height_enum import RbmMediaHeightEnum + +class TestRbmMediaHeightEnum(unittest.TestCase): + """RbmMediaHeightEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testRbmMediaHeightEnum(self): + """Test RbmMediaHeightEnum""" + short = RbmMediaHeightEnum('SHORT') + medium = RbmMediaHeightEnum('MEDIUM') + tall = RbmMediaHeightEnum('TALL') + assert short == 'SHORT' + assert medium == 'MEDIUM' + assert tall == 'TALL' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_standalone_card_orientation_enum.py b/test/unit/models/test_standalone_card_orientation_enum.py new file mode 100644 index 00000000..717e3ea6 --- /dev/null +++ b/test/unit/models/test_standalone_card_orientation_enum.py @@ -0,0 +1,37 @@ +# 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.standalone_card_orientation_enum import StandaloneCardOrientationEnum + +class TestStandaloneCardOrientationEnum(unittest.TestCase): + """StandaloneCardOrientationEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStandaloneCardOrientationEnum(self): + """Test StandaloneCardOrientationEnum""" + horizontal = StandaloneCardOrientationEnum('HORIZONTAL') + vertical = StandaloneCardOrientationEnum('VERTICAL') + assert horizontal == 'HORIZONTAL' + assert vertical == 'VERTICAL' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_thumbnail_alignment_enum.py b/test/unit/models/test_thumbnail_alignment_enum.py new file mode 100644 index 00000000..d59568b0 --- /dev/null +++ b/test/unit/models/test_thumbnail_alignment_enum.py @@ -0,0 +1,37 @@ +# 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.thumbnail_alignment_enum import ThumbnailAlignmentEnum + +class TestThumbnailAlignmentEnum(unittest.TestCase): + """ThumbnailAlignmentEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testThumbnailAlignmentEnum(self): + """Test ThumbnailAlignmentEnum""" + left = ThumbnailAlignmentEnum('LEFT') + right = ThumbnailAlignmentEnum('RIGHT') + assert left == 'LEFT' + assert right == 'RIGHT' + +if __name__ == '__main__': + unittest.main() From 4eb2bb37c114a600f8e2957f6018b9305019b1dc Mon Sep 17 00:00:00 2001 From: ckoegel Date: Fri, 9 May 2025 14:35:06 -0400 Subject: [PATCH 3/7] model unit tests --- ...t_create_multi_channel_message_response.py | 90 +++++++++++++ test/unit/models/test_error_object.py | 52 ++++++++ test/unit/models/test_link.py | 52 ++++++++ test/unit/models/test_mms_message_content.py | 52 ++++++++ ...est_multi_channel_action_calendar_event.py | 68 ++++++++++ .../test_multi_channel_callback_data.py | 76 +++++++++++ .../test_multi_channel_channel_list_object.py | 66 ++++++++++ ...est_multi_channel_message_callback_data.py | 64 ++++++++++ .../models/test_multi_channel_message_data.py | 64 ++++++++++ .../test_multi_channel_message_request.py | 87 +++++++++++++ test/unit/models/test_rbm_action_base.py | 57 +++++++++ test/unit/models/test_rbm_action_dial.py | 60 +++++++++ test/unit/models/test_rbm_action_open_url.py | 60 +++++++++ .../models/test_rbm_action_view_location.py | 65 ++++++++++ test/unit/models/test_rbm_card_content.py | 75 +++++++++++ .../models/test_rbm_card_content_media.py | 56 ++++++++ .../models/test_rbm_message_carousel_card.py | 120 ++++++++++++++++++ .../models/test_rbm_message_content_file.py | 53 ++++++++ .../models/test_rbm_message_content_text.py | 65 ++++++++++ test/unit/models/test_rbm_message_media.py | 72 +++++++++++ test/unit/models/test_rbm_standalone_card.py | 108 ++++++++++++++++ test/unit/models/test_sms_message_content.py | 51 ++++++++ 22 files changed, 1513 insertions(+) create mode 100644 test/unit/models/test_create_multi_channel_message_response.py create mode 100644 test/unit/models/test_error_object.py create mode 100644 test/unit/models/test_link.py create mode 100644 test/unit/models/test_mms_message_content.py create mode 100644 test/unit/models/test_multi_channel_action_calendar_event.py create mode 100644 test/unit/models/test_multi_channel_callback_data.py create mode 100644 test/unit/models/test_multi_channel_channel_list_object.py create mode 100644 test/unit/models/test_multi_channel_message_callback_data.py create mode 100644 test/unit/models/test_multi_channel_message_data.py create mode 100644 test/unit/models/test_multi_channel_message_request.py create mode 100644 test/unit/models/test_rbm_action_base.py create mode 100644 test/unit/models/test_rbm_action_dial.py create mode 100644 test/unit/models/test_rbm_action_open_url.py create mode 100644 test/unit/models/test_rbm_action_view_location.py create mode 100644 test/unit/models/test_rbm_card_content.py create mode 100644 test/unit/models/test_rbm_card_content_media.py create mode 100644 test/unit/models/test_rbm_message_carousel_card.py create mode 100644 test/unit/models/test_rbm_message_content_file.py create mode 100644 test/unit/models/test_rbm_message_content_text.py create mode 100644 test/unit/models/test_rbm_message_media.py create mode 100644 test/unit/models/test_rbm_standalone_card.py create mode 100644 test/unit/models/test_sms_message_content.py diff --git a/test/unit/models/test_create_multi_channel_message_response.py b/test/unit/models/test_create_multi_channel_message_response.py new file mode 100644 index 00000000..6e23da25 --- /dev/null +++ b/test/unit/models/test_create_multi_channel_message_response.py @@ -0,0 +1,90 @@ +# 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 new file mode 100644 index 00000000..3007fba8 --- /dev/null +++ b/test/unit/models/test_error_object.py @@ -0,0 +1,52 @@ +# 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_object import ErrorObject + +class TestErrorObject(unittest.TestCase): + """ErrorObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ErrorObject: + """Test ErrorObject + 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 ErrorObject( + code = 'code', + message = 'message' + ) + else: + return ErrorObject( + ) + + def testErrorObject(self): + """Test ErrorObject""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, ErrorObject) + assert instance.code == 'code' + assert instance.message == 'message' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_link.py b/test/unit/models/test_link.py new file mode 100644 index 00000000..02a36313 --- /dev/null +++ b/test/unit/models/test_link.py @@ -0,0 +1,52 @@ +# 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.link import Link + +class TestLink(unittest.TestCase): + """Link unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Link: + """Test Link + 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 Link( + rel = 'rel', + href = 'href' + ) + else: + return Link( + ) + + def testLink(self): + """Test Link""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, Link) + assert instance.rel == 'rel' + assert instance.href == 'href' + +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 new file mode 100644 index 00000000..0bc4c952 --- /dev/null +++ b/test/unit/models/test_mms_message_content.py @@ -0,0 +1,52 @@ +# 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 import MmsMessageContent + +class TestMmsMessageContent(unittest.TestCase): + """MmsMessageContent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MmsMessageContent: + """Test MmsMessageContent + 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 MmsMessageContent( + text = 'Hello world', + media = ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"] + ) + else: + return MmsMessageContent( + ) + + def testMmsMessageContent(self): + """Test MmsMessageContent""" + instance = self.make_instance(True) + 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"] + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_multi_channel_action_calendar_event.py b/test/unit/models/test_multi_channel_action_calendar_event.py new file mode 100644 index 00000000..0ba6b65e --- /dev/null +++ b/test/unit/models/test_multi_channel_action_calendar_event.py @@ -0,0 +1,68 @@ +# 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_action_calendar_event import MultiChannelActionCalendarEvent + +class TestMultiChannelActionCalendarEvent(unittest.TestCase): + """MultiChannelActionCalendarEvent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultiChannelActionCalendarEvent: + """Test MultiChannelActionCalendarEvent + 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 MultiChannelActionCalendarEvent( + type = 'REPLY', + text = 'Hello world', + post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + title = 'Meeting with John', + start_time = '2022-09-14T18:20:16Z', + end_time = '2022-09-14T18:20:16Z', + description = 'Discuss the new project' + ) + else: + return MultiChannelActionCalendarEvent( + type = 'REPLY', + text = 'Hello world', + post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + title = 'Meeting with John', + start_time = '2022-09-14T18:20:16Z', + end_time = '2022-09-14T18:20:16Z', + ) + + def testMultiChannelActionCalendarEvent(self): + """Test MultiChannelActionCalendarEvent""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MultiChannelActionCalendarEvent) + assert instance.type == 'REPLY' + assert instance.text == 'Hello world' + assert instance.post_back_data == 'U0dWc2JHOGdkMjl5YkdRPQ==' + assert instance.title == 'Meeting with John' + assert isinstance(instance.start_time, datetime) + assert isinstance(instance.end_time, datetime) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_multi_channel_callback_data.py b/test/unit/models/test_multi_channel_callback_data.py new file mode 100644 index 00000000..cc977d55 --- /dev/null +++ b/test/unit/models/test_multi_channel_callback_data.py @@ -0,0 +1,76 @@ +# 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.py b/test/unit/models/test_multi_channel_channel_list_object.py new file mode 100644 index 00000000..b9aaf27b --- /dev/null +++ b/test/unit/models/test_multi_channel_channel_list_object.py @@ -0,0 +1,66 @@ +# 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_channel_list_object import MultiChannelChannelListObject +from bandwidth.models.rbm_message_content_text import RbmMessageContentText +from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent + +class TestMultiChannelChannelListObject(unittest.TestCase): + """MultiChannelChannelListObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultiChannelChannelListObject: + """Test MultiChannelChannelListObject + 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 MultiChannelChannelListObject( + var_from = 'BandwidthRBM', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + channel = 'RBM', + content = MultiChannelChannelListObjectContent( + RbmMessageContentText( + text = 'Hello', + ) + ) + ) + else: + return MultiChannelChannelListObject( + var_from = 'BandwidthRBM', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + channel = 'RBM', + content = None, + ) + + def testMultiChannelChannelListObject(self): + """Test MultiChannelChannelListObject""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MultiChannelChannelListObject) + assert instance.var_from == 'BandwidthRBM' + assert instance.application_id == '93de2206-9669-4e07-948d-329f4b722ee2' + assert instance.channel == 'RBM' + assert isinstance(instance.content, MultiChannelChannelListObjectContent) + +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 new file mode 100644 index 00000000..f0ad1ae9 --- /dev/null +++ b/test/unit/models/test_multi_channel_message_callback_data.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_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_data.py b/test/unit/models/test_multi_channel_message_data.py new file mode 100644 index 00000000..8f2ab0b9 --- /dev/null +++ b/test/unit/models/test_multi_channel_message_data.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_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_request.py b/test/unit/models/test_multi_channel_message_request.py new file mode 100644 index 00000000..e922a090 --- /dev/null +++ b/test/unit/models/test_multi_channel_message_request.py @@ -0,0 +1,87 @@ +# 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_request import MultiChannelMessageRequest +from bandwidth.models.multi_channel_channel_list_object import MultiChannelChannelListObject +from bandwidth.models.rbm_message_content_text import RbmMessageContentText +from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent + +class TestMultiChannelMessageRequest(unittest.TestCase): + """MultiChannelMessageRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultiChannelMessageRequest: + """Test MultiChannelMessageRequest + 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 MultiChannelMessageRequest( + to = '+15552223333', + channel_list = [ + MultiChannelChannelListObject( + var_from = 'BandwidthRBM', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + channel = 'RBM', + content = MultiChannelChannelListObjectContent( + RbmMessageContentText( + text = 'Hello', + ) + ), + ) + ], + tag = 'custom string', + priority = 'default', + expiration = '2021-02-01T11:29:18-05:00' + ) + else: + return MultiChannelMessageRequest( + to = '+15552223333', + channel_list = [ + MultiChannelChannelListObject( + var_from = 'BandwidthRBM', + application_id = '93de2206-9669-4e07-948d-329f4b722ee2', + channel = 'RBM', + content = MultiChannelChannelListObjectContent( + RbmMessageContentText( + text = 'Hello', + ) + ), + ) + ], + ) + + def testMultiChannelMessageRequest(self): + """Test MultiChannelMessageRequest""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, MultiChannelMessageRequest) + assert instance.to == '+15552223333' + assert isinstance(instance.channel_list, list) + assert isinstance(instance.channel_list[0], MultiChannelChannelListObject) + 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_rbm_action_base.py b/test/unit/models/test_rbm_action_base.py new file mode 100644 index 00000000..2b6fe0a1 --- /dev/null +++ b/test/unit/models/test_rbm_action_base.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.rbm_action_base import RbmActionBase + +class TestRbmActionBase(unittest.TestCase): + """RbmActionBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RbmActionBase: + """Test RbmActionBase + 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 RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + else: + return RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473', + ) + + def testRbmActionBase(self): + """Test RbmActionBase""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RbmActionBase) + assert instance.type == 'REPLY' + assert instance.text == 'Hello world' + assert instance.post_back_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 new file mode 100644 index 00000000..54d09295 --- /dev/null +++ b/test/unit/models/test_rbm_action_dial.py @@ -0,0 +1,60 @@ +# 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.rbm_action_dial import RbmActionDial + +class TestRbmActionDial(unittest.TestCase): + """RbmActionDial unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RbmActionDial: + """Test RbmActionDial + 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 RbmActionDial( + type = 'REPLY', + text = 'Hello world', + post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + phone_number = '+15552223333' + ) + else: + return RbmActionDial( + type = 'REPLY', + text = 'Hello world', + post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + phone_number = '+15552223333', + ) + + def testRbmActionDial(self): + """Test RbmActionDial""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RbmActionDial) + assert instance.type == 'REPLY' + assert instance.text == 'Hello world' + assert instance.post_back_data == 'U0dWc2JHOGdkMjl5YkdRPQ==' + assert instance.phone_number == '+15552223333' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_rbm_action_open_url.py b/test/unit/models/test_rbm_action_open_url.py new file mode 100644 index 00000000..198a8011 --- /dev/null +++ b/test/unit/models/test_rbm_action_open_url.py @@ -0,0 +1,60 @@ +# 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.rbm_action_open_url import RbmActionOpenUrl + +class TestRbmActionOpenUrl(unittest.TestCase): + """RbmActionOpenUrl unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RbmActionOpenUrl: + """Test RbmActionOpenUrl + 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 RbmActionOpenUrl( + type = 'REPLY', + text = 'Hello world', + post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + url = 'https://dev.bandwidth.com' + ) + else: + return RbmActionOpenUrl( + type = 'REPLY', + text = 'Hello world', + post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + url = 'https://dev.bandwidth.com', + ) + + def testRbmActionOpenUrl(self): + """Test RbmActionOpenUrl""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RbmActionOpenUrl) + assert instance.type == 'REPLY' + assert instance.text == 'Hello world' + assert instance.post_back_data == 'U0dWc2JHOGdkMjl5YkdRPQ==' + assert instance.url == 'https://dev.bandwidth.com' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_rbm_action_view_location.py b/test/unit/models/test_rbm_action_view_location.py new file mode 100644 index 00000000..49fc9141 --- /dev/null +++ b/test/unit/models/test_rbm_action_view_location.py @@ -0,0 +1,65 @@ +# 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.rbm_action_view_location import RbmActionViewLocation + +class TestRbmActionViewLocation(unittest.TestCase): + """RbmActionViewLocation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RbmActionViewLocation: + """Test RbmActionViewLocation + 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 RbmActionViewLocation( + type = 'REPLY', + text = 'Hello world', + post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + latitude = '37.7749', + longitude = '-122.4194', + label = 'San Francisco' + ) + else: + return RbmActionViewLocation( + type = 'REPLY', + text = 'Hello world', + post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + latitude = '37.7749', + longitude = '-122.4194', + ) + + def testRbmActionViewLocation(self): + """Test RbmActionViewLocation""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RbmActionViewLocation) + assert instance.type == 'REPLY' + assert instance.text == 'Hello world' + assert instance.post_back_data == 'U0dWc2JHOGdkMjl5YkdRPQ==' + assert instance.latitude == '37.7749' + assert instance.longitude == '-122.4194' + assert instance.label == 'San Francisco' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_rbm_card_content.py b/test/unit/models/test_rbm_card_content.py new file mode 100644 index 00000000..050223c8 --- /dev/null +++ b/test/unit/models/test_rbm_card_content.py @@ -0,0 +1,75 @@ +# 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.rbm_card_content import RbmCardContent +from bandwidth.models.multi_channel_action import MultiChannelAction +from bandwidth.models.rbm_action_base import RbmActionBase +from bandwidth.models.rbm_card_content_media import RbmCardContentMedia + +class TestRbmCardContent(unittest.TestCase): + """RbmCardContent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RbmCardContent: + """Test RbmCardContent + 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 RbmCardContent( + title = 'Bandwidth', + description = 'Bandwidth is a communications platform as a service (CPaaS) company.', + media = RbmCardContentMedia( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + height = 'SHORT' + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + ) + else: + return RbmCardContent( + ) + + def testRbmCardContent(self): + """Test RbmCardContent""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RbmCardContent) + assert instance.title == 'Bandwidth' + assert instance.description == 'Bandwidth is a communications platform as a service (CPaaS) company.' + assert instance.media is not None + assert isinstance(instance.media, RbmCardContentMedia) + assert instance.suggestions is not None + assert isinstance(instance.suggestions, list) + assert len(instance.suggestions) > 0 + assert isinstance(instance.suggestions[0], MultiChannelAction) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_rbm_card_content_media.py b/test/unit/models/test_rbm_card_content_media.py new file mode 100644 index 00000000..adff6952 --- /dev/null +++ b/test/unit/models/test_rbm_card_content_media.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.rbm_card_content_media import RbmCardContentMedia + +class TestRbmCardContentMedia(unittest.TestCase): + """RbmCardContentMedia unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RbmCardContentMedia: + """Test RbmCardContentMedia + 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 RbmCardContentMedia( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + height = 'SHORT' + ) + else: + return RbmCardContentMedia( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + height = 'SHORT', + ) + + def testRbmCardContentMedia(self): + """Test RbmCardContentMedia""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RbmCardContentMedia) + assert instance.file_url == 'https://dev.bandwidth.com/images/bandwidth-logo.png' + assert instance.thumbnail_url == 'https://dev.bandwidth.com/images/bandwidth-logo.png' + assert instance.height == 'SHORT' + +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 new file mode 100644 index 00000000..f44defd6 --- /dev/null +++ b/test/unit/models/test_rbm_message_carousel_card.py @@ -0,0 +1,120 @@ +# 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.rbm_message_carousel_card import RbmMessageCarouselCard +from bandwidth.models.rbm_card_content import RbmCardContent +from bandwidth.models.rbm_card_content_media import RbmCardContentMedia +from bandwidth.models.multi_channel_action import MultiChannelAction +from bandwidth.models.rbm_action_base import RbmActionBase + +class TestRbmMessageCarouselCard(unittest.TestCase): + """RbmMessageCarouselCard unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RbmMessageCarouselCard: + """Test RbmMessageCarouselCard + 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 RbmMessageCarouselCard( + card_width = 'SMALL', + card_contents = [ + RbmCardContent( + title = 'Bandwidth', + description = 'Bandwidth is a communications platform as a service (CPaaS) company.', + media = RbmCardContentMedia( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + height = 'SHORT' + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ], + ) + ], + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + ) + else: + return RbmMessageCarouselCard( + card_width = 'SMALL', + card_contents = [ + RbmCardContent( + title = 'Bandwidth', + description = 'Bandwidth is a communications platform as a service (CPaaS) company.', + media = RbmCardContentMedia( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + height = 'SHORT' + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ], + ) + ], + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + ) + + def testRbmMessageCarouselCard(self): + """Test RbmMessageCarouselCard""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RbmMessageCarouselCard) + assert instance.card_width == 'SMALL' + assert isinstance(instance.card_contents, list) + assert len(instance.card_contents) > 0 + assert isinstance(instance.card_contents[0], RbmCardContent) + assert instance.suggestions is not None + assert isinstance(instance.suggestions, list) + assert len(instance.suggestions) > 0 + assert isinstance(instance.suggestions[0], MultiChannelAction) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_rbm_message_content_file.py b/test/unit/models/test_rbm_message_content_file.py new file mode 100644 index 00000000..88274fd4 --- /dev/null +++ b/test/unit/models/test_rbm_message_content_file.py @@ -0,0 +1,53 @@ +# 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.rbm_message_content_file import RbmMessageContentFile + +class TestRbmMessageContentFile(unittest.TestCase): + """RbmMessageContentFile unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RbmMessageContentFile: + """Test RbmMessageContentFile + 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 RbmMessageContentFile( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png' + ) + else: + return RbmMessageContentFile( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + ) + + def testRbmMessageContentFile(self): + """Test RbmMessageContentFile""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RbmMessageContentFile) + assert instance.file_url == 'https://dev.bandwidth.com/images/bandwidth-logo.png' + assert instance.thumbnail_url == 'https://dev.bandwidth.com/images/bandwidth-logo.png' + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_rbm_message_content_text.py b/test/unit/models/test_rbm_message_content_text.py new file mode 100644 index 00000000..fe3492a1 --- /dev/null +++ b/test/unit/models/test_rbm_message_content_text.py @@ -0,0 +1,65 @@ +# 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.rbm_message_content_text import RbmMessageContentText +from bandwidth.models.multi_channel_action import MultiChannelAction +from bandwidth.models.rbm_action_base import RbmActionBase + +class TestRbmMessageContentText(unittest.TestCase): + """RbmMessageContentText unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RbmMessageContentText: + """Test RbmMessageContentText + 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 RbmMessageContentText( + text = 'Hello world', + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + ) + else: + return RbmMessageContentText( + text = 'Hello world', + ) + + def testRbmMessageContentText(self): + """Test RbmMessageContentText""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RbmMessageContentText) + assert instance.text == 'Hello world' + assert instance.suggestions is not None + assert isinstance(instance.suggestions, list) + assert isinstance(instance.suggestions[0], MultiChannelAction) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_rbm_message_media.py b/test/unit/models/test_rbm_message_media.py new file mode 100644 index 00000000..f2258aa8 --- /dev/null +++ b/test/unit/models/test_rbm_message_media.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.rbm_message_media import RbmMessageMedia +from bandwidth.models.rbm_message_content_file import RbmMessageContentFile +from bandwidth.models.multi_channel_action import MultiChannelAction +from bandwidth.models.rbm_action_base import RbmActionBase + +class TestRbmMessageMedia(unittest.TestCase): + """RbmMessageMedia unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RbmMessageMedia: + """Test RbmMessageMedia + 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 RbmMessageMedia( + media = RbmMessageContentFile( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png' + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + ) + else: + return RbmMessageMedia( + media = RbmMessageContentFile( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png' + ), + ) + + def testRbmMessageMedia(self): + """Test RbmMessageMedia""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RbmMessageMedia) + assert instance.media is not None + assert isinstance(instance.media, RbmMessageContentFile) + assert instance.suggestions is not None + assert isinstance(instance.suggestions, list) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_rbm_standalone_card.py b/test/unit/models/test_rbm_standalone_card.py new file mode 100644 index 00000000..54b2e7b0 --- /dev/null +++ b/test/unit/models/test_rbm_standalone_card.py @@ -0,0 +1,108 @@ +# 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.rbm_standalone_card import RbmStandaloneCard +from bandwidth.models.rbm_card_content import RbmCardContent +from bandwidth.models.rbm_action_base import RbmActionBase +from bandwidth.models.multi_channel_action import MultiChannelAction +from bandwidth.models.rbm_card_content_media import RbmCardContentMedia + +class TestRbmStandaloneCard(unittest.TestCase): + """RbmStandaloneCard unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RbmStandaloneCard: + """Test RbmStandaloneCard + 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 RbmStandaloneCard( + orientation = 'VERTICAL', + thumbnail_image_alignment = 'LEFT', + card_content = RbmCardContent( + title = 'Bandwidth', + description = 'Bandwidth is a communications platform as a service (CPaaS) company.', + media = RbmCardContentMedia( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + height = 'SHORT' + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + ) + else: + return RbmStandaloneCard( + orientation = 'VERTICAL', + thumbnail_image_alignment = 'LEFT', + card_content = RbmCardContent( + title = 'Bandwidth', + description = 'Bandwidth is a communications platform as a service (CPaaS) company.', + media = None, + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + ) + ) + + def testRbmStandaloneCard(self): + """Test RbmStandaloneCard""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, RbmStandaloneCard) + assert instance.orientation == 'VERTICAL' + assert instance.thumbnail_image_alignment == 'LEFT' + assert isinstance(instance.card_content, RbmCardContent) + assert isinstance(instance.suggestions, list) + assert all(isinstance(suggestion, MultiChannelAction) for suggestion in instance.suggestions) + assert instance.card_content.title == 'Bandwidth' + assert instance.card_content.description == 'Bandwidth is a communications platform as a service (CPaaS) company.' + assert instance.card_content.media is not None + assert isinstance(instance.card_content.media, RbmCardContentMedia) + assert isinstance(instance.card_content.suggestions[0], MultiChannelAction) + assert isinstance(instance.suggestions[0], MultiChannelAction) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_sms_message_content.py b/test/unit/models/test_sms_message_content.py new file mode 100644 index 00000000..8f6aa6e7 --- /dev/null +++ b/test/unit/models/test_sms_message_content.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.sms_message_content import SmsMessageContent + +class TestSmsMessageContent(unittest.TestCase): + """SmsMessageContent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SmsMessageContent: + """Test SmsMessageContent + 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 SmsMessageContent( + text = 'Hello world' + ) + else: + return SmsMessageContent( + text = 'Hello world', + ) + + def testSmsMessageContent(self): + """Test SmsMessageContent""" + instance = self.make_instance(True) + assert instance is not None + assert isinstance(instance, SmsMessageContent) + assert instance.text == 'Hello world' + +if __name__ == '__main__': + unittest.main() From 531d44e4beef6029e60b812c7a3338da32e9e34a Mon Sep 17 00:00:00 2001 From: ckoegel Date: Fri, 9 May 2025 15:01:47 -0400 Subject: [PATCH 4/7] polymorphism unit tests --- test/unit/models/test_multi_channel_action.py | 95 +++++++++++++ ...lti_channel_channel_list_object_content.py | 126 ++++++++++++++++++ .../test_rbm_message_content_rich_card.py | 115 ++++++++++++++++ 3 files changed, 336 insertions(+) create mode 100644 test/unit/models/test_multi_channel_action.py create mode 100644 test/unit/models/test_multi_channel_channel_list_object_content.py create mode 100644 test/unit/models/test_rbm_message_content_rich_card.py diff --git a/test/unit/models/test_multi_channel_action.py b/test/unit/models/test_multi_channel_action.py new file mode 100644 index 00000000..6f7ec1c7 --- /dev/null +++ b/test/unit/models/test_multi_channel_action.py @@ -0,0 +1,95 @@ +# 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_action import MultiChannelAction +from bandwidth.models.rbm_action_base import RbmActionBase +from bandwidth.models.rbm_action_dial import RbmActionDial +from bandwidth.models.rbm_action_open_url import RbmActionOpenUrl +from bandwidth.models.rbm_action_view_location import RbmActionViewLocation +from bandwidth.models.multi_channel_action_calendar_event import MultiChannelActionCalendarEvent + +class TestMultiChannelAction(unittest.TestCase): + """MultiChannelAction unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultiChannelAction: + """Test MultiChannelAction + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + + def testMultiChannelAction(self): + """Test MultiChannelAction""" + model_rbm_action_base = MultiChannelAction(RbmActionBase( + type='REPLY', + text='Hello world', + post_back_data='[B@32298473' + )) + model_rbm_action_dial = MultiChannelAction(RbmActionDial( + type='DIAL_PHONE', + text='Hello world', + post_back_data='[B@32298473', + phone_number='1234567890' + )) + model_rbm_action_view_location = MultiChannelAction(RbmActionViewLocation( + type='SHOW_LOCATION', + text='Hello world', + post_back_data='[B@32298473', + latitude='37.7749', + longitude='-122.4194', + label='San Francisco' + )) + model_multi_channel_action_calendar_event = MultiChannelAction(MultiChannelActionCalendarEvent( + type = 'CREATE_CALENDAR_EVENT', + text = 'Hello world', + post_back_data = 'U0dWc2JHOGdkMjl5YkdRPQ==', + title = 'Meeting with John', + start_time = '2022-09-14T18:20:16Z', + end_time = '2022-09-14T18:20:16Z', + description = 'Discuss the new project' + )) + model_rbm_action_open_url = MultiChannelAction(RbmActionOpenUrl( + type='OPEN_URL', + text='Hello world', + post_back_data='[B@32298473', + url='https://www.example.com' + )) + + assert model_rbm_action_base is not None + assert isinstance(model_rbm_action_base, MultiChannelAction) + assert isinstance(model_rbm_action_base.actual_instance, RbmActionBase) + assert model_rbm_action_dial is not None + assert isinstance(model_rbm_action_dial, MultiChannelAction) + assert isinstance(model_rbm_action_dial.actual_instance, RbmActionDial) + assert model_rbm_action_view_location is not None + assert isinstance(model_rbm_action_view_location, MultiChannelAction) + assert isinstance(model_rbm_action_view_location.actual_instance, RbmActionViewLocation) + assert model_multi_channel_action_calendar_event is not None + assert isinstance(model_multi_channel_action_calendar_event, MultiChannelAction) + assert isinstance(model_multi_channel_action_calendar_event.actual_instance, MultiChannelActionCalendarEvent) + assert model_rbm_action_open_url is not None + assert isinstance(model_rbm_action_open_url, MultiChannelAction) + assert isinstance(model_rbm_action_open_url.actual_instance, RbmActionOpenUrl) + + +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 new file mode 100644 index 00000000..aee17472 --- /dev/null +++ b/test/unit/models/test_multi_channel_channel_list_object_content.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 + + +import unittest + +from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent +from bandwidth.models.rbm_message_content_text import RbmMessageContentText +from bandwidth.models.rbm_message_media import RbmMessageMedia +from bandwidth.models.rbm_message_content_rich_card import RbmMessageContentRichCard +from bandwidth.models.sms_message_content import SmsMessageContent +from bandwidth.models.mms_message_content import MmsMessageContent +from bandwidth.models.multi_channel_action import MultiChannelAction +from bandwidth.models.rbm_action_base import RbmActionBase +from bandwidth.models.rbm_card_content_media import RbmCardContentMedia +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 + + +class TestMultiChannelChannelListObjectContent(unittest.TestCase): + """MultiChannelChannelListObjectContent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultiChannelChannelListObjectContent: + """Test MultiChannelChannelListObjectContent + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + + + def testMultiChannelChannelListObjectContent(self): + """Test MultiChannelChannelListObjectContent""" + model_rbm_message_content_text = MultiChannelChannelListObjectContent(RbmMessageContentText( + text = 'Hello world', + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + )) + model_rbm_message_media = MultiChannelChannelListObjectContent(RbmMessageMedia( + media = RbmMessageContentFile( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png' + ) + )) + model_rbm_message_content_rich_card = MultiChannelChannelListObjectContent(RbmMessageContentRichCard( + RbmStandaloneCard( + orientation = 'VERTICAL', + thumbnail_image_alignment = 'LEFT', + card_content = RbmCardContent( + title = 'Bandwidth', + description = 'Bandwidth is a communications platform as a service (CPaaS) company.', + media = RbmCardContentMedia( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + height = 'SHORT' + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + ) + )) + model_sms_message_content = MultiChannelChannelListObjectContent(SmsMessageContent( + text = 'Hello world' + )) + 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"] + )) + + assert model_rbm_message_content_text is not None + assert isinstance(model_rbm_message_content_text, MultiChannelChannelListObjectContent) + assert isinstance(model_rbm_message_content_text.actual_instance, RbmMessageContentText) + assert model_rbm_message_media is not None + assert isinstance(model_rbm_message_media, MultiChannelChannelListObjectContent) + assert isinstance(model_rbm_message_media.actual_instance, RbmMessageMedia) + assert model_rbm_message_content_rich_card is not None + assert isinstance(model_rbm_message_content_rich_card, MultiChannelChannelListObjectContent) + assert isinstance(model_rbm_message_content_rich_card.actual_instance, RbmMessageContentRichCard) + assert model_sms_message_content is not None + assert isinstance(model_sms_message_content, MultiChannelChannelListObjectContent) + assert isinstance(model_sms_message_content.actual_instance, SmsMessageContent) + assert model_mms_message_content is not None + assert isinstance(model_mms_message_content, MultiChannelChannelListObjectContent) + assert isinstance(model_mms_message_content.actual_instance, MmsMessageContent) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/models/test_rbm_message_content_rich_card.py b/test/unit/models/test_rbm_message_content_rich_card.py new file mode 100644 index 00000000..cf3b33fc --- /dev/null +++ b/test/unit/models/test_rbm_message_content_rich_card.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Bandwidth + + Bandwidth's Communication APIs + + The version of the OpenAPI document: 1.0.0 + Contact: letstalk@bandwidth.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from bandwidth.models.rbm_message_content_rich_card import RbmMessageContentRichCard +from bandwidth.models.rbm_standalone_card import RbmStandaloneCard +from bandwidth.models.rbm_message_carousel_card import RbmMessageCarouselCard +from bandwidth.models.rbm_card_content import RbmCardContent +from bandwidth.models.rbm_card_content_media import RbmCardContentMedia +from bandwidth.models.multi_channel_action import MultiChannelAction +from bandwidth.models.rbm_action_base import RbmActionBase + +class TestRbmMessageContentRichCard(unittest.TestCase): + """RbmMessageContentRichCard unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RbmMessageContentRichCard: + """Test RbmMessageContentRichCard + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + + def testRbmMessageContentRichCard(self): + """Test RbmMessageContentRichCard""" + model_rbm_standalone_card = RbmMessageContentRichCard(RbmStandaloneCard( + orientation = 'VERTICAL', + thumbnail_image_alignment = 'LEFT', + card_content = RbmCardContent( + title = 'Bandwidth', + description = 'Bandwidth is a communications platform as a service (CPaaS) company.', + media = RbmCardContentMedia( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + height = 'SHORT' + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + )) + model_rbm_message_carousel_card = RbmMessageContentRichCard(RbmMessageCarouselCard( + card_width = 'SMALL', + card_contents = [ + RbmCardContent( + title = 'Bandwidth', + description = 'Bandwidth is a communications platform as a service (CPaaS) company.', + media = RbmCardContentMedia( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + height = 'SHORT' + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ], + ) + ], + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + post_back_data = '[B@32298473' + ) + ) + ] + )) + + assert model_rbm_standalone_card is not None + assert isinstance(model_rbm_standalone_card, RbmMessageContentRichCard) + assert isinstance(model_rbm_standalone_card.actual_instance, RbmStandaloneCard) + assert model_rbm_message_carousel_card is not None + assert isinstance(model_rbm_message_carousel_card, RbmMessageContentRichCard) + assert isinstance(model_rbm_message_carousel_card.actual_instance, RbmMessageCarouselCard) + +if __name__ == '__main__': + unittest.main() From d212a5b4bcba69450437b4e1cf1630427d844d57 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Fri, 9 May 2025 15:14:17 -0400 Subject: [PATCH 5/7] unit api test --- test/unit/api/test_multi_channel_api.py | 71 +++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 test/unit/api/test_multi_channel_api.py diff --git a/test/unit/api/test_multi_channel_api.py b/test/unit/api/test_multi_channel_api.py new file mode 100644 index 00000000..386f6b0f --- /dev/null +++ b/test/unit/api/test_multi_channel_api.py @@ -0,0 +1,71 @@ +# 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 hamcrest import * +from test.utils.env_variables import * +from bandwidth import ApiClient, Configuration +from bandwidth.api.multi_channel_api import MultiChannelApi +from bandwidth.models.multi_channel_message_request import MultiChannelMessageRequest +from bandwidth.models.multi_channel_channel_list_object import MultiChannelChannelListObject +from bandwidth.models.sms_message_content import SmsMessageContent +from bandwidth.models.multi_channel_message_channel_enum import MultiChannelMessageChannelEnum +from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent + + +class TestMultiChannelApi(unittest.TestCase): + """MultiChannelApi unit test stubs""" + + def setUp(self) -> None: + configuration = Configuration( + username=BW_USERNAME, + password=BW_PASSWORD, + host='http://127.0.0.1:4010', + ignore_operation_servers=True + ) + api_client = ApiClient(configuration) + self.multi_channel_api_instance = MultiChannelApi(api_client) + + @unittest.skip("skip because prism can't handle a oneOf with differing required fields") + def test_create_multi_channel_message(self) -> None: + """Test case for create_multi_channel_message + + Create Multi-Channel Message + """ + + channel_list_item = MultiChannelChannelListObject( + var_from = BW_NUMBER, + application_id = BW_MESSAGING_APPLICATION_ID, + channel = MultiChannelMessageChannelEnum('SMS'), + content = MultiChannelChannelListObjectContent( + SmsMessageContent( + text = 'Hello, this is a test message.', + ) + ) + ) + multi_channel_message_request = MultiChannelMessageRequest( + to = USER_NUMBER, + channel_list = [channel_list_item], + tag = 'tag', + priority = 'high', + expiration = '2023-10-01T00:00:00Z', + ) + + response = self.multi_channel_api_instance.create_multi_channel_message_with_http_info(BW_ACCOUNT_ID, multi_channel_message_request) + assert_that(response.status_code, equal_to(202)) + +if __name__ == '__main__': + unittest.main() From a206ce763d9ff190b55a3837510e1b2e4203b811 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Fri, 9 May 2025 15:30:32 -0400 Subject: [PATCH 6/7] multi_channel smoke test --- test/smoke/test_multi_channel_api.py | 75 ++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 test/smoke/test_multi_channel_api.py diff --git a/test/smoke/test_multi_channel_api.py b/test/smoke/test_multi_channel_api.py new file mode 100644 index 00000000..be20cb44 --- /dev/null +++ b/test/smoke/test_multi_channel_api.py @@ -0,0 +1,75 @@ +# 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, timedelta +from zoneinfo import ZoneInfo + +from hamcrest import * +from test.utils.env_variables import * +from bandwidth import ApiClient, Configuration +from bandwidth.api.multi_channel_api import MultiChannelApi +from bandwidth.models.multi_channel_message_request import MultiChannelMessageRequest +from bandwidth.models.multi_channel_channel_list_object import MultiChannelChannelListObject +from bandwidth.models.multi_channel_message_channel_enum import MultiChannelMessageChannelEnum +from bandwidth.models.rbm_message_content_text import RbmMessageContentText +from bandwidth.models.multi_channel_channel_list_object_content import MultiChannelChannelListObjectContent + + +class TestMultiChannelApi(unittest.TestCase): + """MultiChannelApi unit test stubs""" + + def setUp(self) -> None: + configuration = Configuration( + username=BW_USERNAME, + password=BW_PASSWORD, + ) + api_client = ApiClient(configuration) + self.multi_channel_api_instance = MultiChannelApi(api_client) + + self.expiration = datetime.now(ZoneInfo('America/New_York')) + timedelta(minutes=1) + + def test_create_multi_channel_message(self) -> None: + """Test case for create_multi_channel_message + + Create Multi-Channel Message + """ + + channel_list_item = MultiChannelChannelListObject( + var_from = BW_NUMBER, + application_id = BW_MESSAGING_APPLICATION_ID, + channel = MultiChannelMessageChannelEnum('RBM'), + content = MultiChannelChannelListObjectContent( + RbmMessageContentText( + text = 'Hello, this is a test message.', + ) + ) + ) + multi_channel_message_request = MultiChannelMessageRequest( + to = USER_NUMBER, + channel_list = [channel_list_item], + tag = 'tag', + priority = 'high', + expiration = self.expiration + ) + + response = self.multi_channel_api_instance.create_multi_channel_message_with_http_info( + BW_ACCOUNT_ID, + multi_channel_message_request + ) + assert_that(response.status_code, equal_to(202)) + +if __name__ == '__main__': + unittest.main() From c5006cbc96add093c155448d3552344a31ae8171 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Fri, 9 May 2025 15:33:41 -0400 Subject: [PATCH 7/7] pv smoke test updates --- test/smoke/test_conferences_api.py | 4 ++++ test/smoke/test_recordings_api.py | 1 + test/smoke/test_transcriptions_api.py | 1 + 3 files changed, 6 insertions(+) diff --git a/test/smoke/test_conferences_api.py b/test/smoke/test_conferences_api.py index 4af01266..53f9f9d7 100644 --- a/test/smoke/test_conferences_api.py +++ b/test/smoke/test_conferences_api.py @@ -248,6 +248,7 @@ def test_conference_and_members(self): BW_ACCOUNT_ID, call_id, update_call ) + @unittest.skip("PV Issues") def test_conference_recordings(self) -> None: """ Tests a successful flow of creating a call with a recording. @@ -410,6 +411,7 @@ def test_update_conference_forbidden(self) -> None: self.assertApiException(context, ForbiddenException, 403) + @unittest.skip("PV Issues") def test_update_conference_not_found(self) -> None: with self.assertRaises(NotFoundException) as context: self.conference_api_instance.update_conference( @@ -431,6 +433,7 @@ def test_update_conference_bxml_forbidden(self) -> None: self.assertApiException(context, ForbiddenException, 403) + @unittest.skip("PV Issues") def test_update_conference_bxml_not_found(self) -> None: with self.assertRaises(NotFoundException) as context: self.conference_api_instance.update_conference_bxml( @@ -452,6 +455,7 @@ def test_update_conference_member_forbidden(self) -> None: self.assertApiException(context, ForbiddenException, 403) + @unittest.skip("PV Issues") def test_update_conference_member_not_found(self) -> None: with self.assertRaises(NotFoundException) as context: self.conference_api_instance.update_conference_member( diff --git a/test/smoke/test_recordings_api.py b/test/smoke/test_recordings_api.py index 4415f2c9..b6bbbd9c 100644 --- a/test/smoke/test_recordings_api.py +++ b/test/smoke/test_recordings_api.py @@ -496,6 +496,7 @@ def test_4xx_errors(self) -> None: assert_that(calling(self.recordings_api_instance.delete_recording).with_args( BW_ACCOUNT_ID, call_id, "not a recording id"), raises(NotFoundException)) + @unittest.skip("PV Issues") def test_invalid_update_call_recording_state(self) -> None: """ Tests invalid flows for update_call_recording_state diff --git a/test/smoke/test_transcriptions_api.py b/test/smoke/test_transcriptions_api.py index 847685a6..61c2aaa6 100644 --- a/test/smoke/test_transcriptions_api.py +++ b/test/smoke/test_transcriptions_api.py @@ -144,6 +144,7 @@ def _steps(self): for name in call_order: yield name, getattr(self, name) + @unittest.skip("PV Issues") def test_steps(self) -> None: """Test each function from _steps.call_order in specified order """