rcs 2.0.2 → 2.0.3
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 +19 -6
- data/lib/rcs/campaigns/dlc/client.rb +12 -12
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_help_keywords.rb → dlc_campaign_help_keywords.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_keywords.rb → dlc_campaign_keywords.rb} +20 -20
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_links.rb → dlc_campaign_links.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_opt_in_keywords.rb → dlc_campaign_opt_in_keywords.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_opt_out_keywords.rb → dlc_campaign_opt_out_keywords.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_options.rb → dlc_campaign_options.rb} +5 -5
- data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_use_case.rb → dlc_campaign_use_case.rb} +5 -5
- data/lib/rcs/campaigns/rcs/client.rb +144 -51
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_agent.rb → rcs_agent.rb} +15 -9
- data/lib/rcs/campaigns/rcs/types/rcs_autofill_response.rb +122 -43
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_opt_out.rb → rcs_campaign_help_keywords.rb} +20 -19
- data/lib/rcs/campaigns/rcs/types/rcs_campaign_keywords.rb +98 -0
- data/lib/rcs/campaigns/rcs/types/rcs_campaign_opt_in_keywords.rb +87 -0
- data/lib/rcs/campaigns/rcs/types/rcs_campaign_opt_out_keywords.rb +83 -0
- data/lib/rcs/campaigns/rcs/types/rcs_campaign_traffic.rb +76 -0
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_links.rb → rcs_links.rb} +5 -5
- data/lib/rcs/campaigns/rcs/types/{upsert_rcs_use_case.rb → rcs_use_case.rb} +7 -7
- data/lib/rcs/campaigns/toll_free/client.rb +53 -10
- data/lib/rcs/campaigns/toll_free/types/toll_free_autofill_response.rb +54 -12
- data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_help_keywords.rb +66 -0
- data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_keywords.rb +86 -0
- data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_links.rb +74 -0
- data/lib/rcs/campaigns/toll_free/types/{upsert_toll_free_schema_opt_in.rb → toll_free_campaign_opt_in.rb} +5 -5
- data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_opt_in_keywords.rb +78 -0
- data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_options.rb +64 -0
- data/lib/rcs/campaigns/toll_free/types/{upsert_toll_free_schema_use_case.rb → toll_free_campaign_use_case.rb} +5 -5
- data/lib/rcs/messages/blast/client.rb +419 -0
- data/lib/rcs/messages/blast/types/blast_mms_options.rb +82 -0
- data/lib/rcs/messages/blast/types/blast_mms_response.rb +60 -0
- data/lib/rcs/messages/blast/types/blast_rcs_options.rb +118 -0
- data/lib/rcs/messages/blast/types/blast_rcs_request_options_standalone_card.rb +82 -0
- data/lib/rcs/messages/blast/types/blast_rcs_request_options_standalone_card_image_alignment.rb +16 -0
- data/lib/rcs/messages/blast/types/blast_rcs_request_options_standalone_card_orientation.rb +15 -0
- data/lib/rcs/messages/blast/types/blast_rcs_response.rb +60 -0
- data/lib/rcs/messages/blast/types/blast_sms_options.rb +70 -0
- data/lib/rcs/messages/blast/types/blast_sms_response.rb +60 -0
- data/lib/rcs/messages/mms/client.rb +6 -6
- data/lib/rcs/messages/mms/types/mms_send_response.rb +4 -4
- data/lib/rcs/messages/rcs/client.rb +7 -7
- data/lib/rcs/messages/rcs/types/{rcs_send_response.rb → send_rich_message_response.rb} +11 -11
- data/lib/rcs/messages/schedule/client.rb +103 -0
- data/lib/rcs/messages/sms/client.rb +6 -6
- data/lib/rcs/messages/sms/types/sms_send_response.rb +4 -4
- data/lib/rcs/types/{rcs_base.rb → base_rich_message.rb} +10 -10
- data/lib/rcs/types/blast_details.rb +110 -0
- data/lib/rcs/types/company_entity_type_enum.rb +14 -0
- data/lib/rcs/types/dlc_campaign_with_extended_brand_and_status.rb +30 -2
- data/lib/rcs/types/dlc_with_extended_brand_and_status_mno_brand_tier.rb +15 -0
- data/lib/rcs/types/dlc_with_extended_brand_and_status_mno_tcr_tier.rb +22 -0
- data/lib/rcs/types/extended_brand.rb +10 -1
- data/lib/rcs/types/extended_brand_with_vetting.rb +10 -1
- data/lib/rcs/types/extended_rcs_campaign.rb +122 -51
- data/lib/rcs/types/message_schedule.rb +52 -24
- data/lib/rcs/types/message_status_enum.rb +1 -0
- data/lib/rcs/types/optional_brand_info.rb +10 -1
- data/lib/rcs/types/rcs_campaign.rb +122 -43
- data/lib/rcs/types/rcs_campaign_schema_extra_keywords.rb +94 -0
- data/lib/rcs/types/{rcs_campaign_schema_extra_opt_out.rb → rcs_campaign_schema_extra_keywords_help.rb} +18 -17
- data/lib/rcs/types/rcs_campaign_schema_extra_keywords_opt_in.rb +73 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_keywords_opt_out.rb +73 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_traffic.rb +72 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_use_case.rb +2 -2
- data/lib/rcs/types/rcs_campaign_schema_keywords.rb +94 -0
- data/lib/rcs/types/{rcs_campaign_schema_opt_out.rb → rcs_campaign_schema_keywords_help.rb} +18 -17
- data/lib/rcs/types/rcs_campaign_schema_keywords_opt_in.rb +73 -0
- data/lib/rcs/types/rcs_campaign_schema_keywords_opt_out.rb +73 -0
- data/lib/rcs/types/rcs_campaign_schema_traffic.rb +72 -0
- data/lib/rcs/types/rcs_campaign_schema_use_case.rb +2 -2
- data/lib/rcs/types/rcs_cards_content_cards_item.rb +4 -2
- data/lib/rcs/types/rcs_content.rb +4 -4
- data/lib/rcs/types/rcs_messaging_type_enum.rb +17 -0
- data/lib/rcs/types/rcs_validate_content.rb +8 -8
- data/lib/rcs/types/rcs_validation_result.rb +9 -2
- data/lib/rcs/types/{rcs_cards_cards_item.rb → rich_card.rb} +9 -7
- data/lib/rcs/types/{rcs_cards.rb → rich_cards.rb} +9 -9
- data/lib/rcs/types/rich_cards_message.rb +9 -9
- data/lib/rcs/types/rich_media_message.rb +5 -5
- data/lib/rcs/types/{send_rcs_card_options_standalone_card.rb → rich_standalone_card_options.rb} +9 -7
- data/lib/rcs/types/{rcs_text_content.rb → rich_text.rb} +5 -5
- data/lib/rcs/types/rich_text_message.rb +5 -5
- data/lib/rcs/types/schedule_cancel_result.rb +58 -0
- data/lib/rcs/types/scheduled_blast_details.rb +76 -0
- data/lib/rcs/types/scheduled_blast_response_config.rb +89 -0
- data/lib/rcs/types/{scheduled_messaage.rb → scheduled_message.rb} +5 -5
- data/lib/rcs/types/{send_rcs_card_options.rb → send_rich_cards_options.rb} +18 -14
- data/lib/rcs/types/{options.rb → send_rich_message_options.rb} +5 -5
- data/lib/rcs/types/{sent_rcs_details.rb → sent_rich_message.rb} +5 -5
- data/lib/rcs/types/toll_free_campaign.rb +54 -12
- data/lib/rcs/types/toll_free_campaign_schema_keywords.rb +82 -0
- data/lib/rcs/types/toll_free_campaign_schema_keywords_help.rb +62 -0
- data/lib/rcs/types/toll_free_campaign_schema_keywords_opt_in.rb +74 -0
- data/lib/rcs/types/toll_free_campaign_schema_links.rb +70 -0
- data/lib/rcs/types/{upsert_toll_free_campaign_opt_in.rb → toll_free_campaign_schema_opt_in.rb} +5 -5
- data/lib/rcs/types/toll_free_campaign_schema_options.rb +60 -0
- data/lib/rcs/types/{upsert_toll_free_campaign_use_case.rb → toll_free_campaign_schema_use_case.rb} +5 -5
- data/lib/rcs/types/toll_free_campaign_with_extended_brand_and_status.rb +54 -12
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +66 -32
- metadata +70 -34
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_opt_in.rb +0 -75
- data/lib/rcs/types/rcs_base_options.rb +0 -111
- data/lib/rcs/types/rcs_campaign_opt_in_method_enum.rb +0 -15
- data/lib/rcs/types/rcs_campaign_schema_extra_opt_in.rb +0 -71
- data/lib/rcs/types/rcs_campaign_schema_opt_in.rb +0 -71
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "rcs_campaign_schema_keywords_help"
|
|
4
|
+
require_relative "rcs_campaign_schema_keywords_opt_in"
|
|
5
|
+
require_relative "rcs_campaign_schema_keywords_opt_out"
|
|
6
|
+
require "ostruct"
|
|
7
|
+
require "json"
|
|
8
|
+
|
|
9
|
+
module Pinnacle
|
|
10
|
+
module Types
|
|
11
|
+
class RcsCampaignSchemaKeywords
|
|
12
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaKeywordsHelp]
|
|
13
|
+
attr_reader :help
|
|
14
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaKeywordsOptIn]
|
|
15
|
+
attr_reader :opt_in
|
|
16
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaKeywordsOptOut]
|
|
17
|
+
attr_reader :opt_out
|
|
18
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
19
|
+
attr_reader :additional_properties
|
|
20
|
+
# @return [Object]
|
|
21
|
+
attr_reader :_field_set
|
|
22
|
+
protected :_field_set
|
|
23
|
+
|
|
24
|
+
OMIT = Object.new
|
|
25
|
+
|
|
26
|
+
# @param help [Pinnacle::Types::RcsCampaignSchemaKeywordsHelp]
|
|
27
|
+
# @param opt_in [Pinnacle::Types::RcsCampaignSchemaKeywordsOptIn]
|
|
28
|
+
# @param opt_out [Pinnacle::Types::RcsCampaignSchemaKeywordsOptOut]
|
|
29
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
30
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaKeywords]
|
|
31
|
+
def initialize(help: OMIT, opt_in: OMIT, opt_out: OMIT, additional_properties: nil)
|
|
32
|
+
@help = help if help != OMIT
|
|
33
|
+
@opt_in = opt_in if opt_in != OMIT
|
|
34
|
+
@opt_out = opt_out if opt_out != OMIT
|
|
35
|
+
@additional_properties = additional_properties
|
|
36
|
+
@_field_set = { "HELP": help, "OPT_IN": opt_in, "OPT_OUT": opt_out }.reject do |_k, v|
|
|
37
|
+
v == OMIT
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Deserialize a JSON object to an instance of RcsCampaignSchemaKeywords
|
|
42
|
+
#
|
|
43
|
+
# @param json_object [String]
|
|
44
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaKeywords]
|
|
45
|
+
def self.from_json(json_object:)
|
|
46
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
47
|
+
parsed_json = JSON.parse(json_object)
|
|
48
|
+
if parsed_json["HELP"].nil?
|
|
49
|
+
help = nil
|
|
50
|
+
else
|
|
51
|
+
help = parsed_json["HELP"].to_json
|
|
52
|
+
help = Pinnacle::Types::RcsCampaignSchemaKeywordsHelp.from_json(json_object: help)
|
|
53
|
+
end
|
|
54
|
+
if parsed_json["OPT_IN"].nil?
|
|
55
|
+
opt_in = nil
|
|
56
|
+
else
|
|
57
|
+
opt_in = parsed_json["OPT_IN"].to_json
|
|
58
|
+
opt_in = Pinnacle::Types::RcsCampaignSchemaKeywordsOptIn.from_json(json_object: opt_in)
|
|
59
|
+
end
|
|
60
|
+
if parsed_json["OPT_OUT"].nil?
|
|
61
|
+
opt_out = nil
|
|
62
|
+
else
|
|
63
|
+
opt_out = parsed_json["OPT_OUT"].to_json
|
|
64
|
+
opt_out = Pinnacle::Types::RcsCampaignSchemaKeywordsOptOut.from_json(json_object: opt_out)
|
|
65
|
+
end
|
|
66
|
+
new(
|
|
67
|
+
help: help,
|
|
68
|
+
opt_in: opt_in,
|
|
69
|
+
opt_out: opt_out,
|
|
70
|
+
additional_properties: struct
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Serialize an instance of RcsCampaignSchemaKeywords to a JSON object
|
|
75
|
+
#
|
|
76
|
+
# @return [String]
|
|
77
|
+
def to_json(*_args)
|
|
78
|
+
@_field_set&.to_json
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
82
|
+
# hash and check each fields type against the current object's property
|
|
83
|
+
# definitions.
|
|
84
|
+
#
|
|
85
|
+
# @param obj [Object]
|
|
86
|
+
# @return [Void]
|
|
87
|
+
def self.validate_raw(obj:)
|
|
88
|
+
obj.help.nil? || Pinnacle::Types::RcsCampaignSchemaKeywordsHelp.validate_raw(obj: obj.help)
|
|
89
|
+
obj.opt_in.nil? || Pinnacle::Types::RcsCampaignSchemaKeywordsOptIn.validate_raw(obj: obj.opt_in)
|
|
90
|
+
obj.opt_out.nil? || Pinnacle::Types::RcsCampaignSchemaKeywordsOptOut.validate_raw(obj: obj.opt_out)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -5,11 +5,11 @@ require "json"
|
|
|
5
5
|
|
|
6
6
|
module Pinnacle
|
|
7
7
|
module Types
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
#
|
|
11
|
-
attr_reader :
|
|
12
|
-
# @return [Array<String>] Keywords
|
|
8
|
+
class RcsCampaignSchemaKeywordsHelp
|
|
9
|
+
# @return [String] Message sent when a user sends HELP. Must include at least one support contact
|
|
10
|
+
# method (phone, email, or website).
|
|
11
|
+
attr_reader :message
|
|
12
|
+
# @return [Array<String>] Keywords that trigger help response.
|
|
13
13
|
attr_reader :keywords
|
|
14
14
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
15
15
|
attr_reader :additional_properties
|
|
@@ -19,36 +19,37 @@ module Pinnacle
|
|
|
19
19
|
|
|
20
20
|
OMIT = Object.new
|
|
21
21
|
|
|
22
|
-
# @param
|
|
23
|
-
#
|
|
22
|
+
# @param message [String] Message sent when a user sends HELP. Must include at least one support contact
|
|
23
|
+
# method (phone, email, or website).
|
|
24
|
+
# @param keywords [Array<String>] Keywords that trigger help response.
|
|
24
25
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
25
|
-
# @return [Pinnacle::Types::
|
|
26
|
-
def initialize(
|
|
27
|
-
@
|
|
26
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaKeywordsHelp]
|
|
27
|
+
def initialize(message: OMIT, keywords: OMIT, additional_properties: nil)
|
|
28
|
+
@message = message if message != OMIT
|
|
28
29
|
@keywords = keywords if keywords != OMIT
|
|
29
30
|
@additional_properties = additional_properties
|
|
30
|
-
@_field_set = { "
|
|
31
|
+
@_field_set = { "message": message, "keywords": keywords }.reject do |_k, v|
|
|
31
32
|
v == OMIT
|
|
32
33
|
end
|
|
33
34
|
end
|
|
34
35
|
|
|
35
|
-
# Deserialize a JSON object to an instance of
|
|
36
|
+
# Deserialize a JSON object to an instance of RcsCampaignSchemaKeywordsHelp
|
|
36
37
|
#
|
|
37
38
|
# @param json_object [String]
|
|
38
|
-
# @return [Pinnacle::Types::
|
|
39
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaKeywordsHelp]
|
|
39
40
|
def self.from_json(json_object:)
|
|
40
41
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
41
42
|
parsed_json = JSON.parse(json_object)
|
|
42
|
-
|
|
43
|
+
message = parsed_json["message"]
|
|
43
44
|
keywords = parsed_json["keywords"]
|
|
44
45
|
new(
|
|
45
|
-
|
|
46
|
+
message: message,
|
|
46
47
|
keywords: keywords,
|
|
47
48
|
additional_properties: struct
|
|
48
49
|
)
|
|
49
50
|
end
|
|
50
51
|
|
|
51
|
-
# Serialize an instance of
|
|
52
|
+
# Serialize an instance of RcsCampaignSchemaKeywordsHelp to a JSON object
|
|
52
53
|
#
|
|
53
54
|
# @return [String]
|
|
54
55
|
def to_json(*_args)
|
|
@@ -62,7 +63,7 @@ module Pinnacle
|
|
|
62
63
|
# @param obj [Object]
|
|
63
64
|
# @return [Void]
|
|
64
65
|
def self.validate_raw(obj:)
|
|
65
|
-
obj.
|
|
66
|
+
obj.message&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
|
|
66
67
|
obj.keywords&.is_a?(Array) != false || raise("Passed value for field obj.keywords is not the expected type, validation failed.")
|
|
67
68
|
end
|
|
68
69
|
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "ostruct"
|
|
4
|
+
require "json"
|
|
5
|
+
|
|
6
|
+
module Pinnacle
|
|
7
|
+
module Types
|
|
8
|
+
class RcsCampaignSchemaKeywordsOptIn
|
|
9
|
+
# @return [String] Message sent when a user opt-in. Must include brand name, confirmation of
|
|
10
|
+
# subscription, and disclosures (STOP and HELP instructions, message and data
|
|
11
|
+
# rates).
|
|
12
|
+
attr_reader :message
|
|
13
|
+
# @return [Array<String>] Keywords that trigger opt-in response.
|
|
14
|
+
attr_reader :keywords
|
|
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 message [String] Message sent when a user opt-in. Must include brand name, confirmation of
|
|
24
|
+
# subscription, and disclosures (STOP and HELP instructions, message and data
|
|
25
|
+
# rates).
|
|
26
|
+
# @param keywords [Array<String>] Keywords that trigger opt-in response.
|
|
27
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
28
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaKeywordsOptIn]
|
|
29
|
+
def initialize(message: OMIT, keywords: OMIT, additional_properties: nil)
|
|
30
|
+
@message = message if message != OMIT
|
|
31
|
+
@keywords = keywords if keywords != OMIT
|
|
32
|
+
@additional_properties = additional_properties
|
|
33
|
+
@_field_set = { "message": message, "keywords": keywords }.reject do |_k, v|
|
|
34
|
+
v == OMIT
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Deserialize a JSON object to an instance of RcsCampaignSchemaKeywordsOptIn
|
|
39
|
+
#
|
|
40
|
+
# @param json_object [String]
|
|
41
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaKeywordsOptIn]
|
|
42
|
+
def self.from_json(json_object:)
|
|
43
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
44
|
+
parsed_json = JSON.parse(json_object)
|
|
45
|
+
message = parsed_json["message"]
|
|
46
|
+
keywords = parsed_json["keywords"]
|
|
47
|
+
new(
|
|
48
|
+
message: message,
|
|
49
|
+
keywords: keywords,
|
|
50
|
+
additional_properties: struct
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Serialize an instance of RcsCampaignSchemaKeywordsOptIn to a JSON object
|
|
55
|
+
#
|
|
56
|
+
# @return [String]
|
|
57
|
+
def to_json(*_args)
|
|
58
|
+
@_field_set&.to_json
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
62
|
+
# hash and check each fields type against the current object's property
|
|
63
|
+
# definitions.
|
|
64
|
+
#
|
|
65
|
+
# @param obj [Object]
|
|
66
|
+
# @return [Void]
|
|
67
|
+
def self.validate_raw(obj:)
|
|
68
|
+
obj.message&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
|
|
69
|
+
obj.keywords&.is_a?(Array) != false || raise("Passed value for field obj.keywords is not the expected type, validation failed.")
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "ostruct"
|
|
4
|
+
require "json"
|
|
5
|
+
|
|
6
|
+
module Pinnacle
|
|
7
|
+
module Types
|
|
8
|
+
class RcsCampaignSchemaKeywordsOptOut
|
|
9
|
+
# @return [String] Message sent when a user opt-out. Must include brand name, acknowledge opt-out
|
|
10
|
+
# request and state user will not receive further messages. No marketing or
|
|
11
|
+
# re-engagement attempts.
|
|
12
|
+
attr_reader :message
|
|
13
|
+
# @return [Array<String>] Keywords that trigger opt-out response.
|
|
14
|
+
attr_reader :keywords
|
|
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 message [String] Message sent when a user opt-out. Must include brand name, acknowledge opt-out
|
|
24
|
+
# request and state user will not receive further messages. No marketing or
|
|
25
|
+
# re-engagement attempts.
|
|
26
|
+
# @param keywords [Array<String>] Keywords that trigger opt-out response.
|
|
27
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
28
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaKeywordsOptOut]
|
|
29
|
+
def initialize(message: OMIT, keywords: OMIT, additional_properties: nil)
|
|
30
|
+
@message = message if message != OMIT
|
|
31
|
+
@keywords = keywords if keywords != OMIT
|
|
32
|
+
@additional_properties = additional_properties
|
|
33
|
+
@_field_set = { "message": message, "keywords": keywords }.reject do |_k, v|
|
|
34
|
+
v == OMIT
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Deserialize a JSON object to an instance of RcsCampaignSchemaKeywordsOptOut
|
|
39
|
+
#
|
|
40
|
+
# @param json_object [String]
|
|
41
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaKeywordsOptOut]
|
|
42
|
+
def self.from_json(json_object:)
|
|
43
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
44
|
+
parsed_json = JSON.parse(json_object)
|
|
45
|
+
message = parsed_json["message"]
|
|
46
|
+
keywords = parsed_json["keywords"]
|
|
47
|
+
new(
|
|
48
|
+
message: message,
|
|
49
|
+
keywords: keywords,
|
|
50
|
+
additional_properties: struct
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Serialize an instance of RcsCampaignSchemaKeywordsOptOut to a JSON object
|
|
55
|
+
#
|
|
56
|
+
# @return [String]
|
|
57
|
+
def to_json(*_args)
|
|
58
|
+
@_field_set&.to_json
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
62
|
+
# hash and check each fields type against the current object's property
|
|
63
|
+
# definitions.
|
|
64
|
+
#
|
|
65
|
+
# @param obj [Object]
|
|
66
|
+
# @return [Void]
|
|
67
|
+
def self.validate_raw(obj:)
|
|
68
|
+
obj.message&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
|
|
69
|
+
obj.keywords&.is_a?(Array) != false || raise("Passed value for field obj.keywords is not the expected type, validation failed.")
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "ostruct"
|
|
4
|
+
require "json"
|
|
5
|
+
|
|
6
|
+
module Pinnacle
|
|
7
|
+
module Types
|
|
8
|
+
class RcsCampaignSchemaTraffic
|
|
9
|
+
# @return [Integer] Estimated monthly website visitors.
|
|
10
|
+
attr_reader :monthly_website
|
|
11
|
+
# @return [Integer] Estimated monthly RCS messages sent.
|
|
12
|
+
attr_reader :monthly_rcs_estimate
|
|
13
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
14
|
+
attr_reader :additional_properties
|
|
15
|
+
# @return [Object]
|
|
16
|
+
attr_reader :_field_set
|
|
17
|
+
protected :_field_set
|
|
18
|
+
|
|
19
|
+
OMIT = Object.new
|
|
20
|
+
|
|
21
|
+
# @param monthly_website [Integer] Estimated monthly website visitors.
|
|
22
|
+
# @param monthly_rcs_estimate [Integer] Estimated monthly RCS messages sent.
|
|
23
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
24
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaTraffic]
|
|
25
|
+
def initialize(monthly_website: OMIT, monthly_rcs_estimate: OMIT, additional_properties: nil)
|
|
26
|
+
@monthly_website = monthly_website if monthly_website != OMIT
|
|
27
|
+
@monthly_rcs_estimate = monthly_rcs_estimate if monthly_rcs_estimate != OMIT
|
|
28
|
+
@additional_properties = additional_properties
|
|
29
|
+
@_field_set = {
|
|
30
|
+
"monthlyWebsite": monthly_website,
|
|
31
|
+
"monthlyRcsEstimate": monthly_rcs_estimate
|
|
32
|
+
}.reject do |_k, v|
|
|
33
|
+
v == OMIT
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Deserialize a JSON object to an instance of RcsCampaignSchemaTraffic
|
|
38
|
+
#
|
|
39
|
+
# @param json_object [String]
|
|
40
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaTraffic]
|
|
41
|
+
def self.from_json(json_object:)
|
|
42
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
43
|
+
parsed_json = JSON.parse(json_object)
|
|
44
|
+
monthly_website = parsed_json["monthlyWebsite"]
|
|
45
|
+
monthly_rcs_estimate = parsed_json["monthlyRcsEstimate"]
|
|
46
|
+
new(
|
|
47
|
+
monthly_website: monthly_website,
|
|
48
|
+
monthly_rcs_estimate: monthly_rcs_estimate,
|
|
49
|
+
additional_properties: struct
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Serialize an instance of RcsCampaignSchemaTraffic to a JSON object
|
|
54
|
+
#
|
|
55
|
+
# @return [String]
|
|
56
|
+
def to_json(*_args)
|
|
57
|
+
@_field_set&.to_json
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
|
61
|
+
# hash and check each fields type against the current object's property
|
|
62
|
+
# definitions.
|
|
63
|
+
#
|
|
64
|
+
# @param obj [Object]
|
|
65
|
+
# @return [Void]
|
|
66
|
+
def self.validate_raw(obj:)
|
|
67
|
+
obj.monthly_website&.is_a?(Integer) != false || raise("Passed value for field obj.monthly_website is not the expected type, validation failed.")
|
|
68
|
+
obj.monthly_rcs_estimate&.is_a?(Integer) != false || raise("Passed value for field obj.monthly_rcs_estimate is not the expected type, validation failed.")
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -8,7 +8,7 @@ module Pinnacle
|
|
|
8
8
|
module Types
|
|
9
9
|
# Use case classification for the campaign.
|
|
10
10
|
class RcsCampaignSchemaUseCase
|
|
11
|
-
# @return [String]
|
|
11
|
+
# @return [String] Detailed summary of what the brand is and how this agent will be used.
|
|
12
12
|
attr_reader :behavior
|
|
13
13
|
# @return [Pinnacle::Types::RcsCampaignUseCaseEnum]
|
|
14
14
|
attr_reader :value
|
|
@@ -20,7 +20,7 @@ module Pinnacle
|
|
|
20
20
|
|
|
21
21
|
OMIT = Object.new
|
|
22
22
|
|
|
23
|
-
# @param behavior [String]
|
|
23
|
+
# @param behavior [String] Detailed summary of what the brand is and how this agent will be used.
|
|
24
24
|
# @param value [Pinnacle::Types::RcsCampaignUseCaseEnum]
|
|
25
25
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
26
26
|
# @return [Pinnacle::Types::RcsCampaignSchemaUseCase]
|
|
@@ -9,7 +9,8 @@ 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::RichButton>]
|
|
12
|
+
# @return [Array<Pinnacle::Types::RichButton>] While buttons resemble quick replies, they remain on screen after being clicked
|
|
13
|
+
# and are card-specific.
|
|
13
14
|
attr_reader :buttons
|
|
14
15
|
# @return [Pinnacle::Types::RcsMediaDetailsContent]
|
|
15
16
|
attr_reader :media
|
|
@@ -25,7 +26,8 @@ module Pinnacle
|
|
|
25
26
|
|
|
26
27
|
OMIT = Object.new
|
|
27
28
|
|
|
28
|
-
# @param buttons [Array<Pinnacle::Types::RichButton>]
|
|
29
|
+
# @param buttons [Array<Pinnacle::Types::RichButton>] While buttons resemble quick replies, they remain on screen after being clicked
|
|
30
|
+
# and are card-specific.
|
|
29
31
|
# @param media [Pinnacle::Types::RcsMediaDetailsContent]
|
|
30
32
|
# @param subtitle [String] Secondary text displayed below the title for additional context.
|
|
31
33
|
# @param title [String] Title displayed on the card.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "json"
|
|
4
|
-
require_relative "
|
|
4
|
+
require_relative "rich_text"
|
|
5
5
|
require_relative "rcs_media_content"
|
|
6
6
|
require_relative "rcs_cards_content"
|
|
7
7
|
|
|
@@ -17,8 +17,8 @@ module Pinnacle
|
|
|
17
17
|
def self.from_json(json_object:)
|
|
18
18
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
19
19
|
begin
|
|
20
|
-
Pinnacle::Types::
|
|
21
|
-
return Pinnacle::Types::
|
|
20
|
+
Pinnacle::Types::RichText.validate_raw(obj: struct)
|
|
21
|
+
return Pinnacle::Types::RichText.from_json(json_object: struct) unless struct.nil?
|
|
22
22
|
|
|
23
23
|
return nil
|
|
24
24
|
rescue StandardError
|
|
@@ -51,7 +51,7 @@ module Pinnacle
|
|
|
51
51
|
# @return [Void]
|
|
52
52
|
def self.validate_raw(obj:)
|
|
53
53
|
begin
|
|
54
|
-
return Pinnacle::Types::
|
|
54
|
+
return Pinnacle::Types::RichText.validate_raw(obj: obj)
|
|
55
55
|
rescue StandardError
|
|
56
56
|
# noop
|
|
57
57
|
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pinnacle
|
|
4
|
+
module Types
|
|
5
|
+
# Type of message the agent sends.<br>
|
|
6
|
+
# `OTP`: One time passwords or verification codes. <br>
|
|
7
|
+
# `TRANSACTIONAL`: Account updates, alerts, or notifications.<br>
|
|
8
|
+
# `PROMOTIONAL`: Marketing, sales, or offers.<br>
|
|
9
|
+
# `MULTI_USE`: Mixed message types.<br>
|
|
10
|
+
class RcsMessagingTypeEnum
|
|
11
|
+
OTP = "OTP"
|
|
12
|
+
TRANSACTIONAL = "TRANSACTIONAL"
|
|
13
|
+
PROMOTIONAL = "PROMOTIONAL"
|
|
14
|
+
MULTI_USE = "MULTI_USE"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "json"
|
|
4
|
-
require_relative "
|
|
4
|
+
require_relative "rich_text"
|
|
5
5
|
require_relative "rcs_validate_content_media"
|
|
6
|
-
require_relative "
|
|
6
|
+
require_relative "rich_cards"
|
|
7
7
|
|
|
8
8
|
module Pinnacle
|
|
9
9
|
module Types
|
|
@@ -15,8 +15,8 @@ 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::RichText.validate_raw(obj: struct)
|
|
19
|
+
return Pinnacle::Types::RichText.from_json(json_object: struct) unless struct.nil?
|
|
20
20
|
|
|
21
21
|
return nil
|
|
22
22
|
rescue StandardError
|
|
@@ -31,8 +31,8 @@ module Pinnacle
|
|
|
31
31
|
# noop
|
|
32
32
|
end
|
|
33
33
|
begin
|
|
34
|
-
Pinnacle::Types::
|
|
35
|
-
return Pinnacle::Types::
|
|
34
|
+
Pinnacle::Types::RichCards.validate_raw(obj: struct)
|
|
35
|
+
return Pinnacle::Types::RichCards.from_json(json_object: struct) unless struct.nil?
|
|
36
36
|
|
|
37
37
|
return nil
|
|
38
38
|
rescue StandardError
|
|
@@ -49,7 +49,7 @@ module Pinnacle
|
|
|
49
49
|
# @return [Void]
|
|
50
50
|
def self.validate_raw(obj:)
|
|
51
51
|
begin
|
|
52
|
-
return Pinnacle::Types::
|
|
52
|
+
return Pinnacle::Types::RichText.validate_raw(obj: obj)
|
|
53
53
|
rescue StandardError
|
|
54
54
|
# noop
|
|
55
55
|
end
|
|
@@ -59,7 +59,7 @@ module Pinnacle
|
|
|
59
59
|
# noop
|
|
60
60
|
end
|
|
61
61
|
begin
|
|
62
|
-
return Pinnacle::Types::
|
|
62
|
+
return Pinnacle::Types::RichCards.validate_raw(obj: obj)
|
|
63
63
|
rescue StandardError
|
|
64
64
|
# noop
|
|
65
65
|
end
|
|
@@ -11,6 +11,8 @@ module Pinnacle
|
|
|
11
11
|
attr_reader :total
|
|
12
12
|
# @return [Float] Cost per message.
|
|
13
13
|
attr_reader :unit
|
|
14
|
+
# @return [Integer] Total number of segments used across the message.
|
|
15
|
+
attr_reader :segments
|
|
14
16
|
# @return [Array<String>] List of unsupported media file names or URLs.
|
|
15
17
|
attr_reader :unsupported_files
|
|
16
18
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
|
@@ -24,15 +26,17 @@ module Pinnacle
|
|
|
24
26
|
# @param total [Float] Total price of this message. Calculated by multiplying the number of messages by
|
|
25
27
|
# the unit cost.
|
|
26
28
|
# @param unit [Float] Cost per message.
|
|
29
|
+
# @param segments [Integer] Total number of segments used across the message.
|
|
27
30
|
# @param unsupported_files [Array<String>] List of unsupported media file names or URLs.
|
|
28
31
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
29
32
|
# @return [Pinnacle::Types::RcsValidationResult]
|
|
30
|
-
def initialize(total:, unit:, unsupported_files:, additional_properties: nil)
|
|
33
|
+
def initialize(total:, unit:, segments:, unsupported_files:, additional_properties: nil)
|
|
31
34
|
@total = total
|
|
32
35
|
@unit = unit
|
|
36
|
+
@segments = segments
|
|
33
37
|
@unsupported_files = unsupported_files
|
|
34
38
|
@additional_properties = additional_properties
|
|
35
|
-
@_field_set = { "total": total, "unit": unit, "unsupportedFiles": unsupported_files }
|
|
39
|
+
@_field_set = { "total": total, "unit": unit, "segments": segments, "unsupportedFiles": unsupported_files }
|
|
36
40
|
end
|
|
37
41
|
|
|
38
42
|
# Deserialize a JSON object to an instance of RcsValidationResult
|
|
@@ -44,10 +48,12 @@ module Pinnacle
|
|
|
44
48
|
parsed_json = JSON.parse(json_object)
|
|
45
49
|
total = parsed_json["total"]
|
|
46
50
|
unit = parsed_json["unit"]
|
|
51
|
+
segments = parsed_json["segments"]
|
|
47
52
|
unsupported_files = parsed_json["unsupportedFiles"]
|
|
48
53
|
new(
|
|
49
54
|
total: total,
|
|
50
55
|
unit: unit,
|
|
56
|
+
segments: segments,
|
|
51
57
|
unsupported_files: unsupported_files,
|
|
52
58
|
additional_properties: struct
|
|
53
59
|
)
|
|
@@ -69,6 +75,7 @@ module Pinnacle
|
|
|
69
75
|
def self.validate_raw(obj:)
|
|
70
76
|
obj.total.is_a?(Float) != false || raise("Passed value for field obj.total is not the expected type, validation failed.")
|
|
71
77
|
obj.unit.is_a?(Float) != false || raise("Passed value for field obj.unit is not the expected type, validation failed.")
|
|
78
|
+
obj.segments.is_a?(Integer) != false || raise("Passed value for field obj.segments is not the expected type, validation failed.")
|
|
72
79
|
obj.unsupported_files.is_a?(Array) != false || raise("Passed value for field obj.unsupported_files is not the expected type, validation failed.")
|
|
73
80
|
end
|
|
74
81
|
end
|
|
@@ -7,8 +7,9 @@ require "json"
|
|
|
7
7
|
module Pinnacle
|
|
8
8
|
module Types
|
|
9
9
|
# Individual card containing title, optional media, and action buttons.
|
|
10
|
-
class
|
|
11
|
-
# @return [Array<Pinnacle::Types::RichButton>]
|
|
10
|
+
class RichCard
|
|
11
|
+
# @return [Array<Pinnacle::Types::RichButton>] While buttons resemble quick replies, they remain on screen after being clicked
|
|
12
|
+
# and are card-specific.
|
|
12
13
|
attr_reader :buttons
|
|
13
14
|
# @return [String] Media file URLs to send.
|
|
14
15
|
attr_reader :media
|
|
@@ -24,12 +25,13 @@ module Pinnacle
|
|
|
24
25
|
|
|
25
26
|
OMIT = Object.new
|
|
26
27
|
|
|
27
|
-
# @param buttons [Array<Pinnacle::Types::RichButton>]
|
|
28
|
+
# @param buttons [Array<Pinnacle::Types::RichButton>] While buttons resemble quick replies, they remain on screen after being clicked
|
|
29
|
+
# and are card-specific.
|
|
28
30
|
# @param media [String] Media file URLs to send.
|
|
29
31
|
# @param subtitle [String] Secondary text displayed below the title for additional context.
|
|
30
32
|
# @param title [String] Title displayed on the card.
|
|
31
33
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
|
32
|
-
# @return [Pinnacle::Types::
|
|
34
|
+
# @return [Pinnacle::Types::RichCard]
|
|
33
35
|
def initialize(buttons:, title:, media: OMIT, subtitle: OMIT, additional_properties: nil)
|
|
34
36
|
@buttons = buttons
|
|
35
37
|
@media = media if media != OMIT
|
|
@@ -41,10 +43,10 @@ module Pinnacle
|
|
|
41
43
|
end
|
|
42
44
|
end
|
|
43
45
|
|
|
44
|
-
# Deserialize a JSON object to an instance of
|
|
46
|
+
# Deserialize a JSON object to an instance of RichCard
|
|
45
47
|
#
|
|
46
48
|
# @param json_object [String]
|
|
47
|
-
# @return [Pinnacle::Types::
|
|
49
|
+
# @return [Pinnacle::Types::RichCard]
|
|
48
50
|
def self.from_json(json_object:)
|
|
49
51
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
|
50
52
|
parsed_json = JSON.parse(json_object)
|
|
@@ -64,7 +66,7 @@ module Pinnacle
|
|
|
64
66
|
)
|
|
65
67
|
end
|
|
66
68
|
|
|
67
|
-
# Serialize an instance of
|
|
69
|
+
# Serialize an instance of RichCard to a JSON object
|
|
68
70
|
#
|
|
69
71
|
# @return [String]
|
|
70
72
|
def to_json(*_args)
|