rcs 2.0.2 → 2.0.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.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rcs/brands/client.rb +52 -90
  3. data/lib/rcs/brands/types/{brand_contact.rb → upsert_brand_schema_contact.rb} +20 -18
  4. data/lib/rcs/brands/types/upsert_brand_schema_entity_type.rb +16 -0
  5. data/lib/rcs/brands/types/upsert_brand_schema_sector.rb +28 -0
  6. data/lib/rcs/brands/types/upsert_brand_schema_type.rb +16 -0
  7. data/lib/rcs/campaigns/dlc/client.rb +12 -12
  8. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_help_keywords.rb → dlc_campaign_help_keywords.rb} +5 -5
  9. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_keywords.rb → dlc_campaign_keywords.rb} +20 -20
  10. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_links.rb → dlc_campaign_links.rb} +5 -5
  11. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_opt_in_keywords.rb → dlc_campaign_opt_in_keywords.rb} +5 -5
  12. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_opt_out_keywords.rb → dlc_campaign_opt_out_keywords.rb} +5 -5
  13. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_options.rb → dlc_campaign_options.rb} +5 -5
  14. data/lib/rcs/campaigns/dlc/types/{upsert_dlc_campaign_use_case.rb → dlc_campaign_use_case.rb} +5 -5
  15. data/lib/rcs/campaigns/rcs/client.rb +144 -51
  16. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_agent.rb → rcs_agent.rb} +15 -9
  17. data/lib/rcs/campaigns/rcs/types/rcs_autofill_response.rb +122 -43
  18. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_opt_out.rb → rcs_campaign_help_keywords.rb} +20 -19
  19. data/lib/rcs/campaigns/rcs/types/rcs_campaign_keywords.rb +98 -0
  20. data/lib/rcs/campaigns/rcs/types/rcs_campaign_opt_in_keywords.rb +87 -0
  21. data/lib/rcs/campaigns/rcs/types/rcs_campaign_opt_out_keywords.rb +83 -0
  22. data/lib/rcs/campaigns/rcs/types/rcs_campaign_traffic.rb +76 -0
  23. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_links.rb → rcs_links.rb} +5 -5
  24. data/lib/rcs/campaigns/rcs/types/{upsert_rcs_use_case.rb → rcs_use_case.rb} +7 -7
  25. data/lib/rcs/campaigns/toll_free/client.rb +53 -10
  26. data/lib/rcs/campaigns/toll_free/types/toll_free_autofill_response.rb +54 -12
  27. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_help_keywords.rb +66 -0
  28. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_keywords.rb +86 -0
  29. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_links.rb +74 -0
  30. data/lib/rcs/campaigns/toll_free/types/{upsert_toll_free_schema_opt_in.rb → toll_free_campaign_opt_in.rb} +5 -5
  31. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_opt_in_keywords.rb +78 -0
  32. data/lib/rcs/campaigns/toll_free/types/toll_free_campaign_options.rb +64 -0
  33. data/lib/rcs/campaigns/toll_free/types/{upsert_toll_free_schema_use_case.rb → toll_free_campaign_use_case.rb} +5 -5
  34. data/lib/rcs/messages/blast/client.rb +419 -0
  35. data/lib/rcs/messages/blast/types/blast_mms_options.rb +82 -0
  36. data/lib/rcs/messages/blast/types/blast_mms_response.rb +60 -0
  37. data/lib/rcs/messages/blast/types/blast_rcs_options.rb +118 -0
  38. data/lib/rcs/messages/blast/types/blast_rcs_request_options_standalone_card.rb +82 -0
  39. data/lib/rcs/messages/blast/types/blast_rcs_request_options_standalone_card_image_alignment.rb +16 -0
  40. data/lib/rcs/messages/blast/types/blast_rcs_request_options_standalone_card_orientation.rb +15 -0
  41. data/lib/rcs/messages/blast/types/blast_rcs_response.rb +60 -0
  42. data/lib/rcs/messages/blast/types/blast_sms_options.rb +70 -0
  43. data/lib/rcs/messages/blast/types/blast_sms_response.rb +60 -0
  44. data/lib/rcs/messages/mms/client.rb +6 -6
  45. data/lib/rcs/messages/mms/types/mms_send_response.rb +4 -4
  46. data/lib/rcs/messages/rcs/client.rb +7 -7
  47. data/lib/rcs/messages/rcs/types/{rcs_send_response.rb → send_rich_message_response.rb} +11 -11
  48. data/lib/rcs/messages/schedule/client.rb +103 -0
  49. data/lib/rcs/messages/sms/client.rb +6 -6
  50. data/lib/rcs/messages/sms/types/sms_send_response.rb +4 -4
  51. data/lib/rcs/types/{rcs_base.rb → base_rich_message.rb} +10 -10
  52. data/lib/rcs/types/blast_details.rb +110 -0
  53. data/lib/rcs/types/company_entity_type_enum.rb +14 -0
  54. data/lib/rcs/types/dlc_campaign_with_extended_brand_and_status.rb +30 -2
  55. data/lib/rcs/types/dlc_with_extended_brand_and_status_mno_brand_tier.rb +15 -0
  56. data/lib/rcs/types/dlc_with_extended_brand_and_status_mno_tcr_tier.rb +22 -0
  57. data/lib/rcs/types/extended_brand.rb +10 -1
  58. data/lib/rcs/types/extended_brand_with_vetting.rb +10 -1
  59. data/lib/rcs/types/extended_rcs_campaign.rb +122 -51
  60. data/lib/rcs/types/message_schedule.rb +52 -24
  61. data/lib/rcs/types/message_status_enum.rb +1 -0
  62. data/lib/rcs/types/optional_brand_info.rb +10 -1
  63. data/lib/rcs/types/rcs_campaign.rb +122 -43
  64. data/lib/rcs/types/rcs_campaign_schema_extra_keywords.rb +94 -0
  65. data/lib/rcs/types/{rcs_campaign_schema_extra_opt_out.rb → rcs_campaign_schema_extra_keywords_help.rb} +18 -17
  66. data/lib/rcs/types/rcs_campaign_schema_extra_keywords_opt_in.rb +73 -0
  67. data/lib/rcs/types/rcs_campaign_schema_extra_keywords_opt_out.rb +73 -0
  68. data/lib/rcs/types/rcs_campaign_schema_extra_traffic.rb +72 -0
  69. data/lib/rcs/types/rcs_campaign_schema_extra_use_case.rb +2 -2
  70. data/lib/rcs/types/rcs_campaign_schema_keywords.rb +94 -0
  71. data/lib/rcs/types/{rcs_campaign_schema_opt_out.rb → rcs_campaign_schema_keywords_help.rb} +18 -17
  72. data/lib/rcs/types/rcs_campaign_schema_keywords_opt_in.rb +73 -0
  73. data/lib/rcs/types/rcs_campaign_schema_keywords_opt_out.rb +73 -0
  74. data/lib/rcs/types/rcs_campaign_schema_traffic.rb +72 -0
  75. data/lib/rcs/types/rcs_campaign_schema_use_case.rb +2 -2
  76. data/lib/rcs/types/rcs_cards_content_cards_item.rb +4 -2
  77. data/lib/rcs/types/rcs_content.rb +4 -4
  78. data/lib/rcs/types/rcs_messaging_type_enum.rb +17 -0
  79. data/lib/rcs/types/rcs_validate_content.rb +8 -8
  80. data/lib/rcs/types/rcs_validation_result.rb +9 -2
  81. data/lib/rcs/types/{rcs_cards_cards_item.rb → rich_card.rb} +9 -7
  82. data/lib/rcs/types/{rcs_cards.rb → rich_cards.rb} +9 -9
  83. data/lib/rcs/types/rich_cards_message.rb +9 -9
  84. data/lib/rcs/types/rich_media_message.rb +5 -5
  85. data/lib/rcs/types/{send_rcs_card_options_standalone_card.rb → rich_standalone_card_options.rb} +9 -7
  86. data/lib/rcs/types/{rcs_text_content.rb → rich_text.rb} +5 -5
  87. data/lib/rcs/types/rich_text_message.rb +5 -5
  88. data/lib/rcs/types/schedule_cancel_result.rb +58 -0
  89. data/lib/rcs/types/scheduled_blast_details.rb +76 -0
  90. data/lib/rcs/types/scheduled_blast_response_config.rb +89 -0
  91. data/lib/rcs/types/{scheduled_messaage.rb → scheduled_message.rb} +5 -5
  92. data/lib/rcs/types/{send_rcs_card_options.rb → send_rich_cards_options.rb} +18 -14
  93. data/lib/rcs/types/{rcs_base_options.rb → send_rich_message_options.rb} +5 -5
  94. data/lib/rcs/types/{sent_rcs_details.rb → sent_rich_message.rb} +5 -5
  95. data/lib/rcs/types/toll_free_campaign.rb +54 -12
  96. data/lib/rcs/types/toll_free_campaign_schema_keywords.rb +82 -0
  97. data/lib/rcs/types/toll_free_campaign_schema_keywords_help.rb +62 -0
  98. data/lib/rcs/types/toll_free_campaign_schema_keywords_opt_in.rb +74 -0
  99. data/lib/rcs/types/toll_free_campaign_schema_links.rb +70 -0
  100. data/lib/rcs/types/{upsert_toll_free_campaign_opt_in.rb → toll_free_campaign_schema_opt_in.rb} +5 -5
  101. data/lib/rcs/types/toll_free_campaign_schema_options.rb +60 -0
  102. data/lib/rcs/types/{upsert_toll_free_campaign_use_case.rb → toll_free_campaign_schema_use_case.rb} +5 -5
  103. data/lib/rcs/types/toll_free_campaign_with_extended_brand_and_status.rb +54 -12
  104. data/lib/requests.rb +2 -2
  105. data/lib/types_export.rb +70 -34
  106. metadata +74 -36
  107. data/lib/rcs/campaigns/rcs/types/upsert_rcs_opt_in.rb +0 -75
  108. data/lib/rcs/types/options.rb +0 -111
  109. data/lib/rcs/types/rcs_campaign_opt_in_method_enum.rb +0 -15
  110. data/lib/rcs/types/rcs_campaign_schema_extra_opt_in.rb +0 -71
  111. data/lib/rcs/types/rcs_campaign_schema_opt_in.rb +0 -71
  112. data/lib/rcs/types/upsert_contact.rb +0 -84
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ module Campaigns
8
+ module Rcs
9
+ module Types
10
+ class RcsCampaignTraffic
11
+ # @return [Integer] Estimated monthly website visitors.
12
+ attr_reader :monthly_website
13
+ # @return [Integer] Estimated monthly RCS messages sent.
14
+ attr_reader :monthly_rcs_estimate
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 monthly_website [Integer] Estimated monthly website visitors.
24
+ # @param monthly_rcs_estimate [Integer] Estimated monthly RCS messages sent.
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Pinnacle::Campaigns::Rcs::Types::RcsCampaignTraffic]
27
+ def initialize(monthly_website: OMIT, monthly_rcs_estimate: OMIT, additional_properties: nil)
28
+ @monthly_website = monthly_website if monthly_website != OMIT
29
+ @monthly_rcs_estimate = monthly_rcs_estimate if monthly_rcs_estimate != OMIT
30
+ @additional_properties = additional_properties
31
+ @_field_set = {
32
+ "monthlyWebsite": monthly_website,
33
+ "monthlyRcsEstimate": monthly_rcs_estimate
34
+ }.reject do |_k, v|
35
+ v == OMIT
36
+ end
37
+ end
38
+
39
+ # Deserialize a JSON object to an instance of RcsCampaignTraffic
40
+ #
41
+ # @param json_object [String]
42
+ # @return [Pinnacle::Campaigns::Rcs::Types::RcsCampaignTraffic]
43
+ def self.from_json(json_object:)
44
+ struct = JSON.parse(json_object, object_class: OpenStruct)
45
+ parsed_json = JSON.parse(json_object)
46
+ monthly_website = parsed_json["monthlyWebsite"]
47
+ monthly_rcs_estimate = parsed_json["monthlyRcsEstimate"]
48
+ new(
49
+ monthly_website: monthly_website,
50
+ monthly_rcs_estimate: monthly_rcs_estimate,
51
+ additional_properties: struct
52
+ )
53
+ end
54
+
55
+ # Serialize an instance of RcsCampaignTraffic to a JSON object
56
+ #
57
+ # @return [String]
58
+ def to_json(*_args)
59
+ @_field_set&.to_json
60
+ end
61
+
62
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
63
+ # hash and check each fields type against the current object's property
64
+ # definitions.
65
+ #
66
+ # @param obj [Object]
67
+ # @return [Void]
68
+ def self.validate_raw(obj:)
69
+ obj.monthly_website&.is_a?(Integer) != false || raise("Passed value for field obj.monthly_website is not the expected type, validation failed.")
70
+ obj.monthly_rcs_estimate&.is_a?(Integer) != false || raise("Passed value for field obj.monthly_rcs_estimate is not the expected type, validation failed.")
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -8,7 +8,7 @@ module Pinnacle
8
8
  module Rcs
