From 53548fa991654a7f1acd68e25bcb3f2759447ebf Mon Sep 17 00:00:00 2001 From: DX-Bandwidth Date: Tue, 8 Apr 2025 14:06:56 +0000 Subject: [PATCH] Generate SDK with OpenAPI Generator Version --- .openapi-generator/FILES | 70 +- README.md | 35 +- bandwidth.yml | 633 ++++++++++++++++-- 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 | 108 +++ 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 | 30 + 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, 5430 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..7990bbfd 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,490 @@ 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: + type: object + properties: + height: + $ref: '#/components/schemas/rbmMediaHeightEnum' + file: + $ref: '#/components/schemas/rbmMessageContentFile' + required: + - height + - file + 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 +3292,7 @@ components: type: object properties: applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' accountId: $ref: '#/components/schemas/accountId' callId: @@ -3404,7 +3900,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3441,7 +3937,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3481,7 +3977,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3662,7 +4158,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3702,7 +4198,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3742,7 +4238,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3786,7 +4282,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3820,7 +4316,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3856,7 +4352,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3906,7 +4402,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3956,7 +4452,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -3994,7 +4490,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -4047,7 +4543,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -4086,7 +4582,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -4132,7 +4628,7 @@ components: accountId: $ref: '#/components/schemas/accountId' applicationId: - $ref: '#/components/schemas/applicationId' + $ref: '#/components/schemas/applicationId1' from: $ref: '#/components/schemas/from' to: @@ -4188,7 +4684,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 +5814,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 +7079,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 +7486,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..a637c086 --- /dev/null +++ b/bandwidth/models/rbm_card_content_media.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 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from bandwidth.models.rbm_media_height_enum import RbmMediaHeightEnum +from bandwidth.models.rbm_message_content_file import RbmMessageContentFile +from typing import Optional, Set +from typing_extensions import Self + +class RbmCardContentMedia(BaseModel): + """ + RbmCardContentMedia + """ # noqa: E501 + height: RbmMediaHeightEnum + file: RbmMessageContentFile + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["height", "file"] + + 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, + ) + # override the default output from pydantic by calling `to_dict()` of file + if self.file: + _dict['file'] = self.file.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 RbmCardContentMedia from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "height": obj.get("height"), + "file": RbmMessageContentFile.from_dict(obj["file"]) if obj.get("file") 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_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..f36c9157 --- /dev/null +++ b/docs/RbmCardContentMedia.md @@ -0,0 +1,30 @@ +# RbmCardContentMedia + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**height** | [**RbmMediaHeightEnum**](RbmMediaHeightEnum.md) | | +**file** | [**RbmMessageContentFile**](RbmMessageContentFile.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) + +