diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 7f2bb48b..529223f2 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -158,6 +158,7 @@ docs/RbmMessageContentRichCard.md docs/RbmMessageContentText.md docs/RbmMessageMedia.md docs/RbmOpenUrlEnum.md +docs/RbmSession.md docs/RbmStandaloneCard.md docs/RbmSuggestionResponse.md docs/RbmWebViewEnum.md @@ -381,6 +382,7 @@ lib/bandwidth-sdk/models/rbm_message_content_rich_card.rb lib/bandwidth-sdk/models/rbm_message_content_text.rb lib/bandwidth-sdk/models/rbm_message_media.rb lib/bandwidth-sdk/models/rbm_open_url_enum.rb +lib/bandwidth-sdk/models/rbm_session.rb lib/bandwidth-sdk/models/rbm_standalone_card.rb lib/bandwidth-sdk/models/rbm_suggestion_response.rb lib/bandwidth-sdk/models/rbm_web_view_enum.rb diff --git a/README.md b/README.md index 60bf8060..f86216e1 100644 --- a/README.md +++ b/README.md @@ -322,6 +322,7 @@ Class | Method | HTTP request | Description - [Bandwidth::RbmMessageContentText](docs/RbmMessageContentText.md) - [Bandwidth::RbmMessageMedia](docs/RbmMessageMedia.md) - [Bandwidth::RbmOpenUrlEnum](docs/RbmOpenUrlEnum.md) + - [Bandwidth::RbmSession](docs/RbmSession.md) - [Bandwidth::RbmStandaloneCard](docs/RbmStandaloneCard.md) - [Bandwidth::RbmSuggestionResponse](docs/RbmSuggestionResponse.md) - [Bandwidth::RbmWebViewEnum](docs/RbmWebViewEnum.md) diff --git a/bandwidth.yml b/bandwidth.yml index 350b6217..a33be21b 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -2620,14 +2620,13 @@ components: type: string description: Displayed text for user to click maxLength: 25 - example: Hello world + example: Track my order rbmActionPostbackData: title: Post Back Data type: string - format: byte - description: Base64 payload the customer receives when the reply is clicked. + description: Payload the customer receives when the reply is clicked. maxLength: 2048 - example: SGVsbG8gd29ybGQ= + example: track-order-43654 rbmActionBase: type: object properties: @@ -2916,8 +2915,8 @@ components: properties: text: type: string - description: The text associated with the suggestion response. - example: Yes, I would like to proceed + description: The text of the suggestion the user tapped. + example: Track my order postbackData: $ref: '#/components/schemas/rbmActionPostbackData' pairedMessageId: @@ -2938,6 +2937,70 @@ components: format: double description: The longitude of the client's location. example: '-122.4194' + rbmSession: + type: object + description: >- + RCS interactive session information for the message. + + An interactive session is a 24-hour window covering all Rich and Rich + Media messages exchanged between an + + RCS agent and a specific end user mobile number. It is triggered when at + least 4 messages are exchanged within + + 24 hours, at least 2 of them mobile-originated and at least 1 + mobile-terminated. + + Only present on `message-delivered`, `message-received` and + `session-started` callbacks for RBM messages of + + US agents with the Conversational billing category. Omitted for all + other messages. + properties: + canInitiate: + type: boolean + description: >- + Whether the message can start an interactive session. + + `false` if the message is already part of an active session, or if + the agent is not eligible for + + interactive session billing. + example: false + id: + type: string + nullable: true + description: >- + The unique identifier of the interactive session the message is part + of. This is not a message ID. + + Omitted if the message is not part of a session. + example: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d + type: + type: string + nullable: true + description: |- + The type of the interactive session. + Only present on `session-started` callbacks. + example: INTERACTIVE_SESSION + startTime: + type: string + nullable: true + format: date-time + description: >- + The time the 24-hour session window opened. Only present on + `session-started` callbacks. + example: '2026-08-06T09:59:55Z' + endTime: + type: string + nullable: true + format: date-time + description: >- + The time the 24-hour session window closes. Only present on + `session-started` callbacks. + example: '2026-08-07T09:59:55Z' + required: + - canInitiate callback: description: >- Callbacks are divided into two types based on direction of the related @@ -2960,6 +3023,7 @@ components: message-delivered: '#/components/schemas/statusCallback' message-failed: '#/components/schemas/statusCallback' message-read: '#/components/schemas/statusCallback' + session-started: '#/components/schemas/statusCallback' message-received: '#/components/schemas/inboundCallback' requested-location-response: '#/components/schemas/inboundCallback' suggestion-response: '#/components/schemas/inboundCallback' @@ -3060,12 +3124,17 @@ components: - `message-read` indicates that the RBM message was read by the recipient. + + - `session-started` indicates that a previously exchanged RBM message is + now part of an RCS interactive session and is no longer billed + individually. enum: - message-sending - message-sent - message-delivered - message-failed - message-read + - session-started example: message-delivered inboundCallbackTypeEnum: type: string @@ -3143,6 +3212,8 @@ components: $ref: '#/components/schemas/priorityEnum' channel: $ref: '#/components/schemas/multiChannelMessageChannelEnum' + session: + $ref: '#/components/schemas/rbmSession' required: - id - owner @@ -8878,6 +8949,31 @@ components: media: - >- https://messaging.bandwidth.com/api/v2/users/9900902/media/14762070468292kw2fuqty55yp2b2/0/bw.png + rbmMessageReceivedSessionCallbackExample: + summary: >- + An example of a rbm message-received callback body for a message that is + part of an RCS interactive session. + value: + time: '2026-08-06T10:00:05.502180Z' + type: message-received + to: BandwidthRBM + description: Incoming message received + message: + id: 1786010405502l2ntaoajuqjhqnxu + owner: BandwidthRBM + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + time: '2026-08-06T10:00:05.302180Z' + segmentCount: 1 + direction: in + to: + - BandwidthRBM + from: '+12345678902' + channel: RBM + content: + text: Yes, please book it for tomorrow. + session: + canInitiate: false + id: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d messageSendingCallbackExample: summary: An example of a message-sending callback body. value: @@ -8977,6 +9073,79 @@ components: owner: '+12345678902' direction: out segmentCount: 1 + rbmMessageDeliveredSessionCallbackExample: + summary: >- + An example of a rbm message-delivered callback body for a message that + is part of an RCS interactive session. + value: + type: message-delivered + time: '2026-08-06T10:01:11.160744Z' + description: Message delivered to handset. + to: '+12345678902' + message: + id: 1786010470868ty55yp2b2kw2fuq + time: '2026-08-06T10:01:10.868292Z' + to: + - '+12345678902' + from: BandwidthRBM + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + owner: BandwidthRBM + direction: out + segmentCount: 1 + channel: RBM + session: + canInitiate: false + id: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d + rbmMessageDeliveredCanInitiateSessionCallbackExample: + summary: >- + An example of a rbm message-delivered callback body for a message that + is not yet part of an RCS interactive session. + value: + type: message-delivered + time: '2026-08-06T09:59:56.160744Z' + description: Message delivered to handset. + to: '+12345678902' + message: + id: 1786010395000kw2fuqty55yp2b2 + time: '2026-08-06T09:59:55.000000Z' + to: + - '+12345678902' + from: BandwidthRBM + text: '' + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + owner: BandwidthRBM + direction: out + segmentCount: 1 + channel: RBM + session: + canInitiate: true + sessionStartedCallbackExample: + summary: An example of a session-started callback body. + value: + type: session-started + time: '2026-08-06T10:00:00.123000Z' + description: Message is now part of an RCS interactive session. + to: '+12345678902' + message: + id: 1786010395000kw2fuqty55yp2b2 + owner: BandwidthRBM + applicationId: 93de2206-9669-4e07-948d-329f4b722ee2 + time: '2026-08-06T10:00:00.120000Z' + segmentCount: 1 + direction: out + to: + - '+12345678902' + from: BandwidthRBM + text: '' + tag: '' + channel: RBM + session: + canInitiate: false + id: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d + type: INTERACTIVE_SESSION + startTime: '2026-08-06T09:59:55Z' + endTime: '2026-08-07T09:59:55Z' messageFailedCallbackExample: summary: An example of a message-failed callback body. value: @@ -9980,6 +10149,9 @@ components: $ref: '#/components/examples/smsMessageReceivedCallbackExample' mmsMessageReceivedCallback: $ref: '#/components/examples/mmsMessageReceivedCallbackExample' + rbmMessageReceivedSessionCallback: + $ref: >- + #/components/examples/rbmMessageReceivedSessionCallbackExample responses: '200': description: OK @@ -9995,8 +10167,9 @@ components: information regarding a message sent (MT) from your message-enabled Bandwidth telephone number. -

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

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

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

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