9
9
  module Types
10
10
  # Legal documentation links.
11
- class UpsertRcsLinks
11
+ class RcsLinks
12
12
  # @return [String] Privacy policy URL.
13
13
  attr_reader :privacy_policy
14
14
  # @return [String] Terms of service URL.
@@ -24,7 +24,7 @@ module Pinnacle
24
24
  # @param privacy_policy [String] Privacy policy URL.
25
25
  # @param terms_of_service [String] Terms of service URL.
26
26
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
27
- # @return [Pinnacle::Campaigns::Rcs::Types::UpsertRcsLinks]
27
+ # @return [Pinnacle::Campaigns::Rcs::Types::RcsLinks]
28
28
  def initialize(privacy_policy: OMIT, terms_of_service: OMIT, additional_properties: nil)
29
29
  @privacy_policy = privacy_policy if privacy_policy != OMIT
30
30
  @terms_of_service = terms_of_service if terms_of_service != OMIT
@@ -34,10 +34,10 @@ module Pinnacle
34
34
  end
35
35
  end
36
36
 
37
- # Deserialize a JSON object to an instance of UpsertRcsLinks
37
+ # Deserialize a JSON object to an instance of RcsLinks
38
38
  #
39
39
  # @param json_object [String]
40
- # @return [Pinnacle::Campaigns::Rcs::Types::UpsertRcsLinks]
40
+ # @return [Pinnacle::Campaigns::Rcs::Types::RcsLinks]
41
41
  def self.from_json(json_object:)
