Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2889,6 +2889,11 @@ components:
example: Yes, I would like to proceed
postbackData:
$ref: '#/components/schemas/rbmActionPostbackData'
pairedMessageId:
type: string
nullable: true
description: Corresponding parent message ID (MT).
example: 1752697342534u24xerqdukke523x
rbmLocationResponse:
type: object
properties:
Expand Down Expand Up @@ -2925,7 +2930,7 @@ components:
message-failed: '#/components/schemas/statusCallback'
message-read: '#/components/schemas/statusCallback'
message-received: '#/components/schemas/inboundCallback'
request-location-response: '#/components/schemas/inboundCallback'
requested-location-response: '#/components/schemas/inboundCallback'
suggestion-response: '#/components/schemas/inboundCallback'
statusCallback:
type: object
Expand Down Expand Up @@ -3035,14 +3040,15 @@ components:
- `message-received` indicates an MO message from a Bandwidth user's
client to a Bandwidth number.

- `request-location-response` indicates a response to a location request
sent by the Bandwidth user's client after receiving an RBM message.
- `requested-location-response` indicates a response to a location
request sent by the Bandwidth user's client after receiving an RBM
message.

- `suggestion-response` indicates a response to a suggestion sent by the
Bandwidth user's client after receiving an RBM message.
enum:
- message-received
- request-location-response
- requested-location-response
- suggestion-response
example: message-received
statusCallbackMessage:
Expand Down Expand Up @@ -9154,7 +9160,7 @@ components:
tag: '{"myTag": "myTagValue"}'
updateEndpointBxmlRequestExample:
summary: Update Endpoint BXML Request Example
value: <Bxml><StartRecording /></Bxml>
value: <Response><StartRecording /></Response>
endpointDisconnectedEventExample:
summary: Endpoint Disconnected Event
value:
Expand Down Expand Up @@ -9678,10 +9684,10 @@ components:

<p>The payload type will be one of <code>message-received</code>,
<code>suggestion-response</code>, or
<code>location-request-response</code>.
<code>requested-location-response</code>.

<p>Note that <code>suggestion-response</code> and
<code>location-request-response</code> callback types are
<code>requested-location-response</code> callback types are
pertinent only for RBM messages sent from the
<code>/messages/multiChannel</code> endpoint.

Expand Down
2 changes: 1 addition & 1 deletion docs/Callback.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Bandwidth::Callback.openapi_discriminator_mapping
# :'message-received' => :'InboundCallback',
# :'message-sending' => :'StatusCallback',
# :'message-sent' => :'StatusCallback',
# :'request-location-response' => :'InboundCallback',
# :'requested-location-response' => :'InboundCallback',
# :'suggestion-response' => :'InboundCallback'
# }
```
Expand Down
2 changes: 1 addition & 1 deletion docs/RbmActionBase.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require 'bandwidth-sdk'
instance = Bandwidth::RbmActionBase.new(
type: null,
text: Hello world,
postback_data: [B@24fb752f
postback_data: [B@20706e70
)
```

4 changes: 3 additions & 1 deletion docs/RbmSuggestionResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| ---- | ---- | ----------- | ----- |
| **text** | **String** | The text associated with the suggestion response. | [optional] |
| **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | [optional] |
| **paired_message_id** | **String** | Corresponding parent message ID (MT). | [optional] |

## Example

Expand All @@ -14,7 +15,8 @@ require 'bandwidth-sdk'

