rcs 2.0.0.pre.rc.2 → 2.0.0.pre.rc.4
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/brands/client.rb +6 -6
- data/lib/rcs/brands/types/{autofill_brand_schema_options.rb → autofill_brand_options.rb} +5 -5
- data/lib/rcs/campaigns/dlc/client.rb +12 -12
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_keywords_help.rb → upsert_dlc_campaign_help_keywords.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_keywords.rb → upsert_dlc_campaign_keywords.rb} +20 -20
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_links.rb → upsert_dlc_campaign_links.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_keywords_opt_in.rb → upsert_dlc_campaign_opt_in_keywords.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_keywords_opt_out.rb → upsert_dlc_campaign_opt_out_keywords.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_options.rb → upsert_dlc_campaign_options.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_schema_use_case.rb → upsert_dlc_campaign_use_case.rb} +5 -5
- data/lib/rcs/campaigns/rcs/client.rb +39 -29
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_agent_emails_item.rb → rcs_agent_email.rb} +5 -5
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_agent_phones_item.rb → rcs_agent_phone.rb} +5 -5
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_agent_websites_item.rb → rcs_agent_website.rb} +5 -5
- data/lib/rcs/campaigns/rcs/types/rcs_autofill_response.rb +14 -2
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_agent.rb → upsert_rcs_agent.rb} +17 -17
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_links.rb → upsert_rcs_links.rb} +5 -5
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_opt_in.rb → upsert_rcs_opt_in.rb} +13 -13
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_opt_out.rb → upsert_rcs_opt_out.rb} +5 -5
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_schema_use_case.rb → upsert_rcs_use_case.rb} +5 -5
- data/lib/rcs/campaigns/toll_free/client.rb +4 -4
- data/lib/rcs/campaigns/toll_free/types/toll_free_autofill_response.rb +10 -10
- data/lib/rcs/campaigns/toll_free/types/upsert_toll_free_schema_opt_in.rb +8 -8
- data/lib/rcs/conversations/client.rb +2 -2
- data/lib/rcs/messages/client.rb +24 -10
- data/lib/rcs/messages/mms/client.rb +118 -0
- data/lib/rcs/messages/{send/types/send_mms_response.rb → mms/types/mms_send_response.rb} +4 -4
- data/lib/rcs/messages/{send/types/send_mms_schema_options.rb → mms/types/send_mms_options.rb} +6 -6
- data/lib/rcs/messages/rcs/client.rb +68 -0
- data/lib/rcs/messages/{send/types/send_rcs_response.rb → rcs/types/rcs_send_response.rb} +4 -4
- data/lib/rcs/messages/sms/client.rb +198 -0
- data/lib/rcs/messages/{send/types/send_sms_schema_options.rb → sms/types/send_sms_options.rb} +6 -6
- data/lib/rcs/messages/{send/types/send_sms_response.rb → sms/types/sms_send_response.rb} +4 -4
- data/lib/rcs/messages/types/{message_reaction_schema_options.rb → react_message_options.rb} +5 -5
- data/lib/rcs/phone_numbers/client.rb +18 -18
- data/lib/rcs/phone_numbers/types/{phone_details_schema_options_enhanced_contact_info.rb → enhanced_contact_info.rb} +5 -7
- data/lib/rcs/phone_numbers/types/{phone_details_schema_options.rb → retrieve_phone_number_details_options.rb} +10 -10
- data/lib/rcs/phone_numbers/types/{search_schema_number.rb → search_phone_number_by_digits.rb} +5 -5
- data/lib/rcs/phone_numbers/types/{search_schema_location.rb → search_phone_number_by_location.rb} +5 -5
- data/lib/rcs/phone_numbers/types/{search_schema_options.rb → search_phone_number_options.rb} +5 -5
- data/lib/rcs/phone_numbers/webhook/client.rb +2 -2
- data/lib/rcs/tools/file/client.rb +3 -3
- data/lib/rcs/tools/file/types/{file_upload_schema_options_download.rb → download_options.rb} +5 -5
- data/lib/rcs/tools/file/types/{file_upload_schema_options.rb → upload_file_options.rb} +10 -10
- data/lib/rcs/types/{attach_webhook_schema_webhook_id.rb → attach_webhook_by_id_params.rb} +5 -5
- data/lib/rcs/types/attach_webhook_params.rb +8 -8
- data/lib/rcs/types/{get_conversation_request_id.rb → conversation_by_id_params.rb} +5 -5
- data/lib/rcs/types/{get_conversation_request_recipient.rb → conversation_by_participants_params.rb} +5 -5
- data/lib/rcs/types/{attach_webhook_schema_name.rb → create_and_attach_webhook_by_url_params.rb} +5 -5
- data/lib/rcs/types/extended_rcs_campaign.rb +13 -1
- data/lib/rcs/types/get_conversation_params.rb +8 -8
- data/lib/rcs/types/link_click_event.rb +8 -8
- data/lib/rcs/types/message.rb +8 -8
- data/lib/rcs/types/rcs.rb +12 -12
- data/lib/rcs/types/rcs_campaign.rb +14 -2
- data/lib/rcs/types/rcs_campaign_schema_extra_opt_in.rb +8 -8
- data/lib/rcs/types/rcs_campaign_schema_opt_in.rb +8 -8
- data/lib/rcs/types/rcs_cards.rb +4 -4
- data/lib/rcs/types/rcs_cards_cards_item.rb +4 -4
- data/lib/rcs/types/rcs_cards_content.rb +4 -4
- data/lib/rcs/types/rcs_cards_content_cards_item.rb +4 -4
- data/lib/rcs/types/rcs_media_content.rb +4 -4
- data/lib/rcs/types/rcs_text_content.rb +4 -4
- data/lib/rcs/types/{rcs_button_content.rb → rich_button.rb} +10 -10
- data/lib/rcs/types/{rcs_card.rb → rich_cards_message.rb} +9 -9
- data/lib/rcs/types/{rcs_media.rb → rich_media_message.rb} +9 -9
- data/lib/rcs/types/{rcs_text.rb → rich_text_message.rb} +9 -9
- data/lib/rcs/types/toll_free_campaign.rb +10 -10
- data/lib/rcs/types/toll_free_campaign_with_extended_brand_and_status.rb +10 -10
- data/lib/rcs/types/{nullable_contact.rb → upsert_contact.rb} +5 -5
- data/lib/rcs/types/{toll_free_campaign_schema_opt_in.rb → upsert_toll_free_campaign_opt_in.rb} +13 -13
- data/lib/rcs/types/{toll_free_campaign_schema_use_case.rb → upsert_toll_free_campaign_use_case.rb} +5 -5
- data/lib/rcs.rb +0 -7
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +40 -40
- metadata +43 -45
- data/lib/rcs/message/client.rb +0 -30
- data/lib/rcs/message/sms/client.rb +0 -96
- data/lib/rcs/messages/send/client.rb +0 -318
data/lib/rcs/types/rcs.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "json"
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
6
|
-
require_relative "
|
4
|
+
require_relative "rich_text_message"
|
5
|
+
require_relative "rich_media_message"
|
6
|
+
require_relative "rich_cards_message"
|
7
7
|
|
8
8
|
module Pinnacle
|
9
9
|
module Types
|
@@ -15,24 +15,24 @@ module Pinnacle
|
|
15
15
|
def self.from_json(json_object:)
|
16
16
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
17
17
|
begin
|
18
|
-
Pinnacle::Types::
|
19
|
-
return Pinnacle::Types::
|
18
|
+
Pinnacle::Types::RichTextMessage.validate_raw(obj: struct)
|
19
|
+
return Pinnacle::Types::RichTextMessage.from_json(json_object: struct) unless struct.nil?
|
20
20
|
|
21
21
|
return nil
|
22
22
|
rescue StandardError
|
23
23
|
# noop
|
24
24
|
end
|
25
25
|
begin
|
26
|
-
Pinnacle::Types::
|
27
|
-
return Pinnacle::Types::
|
26
|
+
Pinnacle::Types::RichMediaMessage.validate_raw(obj: struct)
|
27
|
+
return Pinnacle::Types::RichMediaMessage.from_json(json_object: struct) unless struct.nil?
|
28
28
|
|
29
29
|
return nil
|
30
30
|
rescue StandardError
|
31
31
|
# noop
|
32
32
|
end
|
33
33
|
begin
|
34
|
-
Pinnacle::Types::
|
35
|
-
return Pinnacle::Types::
|
34
|
+
Pinnacle::Types::RichCardsMessage.validate_raw(obj: struct)
|
35
|
+
return Pinnacle::Types::RichCardsMessage.from_json(json_object: struct) unless struct.nil?
|
36
36
|
|
37
37
|
return nil
|
38
38
|
rescue StandardError
|
@@ -49,17 +49,17 @@ module Pinnacle
|
|
49
49
|
# @return [Void]
|
50
50
|
def self.validate_raw(obj:)
|
51
51
|
begin
|
52
|
-
return Pinnacle::Types::
|
52
|
+
return Pinnacle::Types::RichTextMessage.validate_raw(obj: obj)
|
53
53
|
rescue StandardError
|
54
54
|
# noop
|
55
55
|
end
|
56
56
|
begin
|
57
|
-
return Pinnacle::Types::
|
57
|
+
return Pinnacle::Types::RichMediaMessage.validate_raw(obj: obj)
|
58
58
|
rescue StandardError
|
59
59
|
# noop
|
60
60
|
end
|
61
61
|
begin
|
62
|
-
return Pinnacle::Types::
|
62
|
+
return Pinnacle::Types::RichCardsMessage.validate_raw(obj: obj)
|
63
63
|
rescue StandardError
|
64
64
|
# noop
|
65
65
|
end
|
@@ -15,6 +15,10 @@ module Pinnacle
|
|
15
15
|
attr_reader :agent
|
16
16
|
# @return [Integer] Unique identifier for the campaign.
|
17
17
|
attr_reader :campaign_id
|
18
|
+
# @return [String] Link to document verifying the brand's name. This may be the certificate of
|
19
|
+
# incorporation, business license, or other relevant document. You can typically
|
20
|
+
# find this on the Secretary of State website.
|
21
|
+
attr_reader :brand_verification_url
|
18
22
|
# @return [Array<String>] List of what the agent might say to users.
|
19
23
|
attr_reader :expected_agent_responses
|
20
24
|
# @return [Pinnacle::Types::RcsCampaignSchemaLinks] Legal documentation links.
|
@@ -35,6 +39,9 @@ module Pinnacle
|
|
35
39
|
|
36
40
|
# @param agent [Pinnacle::Types::RcsCampaignSchemaAgent] Agent configured to the campaign.
|
37
41
|
# @param campaign_id [Integer] Unique identifier for the campaign.
|
42
|
+
# @param brand_verification_url [String] Link to document verifying the brand's name. This may be the certificate of
|
43
|
+
# incorporation, business license, or other relevant document. You can typically
|
44
|
+
# find this on the Secretary of State website.
|
38
45
|
# @param expected_agent_responses [Array<String>] List of what the agent might say to users.
|
39
46
|
# @param links [Pinnacle::Types::RcsCampaignSchemaLinks] Legal documentation links.
|
40
47
|
# @param opt_in [Pinnacle::Types::RcsCampaignSchemaOptIn] Opt-in configuration.
|
@@ -42,10 +49,11 @@ module Pinnacle
|
|
42
49
|
# @param use_case [Pinnacle::Types::RcsCampaignSchemaUseCase] Use case classification for the campaign.
|
43
50
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
44
51
|
# @return [Pinnacle::Types::RcsCampaign]
|
45
|
-
def initialize(agent: OMIT, campaign_id: OMIT,
|
46
|
-
opt_out: OMIT, use_case: OMIT, additional_properties: nil)
|
52
|
+
def initialize(agent: OMIT, campaign_id: OMIT, brand_verification_url: OMIT, expected_agent_responses: OMIT,
|
53
|
+
links: OMIT, opt_in: OMIT, opt_out: OMIT, use_case: OMIT, additional_properties: nil)
|
47
54
|
@agent = agent if agent != OMIT
|
48
55
|
@campaign_id = campaign_id if campaign_id != OMIT
|
56
|
+
@brand_verification_url = brand_verification_url if brand_verification_url != OMIT
|
49
57
|
@expected_agent_responses = expected_agent_responses if expected_agent_responses != OMIT
|
50
58
|
@links = links if links != OMIT
|
51
59
|
@opt_in = opt_in if opt_in != OMIT
|
@@ -55,6 +63,7 @@ module Pinnacle
|
|
55
63
|
@_field_set = {
|
56
64
|
"agent": agent,
|
57
65
|
"campaignId": campaign_id,
|
66
|
+
"brandVerificationUrl": brand_verification_url,
|
58
67
|
"expectedAgentResponses": expected_agent_responses,
|
59
68
|
"links": links,
|
60
69
|
"optIn": opt_in,
|
@@ -79,6 +88,7 @@ module Pinnacle
|
|
79
88
|
agent = Pinnacle::Types::RcsCampaignSchemaAgent.from_json(json_object: agent)
|
80
89
|
end
|
81
90
|
campaign_id = parsed_json["campaignId"]
|
91
|
+
brand_verification_url = parsed_json["brandVerificationUrl"]
|
82
92
|
expected_agent_responses = parsed_json["expectedAgentResponses"]
|
83
93
|
if parsed_json["links"].nil?
|
84
94
|
links = nil
|
@@ -107,6 +117,7 @@ module Pinnacle
|
|
107
117
|
new(
|
108
118
|
agent: agent,
|
109
119
|
campaign_id: campaign_id,
|
120
|
+
brand_verification_url: brand_verification_url,
|
110
121
|
expected_agent_responses: expected_agent_responses,
|
111
122
|
links: links,
|
112
123
|
opt_in: opt_in,
|
@@ -132,6 +143,7 @@ module Pinnacle
|
|
132
143
|
def self.validate_raw(obj:)
|
133
144
|
obj.agent.nil? || Pinnacle::Types::RcsCampaignSchemaAgent.validate_raw(obj: obj.agent)
|
134
145
|
obj.campaign_id&.is_a?(Integer) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
|
146
|
+
obj.brand_verification_url&.is_a?(String) != false || raise("Passed value for field obj.brand_verification_url is not the expected type, validation failed.")
|
135
147
|
obj.expected_agent_responses&.is_a?(Array) != false || raise("Passed value for field obj.expected_agent_responses is not the expected type, validation failed.")
|
136
148
|
obj.links.nil? || Pinnacle::Types::RcsCampaignSchemaLinks.validate_raw(obj: obj.links)
|
137
149
|
obj.opt_in.nil? || Pinnacle::Types::RcsCampaignSchemaOptIn.validate_raw(obj: obj.opt_in)
|
@@ -9,7 +9,7 @@ module Pinnacle
|
|
9
9
|
# Opt-in configuration.
|
10
10
|
class RcsCampaignSchemaExtraOptIn
|
11
11
|
# @return [Pinnacle::Types::RcsCampaignOptInMethodEnum]
|
12
|
-
attr_reader :
|
12
|
+
attr_reader :method_
|
13
13
|
# @return [String] Message shown to users explaining what they are agreeing to when opting in.
|
14
14
|
attr_reader :terms_and_conditions
|
15
15
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -20,15 +20,15 @@ module Pinnacle
|
|
20
20
|
|
21
21
|
OMIT = Object.new
|
22
22
|
|
23
|
-
# @param
|
23
|
+
# @param method_ [Pinnacle::Types::RcsCampaignOptInMethodEnum]
|
24
24
|
# @param terms_and_conditions [String] Message shown to users explaining what they are agreeing to when opting in.
|
25
25
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
26
|
# @return [Pinnacle::Types::RcsCampaignSchemaExtraOptIn]
|
27
|
-
def initialize(
|
28
|
-
@
|
27
|
+
def initialize(method_: OMIT, terms_and_conditions: OMIT, additional_properties: nil)
|
28
|
+
@method_ = method_ if method_ != OMIT
|
29
29
|
@terms_and_conditions = terms_and_conditions if terms_and_conditions != OMIT
|
30
30
|
@additional_properties = additional_properties
|
31
|
-
@_field_set = { "method":
|
31
|
+
@_field_set = { "method": method_, "termsAndConditions": terms_and_conditions }.reject do |_k, v|
|
32
32
|
v == OMIT
|
33
33
|
end
|
34
34
|
end
|
@@ -40,10 +40,10 @@ module Pinnacle
|
|
40
40
|
def self.from_json(json_object:)
|
41
41
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
42
42
|
parsed_json = JSON.parse(json_object)
|
43
|
-
|
43
|
+
method_ = parsed_json["method"]
|
44
44
|
terms_and_conditions = parsed_json["termsAndConditions"]
|
45
45
|
new(
|
46
|
-
|
46
|
+
method_: method_,
|
47
47
|
terms_and_conditions: terms_and_conditions,
|
48
48
|
additional_properties: struct
|
49
49
|
)
|
@@ -63,7 +63,7 @@ module Pinnacle
|
|
63
63
|
# @param obj [Object]
|
64
64
|
# @return [Void]
|
65
65
|
def self.validate_raw(obj:)
|
66
|
-
obj.
|
66
|
+
obj.method_&.is_a?(Pinnacle::Types::RcsCampaignOptInMethodEnum) != false || raise("Passed value for field obj.method_ is not the expected type, validation failed.")
|
67
67
|
obj.terms_and_conditions&.is_a?(String) != false || raise("Passed value for field obj.terms_and_conditions is not the expected type, validation failed.")
|
68
68
|
end
|
69
69
|
end
|
@@ -11,7 +11,7 @@ module Pinnacle
|
|
11
11
|
# @return [String] Message shown to users explaining what they are agreeing to when opting in.
|
12
12
|
attr_reader :terms_and_conditions
|
13
13
|
# @return [Pinnacle::Types::RcsCampaignOptInMethodEnum]
|
14
|
-
attr_reader :
|
14
|
+
attr_reader :method_
|
15
15
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
16
16
|
attr_reader :additional_properties
|
17
17
|
# @return [Object]
|
@@ -21,14 +21,14 @@ module Pinnacle
|
|
21
21
|
OMIT = Object.new
|
22
22
|
|
23
23
|
# @param terms_and_conditions [String] Message shown to users explaining what they are agreeing to when opting in.
|
24
|
-
# @param
|
24
|
+
# @param method_ [Pinnacle::Types::RcsCampaignOptInMethodEnum]
|
25
25
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
26
|
# @return [Pinnacle::Types::RcsCampaignSchemaOptIn]
|
27
|
-
def initialize(terms_and_conditions: OMIT,
|
27
|
+
def initialize(terms_and_conditions: OMIT, method_: OMIT, additional_properties: nil)
|
28
28
|
@terms_and_conditions = terms_and_conditions if terms_and_conditions != OMIT
|
29
|
-
@
|
29
|
+
@method_ = method_ if method_ != OMIT
|
30
30
|
@additional_properties = additional_properties
|
31
|
-
@_field_set = { "termsAndConditions": terms_and_conditions, "method":
|
31
|
+
@_field_set = { "termsAndConditions": terms_and_conditions, "method": method_ }.reject do |_k, v|
|
32
32
|
v == OMIT
|
33
33
|
end
|
34
34
|
end
|
@@ -41,10 +41,10 @@ module Pinnacle
|
|
41
41
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
42
42
|
parsed_json = JSON.parse(json_object)
|
43
43
|
terms_and_conditions = parsed_json["termsAndConditions"]
|
44
|
-
|
44
|
+
method_ = parsed_json["method"]
|
45
45
|
new(
|
46
46
|
terms_and_conditions: terms_and_conditions,
|
47
|
-
|
47
|
+
method_: method_,
|
48
48
|
additional_properties: struct
|
49
49
|
)
|
50
50
|
end
|
@@ -64,7 +64,7 @@ module Pinnacle
|
|
64
64
|
# @return [Void]
|
65
65
|
def self.validate_raw(obj:)
|
66
66
|
obj.terms_and_conditions&.is_a?(String) != false || raise("Passed value for field obj.terms_and_conditions is not the expected type, validation failed.")
|
67
|
-
obj.
|
67
|
+
obj.method_&.is_a?(Pinnacle::Types::RcsCampaignOptInMethodEnum) != false || raise("Passed value for field obj.method_ is not the expected type, validation failed.")
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
data/lib/rcs/types/rcs_cards.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "rcs_cards_cards_item"
|
4
|
-
require_relative "
|
4
|
+
require_relative "rich_button"
|
5
5
|
require "ostruct"
|
6
6
|
require "json"
|
7
7
|
|
@@ -14,7 +14,7 @@ module Pinnacle
|
|
14
14
|
class RcsCards
|
15
15
|
# @return [Array<Pinnacle::Types::RcsCardsCardsItem>] Collection of cards attached to the message.
|
16
16
|
attr_reader :cards
|
17
|
-
# @return [Array<Pinnacle::Types::
|
17
|
+
# @return [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
18
18
|
attr_reader :quick_replies
|
19
19
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
20
20
|
attr_reader :additional_properties
|
@@ -25,7 +25,7 @@ module Pinnacle
|
|
25
25
|
OMIT = Object.new
|
26
26
|
|
27
27
|
# @param cards [Array<Pinnacle::Types::RcsCardsCardsItem>] Collection of cards attached to the message.
|
28
|
-
# @param quick_replies [Array<Pinnacle::Types::
|
28
|
+
# @param quick_replies [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
29
29
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
30
30
|
# @return [Pinnacle::Types::RcsCards]
|
31
31
|
def initialize(cards:, quick_replies:, additional_properties: nil)
|
@@ -48,7 +48,7 @@ module Pinnacle
|
|
48
48
|
end
|
49
49
|
quick_replies = parsed_json["quickReplies"]&.map do |item|
|
50
50
|
item = item.to_json
|
51
|
-
Pinnacle::Types::
|
51
|
+
Pinnacle::Types::RichButton.from_json(json_object: item)
|
52
52
|
end
|
53
53
|
new(
|
54
54
|
cards: cards,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
3
|
+
require_relative "rich_button"
|
4
4
|
require "ostruct"
|
5
5
|
require "json"
|
6
6
|
|
@@ -8,7 +8,7 @@ module Pinnacle
|
|
8
8
|
module Types
|
9
9
|
# Individual card containing title, optional media, and action buttons.
|
10
10
|
class RcsCardsCardsItem
|
11
|
-
# @return [Array<Pinnacle::Types::
|
11
|
+
# @return [Array<Pinnacle::Types::RichButton>] Action buttons attached to the card.
|
12
12
|
attr_reader :buttons
|
13
13
|
# @return [String] Media file URLs to send.
|
14
14
|
attr_reader :media
|
@@ -24,7 +24,7 @@ module Pinnacle
|
|
24
24
|
|
25
25
|
OMIT = Object.new
|
26
26
|
|
27
|
-
# @param buttons [Array<Pinnacle::Types::
|
27
|
+
# @param buttons [Array<Pinnacle::Types::RichButton>] Action buttons attached to the card.
|
28
28
|
# @param media [String] Media file URLs to send.
|
29
29
|
# @param subtitle [String] Secondary text displayed below the title for additional context.
|
30
30
|
# @param title [String] Title displayed on the card.
|
@@ -50,7 +50,7 @@ module Pinnacle
|
|
50
50
|
parsed_json = JSON.parse(json_object)
|
51
51
|
buttons = parsed_json["buttons"]&.map do |item|
|
52
52
|
item = item.to_json
|
53
|
-
Pinnacle::Types::
|
53
|
+
Pinnacle::Types::RichButton.from_json(json_object: item)
|
54
54
|
end
|
55
55
|
media = parsed_json["media"]
|
56
56
|
subtitle = parsed_json["subtitle"]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "rcs_cards_content_cards_item"
|
4
|
-
require_relative "
|
4
|
+
require_relative "rich_button"
|
5
5
|
require "ostruct"
|
6
6
|
require "json"
|
7
7
|
|
@@ -14,7 +14,7 @@ module Pinnacle
|
|
14
14
|
class RcsCardsContent
|
15
15
|
# @return [Array<Pinnacle::Types::RcsCardsContentCardsItem>] Collection of cards attached to the message.
|
16
16
|
attr_reader :cards
|
17
|
-
# @return [Array<Pinnacle::Types::
|
17
|
+
# @return [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
18
18
|
attr_reader :quick_replies
|
19
19
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
20
20
|
attr_reader :additional_properties
|
@@ -25,7 +25,7 @@ module Pinnacle
|
|
25
25
|
OMIT = Object.new
|
26
26
|
|
27
27
|
# @param cards [Array<Pinnacle::Types::RcsCardsContentCardsItem>] Collection of cards attached to the message.
|
28
|
-
# @param quick_replies [Array<Pinnacle::Types::
|
28
|
+
# @param quick_replies [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
29
29
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
30
30
|
# @return [Pinnacle::Types::RcsCardsContent]
|
31
31
|
def initialize(cards:, quick_replies:, additional_properties: nil)
|
@@ -48,7 +48,7 @@ module Pinnacle
|
|
48
48
|
end
|
49
49
|
quick_replies = parsed_json["quickReplies"]&.map do |item|
|
50
50
|
item = item.to_json
|
51
|
-
Pinnacle::Types::
|
51
|
+
Pinnacle::Types::RichButton.from_json(json_object: item)
|
52
52
|
end
|
53
53
|
new(
|
54
54
|
cards: cards,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
3
|
+
require_relative "rich_button"
|
4
4
|
require_relative "rcs_media_details_content"
|
5
5
|
require "ostruct"
|
6
6
|
require "json"
|
@@ -9,7 +9,7 @@ module Pinnacle
|
|
9
9
|
module Types
|
10
10
|
# Individual card containing title, optional media, and action buttons.
|
11
11
|
class RcsCardsContentCardsItem
|
12
|
-
# @return [Array<Pinnacle::Types::
|
12
|
+
# @return [Array<Pinnacle::Types::RichButton>] Action buttons attached to the card.
|
13
13
|
attr_reader :buttons
|
14
14
|
# @return [Pinnacle::Types::RcsMediaDetailsContent]
|
15
15
|
attr_reader :media
|
@@ -25,7 +25,7 @@ module Pinnacle
|
|
25
25
|
|
26
26
|
OMIT = Object.new
|
27
27
|
|
28
|
-
# @param buttons [Array<Pinnacle::Types::
|
28
|
+
# @param buttons [Array<Pinnacle::Types::RichButton>] Action buttons attached to the card.
|
29
29
|
# @param media [Pinnacle::Types::RcsMediaDetailsContent]
|
30
30
|
# @param subtitle [String] Secondary text displayed below the title for additional context.
|
31
31
|
# @param title [String] Title displayed on the card.
|
@@ -51,7 +51,7 @@ module Pinnacle
|
|
51
51
|
parsed_json = JSON.parse(json_object)
|
52
52
|
buttons = parsed_json["buttons"]&.map do |item|
|
53
53
|
item = item.to_json
|
54
|
-
Pinnacle::Types::
|
54
|
+
Pinnacle::Types::RichButton.from_json(json_object: item)
|
55
55
|
end
|
56
56
|
if parsed_json["media"].nil?
|
57
57
|
media = nil
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "rcs_media_details_content"
|
4
|
-
require_relative "
|
4
|
+
require_relative "rich_button"
|
5
5
|
require "ostruct"
|
6
6
|
require "json"
|
7
7
|
|
@@ -14,7 +14,7 @@ module Pinnacle
|
|
14
14
|
class RcsMediaContent
|
15
15
|
# @return [Pinnacle::Types::RcsMediaDetailsContent]
|
16
16
|
attr_reader :media
|
17
|
-
# @return [Array<Pinnacle::Types::
|
17
|
+
# @return [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
18
18
|
attr_reader :quick_replies
|
19
19
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
20
20
|
attr_reader :additional_properties
|
@@ -25,7 +25,7 @@ module Pinnacle
|
|
25
25
|
OMIT = Object.new
|
26
26
|
|
27
27
|
# @param media [Pinnacle::Types::RcsMediaDetailsContent]
|
28
|
-
# @param quick_replies [Array<Pinnacle::Types::
|
28
|
+
# @param quick_replies [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
29
29
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
30
30
|
# @return [Pinnacle::Types::RcsMediaContent]
|
31
31
|
def initialize(media:, quick_replies:, additional_properties: nil)
|
@@ -50,7 +50,7 @@ module Pinnacle
|
|
50
50
|
end
|
51
51
|
quick_replies = parsed_json["quickReplies"]&.map do |item|
|
52
52
|
item = item.to_json
|
53
|
-
Pinnacle::Types::
|
53
|
+
Pinnacle::Types::RichButton.from_json(json_object: item)
|
54
54
|
end
|
55
55
|
new(
|
56
56
|
media: media,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
3
|
+
require_relative "rich_button"
|
4
4
|
require "ostruct"
|
5
5
|
require "json"
|
6
6
|
|
@@ -8,7 +8,7 @@ module Pinnacle
|
|
8
8
|
module Types
|
9
9
|
# Message containing longer text content with optional quick reply buttons.
|
10
10
|
class RcsTextContent
|
11
|
-
# @return [Array<Pinnacle::Types::
|
11
|
+
# @return [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
12
12
|
attr_reader :quick_replies
|
13
13
|
# @return [String] Text content of the RCS message.
|
14
14
|
attr_reader :text
|
@@ -20,7 +20,7 @@ module Pinnacle
|
|
20
20
|
|
21
21
|
OMIT = Object.new
|
22
22
|
|
23
|
-
# @param quick_replies [Array<Pinnacle::Types::
|
23
|
+
# @param quick_replies [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
24
24
|
# @param text [String] Text content of the RCS message.
|
25
25
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
26
|
# @return [Pinnacle::Types::RcsTextContent]
|
@@ -40,7 +40,7 @@ module Pinnacle
|
|
40
40
|
parsed_json = JSON.parse(json_object)
|
41
41
|
quick_replies = parsed_json["quickReplies"]&.map do |item|
|
42
42
|
item = item.to_json
|
43
|
-
Pinnacle::Types::
|
43
|
+
Pinnacle::Types::RichButton.from_json(json_object: item)
|
44
44
|
end
|
45
45
|
text = parsed_json["text"]
|
46
46
|
new(
|
@@ -10,7 +10,7 @@ require_relative "rcs_button_send_location"
|
|
10
10
|
|
11
11
|
module Pinnacle
|
12
12
|
module Types
|
13
|
-
class
|
13
|
+
class RichButton
|
14
14
|
# @return [Object]
|
15
15
|
attr_reader :member
|
16
16
|
# @return [String]
|
@@ -21,16 +21,16 @@ module Pinnacle
|
|
21
21
|
|
22
22
|
# @param member [Object]
|
23
23
|
# @param discriminant [String]
|
24
|
-
# @return [Pinnacle::Types::
|
24
|
+
# @return [Pinnacle::Types::RichButton]
|
25
25
|
def initialize(member:, discriminant:)
|
26
26
|
@member = member
|
27
27
|
@discriminant = discriminant
|
28
28
|
end
|
29
29
|
|
30
|
-
# Deserialize a JSON object to an instance of
|
30
|
+
# Deserialize a JSON object to an instance of RichButton
|
31
31
|
#
|
32
32
|
# @param json_object [String]
|
33
|
-
# @return [Pinnacle::Types::
|
33
|
+
# @return [Pinnacle::Types::RichButton]
|
34
34
|
def self.from_json(json_object:)
|
35
35
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
36
|
member = case struct.type
|
@@ -109,37 +109,37 @@ module Pinnacle
|
|
109
109
|
end
|
110
110
|
|
111
111
|
# @param member [Pinnacle::Types::RcsButtonOpenUrl]
|
112
|
-
# @return [Pinnacle::Types::
|
112
|
+
# @return [Pinnacle::Types::RichButton]
|
113
113
|
def self.open_url(member:)
|
114
114
|
new(member: member, discriminant: "openUrl")
|
115
115
|
end
|
116
116
|
|
117
117
|
# @param member [Pinnacle::Types::RcsButtonCall]
|
118
|
-
# @return [Pinnacle::Types::
|
118
|
+
# @return [Pinnacle::Types::RichButton]
|
119
119
|
def self.call(member:)
|
120
120
|
new(member: member, discriminant: "call")
|
121
121
|
end
|
122
122
|
|
123
123
|
# @param member [Pinnacle::Types::RcsButtonTrigger]
|
124
|
-
# @return [Pinnacle::Types::
|
124
|
+
# @return [Pinnacle::Types::RichButton]
|
125
125
|
def self.trigger(member:)
|
126
126
|
new(member: member, discriminant: "trigger")
|
127
127
|
end
|
128
128
|
|
129
129
|
# @param member [Pinnacle::Types::RcsButtonRequestUserLocation]
|
130
|
-
# @return [Pinnacle::Types::
|
130
|
+
# @return [Pinnacle::Types::RichButton]
|
131
131
|
def self.request_user_location(member:)
|
132
132
|
new(member: member, discriminant: "requestUserLocation")
|
133
133
|
end
|
134
134
|
|
135
135
|
# @param member [Pinnacle::Types::RcsButtonScheduleEvent]
|
136
|
-
# @return [Pinnacle::Types::
|
136
|
+
# @return [Pinnacle::Types::RichButton]
|
137
137
|
def self.schedule_event(member:)
|
138
138
|
new(member: member, discriminant: "scheduleEvent")
|
139
139
|
end
|
140
140
|
|
141
141
|
# @param member [Pinnacle::Types::RcsButtonSendLocation]
|
142
|
-
# @return [Pinnacle::Types::
|
142
|
+
# @return [Pinnacle::Types::RichButton]
|
143
143
|
def self.send_location(member:)
|
144
144
|
new(member: member, discriminant: "sendLocation")
|
145
145
|
end
|
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
require_relative "rcs_base_options"
|
4
4
|
require_relative "rcs_cards_cards_item"
|
5
|
-
require_relative "
|
5
|
+
require_relative "rich_button"
|
6
6
|
require "ostruct"
|
7
7
|
require "json"
|
8
8
|
|
9
9
|
module Pinnacle
|
10
10
|
module Types
|
11
|
-
class
|
11
|
+
class RichCardsMessage
|
12
12
|
# @return [String] Your RCS agent ID which must be prefixed with 'agent_'.
|
13
13
|
attr_reader :from
|
14
14
|
# @return [Pinnacle::Types::RcsBaseOptions] Configure how your RCS message is sent and tracked.
|
@@ -17,7 +17,7 @@ module Pinnacle
|
|
17
17
|
attr_reader :to
|
18
18
|
# @return [Array<Pinnacle::Types::RcsCardsCardsItem>] Collection of cards attached to the message.
|
19
19
|
attr_reader :cards
|
20
|
-
# @return [Array<Pinnacle::Types::
|
20
|
+
# @return [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
21
21
|
attr_reader :quick_replies
|
22
22
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
23
23
|
attr_reader :additional_properties
|
@@ -31,9 +31,9 @@ module Pinnacle
|
|
31
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
|
-
# @param quick_replies [Array<Pinnacle::Types::
|
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
|
-
# @return [Pinnacle::Types::
|
36
|
+
# @return [Pinnacle::Types::RichCardsMessage]
|
37
37
|
def initialize(from:, to:, cards:, quick_replies:, options: OMIT, additional_properties: nil)
|
38
38
|
@from = from
|
39
39
|
@options = options if options != OMIT
|
@@ -52,10 +52,10 @@ module Pinnacle
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
# Deserialize a JSON object to an instance of
|
55
|
+
# Deserialize a JSON object to an instance of RichCardsMessage
|
56
56
|
#
|
57
57
|
# @param json_object [String]
|
58
|
-
# @return [Pinnacle::Types::
|
58
|
+
# @return [Pinnacle::Types::RichCardsMessage]
|
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)
|
@@ -73,7 +73,7 @@ module Pinnacle
|
|
73
73
|
end
|
74
74
|
quick_replies = parsed_json["quickReplies"]&.map do |item|
|
75
75
|
item = item.to_json
|
76
|
-
Pinnacle::Types::
|
76
|
+
Pinnacle::Types::RichButton.from_json(json_object: item)
|
77
77
|
end
|
78
78
|
new(
|
79
79
|
from: from,
|
@@ -85,7 +85,7 @@ module Pinnacle
|
|
85
85
|
)
|
86
86
|
end
|
87
87
|
|
88
|
-
# Serialize an instance of
|
88
|
+
# Serialize an instance of RichCardsMessage to a JSON object
|
89
89
|
#
|
90
90
|
# @return [String]
|
91
91
|
def to_json(*_args)
|
@@ -1,18 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
3
|
+
require_relative "rich_button"
|
4
4
|
require_relative "rcs_base_options"
|
5
5
|
require "ostruct"
|
6
6
|
require "json"
|
7
7
|
|
8
8
|
module Pinnacle
|
9
9
|
module Types
|
10
|
-
class
|
10
|
+
class RichMediaMessage
|
11
11
|
# @return [String] Media file URLs to send. <br>
|
12
12
|
# See [supported media
|
13
13
|
# types](https://app.pinnacle.sh/supported-file-types?type=RCS-MEDIA).
|
14
14
|
attr_reader :media
|
15
|
-
# @return [Array<Pinnacle::Types::
|
15
|
+
# @return [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
16
16
|
attr_reader :quick_replies
|
17
17
|
# @return [String] Your RCS agent ID which must be prefixed with 'agent_'.
|
18
18
|
attr_reader :from
|
@@ -31,12 +31,12 @@ module Pinnacle
|
|
31
31
|
# @param media [String] Media file URLs to send. <br>
|
32
32
|
# See [supported media
|
33
33
|
# types](https://app.pinnacle.sh/supported-file-types?type=RCS-MEDIA).
|
34
|
-
# @param quick_replies [Array<Pinnacle::Types::
|
34
|
+
# @param quick_replies [Array<Pinnacle::Types::RichButton>] List of interactive quick reply buttons in the message.
|
35
35
|
# @param from [String] Your RCS agent ID which must be prefixed with 'agent_'.
|
36
36
|
# @param options [Pinnacle::Types::RcsBaseOptions] Configure how your RCS message is sent and tracked.
|
37
37
|
# @param to [String] Recipient's phone number in E.164 format.
|
38
38
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
39
|
-
# @return [Pinnacle::Types::
|
39
|
+
# @return [Pinnacle::Types::RichMediaMessage]
|
40
40
|
def initialize(media:, quick_replies:, from:, to:, options: OMIT, additional_properties: nil)
|
41
41
|
@media = media
|
42
42
|
@quick_replies = quick_replies
|
@@ -55,17 +55,17 @@ module Pinnacle
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
# Deserialize a JSON object to an instance of
|
58
|
+
# Deserialize a JSON object to an instance of RichMediaMessage
|
59
59
|
#
|
60
60
|
# @param json_object [String]
|
61
|
-
# @return [Pinnacle::Types::
|
61
|
+
# @return [Pinnacle::Types::RichMediaMessage]
|
62
62
|
def self.from_json(json_object:)
|
63
63
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
64
64
|
parsed_json = JSON.parse(json_object)
|
65
65
|
media = parsed_json["media"]
|
66
66
|
quick_replies = parsed_json["quickReplies"]&.map do |item|
|
67
67
|
item = item.to_json
|
68
|
-
Pinnacle::Types::
|
68
|
+
Pinnacle::Types::RichButton.from_json(json_object: item)
|
69
69
|
end
|
70
70
|
from = parsed_json["from"]
|
71
71
|
if parsed_json["options"].nil?
|
@@ -85,7 +85,7 @@ module Pinnacle
|
|
85
85
|
)
|
86
86
|
end
|
87
87
|
|
88
|
-
# Serialize an instance of
|
88
|
+
# Serialize an instance of RichMediaMessage to a JSON object
|
89
89
|
#
|
90
90
|
# @return [String]
|
91
91
|
def to_json(*_args)
|