42
42
  struct = JSON.parse(json_object, object_class: OpenStruct)
43
43
  parsed_json = JSON.parse(json_object)
@@ -50,7 +50,7 @@ module Pinnacle
50
50
  )
51
51
  end
52
52
 
53
- # Serialize an instance of UpsertRcsLinks to a JSON object
53
+ # Serialize an instance of RcsLinks to a JSON object
54
54
  #
55
55
  # @return [String]
56
56
  def to_json(*_args)
@@ -9,8 +9,8 @@ module Pinnacle
9
9
  module Rcs
10
10
  module Types
11
11
  # Use case classification for the campaign.
12
- class UpsertRcsUseCase
13
- # @return [String] Summary of the use case.
12
+ class RcsUseCase
13
+ # @return [String] Detailed summary of what the brand is and how this agent will be used.
14
14
  attr_reader :behavior
15
15
  # @return [Pinnacle::Types::RcsCampaignUseCaseEnum]
16
16
  attr_reader :value
@@ -22,10 +22,10 @@ module Pinnacle
22
22
 
23
23
  OMIT = Object.new
24
24
 
25
- # @param behavior [String] Summary of the use case.
25
+ # @param behavior [String] Detailed summary of what the brand is and how this agent will be used.
26
26
  # @param value [Pinnacle::Types::RcsCampaignUseCaseEnum]