instance = Bandwidth::RbmSuggestionResponse.new(
text: Yes, I would like to proceed,
postback_data: [B@24fb752f
postback_data: [B@20706e70,
paired_message_id: 1752697342534u24xerqdukke523x
)
```

2 changes: 1 addition & 1 deletion lib/bandwidth-sdk/models/callback.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def openapi_discriminator_mapping
:'message-received' => :'InboundCallback',
:'message-sending' => :'StatusCallback',
:'message-sent' => :'StatusCallback',
:'request-location-response' => :'InboundCallback',
:'requested-location-response' => :'InboundCallback',
:'suggestion-response' => :'InboundCallback'
}
end
Expand Down
4 changes: 2 additions & 2 deletions lib/bandwidth-sdk/models/inbound_callback_type_enum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
module Bandwidth
class InboundCallbackTypeEnum
MESSAGE_RECEIVED = 'message-received'.freeze
REQUEST_LOCATION_RESPONSE = 'request-location-response'.freeze
REQUESTED_LOCATION_RESPONSE = 'requested-location-response'.freeze
SUGGESTION_RESPONSE = 'suggestion-response'.freeze

def self.all_vars
@all_vars ||= [MESSAGE_RECEIVED, REQUEST_LOCATION_RESPONSE, SUGGESTION_RESPONSE].freeze
@all_vars ||= [MESSAGE_RECEIVED, REQUESTED_LOCATION_RESPONSE, SUGGESTION_RESPONSE].freeze
end

# Builds the enum from string
Expand Down
19 changes: 15 additions & 4 deletions lib/bandwidth-sdk/models/rbm_suggestion_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ class RbmSuggestionResponse < ApiModelBase
# Base64 payload the customer receives when the reply is clicked.
attr_accessor :postback_data

# Corresponding parent message ID (MT).
attr_accessor :paired_message_id

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'text' => :'text',
:'postback_data' => :'postbackData'
:'postback_data' => :'postbackData',
:'paired_message_id' => :'pairedMessageId'
}
end

Expand All @@ -43,13 +47,15 @@ def self.acceptable_attributes
def self.openapi_types
{
:'text' => :'String',
:'postback_data' => :'String'
:'postback_data' => :'String',
:'paired_message_id' => :'String'
}
end

# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
:'paired_message_id'
])
end

Expand All @@ -76,6 +82,10 @@ def initialize(attributes = {})
if attributes.key?(:'postback_data')
self.postback_data = attributes[:'postback_data']
end

if attributes.key?(:'paired_message_id')
self.paired_message_id = attributes[:'paired_message_id']
end
end

# Show invalid properties with the reasons. Usually used together with valid?
Expand Down Expand Up @@ -118,7 +128,8 @@ def ==(o)
return true if self.equal?(o)
self.class == o.class &&
text == o.text &&
postback_data == o.postback_data
postback_data == o.postback_data &&
paired_message_id == o.paired_message_id
end

# @see the `==` method
Expand All @@ -130,7 +141,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[text, postback_data].hash
[text, postback_data, paired_message_id].hash
end

# Builds the object from hash
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/models/callback_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
:'message-received' => :'InboundCallback',
:'message-sending' => :'StatusCallback',
:'message-sent' => :'StatusCallback',
:'request-location-response' => :'InboundCallback',
:'requested-location-response' => :'InboundCallback',
:'suggestion-response' => :'InboundCallback'
})
end
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/models/inbound_callback_type_enum_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
end

it 'defines REQUEST_LOCATION_RESPONSE' do
expect(Bandwidth::InboundCallbackTypeEnum::REQUEST_LOCATION_RESPONSE).to eq('request-location-response')
expect(Bandwidth::InboundCallbackTypeEnum::REQUESTED_LOCATION_RESPONSE).to eq('requested-location-response')
end

it 'defines SUGGESTION_RESPONSE' do
Expand All @@ -18,7 +18,7 @@
it 'returns every valid enum value' do
expect(Bandwidth::InboundCallbackTypeEnum.all_vars).to eq([
'message-received',
'request-location-response',
'requested-location-response',
'suggestion-response'
])
end
Expand All @@ -27,7 +27,7 @@
describe '.build_from_hash' do
it 'returns the value when it matches a valid enum value' do
expect(Bandwidth::InboundCallbackTypeEnum.build_from_hash('message-received')).to eq('message-received')
expect(Bandwidth::InboundCallbackTypeEnum.build_from_hash('request-location-response')).to eq('request-location-response')
expect(Bandwidth::InboundCallbackTypeEnum.build_from_hash('requested-location-response')).to eq('requested-location-response')
expect(Bandwidth::InboundCallbackTypeEnum.build_from_hash('suggestion-response')).to eq('suggestion-response')
end

Expand Down
14 changes: 9 additions & 5 deletions spec/unit/models/rbm_suggestion_response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
let(:rbm_suggestion_response_default) { Bandwidth::RbmSuggestionResponse.new }
let(:rbm_suggestion_response_values) { Bandwidth::RbmSuggestionResponse.new({
text: 'Yes',
postback_data: 'reply_yes'
postback_data: 'reply_yes',
paired_message_id: 'paired_message_123'
}) }

describe '#initialize' do
Expand All @@ -28,25 +29,27 @@

describe '#openapi_nullable' do
it 'expects nullable attributes to be an empty set' do
expect(Bandwidth::RbmSuggestionResponse.openapi_nullable).to eq(Set.new([]))
expect(Bandwidth::RbmSuggestionResponse.openapi_nullable).to eq(Set.new([:paired_message_id]))
end
end

describe '#build_from_hash' do
it 'validates instance of RbmSuggestionResponse created by the build_from_hash method' do
rbm_suggestion_response_from_hash = Bandwidth::RbmSuggestionResponse.build_from_hash({
text: 'Yes',
postbackData: 'reply_yes'
postbackData: 'reply_yes',
pairedMessageId: 'paired_message_123'
})
expect(rbm_suggestion_response_from_hash).to be_instance_of(Bandwidth::RbmSuggestionResponse)
expect(rbm_suggestion_response_from_hash.text).to eq('Yes')
expect(rbm_suggestion_response_from_hash.postback_data).to eq('reply_yes')
expect(rbm_suggestion_response_from_hash.paired_message_id).to eq('paired_message_123')
end
end

describe '#to_s' do
it 'returns a string representation of the object' do
expect(rbm_suggestion_response_values.to_s).to eq('{:text=>"Yes", :postbackData=>"reply_yes"}')
expect(rbm_suggestion_response_values.to_s).to eq('{:text=>"Yes", :postbackData=>"reply_yes", :pairedMessageId=>"paired_message_123"}')
end
end

Expand All @@ -61,7 +64,8 @@
it 'returns a hash representation of the object' do
expect(rbm_suggestion_response_values.to_body).to eq({
text: 'Yes',
postbackData: 'reply_yes'
postbackData: 'reply_yes',
pairedMessageId: 'paired_message_123'
})
end
end
Expand Down