diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 232d698f..0c639e6c 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -162,6 +162,7 @@ docs/Model/RbmMessageContentRichCard.md docs/Model/RbmMessageContentText.md docs/Model/RbmMessageMedia.md docs/Model/RbmOpenUrlEnum.md +docs/Model/RbmSession.md docs/Model/RbmStandaloneCard.md docs/Model/RbmSuggestionResponse.md docs/Model/RbmWebViewEnum.md @@ -384,6 +385,7 @@ src/Model/RbmMessageContentRichCard.php src/Model/RbmMessageContentText.php src/Model/RbmMessageMedia.php src/Model/RbmOpenUrlEnum.php +src/Model/RbmSession.php src/Model/RbmStandaloneCard.php src/Model/RbmSuggestionResponse.php src/Model/RbmWebViewEnum.php diff --git a/README.md b/README.md index 2ed1c816..55a7a886 100644 --- a/README.md +++ b/README.md @@ -274,6 +274,7 @@ Class | Method | HTTP request | Description - [RbmMessageContentText](docs/Model/RbmMessageContentText.md) - [RbmMessageMedia](docs/Model/RbmMessageMedia.md) - [RbmOpenUrlEnum](docs/Model/RbmOpenUrlEnum.md) +- [RbmSession](docs/Model/RbmSession.md) - [RbmStandaloneCard](docs/Model/RbmStandaloneCard.md) - [RbmSuggestionResponse](docs/Model/RbmSuggestionResponse.md) - [RbmWebViewEnum](docs/Model/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/Model/InboundCallbackMessage.md b/docs/Model/InboundCallbackMessage.md index b96d8bf7..e6b0770e 100644 --- a/docs/Model/InboundCallbackMessage.md +++ b/docs/Model/InboundCallbackMessage.md @@ -17,6 +17,7 @@ Name | Type | Description | Notes **media** | **string[]** | Optional media, not applicable for sms | [optional] **priority** | [**\Bandwidth\Model\PriorityEnum**](PriorityEnum.md) | | [optional] **channel** | [**\Bandwidth\Model\MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | [optional] +**session** | [**\Bandwidth\Model\RbmSession**](RbmSession.md) | | [optional] **content** | [**\Bandwidth\Model\MultiChannelMessageContent**](MultiChannelMessageContent.md) | | [optional] **suggestion_response** | [**\Bandwidth\Model\RbmSuggestionResponse**](RbmSuggestionResponse.md) | | [optional] **location_response** | [**\Bandwidth\Model\RbmLocationResponse**](RbmLocationResponse.md) | | [optional] diff --git a/docs/Model/MultiChannelActionCalendarEvent.md b/docs/Model/MultiChannelActionCalendarEvent.md index 7a41991a..00c4cb23 100644 --- a/docs/Model/MultiChannelActionCalendarEvent.md +++ b/docs/Model/MultiChannelActionCalendarEvent.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**\Bandwidth\Model\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** | **\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. | diff --git a/docs/Model/RbmActionBase.md b/docs/Model/RbmActionBase.md index 9e641fe3..c8501ca6 100644 --- a/docs/Model/RbmActionBase.md +++ b/docs/Model/RbmActionBase.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**\Bandwidth\Model\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. | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RbmActionDial.md b/docs/Model/RbmActionDial.md index 0744ebd4..aecfcfcf 100644 --- a/docs/Model/RbmActionDial.md +++ b/docs/Model/RbmActionDial.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**\Bandwidth\Model\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. | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RbmActionOpenUrl.md b/docs/Model/RbmActionOpenUrl.md index e3c16313..642bb76a 100644 --- a/docs/Model/RbmActionOpenUrl.md +++ b/docs/Model/RbmActionOpenUrl.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**\Bandwidth\Model\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** | [**\Bandwidth\Model\RbmOpenUrlEnum**](RbmOpenUrlEnum.md) | | [optional] **webview_view_mode** | [**\Bandwidth\Model\RbmWebViewEnum**](RbmWebViewEnum.md) | | [optional] diff --git a/docs/Model/RbmActionViewLocation.md b/docs/Model/RbmActionViewLocation.md index 2fb12d5b..f659a972 100644 --- a/docs/Model/RbmActionViewLocation.md +++ b/docs/Model/RbmActionViewLocation.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**\Bandwidth\Model\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] diff --git a/docs/Model/RbmSession.md b/docs/Model/RbmSession.md new file mode 100644 index 00000000..de5e278d --- /dev/null +++ b/docs/Model/RbmSession.md @@ -0,0 +1,13 @@ +# RbmSession + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_initiate** | **bool** | 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** | **\DateTime** | The time the 24-hour session window opened. Only present on `session-started` callbacks. | [optional] +**end_time** | **\DateTime** | The time the 24-hour session window closes. Only present on `session-started` callbacks. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RbmSuggestionResponse.md b/docs/Model/RbmSuggestionResponse.md index f4463792..e5e81ff7 100644 --- a/docs/Model/RbmSuggestionResponse.md +++ b/docs/Model/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] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StatusCallbackMessage.md b/docs/Model/StatusCallbackMessage.md index 286542fa..92f5458e 100644 --- a/docs/Model/StatusCallbackMessage.md +++ b/docs/Model/StatusCallbackMessage.md @@ -17,5 +17,6 @@ Name | Type | Description | Notes **media** | **string[]** | Optional media, not applicable for sms | [optional] **priority** | [**\Bandwidth\Model\PriorityEnum**](PriorityEnum.md) | | [optional] **channel** | [**\Bandwidth\Model\MultiChannelMessageChannelEnum**](MultiChannelMessageChannelEnum.md) | | [optional] +**session** | [**\Bandwidth\Model\RbmSession**](RbmSession.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Model/Callback.php b/src/Model/Callback.php index 510aab93..f4bf0aae 100644 --- a/src/Model/Callback.php +++ b/src/Model/Callback.php @@ -84,6 +84,7 @@ public static function getOneOfDiscriminatorMappings(): array 'message-sending' => '\Bandwidth\Model\StatusCallback', 'message-sent' => '\Bandwidth\Model\StatusCallback', 'requested-location-response' => '\Bandwidth\Model\InboundCallback', + 'session-started' => '\Bandwidth\Model\StatusCallback', 'suggestion-response' => '\Bandwidth\Model\InboundCallback' ]; } diff --git a/src/Model/InboundCallbackMessage.php b/src/Model/InboundCallbackMessage.php index c45b43e6..d0395321 100644 --- a/src/Model/InboundCallbackMessage.php +++ b/src/Model/InboundCallbackMessage.php @@ -72,6 +72,7 @@ class InboundCallbackMessage implements ModelInterface, ArrayAccess, JsonSeriali 'media' => 'string[]', 'priority' => '\Bandwidth\Model\PriorityEnum', 'channel' => '\Bandwidth\Model\MultiChannelMessageChannelEnum', + 'session' => '\Bandwidth\Model\RbmSession', 'content' => '\Bandwidth\Model\MultiChannelMessageContent', 'suggestion_response' => '\Bandwidth\Model\RbmSuggestionResponse', 'location_response' => '\Bandwidth\Model\RbmLocationResponse' @@ -96,6 +97,7 @@ class InboundCallbackMessage implements ModelInterface, ArrayAccess, JsonSeriali 'media' => 'uri', 'priority' => null, 'channel' => null, + 'session' => null, 'content' => null, 'suggestion_response' => null, 'location_response' => null @@ -120,6 +122,7 @@ class InboundCallbackMessage implements ModelInterface, ArrayAccess, JsonSeriali 'media' => false, 'priority' => false, 'channel' => false, + 'session' => false, 'content' => false, 'suggestion_response' => false, 'location_response' => false @@ -214,6 +217,7 @@ public function isNullableSetToNull(string $property): bool 'media' => 'media', 'priority' => 'priority', 'channel' => 'channel', + 'session' => 'session', 'content' => 'content', 'suggestion_response' => 'suggestionResponse', 'location_response' => 'locationResponse' @@ -238,6 +242,7 @@ public function isNullableSetToNull(string $property): bool 'media' => 'setMedia', 'priority' => 'setPriority', 'channel' => 'setChannel', + 'session' => 'setSession', 'content' => 'setContent', 'suggestion_response' => 'setSuggestionResponse', 'location_response' => 'setLocationResponse' @@ -262,6 +267,7 @@ public function isNullableSetToNull(string $property): bool 'media' => 'getMedia', 'priority' => 'getPriority', 'channel' => 'getChannel', + 'session' => 'getSession', 'content' => 'getContent', 'suggestion_response' => 'getSuggestionResponse', 'location_response' => 'getLocationResponse' @@ -327,6 +333,7 @@ public function __construct(?array $data = null) $this->setIfExists('media', $data ?? [], null); $this->setIfExists('priority', $data ?? [], null); $this->setIfExists('channel', $data ?? [], null); + $this->setIfExists('session', $data ?? [], null); $this->setIfExists('content', $data ?? [], null); $this->setIfExists('suggestion_response', $data ?? [], null); $this->setIfExists('location_response', $data ?? [], null); @@ -745,6 +752,33 @@ public function setChannel(?\Bandwidth\Model\MultiChannelMessageChannelEnum $cha return $this; } + /** + * Gets session + * + * @return \Bandwidth\Model\RbmSession|null + */ + public function getSession(): ?\Bandwidth\Model\RbmSession + { + return $this->container['session']; + } + + /** + * Sets session + * + * @param \Bandwidth\Model\RbmSession|null $session session + * + * @return $this + */ + public function setSession(?\Bandwidth\Model\RbmSession $session): static + { + if (is_null($session)) { + throw new InvalidArgumentException('non-nullable session cannot be null'); + } + $this->container['session'] = $session; + + return $this; + } + /** * Gets content * diff --git a/src/Model/MultiChannelActionCalendarEvent.php b/src/Model/MultiChannelActionCalendarEvent.php index fba5f1b7..d6483ea1 100644 --- a/src/Model/MultiChannelActionCalendarEvent.php +++ b/src/Model/MultiChannelActionCalendarEvent.php @@ -76,7 +76,7 @@ class MultiChannelActionCalendarEvent implements ModelInterface, ArrayAccess, Js protected static array $openAPIFormats = [ 'type' => null, 'text' => null, - 'postback_data' => 'byte', + 'postback_data' => null, 'title' => null, 'start_time' => 'date-time', 'end_time' => 'date-time', @@ -307,6 +307,10 @@ public function listInvalidProperties(): array if ($this->container['postback_data'] === null) { $invalidProperties[] = "'postback_data' can't be null"; } + if (!is_null($this->container['postback_data']) && (mb_strlen($this->container['postback_data']) > 2048)) { + $invalidProperties[] = "invalid value for 'postback_data', the character length must be smaller than or equal to 2048."; + } + if ($this->container['title'] === null) { $invalidProperties[] = "'title' can't be null"; } @@ -407,7 +411,7 @@ public function getPostbackData(): string /** * Sets postback_data * - * @param string $postback_data Base64 payload the customer receives when the reply is clicked. + * @param string $postback_data Payload the customer receives when the reply is clicked. * * @return $this */ @@ -416,6 +420,9 @@ public function setPostbackData(string $postback_data): static if (is_null($postback_data)) { throw new InvalidArgumentException('non-nullable postback_data cannot be null'); } + if ((mb_strlen($postback_data) > 2048)) { + throw new InvalidArgumentException('invalid length for $postback_data when calling MultiChannelActionCalendarEvent., must be smaller than or equal to 2048.'); + } $this->container['postback_data'] = $postback_data; diff --git a/src/Model/RbmActionBase.php b/src/Model/RbmActionBase.php index 4efb02c4..d0cae684 100644 --- a/src/Model/RbmActionBase.php +++ b/src/Model/RbmActionBase.php @@ -72,7 +72,7 @@ class RbmActionBase implements ModelInterface, ArrayAccess, JsonSerializable protected static array $openAPIFormats = [ 'type' => null, 'text' => null, - 'postback_data' => 'byte' + 'postback_data' => null ]; /** @@ -279,6 +279,10 @@ public function listInvalidProperties(): array if ($this->container['postback_data'] === null) { $invalidProperties[] = "'postback_data' can't be null"; } + if (!is_null($this->container['postback_data']) && (mb_strlen($this->container['postback_data']) > 2048)) { + $invalidProperties[] = "invalid value for 'postback_data', the character length must be smaller than or equal to 2048."; + } + return $invalidProperties; } @@ -362,7 +366,7 @@ public function getPostbackData(): string /** * Sets postback_data * - * @param string $postback_data Base64 payload the customer receives when the reply is clicked. + * @param string $postback_data Payload the customer receives when the reply is clicked. * * @return $this */ @@ -371,6 +375,9 @@ public function setPostbackData(string $postback_data): static if (is_null($postback_data)) { throw new InvalidArgumentException('non-nullable postback_data cannot be null'); } + if ((mb_strlen($postback_data) > 2048)) { + throw new InvalidArgumentException('invalid length for $postback_data when calling RbmActionBase., must be smaller than or equal to 2048.'); + } $this->container['postback_data'] = $postback_data; diff --git a/src/Model/RbmActionDial.php b/src/Model/RbmActionDial.php index 23fa9998..47967bb5 100644 --- a/src/Model/RbmActionDial.php +++ b/src/Model/RbmActionDial.php @@ -73,7 +73,7 @@ class RbmActionDial implements ModelInterface, ArrayAccess, JsonSerializable protected static array $openAPIFormats = [ 'type' => null, 'text' => null, - 'postback_data' => 'byte', + 'postback_data' => null, 'phone_number' => null ]; @@ -286,6 +286,10 @@ public function listInvalidProperties(): array if ($this->container['postback_data'] === null) { $invalidProperties[] = "'postback_data' can't be null"; } + if (!is_null($this->container['postback_data']) && (mb_strlen($this->container['postback_data']) > 2048)) { + $invalidProperties[] = "invalid value for 'postback_data', the character length must be smaller than or equal to 2048."; + } + if ($this->container['phone_number'] === null) { $invalidProperties[] = "'phone_number' can't be null"; } @@ -372,7 +376,7 @@ public function getPostbackData(): string /** * Sets postback_data * - * @param string $postback_data Base64 payload the customer receives when the reply is clicked. + * @param string $postback_data Payload the customer receives when the reply is clicked. * * @return $this */ @@ -381,6 +385,9 @@ public function setPostbackData(string $postback_data): static if (is_null($postback_data)) { throw new InvalidArgumentException('non-nullable postback_data cannot be null'); } + if ((mb_strlen($postback_data) > 2048)) { + throw new InvalidArgumentException('invalid length for $postback_data when calling RbmActionDial., must be smaller than or equal to 2048.'); + } $this->container['postback_data'] = $postback_data; diff --git a/src/Model/RbmActionOpenUrl.php b/src/Model/RbmActionOpenUrl.php index 66aa7a6b..716fc40f 100644 --- a/src/Model/RbmActionOpenUrl.php +++ b/src/Model/RbmActionOpenUrl.php @@ -75,7 +75,7 @@ class RbmActionOpenUrl implements ModelInterface, ArrayAccess, JsonSerializable protected static array $openAPIFormats = [ 'type' => null, 'text' => null, - 'postback_data' => 'byte', + 'postback_data' => null, 'url' => 'uri', 'application' => null, 'webview_view_mode' => null @@ -300,6 +300,10 @@ public function listInvalidProperties(): array if ($this->container['postback_data'] === null) { $invalidProperties[] = "'postback_data' can't be null"; } + if (!is_null($this->container['postback_data']) && (mb_strlen($this->container['postback_data']) > 2048)) { + $invalidProperties[] = "invalid value for 'postback_data', the character length must be smaller than or equal to 2048."; + } + if ($this->container['url'] === null) { $invalidProperties[] = "'url' can't be null"; } @@ -390,7 +394,7 @@ public function getPostbackData(): string /** * Sets postback_data * - * @param string $postback_data Base64 payload the customer receives when the reply is clicked. + * @param string $postback_data Payload the customer receives when the reply is clicked. * * @return $this */ @@ -399,6 +403,9 @@ public function setPostbackData(string $postback_data): static if (is_null($postback_data)) { throw new InvalidArgumentException('non-nullable postback_data cannot be null'); } + if ((mb_strlen($postback_data) > 2048)) { + throw new InvalidArgumentException('invalid length for $postback_data when calling RbmActionOpenUrl., must be smaller than or equal to 2048.'); + } $this->container['postback_data'] = $postback_data; diff --git a/src/Model/RbmActionViewLocation.php b/src/Model/RbmActionViewLocation.php index 50ced2af..39a95275 100644 --- a/src/Model/RbmActionViewLocation.php +++ b/src/Model/RbmActionViewLocation.php @@ -75,7 +75,7 @@ class RbmActionViewLocation implements ModelInterface, ArrayAccess, JsonSerializ protected static array $openAPIFormats = [ 'type' => null, 'text' => null, - 'postback_data' => 'byte', + 'postback_data' => null, 'latitude' => 'double', 'longitude' => 'double', 'label' => null @@ -300,6 +300,10 @@ public function listInvalidProperties(): array if ($this->container['postback_data'] === null) { $invalidProperties[] = "'postback_data' can't be null"; } + if (!is_null($this->container['postback_data']) && (mb_strlen($this->container['postback_data']) > 2048)) { + $invalidProperties[] = "invalid value for 'postback_data', the character length must be smaller than or equal to 2048."; + } + if ($this->container['latitude'] === null) { $invalidProperties[] = "'latitude' can't be null"; } @@ -393,7 +397,7 @@ public function getPostbackData(): string /** * Sets postback_data * - * @param string $postback_data Base64 payload the customer receives when the reply is clicked. + * @param string $postback_data Payload the customer receives when the reply is clicked. * * @return $this */ @@ -402,6 +406,9 @@ public function setPostbackData(string $postback_data): static if (is_null($postback_data)) { throw new InvalidArgumentException('non-nullable postback_data cannot be null'); } + if ((mb_strlen($postback_data) > 2048)) { + throw new InvalidArgumentException('invalid length for $postback_data when calling RbmActionViewLocation., must be smaller than or equal to 2048.'); + } $this->container['postback_data'] = $postback_data; diff --git a/src/Model/RbmSession.php b/src/Model/RbmSession.php new file mode 100644 index 00000000..bf7e1cb6 --- /dev/null +++ b/src/Model/RbmSession.php @@ -0,0 +1,552 @@ + + */ +class RbmSession implements ModelInterface, ArrayAccess, JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static string $openAPIModelName = 'rbmSession'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var array