27
27
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
28
- # @return [Pinnacle::Campaigns::Rcs::Types::UpsertRcsUseCase]
28
+ # @return [Pinnacle::Campaigns::Rcs::Types::RcsUseCase]
29
29
  def initialize(behavior: OMIT, value: OMIT, additional_properties: nil)
30
30
  @behavior = behavior if behavior != OMIT
31
31
  @value = value if value != OMIT
@@ -35,10 +35,10 @@ module Pinnacle
35
35
  end
36
36
  end
37
37
 
38
- # Deserialize a JSON object to an instance of UpsertRcsUseCase
38
+ # Deserialize a JSON object to an instance of RcsUseCase
39
39
  #
40
40
  # @param json_object [String]
41
- # @return [Pinnacle::Campaigns::Rcs::Types::UpsertRcsUseCase]
41
+ # @return [Pinnacle::Campaigns::Rcs::Types::RcsUseCase]
42
42
  def self.from_json(json_object:)
43
43
  struct = JSON.parse(json_object, object_class: OpenStruct)
44
44
  parsed_json = JSON.parse(json_object)
@@ -51,7 +51,7 @@ module Pinnacle
51
51
  )
52
52
  end
53
53
 
54
- # Serialize an instance of UpsertRcsUseCase to a JSON object
54
+ # Serialize an instance of RcsUseCase to a JSON object
55
55
  #
56
56
  # @return [String]
57
57
  def to_json(*_args)
@@ -5,9 +5,12 @@ require_relative "../../types/autofill_campaign_params"
5
5
  require_relative "types/toll_free_autofill_response"
6
6
  require_relative "../../types/toll_free_campaign_with_extended_brand_and_status"
7
7
  require_relative "../../types/campaign_submission_result"
8
+ require_relative "types/toll_free_campaign_keywords"
9
+ require_relative "types/toll_free_campaign_links"
8
10
  require_relative "../../types/message_volume_enum"
9
- require_relative "types/upsert_toll_free_schema_opt_in"
10
- require_relative "types/upsert_toll_free_schema_use_case"
11
+ require_relative "types/toll_free_campaign_opt_in"
12
+ require_relative "types/toll_free_campaign_options"
13
+ require_relative "types/toll_free_campaign_use_case"
11
14
  require_relative "../../types/validate_campaign_params"
12
15
  require_relative "../../types/campaign_validation_result"
13
16
  require "async"
@@ -129,14 +132,25 @@ module Pinnacle
129
132
  # for example: `b_1234567890`.
130
133
  # @param campaign_id [String] Unique identifier for the campaign. This identifier is a string that always
131
134
  # begins with the prefix `tf_`, for example: `tf_1234567890`.
135
+ # @param keywords [Hash] Keyword response configuration.Request of type Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignKeywords, as a Hash
136
+ # * :help (Hash)
137
+ # * :message (String)
138
+ # * :opt_in (Hash)
139
+ # * :message (String)
140
+ # * :keywords (Array<String>)
141
+ # @param links [Hash] Legal documentation links.Request of type Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignLinks, as a Hash
142
+ # * :privacy_policy (String)
143
+ # * :terms_of_service (String)
132
144
  # @param monthly_volume [Pinnacle::Types::MessageVolumeEnum]
133
145
  # @param name [String] Display name of the campaign.
134
- # @param opt_in [Hash] Opt-in keyword settings.Request of type Pinnacle::Campaigns::TollFree::Types::UpsertTollFreeSchemaOptIn, as a Hash
146
+ # @param opt_in [Hash] Opt-in keyword settings.Request of type Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignOptIn, as a Hash
135
147
  # * :method_ (Pinnacle::Types::OptInMethodEnum)
136
148
  # * :url (String)
137
149
  # * :workflow_description (String)
150
+ # @param options [Hash] Campaign configuration options.Request of type Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignOptions, as a Hash
151
+ # * :age_gated (Boolean)
138
152
  # @param production_message_content [String] Explain message that would be sent.
139
- # @param use_case [Hash] Use case classification for the campaign.Request of type Pinnacle::Campaigns::TollFree::Types::UpsertTollFreeSchemaUseCase, as a Hash
153
+ # @param use_case [Hash] Use case classification for the campaign.Request of type Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignUseCase, as a Hash
140
154
  # * :summary (String)
141
155
  # * :value (Pinnacle::Types::TollFreeCampaignUseCaseEnum)
142
156
  # @param request_options [Pinnacle::RequestOptions]
@@ -150,14 +164,20 @@ module Pinnacle
150
164
  # api.campaigns.toll_free.upsert(
