rcs 2.0.0 → 2.0.2
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/audiences/client.rb +347 -0
- data/lib/rcs/audiences/contacts/client.rb +173 -0
- data/lib/rcs/audiences/types/audiences_get_response.rb +58 -0
- 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/audience_count_only.rb +87 -0
- data/lib/rcs/types/audience_with_pagination.rb +114 -0
- data/lib/rcs/types/delete_audience_response.rb +57 -0
- data/lib/rcs/types/options.rb +111 -0
- data/lib/rcs/types/pagination.rb +81 -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/rcs/types/sent_mms_details.rb +18 -4
- data/lib/rcs.rb +7 -0
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +13 -0
- metadata +17 -2
|
@@ -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
|
|
@@ -6,8 +6,15 @@ require "json"
|
|
|
6
6
|
module Pinnacle
|
|
7
7
|
module Types
|
|
8
8
|
class SentMmsDetails
|
|
9
|
-
# @return [Array<String>] Array of unique identifiers for
|
|
10
|
-
#
|
|
9
|
+
# @return [Array<String>] Array of unique message identifiers for an individual MMS send. Each identifier
|
|
10
|
+
# is a string that always begins with the prefix `msg_`, for example:
|
|
11
|
+
# `msg_1234567890`. <br><br>
|
|
12
|
+
# When media assets are too large to fit in a single MMS and
|
|
13
|
+
# `options.multiple_messages` is set to true, the content is automatically split
|
|
14
|
+
# across multiple messages. Each split message gets its own ID, and all IDs are
|
|
15
|
+
# returned in this array. <br><br>
|
|
16
|
+
# Note: When sending to audiences, you'll receive multiple response objects (one
|
|
17
|
+
# per recipient), each containing its own messageIds array.
|
|
11
18
|
attr_reader :message_ids
|
|
12
19
|
# @return [Float] Total number of segments used across the message.
|
|
13
20
|
attr_reader :segments
|
|
@@ -27,8 +34,15 @@ module Pinnacle
|
|
|
27
34
|
|
|
28
35
|
OMIT = Object.new
|
|
29
36
|
|
|
30
|
-
# @param message_ids [Array<String>] Array of unique identifiers for
|
|
31
|
-
#
|
|
37
|
+
# @param message_ids [Array<String>] Array of unique message identifiers for an individual MMS send. Each identifier
|
|
38
|
+
# is a string that always begins with the prefix `msg_`, for example:
|
|
39
|
+
# `msg_1234567890`. <br><br>
|
|
40
|
+
# When media assets are too large to fit in a single MMS and
|
|
41
|
+
# `options.multiple_messages` is set to true, the content is automatically split
|
|
42
|
+
# across multiple messages. Each split message gets its own ID, and all IDs are
|
|
43
|
+
# returned in this array. <br><br>
|
|
44
|
+
# Note: When sending to audiences, you'll receive multiple response objects (one
|
|
45
|
+
# per recipient), each containing its own messageIds array.
|
|
32
46
|
# @param segments [Float] Total number of segments used across the message.
|
|
33
47
|
# @param total_cost [Float] Total cost of sending the message.
|
|
34
48
|
# @param sender [String] Sender's phone number in E.164 format.
|