rcs 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rcs/messages/rcs/client.rb +124 -0
- data/lib/rcs/messages/rcs/types/send_typing_indicator_schema_options.rb +66 -0
- data/lib/rcs/types/options.rb +111 -0
- data/lib/rcs/types/rcs_button_open_url.rb +36 -9
- data/lib/rcs/types/rcs_button_open_url_webview_mode.rb +19 -0
- data/lib/rcs/types/rcs_button_send_location.rb +20 -9
- data/lib/rcs/types/rich_cards_message.rb +10 -10
- data/lib/rcs/types/send_rcs_card_options.rb +132 -0
- data/lib/rcs/types/send_rcs_card_options_standalone_card.rb +78 -0
- data/lib/rcs/types/send_rcs_card_options_standalone_card_image_alignment.rb +12 -0
- data/lib/rcs/types/send_rcs_card_options_standalone_card_orientation.rb +11 -0
- data/lib/rcs/types/send_typing_indicator_response.rb +100 -0
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +8 -0
- metadata +10 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c98f78cc1ea5796ec8fc65c63be91084717c9b726b8191ad79266ddf73c34285
|
|
4
|
+
data.tar.gz: 1d4af67f770184e27a8ecfa6ddb67142c62ea935e6e035e6314ded4e7913e554
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1eeb298dfb7a4207d5e3effb626124e3c27275c2d96f66b48f3013ed67a1dcd6300c47961a71ec0c543ca2166d79d96e7909f2f5d1d425bac3739a16da5365a3
|
|
7
|
+
data.tar.gz: c856a7edbe4169431bcbe72ede9ddb6e21dea469579b73f60cd1cf3a9ca496e8fa6905b9fc3441bca04e06aeaf0a7c1a16f9e4e9e8addf3fcd7761a0e0be5bb3
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
require_relative "../../../requests"
|
|
4
4
|
require_relative "../../types/rich_message"
|
|
5
5
|
require_relative "types/rcs_send_response"
|
|
6
|
+
require_relative "types/send_typing_indicator_schema_options"
|
|
7
|
+
require_relative "../../types/send_typing_indicator_response"
|
|
6
8
|
require_relative "../../types/rcs_validate_content"
|
|
7
9
|
require_relative "../../types/rcs_validation_result"
|
|
8
10
|
require "async"
|
|
@@ -51,6 +53,66 @@ module Pinnacle
|
|
|
51
53
|
Pinnacle::Messages::Rcs::Types::RcsSendResponse.from_json(json_object: response.body)
|
|
52
54
|
end
|
|
53
55
|
|
|
56
|
+
# Send a typing indicator from an RCS agent to a recipient.
|
|
57
|
+
# This endpoint allows RCS agents to display a typing indicator to recipients. The
|
|
58
|
+
# indicator is a message bubble with animated typing dots like this: <img
|
|
59
|
+
# le.app/storage/v1/object/public/pinnacle-public-assets/ios-typing-indicator.png"
|
|
60
|
+
# alt="Typing Indicator" style="display: inline; height: 1.5em; vertical-align:
|
|
61
|
+
# middle; margin: 0 4px;" />
|
|
62
|
+
# **Use Case:** Typing indicators are especially useful for providing feedback to
|
|
63
|
+
# users while the agent is thinking or generating a response that may take some
|
|
64
|
+
# time, creating a more engaging conversational experience.
|
|
65
|
+
# **Expiration:** Typing indicators automatically expire after around 20 seconds
|
|
66
|
+
# or when the agent sends a message, whichever comes first.
|
|
67
|
+
# **Frequency:** You can send typing indicators as many times as needed, though
|
|
68
|
+
# only one will be displayed at a time. Sending multiple typing indicators will
|
|
69
|
+
# extend the duration of the current indicator.
|
|
70
|
+
# > **Note:** Typing indicators are best-effort hints, not delivery-guaranteed
|
|
71
|
+
# state. The platform is allowed to coalesce or drop them, and the client UI
|
|
72
|
+
# decides when to show/hide.
|
|
73
|
+
#
|
|
74
|
+
# @param agent_id [String] The unique identifier of the RCS agent sending the typing indicator. <br>
|
|
75
|
+
# Format: `agent_` followed by alphanumeric characters (e.g., `agent_pinnacle`).
|
|
76
|
+
# @param to [String] The recipient's phone number in E.164 format. <br>
|
|
77
|
+
# Must include country code with a leading plus sign (e.g., `+14155551234`).
|
|
78
|
+
# @param options [Hash] Configure how your typing indicator is sent.Request of type Pinnacle::Messages::Rcs::Types::SendTypingIndicatorSchemaOptions, as a Hash
|
|
79
|
+
# * :test_mode (Boolean)
|
|
80
|
+
# @param request_options [Pinnacle::RequestOptions]
|
|
81
|
+
# @return [Pinnacle::Types::SendTypingIndicatorResponse]
|
|
82
|
+
# @example
|
|
83
|
+
# api = Pinnacle::Client.new(
|
|
84
|
+
# base_url: "https://api.example.com",
|
|
85
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
|
86
|
+
# api_key: "YOUR_API_KEY"
|
|
87
|
+
# )
|
|
88
|
+
# api.messages.rcs.send_typing(
|
|
89
|
+
# agent_id: "agent_pinnacle",
|
|
90
|
+
# to: "+14154746461",
|
|
91
|
+
# options: { test_mode: false }
|
|
92
|
+
# )
|
|
93
|
+
def send_typing(agent_id:, to:, options: nil, request_options: nil)
|
|
94
|
+
response = @request_client.conn.post do |req|
|
|
95
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
96
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
97
|
+
req.headers = {
|
|
98
|
+
**(req.headers || {}),
|
|
99
|
+
**@request_client.get_headers,
|
|
100
|
+
**(request_options&.additional_headers || {})
|
|
101
|
+
}.compact
|
|
102
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
|
103
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
|
104
|
+
end
|
|
105
|
+
req.body = {
|
|
106
|
+
**(request_options&.additional_body_parameters || {}),
|
|
107
|
+
agentId: agent_id,
|
|
108
|
+
to: to,
|
|
109
|
+
options: options
|
|
110
|
+
}.compact
|
|
111
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/messages/typing"
|
|
112
|
+
end
|
|
113
|
+
Pinnacle::Types::SendTypingIndicatorResponse.from_json(json_object: response.body)
|
|
114
|
+
end
|
|
115
|
+
|
|
54
116
|
# Validate RCS message content without sending it.
|
|
55
117
|
#
|
|
56
118
|
# @param request [Pinnacle::Types::RcsTextContent, Pinnacle::Types::RcsValidateContentMedia, Pinnacle::Types::RcsCards]
|
|
@@ -126,6 +188,68 @@ module Pinnacle
|
|
|
126
188
|
end
|
|
127
189
|
end
|
|
128
190
|
|
|
191
|
+
# Send a typing indicator from an RCS agent to a recipient.
|
|
192
|
+
# This endpoint allows RCS agents to display a typing indicator to recipients. The
|
|
193
|
+
# indicator is a message bubble with animated typing dots like this: <img
|
|
194
|
+
# le.app/storage/v1/object/public/pinnacle-public-assets/ios-typing-indicator.png"
|
|
195
|
+
# alt="Typing Indicator" style="display: inline; height: 1.5em; vertical-align:
|
|
196
|
+
# middle; margin: 0 4px;" />
|
|
197
|
+
# **Use Case:** Typing indicators are especially useful for providing feedback to
|
|
198
|
+
# users while the agent is thinking or generating a response that may take some
|
|
199
|
+
# time, creating a more engaging conversational experience.
|
|
200
|
+
# **Expiration:** Typing indicators automatically expire after around 20 seconds
|
|
201
|
+
# or when the agent sends a message, whichever comes first.
|
|
202
|
+
# **Frequency:** You can send typing indicators as many times as needed, though
|
|
203
|
+
# only one will be displayed at a time. Sending multiple typing indicators will
|
|
204
|
+
# extend the duration of the current indicator.
|
|
205
|
+
# > **Note:** Typing indicators are best-effort hints, not delivery-guaranteed
|
|
206
|
+
# state. The platform is allowed to coalesce or drop them, and the client UI
|
|
207
|
+
# decides when to show/hide.
|
|
208
|
+
#
|
|
209
|
+
# @param agent_id [String] The unique identifier of the RCS agent sending the typing indicator. <br>
|
|
210
|
+
# Format: `agent_` followed by alphanumeric characters (e.g., `agent_pinnacle`).
|
|
211
|
+
# @param to [String] The recipient's phone number in E.164 format. <br>
|
|
212
|
+
# Must include country code with a leading plus sign (e.g., `+14155551234`).
|
|
213
|
+
# @param options [Hash] Configure how your typing indicator is sent.Request of type Pinnacle::Messages::Rcs::Types::SendTypingIndicatorSchemaOptions, as a Hash
|
|
214
|
+
# * :test_mode (Boolean)
|
|
215
|
+
# @param request_options [Pinnacle::RequestOptions]
|
|
216
|
+
# @return [Pinnacle::Types::SendTypingIndicatorResponse]
|
|
217
|
+
# @example
|
|
218
|
+
# api = Pinnacle::Client.new(
|
|
219
|
+
# base_url: "https://api.example.com",
|
|
220
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
|
221
|
+
# api_key: "YOUR_API_KEY"
|
|
222
|
+
# )
|
|
223
|
+
# api.messages.rcs.send_typing(
|
|
224
|
+
# agent_id: "agent_pinnacle",
|
|
225
|
+
# to: "+14154746461",
|
|
226
|
+
# options: { test_mode: false }
|
|
227
|
+
# )
|
|
228
|
+
def send_typing(agent_id:, to:, options: nil, request_options: nil)
|
|
229
|
+
Async do
|
|
230
|
+
response = @request_client.conn.post do |req|
|
|
231
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
|
232
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
|
233
|
+
req.headers = {
|
|
234
|
+
**(req.headers || {}),
|
|
235
|
+
**@request_client.get_headers,
|
|
236
|
+
**(request_options&.additional_headers || {})
|
|
237
|
+
}.compact
|
|
238
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
|
239
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
|
240
|
+
end
|
|
241
|
+
req.body = {
|
|
242
|
+
**(request_options&.additional_body_parameters || {}),
|
|
243
|
+
agentId: agent_id,
|
|
244
|
+
to: to,
|
|
245
|
+
options: options
|
|
246
|
+
}.compact
|
|
247
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/messages/typing"
|
|
248
|
+
end
|
|
249
|
+
Pinnacle::Types::SendTypingIndicatorResponse.from_json(json_object: response.body)
|
|
250
|
+
end
|
|
251
|
+
end
|
|
252
|
+
|
|
129
253
|
# Validate RCS message content without sending it.
|
|
130
254
|
#
|
|
131
255
|
# @param request [Pinnacle::Types::RcsTextContent, Pinnacle::Types::RcsValidateContentMedia, Pinnacle::Types::RcsCards]
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "ostruct"
|
|
4
|
+
require "json"
|
|
5
|
+
|
|
6
|
+
module Pinnacle
|
|
7
|
+
module Messages
|
|
8
|
+
module Rcs
|
|
9
|
+
module Types
|
|
10
|
+
# Configure how your typing indicator is sent.
|
|
11
|
+
class SendTypingIndicatorSchemaOptions
|
|
12
|
+
# @return [Boolean] Send via the test agent to whitelisted test devices. Useful for development and
|
|
13
|
+
# debugging.
|
|
14
|
+
attr_reader :test_mode
|
|
15
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
16
|
+
attr_reader :additional_properties
|
|
17
|
+
# @return [Object]
|
|
18
|
+
attr_reader :_field_set
|
|
19
|
+
protected :_field_set
|
|
20
|
+
|
|
21
|
+
OMIT = Object.new
|
|
22
|
+
|
|
23
|
+
# @param test_mode [Boolean] Send via the test agent to whitelisted test devices. Useful for development and
|
|
24
|
+
# debugging.
|
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
26
|
+
# @return [Pinnacle::Messages::Rcs::Types::SendTypingIndicatorSchemaOptions]
|
|
27
|
+
def initialize(test_mode: OMIT, additional_properties: nil)
|
|
28
|
+
@test_mode = test_mode if test_mode != OMIT
|
|
29
|
+
@additional_properties = additional_properties
|
|
30
|
+
@_field_set = { "test_mode": test_mode }.reject do |_k, v|
|
|
31
|
+
v == OMIT
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Deserialize a JSON object to an instance of SendTypingIndicatorSchemaOptions
|
|
36
|
+
#
|
|
37
|
+
# @param json_object [String]
|
|
38
|
+
# @return [Pinnacle::Messages::Rcs::Types::SendTypingIndicatorSchemaOptions]
|
|
39
|
+
def self.from_json(json_object:)
|
|
40
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
41
|
+
parsed_json = JSON.parse(json_object)
|
|
42
|
+
test_mode = parsed_json["test_mode"]
|
|
43
|
+
new(test_mode: test_mode, additional_properties: struct)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Serialize an instance of SendTypingIndicatorSchemaOptions to a JSON object
|
|
47
|
+
#
|
|
48
|
+
# @return [String]
|
|
49
|
+
def to_json(*_args)
|
|
50
|
+
@_field_set&.to_json
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
54
|
+
# hash and check each fields type against the current object's property
|
|
55
|
+
# definitions.
|
|
56
|
+
#
|
|
57
|
+
# @param obj [Object]
|
|
58
|
+
# @return [Void]
|
|
59
|
+
def self.validate_raw(obj:)
|
|
60
|
+
obj.test_mode&.is_a?(Boolean) != false || raise("Passed value for field obj.test_mode is not the expected type, validation failed.")
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "message_schedule"
|
|
4
|
+
require_relative "tracking"
|
|
5
|
+
require "ostruct"
|
|
6
|
+
require "json"
|
|
7
|
+
|
|
8
|
+
module Pinnacle
|
|
9
|
+
module Types
|
|
10
|
+
# Configure how your RCS message is sent and tracked.
|
|
11
|
+
class Options
|
|
12
|
+
# @return [Pinnacle::Types::MessageSchedule]
|
|
13
|
+
attr_reader :schedule
|
|
14
|
+
# @return [Boolean] Send via the test agent to whitelisted test devices. Useful for development and
|
|
15
|
+
# debugging.
|
|
16
|
+
attr_reader :test_mode
|
|
17
|
+
# @return [Pinnacle::Types::Tracking]
|
|
18
|
+
attr_reader :tracking
|
|
19
|
+
# @return [Boolean] Media files and card media will be transcoded to a supported RCS format. This
|
|
20
|
+
# adds a small delay to sending the message. Ignored for rich text messages.
|
|
21
|
+
attr_reader :transcode
|
|
22
|
+
# @return [Boolean] Validate your message for any unsupported files. <br>
|
|
23
|
+
# If failed, errors will be thrown and the message will not send.
|
|
24
|
+
attr_reader :validate
|
|
25
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
26
|
+
attr_reader :additional_properties
|
|
27
|
+
# @return [Object]
|
|
28
|
+
attr_reader :_field_set
|
|
29
|
+
protected :_field_set
|
|
30
|
+
|
|
31
|
+
OMIT = Object.new
|
|
32
|
+
|
|
33
|
+
# @param schedule [Pinnacle::Types::MessageSchedule]
|
|
34
|
+
# @param test_mode [Boolean] Send via the test agent to whitelisted test devices. Useful for development and
|
|
35
|
+
# debugging.
|
|
36
|
+
# @param tracking [Pinnacle::Types::Tracking]
|
|
37
|
+
# @param transcode [Boolean] Media files and card media will be transcoded to a supported RCS format. This
|
|
38
|
+
# adds a small delay to sending the message. Ignored for rich text messages.
|
|
39
|
+
# @param validate [Boolean] Validate your message for any unsupported files. <br>
|
|
40
|
+
# If failed, errors will be thrown and the message will not send.
|
|
41
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
42
|
+
# @return [Pinnacle::Types::Options]
|
|
43
|
+
def initialize(schedule: OMIT, test_mode: OMIT, tracking: OMIT, transcode: OMIT, validate: OMIT,
|
|
44
|
+
additional_properties: nil)
|
|
45
|
+
@schedule = schedule if schedule != OMIT
|
|
46
|
+
@test_mode = test_mode if test_mode != OMIT
|
|
47
|
+
@tracking = tracking if tracking != OMIT
|
|
48
|
+
@transcode = transcode if transcode != OMIT
|
|
49
|
+
@validate = validate if validate != OMIT
|
|
50
|
+
@additional_properties = additional_properties
|
|
51
|
+
@_field_set = {
|
|
52
|
+
"schedule": schedule,
|
|
53
|
+
"test_mode": test_mode,
|
|
54
|
+
"tracking": tracking,
|
|
55
|
+
"transcode": transcode,
|
|
56
|
+
"validate": validate
|
|
57
|
+
}.reject do |_k, v|
|
|
58
|
+
v == OMIT
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Deserialize a JSON object to an instance of Options
|
|
63
|
+
#
|
|
64
|
+
# @param json_object [String]
|
|
65
|
+
# @return [Pinnacle::Types::Options]
|
|
66
|
+
def self.from_json(json_object:)
|
|
67
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
68
|
+
parsed_json = JSON.parse(json_object)
|
|
69
|
+
if parsed_json["schedule"].nil?
|
|
70
|
+
schedule = nil
|
|
71
|
+
else
|
|
72
|
+
schedule = parsed_json["schedule"].to_json
|
|
73
|
+
schedule = Pinnacle::Types::MessageSchedule.from_json(json_object: schedule)
|
|
74
|
+
end
|
|
75
|
+
test_mode = parsed_json["test_mode"]
|
|
76
|
+
tracking = parsed_json["tracking"]
|
|
77
|
+
transcode = parsed_json["transcode"]
|
|
78
|
+
validate = parsed_json["validate"]
|
|
79
|
+
new(
|
|
80
|
+
schedule: schedule,
|
|
81
|
+
test_mode: test_mode,
|
|
82
|
+
tracking: tracking,
|
|
83
|
+
transcode: transcode,
|
|
84
|
+
validate: validate,
|
|
85
|
+
additional_properties: struct
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Serialize an instance of Options to a JSON object
|
|
90
|
+
#
|
|
91
|
+
# @return [String]
|
|
92
|
+
def to_json(*_args)
|
|
93
|
+
@_field_set&.to_json
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
97
|
+
# hash and check each fields type against the current object's property
|
|
98
|
+
# definitions.
|
|
99
|
+
#
|
|
100
|
+
# @param obj [Object]
|
|
101
|
+
# @return [Void]
|
|
102
|
+
def self.validate_raw(obj:)
|
|
103
|
+
obj.schedule.nil? || Pinnacle::Types::MessageSchedule.validate_raw(obj: obj.schedule)
|
|
104
|
+
obj.test_mode&.is_a?(Boolean) != false || raise("Passed value for field obj.test_mode is not the expected type, validation failed.")
|
|
105
|
+
obj.tracking&.is_a?(Pinnacle::Types::Tracking) != false || raise("Passed value for field obj.tracking is not the expected type, validation failed.")
|
|
106
|
+
obj.transcode&.is_a?(Boolean) != false || raise("Passed value for field obj.transcode is not the expected type, validation failed.")
|
|
107
|
+
obj.validate&.is_a?(Boolean) != false || raise("Passed value for field obj.validate is not the expected type, validation failed.")
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative "rcs_button_open_url_webview_mode"
|
|
3
4
|
require "ostruct"
|
|
4
5
|
require "json"
|
|
5
6
|
|
|
@@ -7,12 +8,21 @@ module Pinnacle
|
|
|
7
8
|
module Types
|
|
8
9
|
# Button that opens a URL when tapped by the recipient.
|
|
9
10
|
class RcsButtonOpenUrl
|
|
10
|
-
# @return [
|
|
11
|
-
|
|
11
|
+
# @return [Pinnacle::Types::RcsButtonOpenUrlWebviewMode] Controls how the URL is displayed when the button is tapped.
|
|
12
|
+
# **Default behavior:** If not specified, the URL opens in the device's default
|
|
13
|
+
# browser. If you're sending deeplinks, you should use this mode as it will open
|
|
14
|
+
# the deeplink in the native app if it is installed.
|
|
15
|
+
# **Available modes in order of size:**
|
|
16
|
+
# - `HALF` — Half-screen webview overlay
|
|
17
|
+
# - `TALL` — Tall webview overlay
|
|
18
|
+
# - `FULL` — Full-screen webview
|
|
19
|
+
attr_reader :webview_mode
|
|
12
20
|
# @return [String] The URL to open when the button is tapped. Must be a valid HTTP or HTTPS URL.
|
|
13
21
|
attr_reader :payload
|
|
14
22
|
# @return [String] Display text for the button.
|
|
15
23
|
attr_reader :title
|
|
24
|
+
# @return [String] Optional additional data to attach to this button.
|
|
25
|
+
attr_reader :metadata
|
|
16
26
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
17
27
|
attr_reader :additional_properties
|
|
18
28
|
# @return [Object]
|
|
@@ -21,17 +31,31 @@ module Pinnacle
|
|
|
21
31
|
|
|
22
32
|
OMIT = Object.new
|
|
23
33
|
|
|
24
|
-
# @param
|
|
34
|
+
# @param webview_mode [Pinnacle::Types::RcsButtonOpenUrlWebviewMode] Controls how the URL is displayed when the button is tapped.
|
|
35
|
+
# **Default behavior:** If not specified, the URL opens in the device's default
|
|
36
|
+
# browser. If you're sending deeplinks, you should use this mode as it will open
|
|
37
|
+
# the deeplink in the native app if it is installed.
|
|
38
|
+
# **Available modes in order of size:**
|
|
39
|
+
# - `HALF` — Half-screen webview overlay
|
|
40
|
+
# - `TALL` — Tall webview overlay
|
|
41
|
+
# - `FULL` — Full-screen webview
|
|
25
42
|
# @param payload [String] The URL to open when the button is tapped. Must be a valid HTTP or HTTPS URL.
|
|
26
43
|
# @param title [String] Display text for the button.
|
|
44
|
+
# @param metadata [String] Optional additional data to attach to this button.
|
|
27
45
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
28
46
|
# @return [Pinnacle::Types::RcsButtonOpenUrl]
|
|
29
|
-
def initialize(payload:, title:, metadata: OMIT, additional_properties: nil)
|
|
30
|
-
@
|
|
47
|
+
def initialize(payload:, title:, webview_mode: OMIT, metadata: OMIT, additional_properties: nil)
|
|
48
|
+
@webview_mode = webview_mode if webview_mode != OMIT
|
|
31
49
|
@payload = payload
|
|
32
50
|
@title = title
|
|
51
|
+
@metadata = metadata if metadata != OMIT
|
|
33
52
|
@additional_properties = additional_properties
|
|
34
|
-
@_field_set = {
|
|
53
|
+
@_field_set = {
|
|
54
|
+
"webviewMode": webview_mode,
|
|
55
|
+
"payload": payload,
|
|
56
|
+
"title": title,
|
|
57
|
+
"metadata": metadata
|
|
58
|
+
}.reject do |_k, v|
|
|
35
59
|
v == OMIT
|
|
36
60
|
end
|
|
37
61
|
end
|
|
@@ -43,13 +67,15 @@ module Pinnacle
|
|
|
43
67
|
def self.from_json(json_object:)
|
|
44
68
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
45
69
|
parsed_json = JSON.parse(json_object)
|
|
46
|
-
|
|
70
|
+
webview_mode = parsed_json["webviewMode"]
|
|
47
71
|
payload = parsed_json["payload"]
|
|
48
72
|
title = parsed_json["title"]
|
|
73
|
+
metadata = parsed_json["metadata"]
|
|
49
74
|
new(
|
|
50
|
-
|
|
75
|
+
webview_mode: webview_mode,
|
|
51
76
|
payload: payload,
|
|
52
77
|
title: title,
|
|
78
|
+
metadata: metadata,
|
|
53
79
|
additional_properties: struct
|
|
54
80
|
)
|
|
55
81
|
end
|
|
@@ -68,9 +94,10 @@ module Pinnacle
|
|
|
68
94
|
# @param obj [Object]
|
|
69
95
|
# @return [Void]
|
|
70
96
|
def self.validate_raw(obj:)
|
|
71
|
-
obj.
|
|
97
|
+
obj.webview_mode&.is_a?(Pinnacle::Types::RcsButtonOpenUrlWebviewMode) != false || raise("Passed value for field obj.webview_mode is not the expected type, validation failed.")
|
|
72
98
|
obj.payload.is_a?(String) != false || raise("Passed value for field obj.payload is not the expected type, validation failed.")
|
|
73
99
|
obj.title.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.")
|
|
100
|
+
obj.metadata&.is_a?(String) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
|
|
74
101
|
end
|
|
75
102
|
end
|
|
76
103
|
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
# Controls how the URL is displayed when the button is tapped.
|
|
6
|
+
# **Default behavior:** If not specified, the URL opens in the device's default
|
|
7
|
+
# browser. If you're sending deeplinks, you should use this mode as it will open
|
|
8
|
+
# the deeplink in the native app if it is installed.
|
|
9
|
+
# **Available modes in order of size:**
|
|
10
|
+
# - `HALF` — Half-screen webview overlay
|
|
11
|
+
# - `TALL` — Tall webview overlay
|
|
12
|
+
# - `FULL` — Full-screen webview
|
|
13
|
+
class RcsButtonOpenUrlWebviewMode
|
|
14
|
+
HALF = "HALF"
|
|
15
|
+
TALL = "TALL"
|
|
16
|
+
FULL = "FULL"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -8,12 +8,16 @@ module Pinnacle
|
|
|
8
8
|
module Types
|
|
9
9
|
# Button that shares a specific location with the recipient when tapped.
|
|
10
10
|
class RcsButtonSendLocation
|
|
11
|
+
# @return [String] Optional name or label for the location that will be displayed in the map app
|
|
12
|
+
# (e.g., "Central Park", "Home Office").
|
|
13
|
+
# If not provided, the button title will be used as the location name.
|
|
14
|
+
attr_reader :name
|
|
11
15
|
# @return [Pinnacle::Types::RcsButtonSendLocationLatLong] Geographic coordinates of the location to share.
|
|
12
16
|
attr_reader :lat_long
|
|
13
|
-
# @return [String] Optional additional data to attach to this button.
|
|
14
|
-
attr_reader :metadata
|
|
15
17
|
# @return [String] Display text for the button.
|
|
16
18
|
attr_reader :title
|
|
19
|
+
# @return [String] Optional additional data to attach to this button.
|
|
20
|
+
attr_reader :metadata
|
|
17
21
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
18
22
|
attr_reader :additional_properties
|
|
19
23
|
# @return [Object]
|
|
@@ -22,17 +26,21 @@ module Pinnacle
|
|
|
22
26
|
|
|
23
27
|
OMIT = Object.new
|
|
24
28
|
|
|
29
|
+
# @param name [String] Optional name or label for the location that will be displayed in the map app
|
|
30
|
+
# (e.g., "Central Park", "Home Office").
|
|
31
|
+
# If not provided, the button title will be used as the location name.
|
|
25
32
|
# @param lat_long [Pinnacle::Types::RcsButtonSendLocationLatLong] Geographic coordinates of the location to share.
|
|
26
|
-
# @param metadata [String] Optional additional data to attach to this button.
|
|
27
33
|
# @param title [String] Display text for the button.
|
|
34
|
+
# @param metadata [String] Optional additional data to attach to this button.
|
|
28
35
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
29
36
|
# @return [Pinnacle::Types::RcsButtonSendLocation]
|
|
30
|
-
def initialize(lat_long:, title:, metadata: OMIT, additional_properties: nil)
|
|
37
|
+
def initialize(lat_long:, title:, name: OMIT, metadata: OMIT, additional_properties: nil)
|
|
38
|
+
@name = name if name != OMIT
|
|
31
39
|
@lat_long = lat_long
|
|
32
|
-
@metadata = metadata if metadata != OMIT
|
|
33
40
|
@title = title
|
|
41
|
+
@metadata = metadata if metadata != OMIT
|
|
34
42
|
@additional_properties = additional_properties
|
|
35
|
-
@_field_set = { "
|
|
43
|
+
@_field_set = { "name": name, "latLong": lat_long, "title": title, "metadata": metadata }.reject do |_k, v|
|
|
36
44
|
v == OMIT
|
|
37
45
|
end
|
|
38
46
|
end
|
|
@@ -44,18 +52,20 @@ module Pinnacle
|
|
|
44
52
|
def self.from_json(json_object:)
|
|
45
53
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
46
54
|
parsed_json = JSON.parse(json_object)
|
|
55
|
+
name = parsed_json["name"]
|
|
47
56
|
if parsed_json["latLong"].nil?
|
|
48
57
|
lat_long = nil
|
|
49
58
|
else
|
|
50
59
|
lat_long = parsed_json["latLong"].to_json
|
|
51
60
|
lat_long = Pinnacle::Types::RcsButtonSendLocationLatLong.from_json(json_object: lat_long)
|
|
52
61
|
end
|
|
53
|
-
metadata = parsed_json["metadata"]
|
|
54
62
|
title = parsed_json["title"]
|
|
63
|
+
metadata = parsed_json["metadata"]
|
|
55
64
|
new(
|
|
65
|
+
name: name,
|
|
56
66
|
lat_long: lat_long,
|
|
57
|
-
metadata: metadata,
|
|
58
67
|
title: title,
|
|
68
|
+
metadata: metadata,
|
|
59
69
|
additional_properties: struct
|
|
60
70
|
)
|
|
61
71
|
end
|
|
@@ -74,9 +84,10 @@ module Pinnacle
|
|
|
74
84
|
# @param obj [Object]
|
|
75
85
|
# @return [Void]
|
|
76
86
|
def self.validate_raw(obj:)
|
|
87
|
+
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
|
77
88
|
Pinnacle::Types::RcsButtonSendLocationLatLong.validate_raw(obj: obj.lat_long)
|
|
78
|
-
obj.metadata&.is_a?(String) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
|
|
79
89
|
obj.title.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.")
|
|
90
|
+
obj.metadata&.is_a?(String) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
|
|
80
91
|
end
|
|
81
92
|
end
|
|
82
93
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative "
|
|
3
|
+
require_relative "send_rcs_card_options"
|
|
4
4
|
require_relative "rcs_cards_cards_item"
|
|
5
5
|
require_relative "rich_button"
|
|
6
6
|
require "ostruct"
|
|
@@ -9,10 +9,10 @@ require "json"
|
|
|
9
9
|
module Pinnacle
|
|
10
10
|
module Types
|
|
11
11
|
class RichCardsMessage
|
|
12
|
+
# @return [Pinnacle::Types::SendRcsCardOptions]
|
|
13
|
+
attr_reader :options
|
|
12
14
|
# @return [String] Your RCS agent ID which must be prefixed with 'agent_'.
|
|
13
15
|
attr_reader :from
|
|
14
|
-
# @return [Pinnacle::Types::RcsBaseOptions] Configure how your RCS message is sent and tracked.
|
|
15
|
-
attr_reader :options
|
|
16
16
|
# @return [String] Recipient's phone number in E.164 format.
|
|
17
17
|
attr_reader :to
|
|
18
18
|
# @return [Array<Pinnacle::Types::RcsCardsCardsItem>] Collection of cards attached to the message.
|
|
@@ -27,23 +27,23 @@ module Pinnacle
|
|
|
27
27
|
|
|
28
28
|
OMIT = Object.new
|
|
29
29
|
|
|
30
|
+
# @param options [Pinnacle::Types::SendRcsCardOptions]
|
|
30
31
|
# @param from [String] Your RCS agent ID which must be prefixed with 'agent_'.
|
|
31
|
-
# @param options [Pinnacle::Types::RcsBaseOptions] Configure how your RCS message is sent and tracked.
|
|
32
32
|
# @param to [String] Recipient's phone number in E.164 format.
|
|
33
33
|
# @param cards [Array<Pinnacle::Types::RcsCardsCardsItem>] Collection of cards attached to the message.
|
|
34
34
|
# @param quick_replies [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
|
35
35
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
36
36
|
# @return [Pinnacle::Types::RichCardsMessage]
|
|
37
37
|
def initialize(from:, to:, cards:, quick_replies:, options: OMIT, additional_properties: nil)
|
|
38
|
-
@from = from
|
|
39
38
|
@options = options if options != OMIT
|
|
39
|
+
@from = from
|
|
40
40
|
@to = to
|
|
41
41
|
@cards = cards
|
|
42
42
|
@quick_replies = quick_replies
|
|
43
43
|
@additional_properties = additional_properties
|
|
44
44
|
@_field_set = {
|
|
45
|
-
"from": from,
|
|
46
45
|
"options": options,
|
|
46
|
+
"from": from,
|
|
47
47
|
"to": to,
|
|
48
48
|
"cards": cards,
|
|
49
49
|
"quickReplies": quick_replies
|
|
@@ -59,13 +59,13 @@ module Pinnacle
|
|
|
59
59
|
def self.from_json(json_object:)
|
|
60
60
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
61
61
|
parsed_json = JSON.parse(json_object)
|
|
62
|
-
from = parsed_json["from"]
|
|
63
62
|
if parsed_json["options"].nil?
|
|
64
63
|
options = nil
|
|
65
64
|
else
|
|
66
65
|
options = parsed_json["options"].to_json
|
|
67
|
-
options = Pinnacle::Types::
|
|
66
|
+
options = Pinnacle::Types::SendRcsCardOptions.from_json(json_object: options)
|
|
68
67
|
end
|
|
68
|
+
from = parsed_json["from"]
|
|
69
69
|
to = parsed_json["to"]
|
|
70
70
|
cards = parsed_json["cards"]&.map do |item|
|
|
71
71
|
item = item.to_json
|
|
@@ -76,8 +76,8 @@ module Pinnacle
|
|
|
76
76
|
Pinnacle::Types::RichButton.from_json(json_object: item)
|
|
77
77
|
end
|
|
78
78
|
new(
|
|
79
|
-
from: from,
|
|
80
79
|
options: options,
|
|
80
|
+
from: from,
|
|
81
81
|
to: to,
|
|
82
82
|
cards: cards,
|
|
83
83
|
quick_replies: quick_replies,
|
|
@@ -99,8 +99,8 @@ module Pinnacle
|
|
|
99
99
|
# @param obj [Object]
|
|
100
100
|
# @return [Void]
|
|
101
101
|
def self.validate_raw(obj:)
|
|
102
|
+
obj.options.nil? || Pinnacle::Types::SendRcsCardOptions.validate_raw(obj: obj.options)
|
|
102
103
|
obj.from.is_a?(String) != false || raise("Passed value for field obj.from is not the expected type, validation failed.")
|
|
103
|
-
obj.options.nil? || Pinnacle::Types::RcsBaseOptions.validate_raw(obj: obj.options)
|
|
104
104
|
obj.to.is_a?(String) != false || raise("Passed value for field obj.to is not the expected type, validation failed.")
|
|
105
105
|
obj.cards.is_a?(Array) != false || raise("Passed value for field obj.cards is not the expected type, validation failed.")
|
|
106
106
|
obj.quick_replies.is_a?(Array) != false || raise("Passed value for field obj.quick_replies is not the expected type, validation failed.")
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "send_rcs_card_options_standalone_card"
|
|
4
|
+
require_relative "message_schedule"
|
|
5
|
+
require_relative "tracking"
|
|
6
|
+
require "ostruct"
|
|
7
|
+
require "json"
|
|
8
|
+
|
|
9
|
+
module Pinnacle
|
|
10
|
+
module Types
|
|
11
|
+
class SendRcsCardOptions
|
|
12
|
+
# @return [Pinnacle::Types::SendRcsCardOptionsStandaloneCard] Configure standalone card layout options for enhanced visual presentation.
|
|
13
|
+
# > **⚠️ Important Restriction**
|
|
14
|
+
# >
|
|
15
|
+
# > This option is **only valid for single card messages**. Using it with multiple
|
|
16
|
+
# cards will cause the request to fail with a validation error.
|
|
17
|
+
attr_reader :standalone_card
|
|
18
|
+
# @return [Pinnacle::Types::MessageSchedule]
|
|
19
|
+
attr_reader :schedule
|
|
20
|
+
# @return [Boolean] Send via the test agent to whitelisted test devices. Useful for development and
|
|
21
|
+
# debugging.
|
|
22
|
+
attr_reader :test_mode
|
|
23
|
+
# @return [Pinnacle::Types::Tracking]
|
|
24
|
+
attr_reader :tracking
|
|
25
|
+
# @return [Boolean] Media files and card media will be transcoded to a supported RCS format. This
|
|
26
|
+
# adds a small delay to sending the message. Ignored for rich text messages.
|
|
27
|
+
attr_reader :transcode
|
|
28
|
+
# @return [Boolean] Validate your message for any unsupported files. <br>
|
|
29
|
+
# If failed, errors will be thrown and the message will not send.
|
|
30
|
+
attr_reader :validate
|
|
31
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
32
|
+
attr_reader :additional_properties
|
|
33
|
+
# @return [Object]
|
|
34
|
+
attr_reader :_field_set
|
|
35
|
+
protected :_field_set
|
|
36
|
+
|
|
37
|
+
OMIT = Object.new
|
|
38
|
+
|
|
39
|
+
# @param standalone_card [Pinnacle::Types::SendRcsCardOptionsStandaloneCard] Configure standalone card layout options for enhanced visual presentation.
|
|
40
|
+
# > **⚠️ Important Restriction**
|
|
41
|
+
# >
|
|
42
|
+
# > This option is **only valid for single card messages**. Using it with multiple
|
|
43
|
+
# cards will cause the request to fail with a validation error.
|
|
44
|
+
# @param schedule [Pinnacle::Types::MessageSchedule]
|
|
45
|
+
# @param test_mode [Boolean] Send via the test agent to whitelisted test devices. Useful for development and
|
|
46
|
+
# debugging.
|
|
47
|
+
# @param tracking [Pinnacle::Types::Tracking]
|
|
48
|
+
# @param transcode [Boolean] Media files and card media will be transcoded to a supported RCS format. This
|
|
49
|
+
# adds a small delay to sending the message. Ignored for rich text messages.
|
|
50
|
+
# @param validate [Boolean] Validate your message for any unsupported files. <br>
|
|
51
|
+
# If failed, errors will be thrown and the message will not send.
|
|
52
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
53
|
+
# @return [Pinnacle::Types::SendRcsCardOptions]
|
|
54
|
+
def initialize(standalone_card: OMIT, schedule: OMIT, test_mode: OMIT, tracking: OMIT, transcode: OMIT,
|
|
55
|
+
validate: OMIT, additional_properties: nil)
|
|
56
|
+
@standalone_card = standalone_card if standalone_card != OMIT
|
|
57
|
+
@schedule = schedule if schedule != OMIT
|
|
58
|
+
@test_mode = test_mode if test_mode != OMIT
|
|
59
|
+
@tracking = tracking if tracking != OMIT
|
|
60
|
+
@transcode = transcode if transcode != OMIT
|
|
61
|
+
@validate = validate if validate != OMIT
|
|
62
|
+
@additional_properties = additional_properties
|
|
63
|
+
@_field_set = {
|
|
64
|
+
"standalone_card": standalone_card,
|
|
65
|
+
"schedule": schedule,
|
|
66
|
+
"test_mode": test_mode,
|
|
67
|
+
"tracking": tracking,
|
|
68
|
+
"transcode": transcode,
|
|
69
|
+
"validate": validate
|
|
70
|
+
}.reject do |_k, v|
|
|
71
|
+
v == OMIT
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Deserialize a JSON object to an instance of SendRcsCardOptions
|
|
76
|
+
#
|
|
77
|
+
# @param json_object [String]
|
|
78
|
+
# @return [Pinnacle::Types::SendRcsCardOptions]
|
|
79
|
+
def self.from_json(json_object:)
|
|
80
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
81
|
+
parsed_json = JSON.parse(json_object)
|
|
82
|
+
if parsed_json["standalone_card"].nil?
|
|
83
|
+
standalone_card = nil
|
|
84
|
+
else
|
|
85
|
+
standalone_card = parsed_json["standalone_card"].to_json
|
|
86
|
+
standalone_card = Pinnacle::Types::SendRcsCardOptionsStandaloneCard.from_json(json_object: standalone_card)
|
|
87
|
+
end
|
|
88
|
+
if parsed_json["schedule"].nil?
|
|
89
|
+
schedule = nil
|
|
90
|
+
else
|
|
91
|
+
schedule = parsed_json["schedule"].to_json
|
|
92
|
+
schedule = Pinnacle::Types::MessageSchedule.from_json(json_object: schedule)
|
|
93
|
+
end
|
|
94
|
+
test_mode = parsed_json["test_mode"]
|
|
95
|
+
tracking = parsed_json["tracking"]
|
|
96
|
+
transcode = parsed_json["transcode"]
|
|
97
|
+
validate = parsed_json["validate"]
|
|
98
|
+
new(
|
|
99
|
+
standalone_card: standalone_card,
|
|
100
|
+
schedule: schedule,
|
|
101
|
+
test_mode: test_mode,
|
|
102
|
+
tracking: tracking,
|
|
103
|
+
transcode: transcode,
|
|
104
|
+
validate: validate,
|
|
105
|
+
additional_properties: struct
|
|
106
|
+
)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Serialize an instance of SendRcsCardOptions to a JSON object
|
|
110
|
+
#
|
|
111
|
+
# @return [String]
|
|
112
|
+
def to_json(*_args)
|
|
113
|
+
@_field_set&.to_json
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
117
|
+
# hash and check each fields type against the current object's property
|
|
118
|
+
# definitions.
|
|
119
|
+
#
|
|
120
|
+
# @param obj [Object]
|
|
121
|
+
# @return [Void]
|
|
122
|
+
def self.validate_raw(obj:)
|
|
123
|
+
obj.standalone_card.nil? || Pinnacle::Types::SendRcsCardOptionsStandaloneCard.validate_raw(obj: obj.standalone_card)
|
|
124
|
+
obj.schedule.nil? || Pinnacle::Types::MessageSchedule.validate_raw(obj: obj.schedule)
|
|
125
|
+
obj.test_mode&.is_a?(Boolean) != false || raise("Passed value for field obj.test_mode is not the expected type, validation failed.")
|
|
126
|
+
obj.tracking&.is_a?(Pinnacle::Types::Tracking) != false || raise("Passed value for field obj.tracking is not the expected type, validation failed.")
|
|
127
|
+
obj.transcode&.is_a?(Boolean) != false || raise("Passed value for field obj.transcode is not the expected type, validation failed.")
|
|
128
|
+
obj.validate&.is_a?(Boolean) != false || raise("Passed value for field obj.validate is not the expected type, validation failed.")
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "send_rcs_card_options_standalone_card_orientation"
|
|
4
|
+
require_relative "send_rcs_card_options_standalone_card_image_alignment"
|
|
5
|
+
require "ostruct"
|
|
6
|
+
require "json"
|
|
7
|
+
|
|
8
|
+
module Pinnacle
|
|
9
|
+
module Types
|
|
10
|
+
# Configure standalone card layout options for enhanced visual presentation.
|
|
11
|
+
# > **⚠️ Important Restriction**
|
|
12
|
+
# >
|
|
13
|
+
# > This option is **only valid for single card messages**. Using it with multiple
|
|
14
|
+
# cards will cause the request to fail with a validation error.
|
|
15
|
+
class SendRcsCardOptionsStandaloneCard
|
|
16
|
+
# @return [Pinnacle::Types::SendRcsCardOptionsStandaloneCardOrientation] The orientation of the standalone card.
|
|
17
|
+
attr_reader :orientation
|
|
18
|
+
# @return [Pinnacle::Types::SendRcsCardOptionsStandaloneCardImageAlignment] The alignment of the image in the standalone card. This field is ignored if
|
|
19
|
+
# orientation is VERTICAL.
|
|
20
|
+
attr_reader :image_alignment
|
|
21
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
22
|
+
attr_reader :additional_properties
|
|
23
|
+
# @return [Object]
|
|
24
|
+
attr_reader :_field_set
|
|
25
|
+
protected :_field_set
|
|
26
|
+
|
|
27
|
+
OMIT = Object.new
|
|
28
|
+
|
|
29
|
+
# @param orientation [Pinnacle::Types::SendRcsCardOptionsStandaloneCardOrientation] The orientation of the standalone card.
|
|
30
|
+
# @param image_alignment [Pinnacle::Types::SendRcsCardOptionsStandaloneCardImageAlignment] The alignment of the image in the standalone card. This field is ignored if
|
|
31
|
+
# orientation is VERTICAL.
|
|
32
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
33
|
+
# @return [Pinnacle::Types::SendRcsCardOptionsStandaloneCard]
|
|
34
|
+
def initialize(orientation: OMIT, image_alignment: OMIT, additional_properties: nil)
|
|
35
|
+
@orientation = orientation if orientation != OMIT
|
|
36
|
+
@image_alignment = image_alignment if image_alignment != OMIT
|
|
37
|
+
@additional_properties = additional_properties
|
|
38
|
+
@_field_set = { "orientation": orientation, "image_alignment": image_alignment }.reject do |_k, v|
|
|
39
|
+
v == OMIT
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Deserialize a JSON object to an instance of SendRcsCardOptionsStandaloneCard
|
|
44
|
+
#
|
|
45
|
+
# @param json_object [String]
|
|
46
|
+
# @return [Pinnacle::Types::SendRcsCardOptionsStandaloneCard]
|
|
47
|
+
def self.from_json(json_object:)
|
|
48
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
49
|
+
parsed_json = JSON.parse(json_object)
|
|
50
|
+
orientation = parsed_json["orientation"]
|
|
51
|
+
image_alignment = parsed_json["image_alignment"]
|
|
52
|
+
new(
|
|
53
|
+
orientation: orientation,
|
|
54
|
+
image_alignment: image_alignment,
|
|
55
|
+
additional_properties: struct
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Serialize an instance of SendRcsCardOptionsStandaloneCard to a JSON object
|
|
60
|
+
#
|
|
61
|
+
# @return [String]
|
|
62
|
+
def to_json(*_args)
|
|
63
|
+
@_field_set&.to_json
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
67
|
+
# hash and check each fields type against the current object's property
|
|
68
|
+
# definitions.
|
|
69
|
+
#
|
|
70
|
+
# @param obj [Object]
|
|
71
|
+
# @return [Void]
|
|
72
|
+
def self.validate_raw(obj:)
|
|
73
|
+
obj.orientation&.is_a?(Pinnacle::Types::SendRcsCardOptionsStandaloneCardOrientation) != false || raise("Passed value for field obj.orientation is not the expected type, validation failed.")
|
|
74
|
+
obj.image_alignment&.is_a?(Pinnacle::Types::SendRcsCardOptionsStandaloneCardImageAlignment) != false || raise("Passed value for field obj.image_alignment is not the expected type, validation failed.")
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
# The alignment of the image in the standalone card. This field is ignored if
|
|
6
|
+
# orientation is VERTICAL.
|
|
7
|
+
class SendRcsCardOptionsStandaloneCardImageAlignment
|
|
8
|
+
LEFT = "LEFT"
|
|
9
|
+
RIGHT = "RIGHT"
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "date"
|
|
4
|
+
require "ostruct"
|
|
5
|
+
require "json"
|
|
6
|
+
|
|
7
|
+
module Pinnacle
|
|
8
|
+
module Types
|
|
9
|
+
# Response schema confirming the typing indicator was sent.
|
|
10
|
+
class SendTypingIndicatorResponse
|
|
11
|
+
# @return [Boolean] Indicates whether the typing indicator was successfully sent.
|
|
12
|
+
attr_reader :success
|
|
13
|
+
# @return [String] The RCS agent that sent the typing indicator.
|
|
14
|
+
attr_reader :agent_id
|
|
15
|
+
# @return [String] The recipient's phone number that received the typing indicator.
|
|
16
|
+
attr_reader :recipient
|
|
17
|
+
# @return [DateTime] Timestamp when the typing indicator was started (ISO 8601 format).
|
|
18
|
+
attr_reader :started_at
|
|
19
|
+
# @return [DateTime] Timestamp when the typing indicator will automatically expire (ISO 8601 format).
|
|
20
|
+
# <br>
|
|
21
|
+
# This is typically one minute after `startedAt` unless a message is sent first.
|
|
22
|
+
attr_reader :ended_at
|
|
23
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
24
|
+
attr_reader :additional_properties
|
|
25
|
+
# @return [Object]
|
|
26
|
+
attr_reader :_field_set
|
|
27
|
+
protected :_field_set
|
|
28
|
+
|
|
29
|
+
OMIT = Object.new
|
|
30
|
+
|
|
31
|
+
# @param success [Boolean] Indicates whether the typing indicator was successfully sent.
|
|
32
|
+
# @param agent_id [String] The RCS agent that sent the typing indicator.
|
|
33
|
+
# @param recipient [String] The recipient's phone number that received the typing indicator.
|
|
34
|
+
# @param started_at [DateTime] Timestamp when the typing indicator was started (ISO 8601 format).
|
|
35
|
+
# @param ended_at [DateTime] Timestamp when the typing indicator will automatically expire (ISO 8601 format).
|
|
36
|
+
# <br>
|
|
37
|
+
# This is typically one minute after `startedAt` unless a message is sent first.
|
|
38
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
39
|
+
# @return [Pinnacle::Types::SendTypingIndicatorResponse]
|
|
40
|
+
def initialize(success:, agent_id:, recipient:, started_at:, ended_at:, additional_properties: nil)
|
|
41
|
+
@success = success
|
|
42
|
+
@agent_id = agent_id
|
|
43
|
+
@recipient = recipient
|
|
44
|
+
@started_at = started_at
|
|
45
|
+
@ended_at = ended_at
|
|
46
|
+
@additional_properties = additional_properties
|
|
47
|
+
@_field_set = {
|
|
48
|
+
"success": success,
|
|
49
|
+
"agentId": agent_id,
|
|
50
|
+
"recipient": recipient,
|
|
51
|
+
"startedAt": started_at,
|
|
52
|
+
"endedAt": ended_at
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Deserialize a JSON object to an instance of SendTypingIndicatorResponse
|
|
57
|
+
#
|
|
58
|
+
# @param json_object [String]
|
|
59
|
+
# @return [Pinnacle::Types::SendTypingIndicatorResponse]
|
|
60
|
+
def self.from_json(json_object:)
|
|
61
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
62
|
+
parsed_json = JSON.parse(json_object)
|
|
63
|
+
success = parsed_json["success"]
|
|
64
|
+
agent_id = parsed_json["agentId"]
|
|
65
|
+
recipient = parsed_json["recipient"]
|
|
66
|
+
started_at = (DateTime.parse(parsed_json["startedAt"]) unless parsed_json["startedAt"].nil?)
|
|
67
|
+
ended_at = (DateTime.parse(parsed_json["endedAt"]) unless parsed_json["endedAt"].nil?)
|
|
68
|
+
new(
|
|
69
|
+
success: success,
|
|
70
|
+
agent_id: agent_id,
|
|
71
|
+
recipient: recipient,
|
|
72
|
+
started_at: started_at,
|
|
73
|
+
ended_at: ended_at,
|
|
74
|
+
additional_properties: struct
|
|
75
|
+
)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Serialize an instance of SendTypingIndicatorResponse to a JSON object
|
|
79
|
+
#
|
|
80
|
+
# @return [String]
|
|
81
|
+
def to_json(*_args)
|
|
82
|
+
@_field_set&.to_json
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
86
|
+
# hash and check each fields type against the current object's property
|
|
87
|
+
# definitions.
|
|
88
|
+
#
|
|
89
|
+
# @param obj [Object]
|
|
90
|
+
# @return [Void]
|
|
91
|
+
def self.validate_raw(obj:)
|
|
92
|
+
obj.success.is_a?(Boolean) != false || raise("Passed value for field obj.success is not the expected type, validation failed.")
|
|
93
|
+
obj.agent_id.is_a?(String) != false || raise("Passed value for field obj.agent_id is not the expected type, validation failed.")
|
|
94
|
+
obj.recipient.is_a?(String) != false || raise("Passed value for field obj.recipient is not the expected type, validation failed.")
|
|
95
|
+
obj.started_at.is_a?(DateTime) != false || raise("Passed value for field obj.started_at is not the expected type, validation failed.")
|
|
96
|
+
obj.ended_at.is_a?(DateTime) != false || raise("Passed value for field obj.ended_at is not the expected type, validation failed.")
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
data/lib/requests.rb
CHANGED
|
@@ -43,7 +43,7 @@ module Pinnacle
|
|
|
43
43
|
|
|
44
44
|
# @return [Hash{String => String}]
|
|
45
45
|
def get_headers
|
|
46
|
-
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "rcs", "X-Fern-SDK-Version": "2.0.
|
|
46
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "rcs", "X-Fern-SDK-Version": "2.0.1" }
|
|
47
47
|
headers["PINNACLE-API-KEY"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
|
|
48
48
|
headers
|
|
49
49
|
end
|
|
@@ -87,7 +87,7 @@ module Pinnacle
|
|
|
87
87
|
|
|
88
88
|
# @return [Hash{String => String}]
|
|
89
89
|
def get_headers
|
|
90
|
-
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "rcs", "X-Fern-SDK-Version": "2.0.
|
|
90
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "rcs", "X-Fern-SDK-Version": "2.0.1" }
|
|
91
91
|
headers["PINNACLE-API-KEY"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
|
|
92
92
|
headers
|
|
93
93
|
end
|
data/lib/types_export.rb
CHANGED
|
@@ -44,6 +44,7 @@ require_relative "rcs/types/sent_mms_details"
|
|
|
44
44
|
require_relative "rcs/messages/mms/types/mms_send_response"
|
|
45
45
|
require_relative "rcs/types/sent_rcs_details"
|
|
46
46
|
require_relative "rcs/messages/rcs/types/rcs_send_response"
|
|
47
|
+
require_relative "rcs/messages/rcs/types/send_typing_indicator_schema_options"
|
|
47
48
|
require_relative "rcs/tools/file/types/download_options"
|
|
48
49
|
require_relative "rcs/tools/file/types/upload_file_options"
|
|
49
50
|
require_relative "rcs/tools/contact_card/types/get_v_card_schema_options"
|
|
@@ -136,6 +137,7 @@ require_relative "rcs/types/conversation_list"
|
|
|
136
137
|
require_relative "rcs/types/successful_conversation_update"
|
|
137
138
|
require_relative "rcs/types/sms_content"
|
|
138
139
|
require_relative "rcs/types/mms_content"
|
|
140
|
+
require_relative "rcs/types/rcs_button_open_url_webview_mode"
|
|
139
141
|
require_relative "rcs/types/rcs_button_open_url"
|
|
140
142
|
require_relative "rcs/types/rcs_button_call"
|
|
141
143
|
require_relative "rcs/types/rcs_button_trigger"
|
|
@@ -177,8 +179,14 @@ require_relative "rcs/types/rich_text_message"
|
|
|
177
179
|
require_relative "rcs/types/rich_media_message"
|
|
178
180
|
require_relative "rcs/types/rcs_cards_cards_item"
|
|
179
181
|
require_relative "rcs/types/rcs_cards"
|
|
182
|
+
require_relative "rcs/types/options"
|
|
183
|
+
require_relative "rcs/types/send_rcs_card_options_standalone_card_orientation"
|
|
184
|
+
require_relative "rcs/types/send_rcs_card_options_standalone_card_image_alignment"
|
|
185
|
+
require_relative "rcs/types/send_rcs_card_options_standalone_card"
|
|
186
|
+
require_relative "rcs/types/send_rcs_card_options"
|
|
180
187
|
require_relative "rcs/types/rich_cards_message"
|
|
181
188
|
require_relative "rcs/types/rich_message"
|
|
189
|
+
require_relative "rcs/types/send_typing_indicator_response"
|
|
182
190
|
require_relative "rcs/types/sms_validation_response_segments_gsm_7"
|
|
183
191
|
require_relative "rcs/types/sms_validation_response_segments_utf_16"
|
|
184
192
|
require_relative "rcs/types/sms_validation_response_segments"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rcs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ''
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: async-http-faraday
|
|
@@ -137,6 +137,7 @@ files:
|
|
|
137
137
|
- lib/rcs/messages/mms/types/send_mms_options.rb
|
|
138
138
|
- lib/rcs/messages/rcs/client.rb
|
|
139
139
|
- lib/rcs/messages/rcs/types/rcs_send_response.rb
|
|
140
|
+
- lib/rcs/messages/rcs/types/send_typing_indicator_schema_options.rb
|
|
140
141
|
- lib/rcs/messages/sms/client.rb
|
|
141
142
|
- lib/rcs/messages/sms/types/send_sms_options.rb
|
|
142
143
|
- lib/rcs/messages/sms/types/sms_send_response.rb
|
|
@@ -273,6 +274,7 @@ files:
|
|
|
273
274
|
- lib/rcs/types/optional_brand_info.rb
|
|
274
275
|
- lib/rcs/types/optional_contact.rb
|
|
275
276
|
- lib/rcs/types/optional_contacts.rb
|
|
277
|
+
- lib/rcs/types/options.rb
|
|
276
278
|
- lib/rcs/types/phone.rb
|
|
277
279
|
- lib/rcs/types/phone_capabilities.rb
|
|
278
280
|
- lib/rcs/types/phone_enum.rb
|
|
@@ -297,6 +299,7 @@ files:
|
|
|
297
299
|
- lib/rcs/types/rcs_base_options.rb
|
|
298
300
|
- lib/rcs/types/rcs_button_call.rb
|
|
299
301
|
- lib/rcs/types/rcs_button_open_url.rb
|
|
302
|
+
- lib/rcs/types/rcs_button_open_url_webview_mode.rb
|
|
300
303
|
- lib/rcs/types/rcs_button_request_user_location.rb
|
|
301
304
|
- lib/rcs/types/rcs_button_schedule_event.rb
|
|
302
305
|
- lib/rcs/types/rcs_button_send_location.rb
|
|
@@ -348,8 +351,13 @@ files:
|
|
|
348
351
|
- lib/rcs/types/rich_text_message.rb
|
|
349
352
|
- lib/rcs/types/scheduled_messaage.rb
|
|
350
353
|
- lib/rcs/types/scheduled_send_response_config.rb
|
|
354
|
+
- lib/rcs/types/send_rcs_card_options.rb
|
|
355
|
+
- lib/rcs/types/send_rcs_card_options_standalone_card.rb
|
|
356
|
+
- lib/rcs/types/send_rcs_card_options_standalone_card_image_alignment.rb
|
|
357
|
+
- lib/rcs/types/send_rcs_card_options_standalone_card_orientation.rb
|
|
351
358
|
- lib/rcs/types/send_sms_response_segments.rb
|
|
352
359
|
- lib/rcs/types/send_sms_response_segments_encoding.rb
|
|
360
|
+
- lib/rcs/types/send_typing_indicator_response.rb
|
|
353
361
|
- lib/rcs/types/sent_mms_details.rb
|
|
354
362
|
- lib/rcs/types/sent_rcs_details.rb
|
|
355
363
|
- lib/rcs/types/sent_sms_details.rb
|