151
165
  # brand: "b_1234567890",
152
166
  # campaign_id: "tf_1234567890",
167
+ # keywords: { help: { message: "Email founders@trypinnacle.app for support." }, opt_in: { message: "Welcome back to Pinnacle!<br>
168
+ # 🔔 You're now subscribed to Pinnacle and will continue receiving important updates and news. Feel free to contact this us at any time for help.<br>
169
+ # Reply STOP to opt out and HELP for support. Message & rates may apply.
170
+ # ", keywords: ["START", "SUBSCRIBE"] } },
171
+ # links: { privacy_policy: "https://www.pinnacle.sh/privacy", terms_of_service: "https://www.pinnacle.sh/terms" },
153
172
  # monthly_volume: ONE_000,
154
173
  # name: "Pinnacle",
155
174
  # opt_in: { method_: DIGITAL, url: "https://www.pinnacle.sh/", workflow_description: "Visit https://www.pinnacle.sh/" },
175
+ # options: { age_gated: false },
156
176
  # production_message_content: "Join the Pinnacle workshop tomorrow and send your first RCS!",
157
177
  # use_case: { summary: "Alerts clients about any Pinnacle hosted workshops.", value: WORKSHOP_ALERTS }
158
178
  # )
159
- def upsert(brand: nil, campaign_id: nil, monthly_volume: nil, name: nil, opt_in: nil,
160
- production_message_content: nil, use_case: nil, request_options: nil)
179
+ def upsert(brand: nil, campaign_id: nil, keywords: nil, links: nil, monthly_volume: nil, name: nil, opt_in: nil,
180
+ options: nil, production_message_content: nil, use_case: nil, request_options: nil)
161
181
  response = @request_client.conn.post do |req|
162
182
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
163
183
  req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
@@ -173,9 +193,12 @@ module Pinnacle
173
193
  **(request_options&.additional_body_parameters || {}),
174
194
  brand: brand,
175
195
  campaignId: campaign_id,
196
+ keywords: keywords,
197
+ links: links,
176
198
  monthlyVolume: monthly_volume,
177
199
  name: name,
178
200
  optIn: opt_in,
201
+ options: options,
179
202
  productionMessageContent: production_message_content,
180
203
  useCase: use_case
181
204
  }.compact
@@ -339,14 +362,25 @@ module Pinnacle
339
362
  # for example: `b_1234567890`.
340
363
  # @param campaign_id [String] Unique identifier for the campaign. This identifier is a string that always
341
364
  # begins with the prefix `tf_`, for example: `tf_1234567890`.
365
+ # @param keywords [Hash] Keyword response configuration.Request of type Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignKeywords, as a Hash
366
+ # * :help (Hash)
367
+ # * :message (String)
368
+ # * :opt_in (Hash)
369
+ # * :message (String)
370
+ # * :keywords (Array<String>)
371
+ # @param links [Hash] Legal documentation links.Request of type Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignLinks, as a Hash
372
+ # * :privacy_policy (String)
373
+ # * :terms_of_service (String)
342
374
  # @param monthly_volume [Pinnacle::Types::MessageVolumeEnum]
343
375
  # @param name [String] Display name of the campaign.
344
- # @param opt_in [Hash] Opt-in keyword settings.Request of type Pinnacle::Campaigns::TollFree::Types::UpsertTollFreeSchemaOptIn, as a Hash
376
+ # @param opt_in [Hash] Opt-in keyword settings.Request of type Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignOptIn, as a Hash
345
377
  # * :method_ (Pinnacle::Types::OptInMethodEnum)
346
378
  # * :url (String)
347
379
  # * :workflow_description (String)
380
+ # @param options [Hash] Campaign configuration options.Request of type Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignOptions, as a Hash
381
+ # * :age_gated (Boolean)
348
382
  # @param production_message_content [String] Explain message that would be sent.
349
- # @param use_case [Hash] Use case classification for the campaign.Request of type Pinnacle::Campaigns::TollFree::Types::UpsertTollFreeSchemaUseCase, as a Hash
383
+ # @param use_case [Hash] Use case classification for the campaign.Request of type Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignUseCase, as a Hash
350
384
  # * :summary (String)
351
385
  # * :value (Pinnacle::Types::TollFreeCampaignUseCaseEnum)
352
386
  # @param request_options [Pinnacle::RequestOptions]
@@ -360,14 +394,20 @@ module Pinnacle
360
394
  # api.campaigns.toll_free.upsert(
361
395
  # brand: "b_1234567890",
362
396
  # campaign_id: "tf_1234567890",
397
+ # keywords: { help: { message: "Email founders@trypinnacle.app for support." }, opt_in: { message: "Welcome back to Pinnacle!<br>
398
+ # 🔔 You're now subscribed to Pinnacle and will continue receiving important updates and news. Feel free to contact this us at any time for help.<br>
399
+ # Reply STOP to opt out and HELP for support. Message & rates may apply.
400
+ # ", keywords: ["START", "SUBSCRIBE"] } },
401
+ # links: { privacy_policy: "https://www.pinnacle.sh/privacy", terms_of_service: "https://www.pinnacle.sh/terms" },
363
402
  # monthly_volume: ONE_000,
