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 bandwidth/models/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Callback(BaseModel):
'message-received': 'InboundCallback',
'message-sending': 'StatusCallback',
'message-sent': 'StatusCallback',
'request-location-response': 'InboundCallback',
'requested-location-response': 'InboundCallback',
'suggestion-response': 'InboundCallback'
}

Expand Down
4 changes: 2 additions & 2 deletions bandwidth/models/inbound_callback_type_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

class InboundCallbackTypeEnum(str, Enum):
"""
The possible inbound callback types originating from MO messages or multichannel message client responses: - `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. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message.
The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `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.
"""

"""
allowed enum values
"""
MESSAGE_MINUS_RECEIVED = 'message-received'
REQUEST_MINUS_LOCATION_MINUS_RESPONSE = 'request-location-response'
REQUESTED_MINUS_LOCATION_MINUS_RESPONSE = 'requested-location-response'
SUGGESTION_MINUS_RESPONSE = 'suggestion-response'

@classmethod
Expand Down
11 changes: 9 additions & 2 deletions bandwidth/models/rbm_suggestion_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ class RbmSuggestionResponse(BaseModel):
""" # noqa: E501
text: Optional[StrictStr] = Field(default=None, description="The text associated with the suggestion response.")
postback_data: Optional[Union[Annotated[bytes, Field(strict=True, max_length=2048)], Annotated[str, Field(strict=True, max_length=2048)]]] = Field(default=None, description="Base64 payload the customer receives when the reply is clicked.", alias="postbackData")
paired_message_id: Optional[StrictStr] = Field(default=None, description="Corresponding parent message ID (MT).", alias="pairedMessageId")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["text", "postbackData"]
__properties: ClassVar[List[str]] = ["text", "postbackData", "pairedMessageId"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -79,6 +80,11 @@ def to_dict(self) -> Dict[str, Any]:
for _key, _value in self.additional_properties.items():
_dict[_key] = _value

# set to None if paired_message_id (nullable) is None
# and model_fields_set contains the field
if self.paired_message_id is None and "paired_message_id" in self.model_fields_set:
_dict['pairedMessageId'] = None

return _dict

@classmethod
Expand All @@ -92,7 +98,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:

_obj = cls.model_validate({
"text": obj.get("text"),
"postbackData": obj.get("postbackData")
"postbackData": obj.get("postbackData"),
"pairedMessageId": obj.get("pairedMessageId")
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
4 changes: 2 additions & 2 deletions docs/InboundCallbackTypeEnum.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# InboundCallbackTypeEnum

The possible inbound callback types originating from MO messages or multichannel message client responses: - `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. - `suggestion-response` indicates a response to a suggestion sent by the Bandwidth user's client after receiving an RBM message.
The possible inbound callback types originating from MO messages or multichannel message client responses: - `message-received` indicates an MO message from a Bandwidth user's client to a Bandwidth number. - `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_MINUS_RECEIVED` (value: `'message-received'`)

* `REQUEST_MINUS_LOCATION_MINUS_RESPONSE` (value: `'request-location-response'`)
* `REQUESTED_MINUS_LOCATION_MINUS_RESPONSE` (value: `'requested-location-response'`)

* `SUGGESTION_MINUS_RESPONSE` (value: `'suggestion-response'`)

Expand Down
1 change: 1 addition & 0 deletions docs/RbmSuggestionResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**text** | **str** | The text associated with the suggestion response. | [optional]
**postback_data** | **bytearray** | Base64 payload the customer receives when the reply is clicked. | [optional]
**paired_message_id** | **str** | Corresponding parent message ID (MT). | [optional]

## Example

Expand Down
2 changes: 1 addition & 1 deletion test/unit/models/test_inbound_callback_type_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def tearDown(self):
def testInboundCallbackTypeEnum(self):
"""Test InboundCallbackTypeEnum"""
assert InboundCallbackTypeEnum('message-received') == 'message-received'
assert InboundCallbackTypeEnum('request-location-response') == 'request-location-response'
assert InboundCallbackTypeEnum('requested-location-response') == 'requested-location-response'
assert InboundCallbackTypeEnum('suggestion-response') == 'suggestion-response'

if __name__ == '__main__':
Expand Down
4 changes: 3 additions & 1 deletion test/unit/models/test_rbm_suggestion_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def make_instance(self, include_optional) -> RbmSuggestionResponse:
if include_optional:
return RbmSuggestionResponse(
text = 'Yes, I would like to proceed',
postback_data = '[B@5d4a34ff'
postback_data = '[B@5d4a34ff',
paired_message_id = '1234567890'
)
else:
return RbmSuggestionResponse(
Expand All @@ -47,6 +48,7 @@ def testRbmSuggestionResponse(self):
assert isinstance(instance, RbmSuggestionResponse)
assert instance.text == 'Yes, I would like to proceed'
assert instance.postback_data == '[B@5d4a34ff'
assert instance.paired_message_id == '1234567890'

if __name__ == '__main__':
unittest.main()