diff --git a/bandwidth.yml b/bandwidth.yml index 84e00b3..5927a5e 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/docs/MultiChannelAction.md b/docs/MultiChannelAction.md index 6209fce..2dd7101 100644 --- a/docs/MultiChannelAction.md +++ b/docs/MultiChannelAction.md @@ -8,14 +8,14 @@ | **text** | **String** | Displayed text for user to click | | | **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | | | **phone_number** | **String** | 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** | **String** | The label of the location. | [optional] | | **title** | **String** | The title of the event. | | -| **start_time** | **Time** | The start time of the event. | | -| **end_time** | **Time** | The end time of the event. | | +| **start_time** | **Time** | 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** | **Time** | 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** | **String** | The description of the event. | [optional] | -| **url** | **String** | The URL to open in browser. | | +| **url** | **String** | 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 210f98c..d493b05 100644 --- a/docs/MultiChannelActionCalendarEvent.md +++ b/docs/MultiChannelActionCalendarEvent.md @@ -8,8 +8,8 @@ | **text** | **String** | Displayed text for user to click | | | **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | | | **title** | **String** | The title of the event. | | -| **start_time** | **Time** | The start time of the event. | | -| **end_time** | **Time** | The end time of the event. | | +| **start_time** | **Time** | 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** | **Time** | 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** | **String** | The description of the event. | [optional] | ## Example diff --git a/docs/RbmActionBase.md b/docs/RbmActionBase.md index a3e18df..59aa91c 100644 --- a/docs/RbmActionBase.md +++ b/docs/RbmActionBase.md @@ -16,7 +16,7 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmActionBase.new( type: null, text: Hello world, - postback_data: [B@1a99692 + postback_data: [B@3ecbfba1 ) ``` diff --git a/docs/RbmActionOpenUrl.md b/docs/RbmActionOpenUrl.md index 806d991..e03b865 100644 --- a/docs/RbmActionOpenUrl.md +++ b/docs/RbmActionOpenUrl.md @@ -7,7 +7,7 @@ | **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | | | **text** | **String** | Displayed text for user to click | | | **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | | -| **url** | **String** | The URL to open in browser. | | +| **url** | **String** | 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 e623961..8457bbd 100644 --- a/docs/RbmActionViewLocation.md +++ b/docs/RbmActionViewLocation.md @@ -7,8 +7,8 @@ | **type** | [**RbmActionTypeEnum**](RbmActionTypeEnum.md) | | | | **text** | **String** | Displayed text for user to click | | | **postback_data** | **String** | 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** | **String** | The label of the location. | [optional] | ## Example diff --git a/docs/RbmStandaloneCard.md b/docs/RbmStandaloneCard.md index 35d88d2..2e94374 100644 --- a/docs/RbmStandaloneCard.md +++ b/docs/RbmStandaloneCard.md @@ -5,7 +5,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** | [**Array<MultiChannelAction>**](MultiChannelAction.md) | An array of suggested actions for the recipient. | [optional] | diff --git a/docs/RbmSuggestionResponse.md b/docs/RbmSuggestionResponse.md index 4730a01..18b8afd 100644 --- a/docs/RbmSuggestionResponse.md +++ b/docs/RbmSuggestionResponse.md @@ -14,7 +14,7 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmSuggestionResponse.new( text: Yes, I would like to proceed, - postback_data: [B@1a99692 + postback_data: [B@3ecbfba1 ) ``` diff --git a/lib/bandwidth-sdk/configuration.rb b/lib/bandwidth-sdk/configuration.rb index 751eda9..010085e 100644 --- a/lib/bandwidth-sdk/configuration.rb +++ b/lib/bandwidth-sdk/configuration.rb @@ -217,7 +217,6 @@ def initialize body = JSON.parse(response.body) @access_token = body['access_token'] @access_token_expiration = Time.now + body['expires_in'] - @access_token } yield(self) if block_given? diff --git a/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb b/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb index b181880..0a7fa19 100644 --- a/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +++ b/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb @@ -26,10 +26,10 @@ class MultiChannelActionCalendarEvent < ApiModelBase # The title of the event. attr_accessor :title - # The start time of the event. + # 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. attr_accessor :start_time - # The end time of the event. + # 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. attr_accessor :end_time # The description of the event. diff --git a/lib/bandwidth-sdk/models/rbm_action_open_url.rb b/lib/bandwidth-sdk/models/rbm_action_open_url.rb index 0dbcf74..3fbebd7 100644 --- a/lib/bandwidth-sdk/models/rbm_action_open_url.rb +++ b/lib/bandwidth-sdk/models/rbm_action_open_url.rb @@ -23,7 +23,7 @@ class RbmActionOpenUrl < ApiModelBase # Base64 payload the customer receives when the reply is clicked. attr_accessor :postback_data - # The URL to open in browser. + # The URL to open in browser. Must use http:// or https:// scheme. attr_accessor :url attr_accessor :application diff --git a/lib/bandwidth-sdk/models/rbm_action_view_location.rb b/lib/bandwidth-sdk/models/rbm_action_view_location.rb index 90dd45f..211a54b 100644 --- a/lib/bandwidth-sdk/models/rbm_action_view_location.rb +++ b/lib/bandwidth-sdk/models/rbm_action_view_location.rb @@ -23,10 +23,10 @@ class RbmActionViewLocation < ApiModelBase # Base64 payload the customer receives when the reply is clicked. attr_accessor :postback_data - # The latitude of the location. + # The latitude of the location. Must be in range [-90.000000, 90.000000]. attr_accessor :latitude - # The longitude of the location. + # The longitude of the location. Must be in range [-180.000000, 180.000000]. attr_accessor :longitude # The label of the location. diff --git a/lib/bandwidth-sdk/models/rbm_card_content.rb b/lib/bandwidth-sdk/models/rbm_card_content.rb index bcbbe75..64234a2 100644 --- a/lib/bandwidth-sdk/models/rbm_card_content.rb +++ b/lib/bandwidth-sdk/models/rbm_card_content.rb @@ -14,6 +14,7 @@ require 'time' module Bandwidth + # Must contain at least one of title, description, or media to be valid. class RbmCardContent < ApiModelBase # The title of the card. Must be 200 characters or less. attr_accessor :title diff --git a/lib/bandwidth-sdk/models/rbm_message_carousel_card.rb b/lib/bandwidth-sdk/models/rbm_message_carousel_card.rb index 31e1e33..e402d3b 100644 --- a/lib/bandwidth-sdk/models/rbm_message_carousel_card.rb +++ b/lib/bandwidth-sdk/models/rbm_message_carousel_card.rb @@ -132,6 +132,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "card_contents", number of items must be less than or equal to 10.') end + if @card_contents.length < 2 + invalid_properties.push('invalid value for "card_contents", number of items must be greater than or equal to 2.') + end + if !@suggestions.nil? && @suggestions.length > 11 invalid_properties.push('invalid value for "suggestions", number of items must be less than or equal to 11.') end @@ -146,6 +150,7 @@ def valid? return false if @card_width.nil? return false if @card_contents.nil? return false if @card_contents.length > 10 + return false if @card_contents.length < 2 return false if !@suggestions.nil? && @suggestions.length > 11 true end @@ -171,6 +176,10 @@ def card_contents=(card_contents) fail ArgumentError, 'invalid value for "card_contents", number of items must be less than or equal to 10.' end + if card_contents.length < 2 + fail ArgumentError, 'invalid value for "card_contents", number of items must be greater than or equal to 2.' + end + @card_contents = card_contents end diff --git a/lib/bandwidth-sdk/models/rbm_standalone_card.rb b/lib/bandwidth-sdk/models/rbm_standalone_card.rb index e2dcc85..4462b19 100644 --- a/lib/bandwidth-sdk/models/rbm_standalone_card.rb +++ b/lib/bandwidth-sdk/models/rbm_standalone_card.rb @@ -106,8 +106,6 @@ def initialize(attributes = {}) if attributes.key?(:'thumbnail_image_alignment') self.thumbnail_image_alignment = attributes[:'thumbnail_image_alignment'] - else - self.thumbnail_image_alignment = nil end if attributes.key?(:'card_content') @@ -132,10 +130,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "orientation", orientation cannot be nil.') end - if @thumbnail_image_alignment.nil? - invalid_properties.push('invalid value for "thumbnail_image_alignment", thumbnail_image_alignment cannot be nil.') - end - if @card_content.nil? invalid_properties.push('invalid value for "card_content", card_content cannot be nil.') end @@ -152,7 +146,6 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @orientation.nil? - return false if @thumbnail_image_alignment.nil? return false if @card_content.nil? return false if !@suggestions.nil? && @suggestions.length > 11 true @@ -168,16 +161,6 @@ def orientation=(orientation) @orientation = orientation end - # Custom attribute writer method with validation - # @param [Object] thumbnail_image_alignment Value to be assigned - def thumbnail_image_alignment=(thumbnail_image_alignment) - if thumbnail_image_alignment.nil? - fail ArgumentError, 'thumbnail_image_alignment cannot be nil' - end - - @thumbnail_image_alignment = thumbnail_image_alignment - end - # Custom attribute writer method with validation # @param [Object] card_content Value to be assigned def card_content=(card_content)