364
403
  # name: "Pinnacle",
365
404
  # opt_in: { method_: DIGITAL, url: "https://www.pinnacle.sh/", workflow_description: "Visit https://www.pinnacle.sh/" },
405
+ # options: { age_gated: false },
366
406
  # production_message_content: "Join the Pinnacle workshop tomorrow and send your first RCS!",
367
407
  # use_case: { summary: "Alerts clients about any Pinnacle hosted workshops.", value: WORKSHOP_ALERTS }
368
408
  # )
369
- def upsert(brand: nil, campaign_id: nil, monthly_volume: nil, name: nil, opt_in: nil,
370
- production_message_content: nil, use_case: nil, request_options: nil)
409
+ def upsert(brand: nil, campaign_id: nil, keywords: nil, links: nil, monthly_volume: nil, name: nil, opt_in: nil,
410
+ options: nil, production_message_content: nil, use_case: nil, request_options: nil)
371
411
  Async do
372
412
  response = @request_client.conn.post do |req|
373
413
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -384,9 +424,12 @@ module Pinnacle
384
424
  **(request_options&.additional_body_parameters || {}),
385
425
  brand: brand,
386
426
  campaignId: campaign_id,
427
+ keywords: keywords,
428
+ links: links,
387
429
  monthlyVolume: monthly_volume,
388
430
  name: name,
389
431
  optIn: opt_in,
432
+ options: options,
390
433
  productionMessageContent: production_message_content,
391
434
  useCase: use_case
392
435
  }.compact
@@ -1,8 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "../../../types/toll_free_campaign_schema_keywords"
4
+ require_relative "../../../types/toll_free_campaign_schema_links"
3
5
  require_relative "../../../types/message_volume_enum"
4
- require_relative "../../../types/upsert_toll_free_campaign_opt_in"
5
- require_relative "../../../types/upsert_toll_free_campaign_use_case"
6
+ require_relative "../../../types/toll_free_campaign_schema_opt_in"
7
+ require_relative "../../../types/toll_free_campaign_schema_options"
8
+ require_relative "../../../types/toll_free_campaign_schema_use_case"
6
9
  require "ostruct"
7
10
  require "json"
8
11
 
@@ -15,15 +18,21 @@ module Pinnacle
15
18
  attr_reader :brand
16
19
  # @return [String] Unique identifier for the campaign. Must begin with the prefix `tf_`.
17
20
  attr_reader :campaign_id
21
+ # @return [Pinnacle::Types::TollFreeCampaignSchemaKeywords] Keyword response configuration.
22
+ attr_reader :keywords
23
+ # @return [Pinnacle::Types::TollFreeCampaignSchemaLinks] Legal documentation links.
24
+ attr_reader :links
18
25
  # @return [Pinnacle::Types::MessageVolumeEnum]
19
26
  attr_reader :monthly_volume
20
27
  # @return [String] Display name of the campaign.
21
28
  attr_reader :name
22
- # @return [Pinnacle::Types::UpsertTollFreeCampaignOptIn] Opt-in keyword settings.
29
+ # @return [Pinnacle::Types::TollFreeCampaignSchemaOptIn] Opt-in keyword settings.
23
30
  attr_reader :opt_in
31
+ # @return [Pinnacle::Types::TollFreeCampaignSchemaOptions] Campaign configuration options.
32
+ attr_reader :options
24
33
  # @return [String] Explain message that would be sent.
25
34
  attr_reader :production_message_content
26
- # @return [Pinnacle::Types::UpsertTollFreeCampaignUseCase] Use case classification for the campaign.
35
+ # @return [Pinnacle::Types::TollFreeCampaignSchemaUseCase] Use case classification for the campaign.
27
36
  attr_reader :use_case
28
37
  # @return [OpenStruct] Additional properties unmapped to the current class definition
29
38
  attr_reader :additional_properties
@@ -35,29 +44,38 @@ module Pinnacle
35
44
 
36
45
  # @param brand [String]
37
46
  # @param campaign_id [String] Unique identifier for the campaign. Must begin with the prefix `tf_`.
47
+ # @param keywords [Pinnacle::Types::TollFreeCampaignSchemaKeywords] Keyword response configuration.
48
+ # @param links [Pinnacle::Types::TollFreeCampaignSchemaLinks] Legal documentation links.
38
49
  # @param monthly_volume [Pinnacle::Types::MessageVolumeEnum]
39
50
  # @param name [String] Display name of the campaign.
40
- # @param opt_in [Pinnacle::Types::UpsertTollFreeCampaignOptIn] Opt-in keyword settings.
51
+ # @param opt_in [Pinnacle::Types::TollFreeCampaignSchemaOptIn] Opt-in keyword settings.
52
+ # @param options [Pinnacle::Types::TollFreeCampaignSchemaOptions] Campaign configuration options.
41
53
  # @param production_message_content [String] Explain message that would be sent.
42
- # @param use_case [Pinnacle::Types::UpsertTollFreeCampaignUseCase] Use case classification for the campaign.
54
+ # @param use_case [Pinnacle::Types::TollFreeCampaignSchemaUseCase] Use case classification for the campaign.
43
55
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
44
56
  # @return [Pinnacle::Campaigns::TollFree::Types::TollFreeAutofillResponse]
