diff --git a/bandwidth.yml b/bandwidth.yml index 84e00b33..5927a5e8 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -2436,6 +2436,7 @@ components: - media rbmCardContent: type: object + description: Must contain at least one of title, description, or media to be valid. properties: title: type: string @@ -2478,7 +2479,6 @@ components: $ref: '#/components/schemas/multiChannelFullActions' required: - orientation - - thumbnailImageAlignment - cardContent standaloneCardOrientationEnum: type: string @@ -2489,8 +2489,8 @@ components: thumbnailAlignmentEnum: type: string description: >- - The alignment of the thumbnail image in the card. Only applicable if the - card using horizontal orientation. + The alignment of the thumbnail image in the card. Required when + orientation is HORIZONTAL. enum: - LEFT - RIGHT @@ -2505,6 +2505,7 @@ components: type: array items: $ref: '#/components/schemas/rbmCardContent' + minItems: 2 maxItems: 10 suggestions: $ref: '#/components/schemas/multiChannelFullActions' @@ -2568,7 +2569,11 @@ components: type: string description: >- Defines the layout of the WebView on a mobile device. It must be defined - when application is set to `WEBVIEW` + + when application is set to `WEBVIEW` and must not be set when + application + + is set to `BROWSER`. - `FULL` WebView takes the full screen. @@ -2626,12 +2631,16 @@ components: latitude: type: string format: double - description: The latitude of the location. + description: >- + The latitude of the location. Must be in range [-90.000000, + 90.000000]. example: '37.7749' longitude: type: string format: double - description: The longitude of the location. + description: >- + The longitude of the location. Must be in range [-180.000000, + 180.000000]. example: '-122.4194' label: type: string @@ -2655,12 +2664,16 @@ components: startTime: type: string format: date-time - description: The start time of the event. + description: >- + The start time of the event. Must be a valid RFC-3339 value, + e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. example: 2022-09-14T18:20:16.000Z endTime: type: string format: date-time - description: The end time of the event. + description: >- + The end time of the event. Must be a valid RFC-3339 value, e.g., + 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. example: 2022-09-14T18:20:16.000Z description: type: string @@ -2680,7 +2693,7 @@ components: url: type: string format: uri - description: The URL to open in browser. + description: The URL to open in browser. Must use http:// or https:// scheme. example: https://dev.bandwidth.com maxLength: 2048 application: diff --git a/bandwidth/models/multi_channel_action_calendar_event.py b/bandwidth/models/multi_channel_action_calendar_event.py index 1a1d82cb..bf3f67ae 100644 --- a/bandwidth/models/multi_channel_action_calendar_event.py +++ b/bandwidth/models/multi_channel_action_calendar_event.py @@ -34,8 +34,8 @@ class MultiChannelActionCalendarEvent(BaseModel): text: Annotated[str, Field(strict=True, max_length=25)] = Field(description="Displayed text for user to click") postback_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData") title: Annotated[str, Field(strict=True, max_length=100)] = Field(description="The title of the event.") - start_time: datetime = Field(description="The start time of the event.", alias="startTime") - end_time: datetime = Field(description="The end time of the event.", alias="endTime") + start_time: datetime = Field(description="The start time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00.", alias="startTime") + end_time: datetime = Field(description="The end time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00.", 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"] diff --git a/bandwidth/models/rbm_action_open_url.py b/bandwidth/models/rbm_action_open_url.py index ec6dca2a..0e743910 100644 --- a/bandwidth/models/rbm_action_open_url.py +++ b/bandwidth/models/rbm_action_open_url.py @@ -34,7 +34,7 @@ class RbmActionOpenUrl(BaseModel): type: RbmActionTypeEnum text: Annotated[str, Field(strict=True, max_length=25)] = Field(description="Displayed text for user to click") postback_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData") - url: Annotated[str, Field(strict=True, max_length=2048)] = Field(description="The URL to open in browser.") + url: Annotated[str, Field(strict=True, max_length=2048)] = Field(description="The URL to open in browser. Must use http:// or https:// scheme.") application: Optional[RbmOpenUrlEnum] = None webview_view_mode: Optional[RbmWebViewEnum] = Field(default=None, alias="webviewViewMode") additional_properties: Dict[str, Any] = {} diff --git a/bandwidth/models/rbm_action_view_location.py b/bandwidth/models/rbm_action_view_location.py index 8a215b17..c2708fbe 100644 --- a/bandwidth/models/rbm_action_view_location.py +++ b/bandwidth/models/rbm_action_view_location.py @@ -32,8 +32,8 @@ class RbmActionViewLocation(BaseModel): type: RbmActionTypeEnum text: Annotated[str, Field(strict=True, max_length=25)] = Field(description="Displayed text for user to click") postback_data: Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]] = Field(description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData") - latitude: StrictStr = Field(description="The latitude of the location.") - longitude: StrictStr = Field(description="The longitude of the location.") + latitude: StrictStr = Field(description="The latitude of the location. Must be in range [-90.000000, 90.000000].") + longitude: StrictStr = Field(description="The longitude of the location. Must be in range [-180.000000, 180.000000].") 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"] diff --git a/bandwidth/models/rbm_card_content.py b/bandwidth/models/rbm_card_content.py index a8888b08..2a39f30b 100644 --- a/bandwidth/models/rbm_card_content.py +++ b/bandwidth/models/rbm_card_content.py @@ -28,7 +28,7 @@ class RbmCardContent(BaseModel): """ - RbmCardContent + Must contain at least one of title, description, or media to be valid. """ # 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.") diff --git a/bandwidth/models/rbm_message_carousel_card.py b/bandwidth/models/rbm_message_carousel_card.py index 7bf9ed39..1335a5aa 100644 --- a/bandwidth/models/rbm_message_carousel_card.py +++ b/bandwidth/models/rbm_message_carousel_card.py @@ -32,7 +32,7 @@ class RbmMessageCarouselCard(BaseModel): RbmMessageCarouselCard """ # noqa: E501 card_width: CardWidthEnum = Field(alias="cardWidth") - card_contents: Annotated[List[RbmCardContent], Field(max_length=10)] = Field(alias="cardContents") + card_contents: Annotated[List[RbmCardContent], Field(min_length=2, 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"] diff --git a/bandwidth/models/rbm_standalone_card.py b/bandwidth/models/rbm_standalone_card.py index f316aa0f..8757cd19 100644 --- a/bandwidth/models/rbm_standalone_card.py +++ b/bandwidth/models/rbm_standalone_card.py @@ -33,7 +33,7 @@ class RbmStandaloneCard(BaseModel): RbmStandaloneCard """ # noqa: E501 orientation: StandaloneCardOrientationEnum - thumbnail_image_alignment: ThumbnailAlignmentEnum = Field(alias="thumbnailImageAlignment") + thumbnail_image_alignment: Optional[ThumbnailAlignmentEnum] = Field(default=None, 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] = {} diff --git a/bandwidth/models/rbm_web_view_enum.py b/bandwidth/models/rbm_web_view_enum.py index 71f697c2..8283b828 100644 --- a/bandwidth/models/rbm_web_view_enum.py +++ b/bandwidth/models/rbm_web_view_enum.py @@ -21,7 +21,7 @@ class RbmWebViewEnum(str, Enum): """ - Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. + Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` and must not be set when application is set to `BROWSER`. - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. """ """ diff --git a/bandwidth/models/thumbnail_alignment_enum.py b/bandwidth/models/thumbnail_alignment_enum.py index 0c019895..4b14b884 100644 --- a/bandwidth/models/thumbnail_alignment_enum.py +++ b/bandwidth/models/thumbnail_alignment_enum.py @@ -21,7 +21,7 @@ class ThumbnailAlignmentEnum(str, Enum): """ - The alignment of the thumbnail image in the card. Only applicable if the card using horizontal orientation. + The alignment of the thumbnail image in the card. Required when orientation is HORIZONTAL. """ """ diff --git a/docs/MultiChannelAction.md b/docs/MultiChannelAction.md index 1f08cadf..5900a198 100644 --- a/docs/MultiChannelAction.md +++ b/docs/MultiChannelAction.md @@ -9,14 +9,14 @@ Name | Type | Description | Notes **text** | **str** | Displayed text for user to click | **postback_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | **phone_number** | **str** | The phone number to dial. Must be E164 format. | -**latitude** | **float** | The latitude of the location. | -**longitude** | **float** | The longitude of the location. | +**latitude** | **float** | The latitude of the location. Must be in range [-90.000000, 90.000000]. | +**longitude** | **float** | The longitude of the location. Must be in range [-180.000000, 180.000000]. | **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. | +**start_time** | **datetime** | The start time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. | +**end_time** | **datetime** | The end time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. | **description** | **str** | The description of the event. | [optional] -**url** | **str** | The URL to open in browser. | +**url** | **str** | The URL to open in browser. Must use http:// or https:// scheme. | **application** | [**RbmOpenUrlEnum**](RbmOpenUrlEnum.md) | | [optional] **webview_view_mode** | [**RbmWebViewEnum**](RbmWebViewEnum.md) | | [optional] diff --git a/docs/MultiChannelActionCalendarEvent.md b/docs/MultiChannelActionCalendarEvent.md index 5f12d364..4ded4b68 100644 --- a/docs/MultiChannelActionCalendarEvent.md +++ b/docs/MultiChannelActionCalendarEvent.md @@ -9,8 +9,8 @@ Name | Type | Description | Notes **text** | **str** | Displayed text for user to click | **postback_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | **title** | **str** | The title of the event. | -**start_time** | **datetime** | The start time of the event. | -**end_time** | **datetime** | The end time of the event. | +**start_time** | **datetime** | The start time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. | +**end_time** | **datetime** | The end time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. | **description** | **str** | The description of the event. | [optional] ## Example diff --git a/docs/MultiChannelChannelListRBMObjectAllOfContent.md b/docs/MultiChannelChannelListRBMObjectAllOfContent.md index acfe5a4b..8b46303d 100644 --- a/docs/MultiChannelChannelListRBMObjectAllOfContent.md +++ b/docs/MultiChannelChannelListRBMObjectAllOfContent.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **suggestions** | [**List[MultiChannelAction]**](MultiChannelAction.md) | An array of suggested actions for the recipient. | [optional] **media** | [**List[RbmMessageContentFile]**](RbmMessageContentFile.md) | | **orientation** | [**StandaloneCardOrientationEnum**](StandaloneCardOrientationEnum.md) | | -**thumbnail_image_alignment** | [**ThumbnailAlignmentEnum**](ThumbnailAlignmentEnum.md) | | +**thumbnail_image_alignment** | [**ThumbnailAlignmentEnum**](ThumbnailAlignmentEnum.md) | | [optional] **card_content** | [**RbmCardContent**](RbmCardContent.md) | | **card_width** | [**CardWidthEnum**](CardWidthEnum.md) | | **card_contents** | [**List[RbmCardContent]**](RbmCardContent.md) | | diff --git a/docs/RbmActionOpenUrl.md b/docs/RbmActionOpenUrl.md index d42aa2b3..d71fd352 100644 --- a/docs/RbmActionOpenUrl.md +++ b/docs/RbmActionOpenUrl.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | **text** | **str** | Displayed text for user to click | **postback_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | -**url** | **str** | The URL to open in browser. | +**url** | **str** | The URL to open in browser. Must use http:// or https:// scheme. | **application** | [**RbmOpenUrlEnum**](RbmOpenUrlEnum.md) | | [optional] **webview_view_mode** | [**RbmWebViewEnum**](RbmWebViewEnum.md) | | [optional] diff --git a/docs/RbmActionViewLocation.md b/docs/RbmActionViewLocation.md index 353c2427..60d2c4ef 100644 --- a/docs/RbmActionViewLocation.md +++ b/docs/RbmActionViewLocation.md @@ -8,8 +8,8 @@ Name | Type | Description | Notes **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | **text** | **str** | Displayed text for user to click | **postback_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | -**latitude** | **float** | The latitude of the location. | -**longitude** | **float** | The longitude of the location. | +**latitude** | **float** | The latitude of the location. Must be in range [-90.000000, 90.000000]. | +**longitude** | **float** | The longitude of the location. Must be in range [-180.000000, 180.000000]. | **label** | **str** | The label of the location. | [optional] ## Example diff --git a/docs/RbmCardContent.md b/docs/RbmCardContent.md index 44bde90a..edc4bfcf 100644 --- a/docs/RbmCardContent.md +++ b/docs/RbmCardContent.md @@ -1,5 +1,6 @@ # RbmCardContent +Must contain at least one of title, description, or media to be valid. ## Properties diff --git a/docs/RbmMessageContentRichCard.md b/docs/RbmMessageContentRichCard.md index cc6941a6..797d602c 100644 --- a/docs/RbmMessageContentRichCard.md +++ b/docs/RbmMessageContentRichCard.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **orientation** | [**StandaloneCardOrientationEnum**](StandaloneCardOrientationEnum.md) | | -**thumbnail_image_alignment** | [**ThumbnailAlignmentEnum**](ThumbnailAlignmentEnum.md) | | +**thumbnail_image_alignment** | [**ThumbnailAlignmentEnum**](ThumbnailAlignmentEnum.md) | | [optional] **card_content** | [**RbmCardContent**](RbmCardContent.md) | | **suggestions** | [**List[MultiChannelAction]**](MultiChannelAction.md) | An array of suggested actions for the recipient. | [optional] **card_width** | [**CardWidthEnum**](CardWidthEnum.md) | | diff --git a/docs/RbmStandaloneCard.md b/docs/RbmStandaloneCard.md index ca2c9d7d..a28b6ccb 100644 --- a/docs/RbmStandaloneCard.md +++ b/docs/RbmStandaloneCard.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **orientation** | [**StandaloneCardOrientationEnum**](StandaloneCardOrientationEnum.md) | | -**thumbnail_image_alignment** | [**ThumbnailAlignmentEnum**](ThumbnailAlignmentEnum.md) | | +**thumbnail_image_alignment** | [**ThumbnailAlignmentEnum**](ThumbnailAlignmentEnum.md) | | [optional] **card_content** | [**RbmCardContent**](RbmCardContent.md) | | **suggestions** | [**List[MultiChannelAction]**](MultiChannelAction.md) | An array of suggested actions for the recipient. | [optional] diff --git a/docs/RbmWebViewEnum.md b/docs/RbmWebViewEnum.md index b794fcb5..a4fe7f29 100644 --- a/docs/RbmWebViewEnum.md +++ b/docs/RbmWebViewEnum.md @@ -1,6 +1,6 @@ # RbmWebViewEnum -Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. +Defines the layout of the WebView on a mobile device. It must be defined when application is set to `WEBVIEW` and must not be set when application is set to `BROWSER`. - `FULL` WebView takes the full screen. - `HALF` WebView takes half of the screen. - `TALL` WebView takes three-quarters of the screen. ## Enum diff --git a/docs/ThumbnailAlignmentEnum.md b/docs/ThumbnailAlignmentEnum.md index 21b2e5ea..36d86e4d 100644 --- a/docs/ThumbnailAlignmentEnum.md +++ b/docs/ThumbnailAlignmentEnum.md @@ -1,6 +1,6 @@ # ThumbnailAlignmentEnum -The alignment of the thumbnail image in the card. Only applicable if the card using horizontal orientation. +The alignment of the thumbnail image in the card. Required when orientation is HORIZONTAL. ## Enum diff --git a/test/unit/models/test_rbm_message_carousel_card.py b/test/unit/models/test_rbm_message_carousel_card.py index e8df3999..66a12c12 100644 --- a/test/unit/models/test_rbm_message_carousel_card.py +++ b/test/unit/models/test_rbm_message_carousel_card.py @@ -39,6 +39,24 @@ def make_instance(self, include_optional) -> RbmMessageCarouselCard: return RbmMessageCarouselCard( card_width = 'SMALL', card_contents = [ + RbmCardContent( + title = 'Bandwidth', + description = 'Bandwidth is a communications platform as a service (CPaaS) company.', + media = RbmCardContentMedia( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + height = 'SHORT' + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + postback_data = '[B@32298473' + ) + ) + ], + ), RbmCardContent( title = 'Bandwidth', description = 'Bandwidth is a communications platform as a service (CPaaS) company.', @@ -72,6 +90,24 @@ def make_instance(self, include_optional) -> RbmMessageCarouselCard: return RbmMessageCarouselCard( card_width = 'SMALL', card_contents = [ + RbmCardContent( + title = 'Bandwidth', + description = 'Bandwidth is a communications platform as a service (CPaaS) company.', + media = RbmCardContentMedia( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + height = 'SHORT' + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + postback_data = '[B@32298473' + ) + ) + ], + ), RbmCardContent( title = 'Bandwidth', description = 'Bandwidth is a communications platform as a service (CPaaS) company.', diff --git a/test/unit/models/test_rbm_message_content_rich_card.py b/test/unit/models/test_rbm_message_content_rich_card.py index 6275004d..6cdd869c 100644 --- a/test/unit/models/test_rbm_message_content_rich_card.py +++ b/test/unit/models/test_rbm_message_content_rich_card.py @@ -74,6 +74,24 @@ def testRbmMessageContentRichCard(self): model_rbm_message_carousel_card = RbmMessageContentRichCard(RbmMessageCarouselCard( card_width = 'SMALL', card_contents = [ + RbmCardContent( + title = 'Bandwidth', + description = 'Bandwidth is a communications platform as a service (CPaaS) company.', + media = RbmCardContentMedia( + file_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + thumbnail_url = 'https://dev.bandwidth.com/images/bandwidth-logo.png', + height = 'SHORT' + ), + suggestions = [ + MultiChannelAction( + RbmActionBase( + type = 'REPLY', + text = 'Hello world', + postback_data = '[B@32298473' + ) + ) + ], + ), RbmCardContent( title = 'Bandwidth', description = 'Bandwidth is a communications platform as a service (CPaaS) company.',