Note that session-started callbacks are pertinent only for RBM messages of agents with the Conversational billing category.

Please visit Webhooks

content: @@ -10015,8 +10188,16 @@ components: groupMmsMessageDeliveredCallback: $ref: >- #/components/examples/groupMmsMessageDeliveredCallbackExample + rbmMessageDeliveredSessionCallback: + $ref: >- + #/components/examples/rbmMessageDeliveredSessionCallbackExample + rbmMessageDeliveredCanInitiateSessionCallback: + $ref: >- + #/components/examples/rbmMessageDeliveredCanInitiateSessionCallbackExample messageFailedCallback: $ref: '#/components/examples/messageFailedCallbackExample' + sessionStartedCallback: + $ref: '#/components/examples/sessionStartedCallbackExample' responses: '200': description: OK diff --git a/docs/Callback.md b/docs/Callback.md index 80aaca3e..e5756655 100644 --- a/docs/Callback.md +++ b/docs/Callback.md @@ -51,6 +51,7 @@ Bandwidth::Callback.openapi_discriminator_mapping # :'message-sending' => :'StatusCallback', # :'message-sent' => :'StatusCallback', # :'requested-location-response' => :'InboundCallback', +# :'session-started' => :'StatusCallback', # :'suggestion-response' => :'InboundCallback' # } ``` diff --git a/docs/InboundCallbackMessage.md b/docs/InboundCallbackMessage.md index 2ef8d8d9..cd7e67a7 100644 --- a/docs/InboundCallbackMessage.md +++ b/docs/InboundCallbackMessage.md @@ -17,6 +17,7 @@ | **media** | **Array<String>** | Optional media, not applicable for sms | [optional] | | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | | **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | [optional] | +| **session** | [**RbmSession**](RbmSession.md) | | [optional] | | **content** | [**MultiChannelMessageContent**](MultiChannelMessageContent.md) | | [optional] | | **suggestion_response** | [**RbmSuggestionResponse**](RbmSuggestionResponse.md) | | [optional] | | **location_response** | [**RbmLocationResponse**](RbmLocationResponse.md) | | [optional] | @@ -40,6 +41,7 @@ instance = Bandwidth::InboundCallbackMessage.new( media: [https://dev.bandwidth.com/images/bandwidth-logo.png, https://dev.bandwidth.com/images/github_logo.png], priority: null, channel: null, + session: null, content: null, suggestion_response: null, location_response: null diff --git a/docs/MultiChannelAction.md b/docs/MultiChannelAction.md index 2dd71011..a0509c0e 100644 --- a/docs/MultiChannelAction.md +++ b/docs/MultiChannelAction.md @@ -6,7 +6,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. | | +| **postback_data** | **String** | 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. Must be in range [-90.000000, 90.000000]. | | | **longitude** | **Float** | The longitude of the location. Must be in range [-180.000000, 180.000000]. | | @@ -26,8 +26,8 @@ require 'bandwidth-sdk' instance = Bandwidth::MultiChannelAction.new( type: null, - text: Hello world, - postback_data: U0dWc2JHOGdkMjl5YkdRPQ==, + text: Track my order, + postback_data: track-order-43654, phone_number: +15552223333, latitude: 37.7749, longitude: -122.4194, diff --git a/docs/MultiChannelActionCalendarEvent.md b/docs/MultiChannelActionCalendarEvent.md index d493b054..509d4197 100644 --- a/docs/MultiChannelActionCalendarEvent.md +++ b/docs/MultiChannelActionCalendarEvent.md @@ -6,7 +6,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. | | +| **postback_data** | **String** | 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. 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. | | @@ -19,8 +19,8 @@ require 'bandwidth-sdk' instance = Bandwidth::MultiChannelActionCalendarEvent.new( type: null, - text: Hello world, - postback_data: U0dWc2JHOGdkMjl5YkdRPQ==, + text: Track my order, + postback_data: track-order-43654, title: Meeting with John, start_time: 2022-09-14T18:20:16Z, end_time: 2022-09-14T18:20:16Z, diff --git a/docs/RbmActionBase.md b/docs/RbmActionBase.md index cdf5e020..107a150e 100644 --- a/docs/RbmActionBase.md +++ b/docs/RbmActionBase.md @@ -6,7 +6,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. | | +| **postback_data** | **String** | Payload the customer receives when the reply is clicked. | | ## Example @@ -15,8 +15,8 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmActionBase.new( type: null, - text: Hello world, - postback_data: [B@11fa11b2 + text: Track my order, + postback_data: track-order-43654 ) ``` diff --git a/docs/RbmActionDial.md b/docs/RbmActionDial.md index f14ab5bf..20a58bc4 100644 --- a/docs/RbmActionDial.md +++ b/docs/RbmActionDial.md @@ -6,7 +6,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. | | +| **postback_data** | **String** | Payload the customer receives when the reply is clicked. | | | **phone_number** | **String** | The phone number to dial. Must be E164 format. | | ## Example @@ -16,8 +16,8 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmActionDial.new( type: null, - text: Hello world, - postback_data: U0dWc2JHOGdkMjl5YkdRPQ==, + text: Track my order, + postback_data: track-order-43654, phone_number: +15552223333 ) ``` diff --git a/docs/RbmActionOpenUrl.md b/docs/RbmActionOpenUrl.md index e03b865e..ffa45a62 100644 --- a/docs/RbmActionOpenUrl.md +++ b/docs/RbmActionOpenUrl.md @@ -6,7 +6,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. | | +| **postback_data** | **String** | Payload the customer receives when the reply is clicked. | | | **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] | @@ -18,8 +18,8 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmActionOpenUrl.new( type: null, - text: Hello world, - postback_data: U0dWc2JHOGdkMjl5YkdRPQ==, + text: Track my order, + postback_data: track-order-43654, url: https://dev.bandwidth.com, application: null, webview_view_mode: null diff --git a/docs/RbmActionViewLocation.md b/docs/RbmActionViewLocation.md index 8457bbdc..327759f9 100644 --- a/docs/RbmActionViewLocation.md +++ b/docs/RbmActionViewLocation.md @@ -6,7 +6,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. | | +| **postback_data** | **String** | Payload the customer receives when the reply is clicked. | | | **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] | @@ -18,8 +18,8 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmActionViewLocation.new( type: null, - text: Hello world, - postback_data: U0dWc2JHOGdkMjl5YkdRPQ==, + text: Track my order, + postback_data: track-order-43654, latitude: 37.7749, longitude: -122.4194, label: San Francisco diff --git a/docs/RbmSession.md b/docs/RbmSession.md new file mode 100644 index 00000000..595efbc2 --- /dev/null +++ b/docs/RbmSession.md @@ -0,0 +1,26 @@ +# Bandwidth::RbmSession + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **can_initiate** | **Boolean** | Whether the message can start an interactive session. `false` if the message is already part of an active session, or if the agent is not eligible for interactive session billing. | | +| **id** | **String** | The unique identifier of the interactive session the message is part of. This is not a message ID. Omitted if the message is not part of a session. | [optional] | +| **type** | **String** | The type of the interactive session. Only present on `session-started` callbacks. | [optional] | +| **start_time** | **Time** | The time the 24-hour session window opened. Only present on `session-started` callbacks. | [optional] | +| **end_time** | **Time** | The time the 24-hour session window closes. Only present on `session-started` callbacks. | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::RbmSession.new( + can_initiate: false, + id: 0f5a3b9c-2d4e-4f6a-8b1c-7e9d0a2b3c4d, + type: INTERACTIVE_SESSION, + start_time: 2026-08-06T09:59:55Z, + end_time: 2026-08-07T09:59:55Z +) +``` + diff --git a/docs/RbmSuggestionResponse.md b/docs/RbmSuggestionResponse.md index 26993828..443e2905 100644 --- a/docs/RbmSuggestionResponse.md +++ b/docs/RbmSuggestionResponse.md @@ -4,8 +4,8 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **text** | **String** | The text associated with the suggestion response. | [optional] | -| **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | [optional] | +| **text** | **String** | The text of the suggestion the user tapped. | [optional] | +| **postback_data** | **String** | Payload the customer receives when the reply is clicked. | [optional] | | **paired_message_id** | **String** | Corresponding parent message ID (MT). | [optional] | ## Example @@ -14,8 +14,8 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmSuggestionResponse.new( - text: Yes, I would like to proceed, - postback_data: [B@11fa11b2, + text: Track my order, + postback_data: track-order-43654, paired_message_id: 1752697342534u24xerqdukke523x ) ``` diff --git a/docs/StatusCallbackMessage.md b/docs/StatusCallbackMessage.md index 8774826a..460ca2f5 100644 --- a/docs/StatusCallbackMessage.md +++ b/docs/StatusCallbackMessage.md @@ -17,6 +17,7 @@ | **media** | **Array<String>** | Optional media, not applicable for sms | [optional] | | **priority** | [**PriorityEnum**](PriorityEnum.md) | | [optional] | | **channel** | [**MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | [optional] | +| **session** | [**RbmSession**](RbmSession.md) | | [optional] | ## Example @@ -36,7 +37,8 @@ instance = Bandwidth::StatusCallbackMessage.new( tag: custom string, media: ["https://dev.bandwidth.com/images/bandwidth-logo.png","https://dev.bandwidth.com/images/github_logo.png"], priority: null, - channel: null + channel: null, + session: null ) ``` diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb index 9e1b1646..26dd16dc 100644 --- a/lib/bandwidth-sdk.rb +++ b/lib/bandwidth-sdk.rb @@ -164,6 +164,7 @@ require 'bandwidth-sdk/models/rbm_message_content_text' require 'bandwidth-sdk/models/rbm_message_media' require 'bandwidth-sdk/models/rbm_open_url_enum' +require 'bandwidth-sdk/models/rbm_session' require 'bandwidth-sdk/models/rbm_standalone_card' require 'bandwidth-sdk/models/rbm_suggestion_response' require 'bandwidth-sdk/models/rbm_web_view_enum' diff --git a/lib/bandwidth-sdk/models/callback.rb b/lib/bandwidth-sdk/models/callback.rb index cfb1be70..0bed9415 100644 --- a/lib/bandwidth-sdk/models/callback.rb +++ b/lib/bandwidth-sdk/models/callback.rb @@ -40,6 +40,7 @@ def openapi_discriminator_mapping :'message-sending' => :'StatusCallback', :'message-sent' => :'StatusCallback', :'requested-location-response' => :'InboundCallback', + :'session-started' => :'StatusCallback', :'suggestion-response' => :'InboundCallback' } end diff --git a/lib/bandwidth-sdk/models/inbound_callback_message.rb b/lib/bandwidth-sdk/models/inbound_callback_message.rb index 9dae4746..f9db26b3 100644 --- a/lib/bandwidth-sdk/models/inbound_callback_message.rb +++ b/lib/bandwidth-sdk/models/inbound_callback_message.rb @@ -49,6 +49,8 @@ class InboundCallbackMessage < ApiModelBase attr_accessor :channel + attr_accessor :session + attr_accessor :content attr_accessor :suggestion_response @@ -93,6 +95,7 @@ def self.attribute_map :'media' => :'media', :'priority' => :'priority', :'channel' => :'channel', + :'session' => :'session', :'content' => :'content', :'suggestion_response' => :'suggestionResponse', :'location_response' => :'locationResponse' @@ -125,6 +128,7 @@ def self.openapi_types :'media' => :'Array', :'priority' => :'PriorityEnum', :'channel' => :'MultiChannelMessageChannelEnum', + :'session' => :'RbmSession', :'content' => :'MultiChannelMessageContent', :'suggestion_response' => :'RbmSuggestionResponse', :'location_response' => :'RbmLocationResponse' @@ -232,6 +236,10 @@ def initialize(attributes = {}) self.channel = attributes[:'channel'] end + if attributes.key?(:'session') + self.session = attributes[:'session'] + end + if attributes.key?(:'content') self.content = attributes[:'content'] end @@ -398,6 +406,7 @@ def ==(o) media == o.media && priority == o.priority && channel == o.channel && + session == o.session && content == o.content && suggestion_response == o.suggestion_response && location_response == o.location_response @@ -412,7 +421,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority, channel, content, suggestion_response, location_response].hash + [id, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority, channel, session, content, suggestion_response, location_response].hash end # Builds the object from hash 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 c9c17efd..377a00d9 100644 --- a/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb +++ b/lib/bandwidth-sdk/models/multi_channel_action_calendar_event.rb @@ -20,7 +20,7 @@ class MultiChannelActionCalendarEvent < ApiModelBase # Displayed text for user to click attr_accessor :text - # Base64 payload the customer receives when the reply is clicked. + # Payload the customer receives when the reply is clicked. attr_accessor :postback_data # The title of the event. diff --git a/lib/bandwidth-sdk/models/rbm_action_base.rb b/lib/bandwidth-sdk/models/rbm_action_base.rb index b3f9f1cb..572ce45b 100644 --- a/lib/bandwidth-sdk/models/rbm_action_base.rb +++ b/lib/bandwidth-sdk/models/rbm_action_base.rb @@ -20,7 +20,7 @@ class RbmActionBase < ApiModelBase # Displayed text for user to click attr_accessor :text - # Base64 payload the customer receives when the reply is clicked. + # Payload the customer receives when the reply is clicked. attr_accessor :postback_data class EnumAttributeValidator diff --git a/lib/bandwidth-sdk/models/rbm_action_dial.rb b/lib/bandwidth-sdk/models/rbm_action_dial.rb index c4f2d17e..a5444c0b 100644 --- a/lib/bandwidth-sdk/models/rbm_action_dial.rb +++ b/lib/bandwidth-sdk/models/rbm_action_dial.rb @@ -20,7 +20,7 @@ class RbmActionDial < ApiModelBase # Displayed text for user to click attr_accessor :text - # Base64 payload the customer receives when the reply is clicked. + # Payload the customer receives when the reply is clicked. attr_accessor :postback_data # The phone number to dial. Must be E164 format. diff --git a/lib/bandwidth-sdk/models/rbm_action_open_url.rb b/lib/bandwidth-sdk/models/rbm_action_open_url.rb index 1a399248..4d1b2a83 100644 --- a/lib/bandwidth-sdk/models/rbm_action_open_url.rb +++ b/lib/bandwidth-sdk/models/rbm_action_open_url.rb @@ -20,7 +20,7 @@ class RbmActionOpenUrl < ApiModelBase # Displayed text for user to click attr_accessor :text - # Base64 payload the customer receives when the reply is clicked. + # Payload the customer receives when the reply is clicked. attr_accessor :postback_data # The URL to open in browser. Must use http:// or https:// scheme. diff --git a/lib/bandwidth-sdk/models/rbm_action_view_location.rb b/lib/bandwidth-sdk/models/rbm_action_view_location.rb index e89e9296..ef3a10fa 100644 --- a/lib/bandwidth-sdk/models/rbm_action_view_location.rb +++ b/lib/bandwidth-sdk/models/rbm_action_view_location.rb @@ -20,7 +20,7 @@ class RbmActionViewLocation < ApiModelBase # Displayed text for user to click attr_accessor :text - # Base64 payload the customer receives when the reply is clicked. + # Payload the customer receives when the reply is clicked. attr_accessor :postback_data # The latitude of the location. Must be in range [-90.000000, 90.000000]. diff --git a/lib/bandwidth-sdk/models/rbm_session.rb b/lib/bandwidth-sdk/models/rbm_session.rb new file mode 100644 index 00000000..5052f8ee --- /dev/null +++ b/lib/bandwidth-sdk/models/rbm_session.rb @@ -0,0 +1,208 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + # RCS interactive session information for the message. An interactive session is a 24-hour window covering all Rich and Rich Media messages exchanged between an RCS agent and a specific end user mobile number. It is triggered when at least 4 messages are exchanged within 24 hours, at least 2 of them mobile-originated and at least 1 mobile-terminated. Only present on `message-delivered`, `message-received` and `session-started` callbacks for RBM messages of US agents with the Conversational billing category. Omitted for all other messages. + class RbmSession < ApiModelBase + # Whether the message can start an interactive session. `false` if the message is already part of an active session, or if the agent is not eligible for interactive session billing. + attr_accessor :can_initiate + + # The unique identifier of the interactive session the message is part of. This is not a message ID. Omitted if the message is not part of a session. + attr_accessor :id + + # The type of the interactive session. Only present on `session-started` callbacks. + attr_accessor :type + + # The time the 24-hour session window opened. Only present on `session-started` callbacks. + attr_accessor :start_time + + # The time the 24-hour session window closes. Only present on `session-started` callbacks. + attr_accessor :end_time + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'can_initiate' => :'canInitiate', + :'id' => :'id', + :'type' => :'type', + :'start_time' => :'startTime', + :'end_time' => :'endTime' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'can_initiate' => :'Boolean', + :'id' => :'String', + :'type' => :'String', + :'start_time' => :'Time', + :'end_time' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'id', + :'type', + :'start_time', + :'end_time' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::RbmSession` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RbmSession`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'can_initiate') + self.can_initiate = attributes[:'can_initiate'] + else + self.can_initiate = nil + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @can_initiate.nil? + invalid_properties.push('invalid value for "can_initiate", can_initiate cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @can_initiate.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] can_initiate Value to be assigned + def can_initiate=(can_initiate) + if can_initiate.nil? + fail ArgumentError, 'can_initiate cannot be nil' + end + + @can_initiate = can_initiate + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + can_initiate == o.can_initiate && + id == o.id && + type == o.type && + start_time == o.start_time && + end_time == o.end_time + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [can_initiate, id, type, start_time, end_time].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/rbm_suggestion_response.rb b/lib/bandwidth-sdk/models/rbm_suggestion_response.rb index 6a7613c8..3f29e634 100644 --- a/lib/bandwidth-sdk/models/rbm_suggestion_response.rb +++ b/lib/bandwidth-sdk/models/rbm_suggestion_response.rb @@ -15,10 +15,10 @@ module Bandwidth class RbmSuggestionResponse < ApiModelBase - # The text associated with the suggestion response. + # The text of the suggestion the user tapped. attr_accessor :text - # Base64 payload the customer receives when the reply is clicked. + # Payload the customer receives when the reply is clicked. attr_accessor :postback_data # Corresponding parent message ID (MT). diff --git a/lib/bandwidth-sdk/models/status_callback_message.rb b/lib/bandwidth-sdk/models/status_callback_message.rb index ddb75228..2ebb3d91 100644 --- a/lib/bandwidth-sdk/models/status_callback_message.rb +++ b/lib/bandwidth-sdk/models/status_callback_message.rb @@ -50,6 +50,8 @@ class StatusCallbackMessage < ApiModelBase attr_accessor :channel + attr_accessor :session + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -87,7 +89,8 @@ def self.attribute_map :'tag' => :'tag', :'media' => :'media', :'priority' => :'priority', - :'channel' => :'channel' + :'channel' => :'channel', + :'session' => :'session' } end @@ -116,7 +119,8 @@ def self.openapi_types :'tag' => :'String', :'media' => :'Array', :'priority' => :'PriorityEnum', - :'channel' => :'MultiChannelMessageChannelEnum' + :'channel' => :'MultiChannelMessageChannelEnum', + :'session' => :'RbmSession' } end @@ -213,6 +217,10 @@ def initialize(attributes = {}) if attributes.key?(:'channel') self.channel = attributes[:'channel'] end + + if attributes.key?(:'session') + self.session = attributes[:'session'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -367,7 +375,8 @@ def ==(o) tag == o.tag && media == o.media && priority == o.priority && - channel == o.channel + channel == o.channel && + session == o.session end # @see the `==` method @@ -379,7 +388,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority, channel].hash + [id, owner, application_id, time, segment_count, direction, to, from, text, tag, media, priority, channel, session].hash end # Builds the object from hash diff --git a/lib/bandwidth-sdk/models/status_callback_type_enum.rb b/lib/bandwidth-sdk/models/status_callback_type_enum.rb index 39aab93a..98aa51b2 100644 --- a/lib/bandwidth-sdk/models/status_callback_type_enum.rb +++ b/lib/bandwidth-sdk/models/status_callback_type_enum.rb @@ -20,9 +20,10 @@ class StatusCallbackTypeEnum MESSAGE_DELIVERED = 'message-delivered'.freeze MESSAGE_FAILED = 'message-failed'.freeze MESSAGE_READ = 'message-read'.freeze + SESSION_STARTED = 'session-started'.freeze def self.all_vars - @all_vars ||= [MESSAGE_SENDING, MESSAGE_SENT, MESSAGE_DELIVERED, MESSAGE_FAILED, MESSAGE_READ].freeze + @all_vars ||= [MESSAGE_SENDING, MESSAGE_SENT, MESSAGE_DELIVERED, MESSAGE_FAILED, MESSAGE_READ, SESSION_STARTED].freeze end # Builds the enum from string