45
- def initialize(brand: OMIT, campaign_id: OMIT, monthly_volume: OMIT, name: OMIT, opt_in: OMIT,
46
- production_message_content: OMIT, use_case: OMIT, additional_properties: nil)
57
+ def initialize(brand: OMIT, campaign_id: OMIT, keywords: OMIT, links: OMIT, monthly_volume: OMIT, name: OMIT,
58
+ opt_in: OMIT, options: OMIT, production_message_content: OMIT, use_case: OMIT, additional_properties: nil)
47
59
  @brand = brand if brand != OMIT
48
60
  @campaign_id = campaign_id if campaign_id != OMIT
61
+ @keywords = keywords if keywords != OMIT
62
+ @links = links if links != OMIT
49
63
  @monthly_volume = monthly_volume if monthly_volume != OMIT
50
64
  @name = name if name != OMIT
51
65
  @opt_in = opt_in if opt_in != OMIT
66
+ @options = options if options != OMIT
52
67
  @production_message_content = production_message_content if production_message_content != OMIT
53
68
  @use_case = use_case if use_case != OMIT
54
69
  @additional_properties = additional_properties
55
70
  @_field_set = {
56
71
  "brand": brand,
57
72
  "campaignId": campaign_id,
73
+ "keywords": keywords,
74
+ "links": links,
58
75
  "monthlyVolume": monthly_volume,
59
76
  "name": name,
60
77
  "optIn": opt_in,
78
+ "options": options,
61
79
  "productionMessageContent": production_message_content,
62
80
  "useCase": use_case
63
81
  }.reject do |_k, v|
@@ -74,27 +92,48 @@ module Pinnacle
74
92
  parsed_json = JSON.parse(json_object)
75
93
  brand = parsed_json["brand"]
76
94
  campaign_id = parsed_json["campaignId"]
95
+ if parsed_json["keywords"].nil?
96
+ keywords = nil
97
+ else
98
+ keywords = parsed_json["keywords"].to_json
99
+ keywords = Pinnacle::Types::TollFreeCampaignSchemaKeywords.from_json(json_object: keywords)
100
+ end
101
+ if parsed_json["links"].nil?
102
+ links = nil
103
+ else
104
+ links = parsed_json["links"].to_json
105
+ links = Pinnacle::Types::TollFreeCampaignSchemaLinks.from_json(json_object: links)
106
+ end
77
107
  monthly_volume = parsed_json["monthlyVolume"]
78
108
  name = parsed_json["name"]
79
109
  if parsed_json["optIn"].nil?
80
110
  opt_in = nil
81
111
  else
82
112
  opt_in = parsed_json["optIn"].to_json
83
- opt_in = Pinnacle::Types::UpsertTollFreeCampaignOptIn.from_json(json_object: opt_in)
113
+ opt_in = Pinnacle::Types::TollFreeCampaignSchemaOptIn.from_json(json_object: opt_in)
114
+ end
115
+ if parsed_json["options"].nil?
116
+ options = nil
117
+ else
118
+ options = parsed_json["options"].to_json
119
+ options = Pinnacle::Types::TollFreeCampaignSchemaOptions.from_json(json_object: options)
84
120
  end
85
121
  production_message_content = parsed_json["productionMessageContent"]
86
122
  if parsed_json["useCase"].nil?
87
123
  use_case = nil
88
124
  else
89
125
  use_case = parsed_json["useCase"].to_json
90
- use_case = Pinnacle::Types::UpsertTollFreeCampaignUseCase.from_json(json_object: use_case)
126
+ use_case = Pinnacle::Types::TollFreeCampaignSchemaUseCase.from_json(json_object: use_case)
91
127
  end
92
128
  new(
93
129
  brand: brand,
94
130
  campaign_id: campaign_id,
131
+ keywords: keywords,
132
+ links: links,
95
133
  monthly_volume: monthly_volume,
96
134
  name: name,
97
135
  opt_in: opt_in,
136
+ options: options,
98
137
  production_message_content: production_message_content,
99
138
  use_case: use_case,
100
139
  additional_properties: struct
@@ -117,11 +156,14 @@ module Pinnacle
117
156
  def self.validate_raw(obj:)
118
157
  obj.brand&.is_a?(String) != false || raise("Passed value for field obj.brand is not the expected type, validation failed.")
119
158
  obj.campaign_id&.is_a?(String) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
159
+ obj.keywords.nil? || Pinnacle::Types::TollFreeCampaignSchemaKeywords.validate_raw(obj: obj.keywords)
160
+ obj.links.nil? || Pinnacle::Types::TollFreeCampaignSchemaLinks.validate_raw(obj: obj.links)
120
161
  obj.monthly_volume&.is_a?(Pinnacle::Types::MessageVolumeEnum) != false || raise("Passed value for field obj.monthly_volume is not the expected type, validation failed.")
121
162
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
122
- obj.opt_in.nil? || Pinnacle::Types::UpsertTollFreeCampaignOptIn.validate_raw(obj: obj.opt_in)
163
+ obj.opt_in.nil? || Pinnacle::Types::TollFreeCampaignSchemaOptIn.validate_raw(obj: obj.opt_in)
164
+ obj.options.nil? || Pinnacle::Types::TollFreeCampaignSchemaOptions.validate_raw(obj: obj.options)
123
165
  obj.production_message_content&.is_a?(String) != false || raise("Passed value for field obj.production_message_content is not the expected type, validation failed.")
124
- obj.use_case.nil? || Pinnacle::Types::UpsertTollFreeCampaignUseCase.validate_raw(obj: obj.use_case)
166
+ obj.use_case.nil? || Pinnacle::Types::TollFreeCampaignSchemaUseCase.validate_raw(obj: obj.use_case)
125
167
  end
126
168
  end
127
169
  end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ module Campaigns
8
+ module TollFree
9
+ module Types
10
+ # Help keyword settings.
11
+ class TollFreeCampaignHelpKeywords
12
+ # @return [String] Message sent when a user sends HELP. Must include at least one support contact
13
+ # method (phone, email, or website).
14
+ attr_reader :message
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 sends HELP. Must include at least one support contact
24
+ # method (phone, email, or website).
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignHelpKeywords]
27
+ def initialize(message: OMIT, additional_properties: nil)
28
+ @message = message if message != OMIT
29
+ @additional_properties = additional_properties
30
+ @_field_set = { "message": message }.reject do |_k, v|
31
+ v == OMIT
32
+ end
33
+ end
34
+
35
+ # Deserialize a JSON object to an instance of TollFreeCampaignHelpKeywords
36
+ #
37
+ # @param json_object [String]
38
+ # @return [Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignHelpKeywords]
39
+ def self.from_json(json_object:)
40
+ struct = JSON.parse(json_object, object_class: OpenStruct)
41
+ parsed_json = JSON.parse(json_object)
42
+ message = parsed_json["message"]
43
+ new(message: message, additional_properties: struct)
44
+ end
45
+
46
+ # Serialize an instance of TollFreeCampaignHelpKeywords to a JSON object
47
+ #
48
+ # @return [String]
49
+ def to_json(*_args)
50
+ @_field_set&.to_json
51
+ end
52
+
53
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
54
+ # hash and check each fields type against the current object's property
55
+ # definitions.
56
+ #
57
+ # @param obj [Object]
58
+ # @return [Void]
59
+ def self.validate_raw(obj:)
60
+ obj.message&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,86 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "toll_free_campaign_help_keywords"
4
+ require_relative "toll_free_campaign_opt_in_keywords"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Pinnacle
9
+ module Campaigns
10
+ module TollFree
11
+ module Types
12
+ # Keyword response configuration.
13
+ class TollFreeCampaignKeywords
14
+ # @return [Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignHelpKeywords] Help keyword settings.
15
+ attr_reader :help
16
+ # @return [Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignOptInKeywords] Opt-in keyword settings.
17
+ attr_reader :opt_in
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::Campaigns::TollFree::Types::TollFreeCampaignHelpKeywords] Help keyword settings.
27
+ # @param opt_in [Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignOptInKeywords] Opt-in keyword settings.
28
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
29
+ # @return [Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignKeywords]
30
+ def initialize(help: OMIT, opt_in: OMIT, additional_properties: nil)
31
+ @help = help if help != OMIT
32
+ @opt_in = opt_in if opt_in != OMIT
33
+ @additional_properties = additional_properties
34
+ @_field_set = { "HELP": help, "OPT_IN": opt_in }.reject do |_k, v|
35
+ v == OMIT
36
+ end
37
+ end
38
+
39
+ # Deserialize a JSON object to an instance of TollFreeCampaignKeywords
40
+ #
41
+ # @param json_object [String]
42
+ # @return [Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignKeywords]
43
+ def self.from_json(json_object:)
44
+ struct = JSON.parse(json_object, object_class: OpenStruct)
45
+ parsed_json = JSON.parse(json_object)
46
+ if parsed_json["HELP"].nil?
47
+ help = nil
48
+ else
49
+ help = parsed_json["HELP"].to_json
50
+ help = Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignHelpKeywords.from_json(json_object: help)
51
+ end
52
+ if parsed_json["OPT_IN"].nil?
53
+ opt_in = nil
54
+ else
55
+ opt_in = parsed_json["OPT_IN"].to_json
56
+ opt_in = Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignOptInKeywords.from_json(json_object: opt_in)
57
+ end
58
+ new(
59
+ help: help,
60
+ opt_in: opt_in,
61
+ additional_properties: struct
62
+ )
63
+ end
64
+
65
+ # Serialize an instance of TollFreeCampaignKeywords to a JSON object
66
+ #
67
+ # @return [String]
68
+ def to_json(*_args)
69
+ @_field_set&.to_json
70
+ end
71
+
72
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
73
+ # hash and check each fields type against the current object's property
74
+ # definitions.
75
+ #
76
+ # @param obj [Object]
77
+ # @return [Void]
78
+ def self.validate_raw(obj:)
79
+ obj.help.nil? || Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignHelpKeywords.validate_raw(obj: obj.help)
80
+ obj.opt_in.nil? || Pinnacle::Campaigns::TollFree::Types::TollFreeCampaignOptInKeywords.validate_raw(obj: obj.opt_in)
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end