rcs 2.0.0.pre.rc.3 → 2.0.0.pre.rc.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1427bbd6a4b71cea24dabba775a6738497b9ac5a511ca5ab39731186c6d0535f
4
- data.tar.gz: f9dd560ed6a0343af0e3f308a2ba4ed8dc6310c31134fa56ac9d322074df14b4
3
+ metadata.gz: 262806a75a52a70e37dd92a0036ba70af3a59aa98ea132dd60f2dad6cbe2c95a
4
+ data.tar.gz: 5dcd700d3f9a65f9dfa3bd4551773fb8fa6789f39e998b053eef877fc95daf70
5
5
  SHA512:
6
- metadata.gz: 0a77a84261329cfa6214225a7eb0d5a48c36eae332672081e9b89cb8b2cf687193f1ba3c791871e478d21738abb024ac12693df14c81e12ea886aa0f48b43f9d
7
- data.tar.gz: e5fd2ee9fe78581876d46a8c6dc0406f85b9501b0df5c8a0f82b700b0eea1ba017f9f1fcca8ff87b2f1fc39614c9657f5c0fe4aecd94adcf3fa7c8b3ce16042f
6
+ metadata.gz: af03848b61375c06cd367fa1b2609616568daba7e7858e377e7f03cfb68f34f9d26b9681bbd9eb94164e48a35219db9932a260feebe59d4f0317243e4ee42e38
7
+ data.tar.gz: 82b3b96ff4b841b1cd3078487f938d01105639414d0bb0950728081aec53b0cd93ea570f8596445c7886d0fee6e38a492bfd6df60040bb82a1b87233ee588d96
@@ -58,9 +58,9 @@ module Pinnacle
58
58
  Pinnacle::Types::AutofillDlcCampaignResponse.from_json(json_object: response.body)
59
59
  end
60
60
 
61
- # Retrieve DLC campaign.
61
+ # Retrieve 10DLC campaign.
62
62
  #
63
- # @param campaign_id [Integer] Unique identifier of the DLC campaign.
63
+ # @param campaign_id [Integer] Unique identifier of the 10DLC campaign.
64
64
  # @param request_options [Pinnacle::RequestOptions]
65
65
  # @return [Pinnacle::Types::DlcCampaignWithExtendedBrandAndStatus]
66
66
  # @example
@@ -90,9 +90,9 @@ module Pinnacle
90
90
  Pinnacle::Types::DlcCampaignWithExtendedBrandAndStatus.from_json(json_object: response.body)
91
91
  end
92
92
 
93
- # Submit your DLC campaign for approval and activation with carriers.
93
+ # Submit your 10DLC campaign for approval and activation with carriers.
94
94
  #
95
- # @param campaign_id [Integer] Unique identifier of the DLC campaign to submit.
95
+ # @param campaign_id [Integer] Unique identifier of the 10DLC campaign to submit.
96
96
  # @param request_options [Pinnacle::RequestOptions]
97
97
  # @return [Pinnacle::Types::CampaignSubmissionResult]
98
98
  # @example
@@ -122,7 +122,7 @@ module Pinnacle
122
122
  Pinnacle::Types::CampaignSubmissionResult.from_json(json_object: response.body)
123
123
  end
124
124
 
125
- # Create a new DLC campaign or updates an existing one. <br>
125
+ # Create a new 10DLC campaign or updates an existing one. <br>
126
126
  # Omit campaignId to create a campaign.
127
127
  #
128
128
  # @param auto_renew [Boolean] Whether the campaign renews automatically.
@@ -207,7 +207,7 @@ module Pinnacle
207
207
  Pinnacle::Types::DlcCampaignWithExtendedBrandAndStatus.from_json(json_object: response.body)
208
208
  end
209
209
 
210
- # Validate your DLC campaign configuration against carrier requirements and
210
+ # Validate your 10DLC campaign configuration against carrier requirements and
211
211
  # compliance rules.
212
212
  #
213
213
  # @param request [Hash] Request of type Pinnacle::Types::ValidateCampaignParams, as a Hash
@@ -286,9 +286,9 @@ module Pinnacle
286
286
  end
287
287
  end
288
288
 
289
- # Retrieve DLC campaign.
289
+ # Retrieve 10DLC campaign.
290
290
  #
291
- # @param campaign_id [Integer] Unique identifier of the DLC campaign.
291
+ # @param campaign_id [Integer] Unique identifier of the 10DLC campaign.
292
292
  # @param request_options [Pinnacle::RequestOptions]
293
293
  # @return [Pinnacle::Types::DlcCampaignWithExtendedBrandAndStatus]
294
294
  # @example
@@ -320,9 +320,9 @@ module Pinnacle
320
320
  end
321
321
  end
322
322
 
323
- # Submit your DLC campaign for approval and activation with carriers.
323
+ # Submit your 10DLC campaign for approval and activation with carriers.
324
324
  #
325
- # @param campaign_id [Integer] Unique identifier of the DLC campaign to submit.
325
+ # @param campaign_id [Integer] Unique identifier of the 10DLC campaign to submit.
326
326
  # @param request_options [Pinnacle::RequestOptions]
327
327
  # @return [Pinnacle::Types::CampaignSubmissionResult]
328
328
  # @example
@@ -354,7 +354,7 @@ module Pinnacle
354
354
  end
355
355
  end
356
356
 
357
- # Create a new DLC campaign or updates an existing one. <br>
357
+ # Create a new 10DLC campaign or updates an existing one. <br>
358
358
  # Omit campaignId to create a campaign.
359
359
  #
360
360
  # @param auto_renew [Boolean] Whether the campaign renews automatically.
@@ -441,7 +441,7 @@ module Pinnacle
441
441
  end
442
442
  end
443
443
 
444
- # Validate your DLC campaign configuration against carrier requirements and
444
+ # Validate your 10DLC campaign configuration against carrier requirements and
445
445
  # compliance rules.
446
446
  #
447
447
  # @param request [Hash] Request of type Pinnacle::Types::ValidateCampaignParams, as a Hash
@@ -135,6 +135,9 @@ module Pinnacle
135
135
  # * :name (String)
136
136
  # * :phones (Array<Pinnacle::Campaigns::Rcs::Types::RcsAgentPhone>)
137
137
  # * :websites (Array<Pinnacle::Campaigns::Rcs::Types::RcsAgentWebsite>)
138
+ # @param brand_verification_url [String] Link to document verifying the brand's name. This may be the certificate of
139
+ # incorporation, business license, or other relevant document. You can typically
140
+ # find this on the Secretary of State website.
138
141
  # @param brand [Integer] Unique identifier for the brand.
139
142
  # @param campaign_id [Integer] Unique identifier for the campaign.
140
143
  # @param expected_agent_responses [Array<String>] List of what the agent might say to users (1-5 required).
@@ -160,6 +163,7 @@ module Pinnacle
160
163
  # )
161
164
  # api.campaigns.rcs.upsert(
162
165
  # agent: { color: "#000000", description: "Engaging campaigns with RBM – next-gen SMS marketing with rich content and better analytics.", emails: [{ email: "founders@trypinnacle.app", label: "Email Us" }], hero_url: "https://agent-logos.storage.googleapis.com/_/m0bk9mmw7kfynqiKSPfsaoc6", icon_url: "https://agent-logos.storage.googleapis.com/_/m0bk9gvlDunZEw1krfruZmw3", name: "Pinnacle Software Development", phones: [{ label: "Contact us directly", phone: "+14154467821" }], websites: [{ label: "Get started with Pinnacle", url: "https://www.trypinnacle.app/" }] },
166
+ # brand_verification_url: "https://www.pinnacle.sh/articles-of-incorporation.pdf",
163
167
  # brand: 2,
164
168
  # expected_agent_responses: ["Here are the things I can help you with.", "I can assist you with booking an appointment, or you may choose to book manually.", "Here are the available times to connect with a representative tomorrow.", "Your appointment has been scheduled."],
165
169
  # links: { privacy_policy: "https://www.trypinnacle.app/privacy", terms_of_service: "https://www.trypinnacle.app/terms" },
@@ -167,8 +171,8 @@ module Pinnacle
167
171
  # opt_out: { description: "Reply STOP to opt-out anytime.", keywords: ["STOP", "UNSUBSCRIBE", "END"] },
168
172
  # use_case: { behavior: "Acts as a customer service representative.", value: OTHER }
169
173
  # )
170
- def upsert(agent: nil, brand: nil, campaign_id: nil, expected_agent_responses: nil, links: nil, opt_in: nil,
171
- opt_out: nil, use_case: nil, request_options: nil)
174
+ def upsert(agent: nil, brand_verification_url: nil, brand: nil, campaign_id: nil, expected_agent_responses: nil,
175
+ links: nil, opt_in: nil, opt_out: nil, use_case: nil, request_options: nil)
172
176
  response = @request_client.conn.post do |req|
173
177
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
174
178
  req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
@@ -183,6 +187,7 @@ module Pinnacle
183
187
  req.body = {
184
188
  **(request_options&.additional_body_parameters || {}),
185
189
  agent: agent,
190
+ brandVerificationUrl: brand_verification_url,
186
191
  brand: brand,
187
192
  campaignId: campaign_id,
188
193
  expectedAgentResponses: expected_agent_responses,
@@ -355,6 +360,9 @@ module Pinnacle
355
360
  # * :name (String)
356
361
  # * :phones (Array<Pinnacle::Campaigns::Rcs::Types::RcsAgentPhone>)
357
362
  # * :websites (Array<Pinnacle::Campaigns::Rcs::Types::RcsAgentWebsite>)
363
+ # @param brand_verification_url [String] Link to document verifying the brand's name. This may be the certificate of
364
+ # incorporation, business license, or other relevant document. You can typically
365
+ # find this on the Secretary of State website.
358
366
  # @param brand [Integer] Unique identifier for the brand.
359
367
  # @param campaign_id [Integer] Unique identifier for the campaign.
360
368
  # @param expected_agent_responses [Array<String>] List of what the agent might say to users (1-5 required).
@@ -380,6 +388,7 @@ module Pinnacle
380
388
  # )
381
389
  # api.campaigns.rcs.upsert(
382
390
  # agent: { color: "#000000", description: "Engaging campaigns with RBM – next-gen SMS marketing with rich content and better analytics.", emails: [{ email: "founders@trypinnacle.app", label: "Email Us" }], hero_url: "https://agent-logos.storage.googleapis.com/_/m0bk9mmw7kfynqiKSPfsaoc6", icon_url: "https://agent-logos.storage.googleapis.com/_/m0bk9gvlDunZEw1krfruZmw3", name: "Pinnacle Software Development", phones: [{ label: "Contact us directly", phone: "+14154467821" }], websites: [{ label: "Get started with Pinnacle", url: "https://www.trypinnacle.app/" }] },
391
+ # brand_verification_url: "https://www.pinnacle.sh/articles-of-incorporation.pdf",
383
392
  # brand: 2,
384
393
  # expected_agent_responses: ["Here are the things I can help you with.", "I can assist you with booking an appointment, or you may choose to book manually.", "Here are the available times to connect with a representative tomorrow.", "Your appointment has been scheduled."],
385
394
  # links: { privacy_policy: "https://www.trypinnacle.app/privacy", terms_of_service: "https://www.trypinnacle.app/terms" },
@@ -387,8 +396,8 @@ module Pinnacle
387
396
  # opt_out: { description: "Reply STOP to opt-out anytime.", keywords: ["STOP", "UNSUBSCRIBE", "END"] },
388
397
  # use_case: { behavior: "Acts as a customer service representative.", value: OTHER }
389
398
  # )
390
- def upsert(agent: nil, brand: nil, campaign_id: nil, expected_agent_responses: nil, links: nil, opt_in: nil,
391
- opt_out: nil, use_case: nil, request_options: nil)
399
+ def upsert(agent: nil, brand_verification_url: nil, brand: nil, campaign_id: nil, expected_agent_responses: nil,
400
+ links: nil, opt_in: nil, opt_out: nil, use_case: nil, request_options: nil)
392
401
  Async do
393
402
  response = @request_client.conn.post do |req|
394
403
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -404,6 +413,7 @@ module Pinnacle
404
413
  req.body = {
405
414
  **(request_options&.additional_body_parameters || {}),
406
415
  agent: agent,
416
+ brandVerificationUrl: brand_verification_url,
407
417
  brand: brand,
408
418
  campaignId: campaign_id,
409
419
  expectedAgentResponses: expected_agent_responses,
@@ -19,6 +19,10 @@ module Pinnacle
19
19
  attr_reader :agent
20
20
  # @return [Integer] Unique identifier for the campaign.
21
21
  attr_reader :campaign_id
22
+ # @return [String] Link to document verifying the brand's name. This may be the certificate of
23
+ # incorporation, business license, or other relevant document. You can typically
24
+ # find this on the Secretary of State website.
25
+ attr_reader :brand_verification_url
22
26
  # @return [Array<String>] List of what the agent might say to users.
23
27
  attr_reader :expected_agent_responses
24
28
  # @return [Pinnacle::Types::RcsCampaignSchemaLinks] Legal documentation links.
@@ -40,6 +44,9 @@ module Pinnacle
40
44
  # @param brand [Integer]
41
45
  # @param agent [Pinnacle::Types::RcsCampaignSchemaAgent] Agent configured to the campaign.
42
46
  # @param campaign_id [Integer] Unique identifier for the campaign.
47
+ # @param brand_verification_url [String] Link to document verifying the brand's name. This may be the certificate of
48
+ # incorporation, business license, or other relevant document. You can typically
49
+ # find this on the Secretary of State website.
43
50
  # @param expected_agent_responses [Array<String>] List of what the agent might say to users.
44
51
  # @param links [Pinnacle::Types::RcsCampaignSchemaLinks] Legal documentation links.
45
52
  # @param opt_in [Pinnacle::Types::RcsCampaignSchemaOptIn] Opt-in configuration.
@@ -47,11 +54,12 @@ module Pinnacle
47
54
  # @param use_case [Pinnacle::Types::RcsCampaignSchemaUseCase] Use case classification for the campaign.
48
55
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
49
56
  # @return [Pinnacle::Campaigns::Rcs::Types::RcsAutofillResponse]
50
- def initialize(brand: OMIT, agent: OMIT, campaign_id: OMIT, expected_agent_responses: OMIT, links: OMIT,
51
- opt_in: OMIT, opt_out: OMIT, use_case: OMIT, additional_properties: nil)
57
+ def initialize(brand: OMIT, agent: OMIT, campaign_id: OMIT, brand_verification_url: OMIT,
58
+ expected_agent_responses: OMIT, links: OMIT, opt_in: OMIT, opt_out: OMIT, use_case: OMIT, additional_properties: nil)
52
59
  @brand = brand if brand != OMIT
53
60
  @agent = agent if agent != OMIT
54
61
  @campaign_id = campaign_id if campaign_id != OMIT
62
+ @brand_verification_url = brand_verification_url if brand_verification_url != OMIT
55
63
  @expected_agent_responses = expected_agent_responses if expected_agent_responses != OMIT
56
64
  @links = links if links != OMIT
57
65
  @opt_in = opt_in if opt_in != OMIT
@@ -62,6 +70,7 @@ module Pinnacle
62
70
  "brand": brand,
63
71
  "agent": agent,
64
72
  "campaignId": campaign_id,
73
+ "brandVerificationUrl": brand_verification_url,
65
74
  "expectedAgentResponses": expected_agent_responses,
66
75
  "links": links,
67
76
  "optIn": opt_in,
@@ -87,6 +96,7 @@ module Pinnacle
87
96
  agent = Pinnacle::Types::RcsCampaignSchemaAgent.from_json(json_object: agent)
88
97
  end
89
98
  campaign_id = parsed_json["campaignId"]
99
+ brand_verification_url = parsed_json["brandVerificationUrl"]
90
100
  expected_agent_responses = parsed_json["expectedAgentResponses"]
91
101
  if parsed_json["links"].nil?
92
102
  links = nil
@@ -116,6 +126,7 @@ module Pinnacle
116
126
  brand: brand,
117
127
  agent: agent,
118
128
  campaign_id: campaign_id,
129
+ brand_verification_url: brand_verification_url,
119
130
  expected_agent_responses: expected_agent_responses,
120
131
  links: links,
121
132
  opt_in: opt_in,
@@ -142,6 +153,7 @@ module Pinnacle
142
153
  obj.brand&.is_a?(Integer) != false || raise("Passed value for field obj.brand is not the expected type, validation failed.")
143
154
  obj.agent.nil? || Pinnacle::Types::RcsCampaignSchemaAgent.validate_raw(obj: obj.agent)
144
155
  obj.campaign_id&.is_a?(Integer) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
156
+ obj.brand_verification_url&.is_a?(String) != false || raise("Passed value for field obj.brand_verification_url is not the expected type, validation failed.")
145
157
  obj.expected_agent_responses&.is_a?(Array) != false || raise("Passed value for field obj.expected_agent_responses is not the expected type, validation failed.")
146
158
  obj.links.nil? || Pinnacle::Types::RcsCampaignSchemaLinks.validate_raw(obj: obj.links)
147
159
  obj.opt_in.nil? || Pinnacle::Types::RcsCampaignSchemaOptIn.validate_raw(obj: obj.opt_in)
@@ -19,9 +19,9 @@ module Pinnacle
19
19
  attr_reader :description
20
20
  # @return [Array<Pinnacle::Campaigns::Rcs::Types::RcsAgentEmail>] List of emails (1-3 required).
21
21
  attr_reader :emails
22
- # @return [String] Link to the agent's hero.
22
+ # @return [String] Link to the agent's hero. Hero must be an image file with dimensions 1440x448px.
23
23
  attr_reader :hero_url
24
- # @return [String] Link to the agent's icon.
24
+ # @return [String] Link to the agent's icon. Icon must be an image file with dimensions 224x224px.
25
25
  attr_reader :icon_url
26
26
  # @return [String] Name of the agent.
27
27
  attr_reader :name
@@ -41,8 +41,8 @@ module Pinnacle
41
41
  # Must have sufficient contrast with white.
42
42
  # @param description [String] Description of the agent.
43
43
  # @param emails [Array<Pinnacle::Campaigns::Rcs::Types::RcsAgentEmail>] List of emails (1-3 required).
44
- # @param hero_url [String] Link to the agent's hero.
45
- # @param icon_url [String] Link to the agent's icon.
44
+ # @param hero_url [String] Link to the agent's hero. Hero must be an image file with dimensions 1440x448px.
45
+ # @param icon_url [String] Link to the agent's icon. Icon must be an image file with dimensions 224x224px.
46
46
  # @param name [String] Name of the agent.
47
47
  # @param phones [Array<Pinnacle::Campaigns::Rcs::Types::RcsAgentPhone>] List of phone numbers (1-3 required).
48
48
  # @param websites [Array<Pinnacle::Campaigns::Rcs::Types::RcsAgentWebsite>] List of urls (1-3 required).
@@ -61,7 +61,7 @@ module Pinnacle
61
61
  # @param receiver [String] Receiver's phone number in E.164 format.
62
62
  # @param sender [String]
63
63
  # @param request_options [Pinnacle::RequestOptions]
64
- # @return [Pinnacle::Types::ConversationList]
64
+ # @return [Pinnacle::Types::ErrorResponse, Pinnacle::Types::RetrievedConversations]
65
65
  # @example
66
66
  # api = Pinnacle::Client.new(
67
67
  # base_url: "https://api.example.com",
@@ -191,7 +191,7 @@ module Pinnacle
191
191
  # @param receiver [String] Receiver's phone number in E.164 format.
192
192
  # @param sender [String]
193
193
  # @param request_options [Pinnacle::RequestOptions]
194
- # @return [Pinnacle::Types::ConversationList]
194
+ # @return [Pinnacle::Types::ErrorResponse, Pinnacle::Types::RetrievedConversations]
195
195
  # @example
196
196
  # api = Pinnacle::Client.new(
197
197
  # base_url: "https://api.example.com",
@@ -28,7 +28,7 @@ module Pinnacle
28
28
  # @param options [Hash] Control how your MMS is processed and delivered.Request of type Pinnacle::Messages::Mms::Types::SendMmsOptions, as a Hash
29
29
  # * :multiple_messages (Boolean)
30
30
  # * :schedule (Hash)
31
- # * :end_date (DateTime)
31
+ # * :end_date (String)
32
32
  # * :recurrence (String)
33
33
  # * :send_at (String)
34
34
  # * :timezone (String)
@@ -128,7 +128,7 @@ module Pinnacle
128
128
  # @param options [Hash] Control how your MMS is processed and delivered.Request of type Pinnacle::Messages::Mms::Types::SendMmsOptions, as a Hash
129
129
  # * :multiple_messages (Boolean)
130
130
  # * :schedule (Hash)
131
- # * :end_date (DateTime)
131
+ # * :end_date (String)
132
132
  # * :recurrence (String)
133
133
  # * :send_at (String)
134
134
  # * :timezone (String)
@@ -24,7 +24,7 @@ module Pinnacle
24
24
  # @param from [String] Phone number that sends the message in E.164 format.
25
25
  # @param options [Hash] Additional settings to customize SMS delivery.Request of type Pinnacle::Messages::Sms::Types::SendSmsOptions, as a Hash
26
26
  # * :schedule (Hash)
27
- # * :end_date (DateTime)
27
+ # * :end_date (String)
28
28
  # * :recurrence (String)
29
29
  # * :send_at (String)
30
30
  # * :timezone (String)
@@ -115,7 +115,7 @@ module Pinnacle
115
115
  # @param from [String] Phone number that sends the message in E.164 format.
116
116
  # @param options [Hash] Additional settings to customize SMS delivery.Request of type Pinnacle::Messages::Sms::Types::SendSmsOptions, as a Hash
117
117
  # * :schedule (Hash)
118
- # * :end_date (DateTime)
118
+ # * :end_date (String)
119
119
  # * :recurrence (String)
120
120
  # * :send_at (String)
121
121
  # * :timezone (String)
@@ -0,0 +1,316 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../requests"
4
+ require_relative "../types/rcs_capabilities_result"
5
+ require "json"
6
+ require_relative "../types/rcs_whitelist_response"
7
+ require_relative "../types/rcs_link_result"
8
+ require "async"
9
+
10
+ module Pinnacle
11
+ class RcsClient
12
+ # @return [Pinnacle::RequestClient]
13
+ attr_reader :request_client
14
+
15
+ # @param request_client [Pinnacle::RequestClient]
16
+ # @return [Pinnacle::RcsClient]
17
+ def initialize(request_client:)
18
+ @request_client = request_client
19
+ end
20
+
21
+ # Check RCS capabilities for one or more phone numbers.
22
+ # This endpoint allows you to verify which RCS features (cards, buttons, etc.) are
23
+ # supported
24
+ # on specific phone numbers before sending RCS messages to them.
25
+ #
26
+ # @param phone_numbers [Array<String>] List of phone numbers to check RCS capabilities for (E.164 format)
27
+ # @param request_options [Pinnacle::RequestOptions]
28
+ # @return [Pinnacle::Types::RCS_CAPABILITIES_RESULT]
29
+ # @example
30
+ # api = Pinnacle::Client.new(
31
+ # base_url: "https://api.example.com",
32
+ # environment: Pinnacle::Environment::DEFAULT,
33
+ # api_key: "YOUR_API_KEY"
34
+ # )
35
+ # api.rcs.get_capabilities(phone_numbers: ["+12345678901", "+19876543210"])
36
+ def get_capabilities(phone_numbers:, request_options: nil)
37
+ response = @request_client.conn.post do |req|
38
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
39
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
40
+ req.headers = {
41
+ **(req.headers || {}),
42
+ **@request_client.get_headers,
43
+ **(request_options&.additional_headers || {})
44
+ }.compact
45
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
46
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
47
+ end
48
+ req.body = { **(request_options&.additional_body_parameters || {}), phoneNumbers: phone_numbers }.compact
49
+ req.url "#{@request_client.get_url(request_options: request_options)}/rcs/capabilities"
50
+ end
51
+ parsed_json = JSON.parse(response.body)
52
+ parsed_json&.transform_values do |value|
53
+ value = value.to_json
54
+ Pinnacle::Types::RcsCapability.from_json(json_object: value)
55
+ end
56
+ end
57
+
58
+ # Whitelist a phone number for testing with your test RCS agent.
59
+ # ## Overview
60
+ # During development and testing, RCS agents can only send messages to whitelisted
61
+ # phone numbers.
62
+ # Use this endpoint to add test devices to your agent's whitelist before sending
63
+ # test messages.
64
+ # ## Verification Process
65
+ # After whitelisting a number, you'll need to complete verification:
66
+ # 1. Check the test device for an "RBM Tester Management" request
67
+ # 2. Accept the request on the device
68
+ # 3. Enter the 4-digit verification code in the Pinnacle dashboard at:
69
+ # ```
70
+ # .pinnacle.sh/dashboard/brands/{brandId}?campaignId={campaignId}&campaignType=RCS
71
+ # ```
72
+ # > **Important Notes**
73
+ # >
74
+ # > - **Testing only:** This is only required for test agents. Production agents
75
+ # can message any RCS-enabled number
76
+ # > - **AT&T limitation:** Whitelisting may currently fail for AT&T numbers
77
+ # > - **Verification required:** The whitelist request isn't complete until you
78
+ # verify the device.
79
+ #
80
+ # @param agent_id [String] The RCS agent ID (must be prefixed with 'agent_')
81
+ # @param phone_number [String] Phone number to whitelist for testing (E.164 format)
82
+ # @param request_options [Pinnacle::RequestOptions]
83
+ # @return [Pinnacle::Types::RcsWhitelistResponse]
84
+ # @example
85
+ # api = Pinnacle::Client.new(
86
+ # base_url: "https://api.example.com",
87
+ # environment: Pinnacle::Environment::DEFAULT,
88
+ # api_key: "YOUR_API_KEY"
89
+ # )
90
+ # api.rcs.whitelist(agent_id: "agent_XXXXXXXXXXXX", phone_number: "+12345678901")
91
+ def whitelist(agent_id:, phone_number:, request_options: nil)
92
+ response = @request_client.conn.post do |req|
93
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
94
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
95
+ req.headers = {
96
+ **(req.headers || {}),
97
+ **@request_client.get_headers,
98
+ **(request_options&.additional_headers || {})
99
+ }.compact
100
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
101
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
102
+ end
103
+ req.body = {
104
+ **(request_options&.additional_body_parameters || {}),
105
+ agentId: agent_id,
106
+ phoneNumber: phone_number
107
+ }.compact
108
+ req.url "#{@request_client.get_url(request_options: request_options)}/rcs/whitelist"
109
+ end
110
+ Pinnacle::Types::RcsWhitelistResponse.from_json(json_object: response.body)
111
+ end
112
+
113
+ # Generate a link for initiating an RCS conversation with your agent.
114
+ # Users can click these links to start conversations with your RCS agent directly
115
+ # from websites, emails, or other applications.
116
+ #
117
+ # @param agent_id [String] The RCS agent ID (must be prefixed with 'agent_')
118
+ # @param test_mode [Boolean] Link to the test agent or the production agent if false
119
+ # @param phone_number [String] Fallback phone number (E.164 format) to use if the phone number does not support
120
+ # RCS. If not provided, no url will be generated.
121
+ # @param body [String] Optional message body to pre-fill after the user clicks the link
122
+ # @param request_options [Pinnacle::RequestOptions]
123
+ # @return [Pinnacle::Types::RcsLinkResult]
124
+ # @example
125
+ # api = Pinnacle::Client.new(
126
+ # base_url: "https://api.example.com",
127
+ # environment: Pinnacle::Environment::DEFAULT,
128
+ # api_key: "YOUR_API_KEY"
129
+ # )
130
+ # api.rcs.get_link(
131
+ # agent_id: "agent_XXXXXXXXXXXX",
132
+ # test_mode: false,
133
+ # phone_number: "+12345678901",
134
+ # body: "Hello, I need help with my order"
135
+ # )
136
+ def get_link(agent_id:, test_mode: nil, phone_number: nil, body: nil, request_options: nil)
137
+ response = @request_client.conn.post do |req|
138
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
139
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
140
+ req.headers = {
141
+ **(req.headers || {}),
142
+ **@request_client.get_headers,
143
+ **(request_options&.additional_headers || {})
144
+ }.compact
145
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
146
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
147
+ end
148
+ req.body = {
149
+ **(request_options&.additional_body_parameters || {}),
150
+ agentId: agent_id,
151
+ testMode: test_mode,
152
+ phoneNumber: phone_number,
153
+ body: body
154
+ }.compact
155
+ req.url "#{@request_client.get_url(request_options: request_options)}/rcs/link"
156
+ end
157
+ Pinnacle::Types::RcsLinkResult.from_json(json_object: response.body)
158
+ end
159
+ end
160
+
161
+ class AsyncRcsClient
162
+ # @return [Pinnacle::AsyncRequestClient]
163
+ attr_reader :request_client
164
+
165
+ # @param request_client [Pinnacle::AsyncRequestClient]
166
+ # @return [Pinnacle::AsyncRcsClient]
167
+ def initialize(request_client:)
168
+ @request_client = request_client
169
+ end
170
+
171
+ # Check RCS capabilities for one or more phone numbers.
172
+ # This endpoint allows you to verify which RCS features (cards, buttons, etc.) are
173
+ # supported
174
+ # on specific phone numbers before sending RCS messages to them.
175
+ #
176
+ # @param phone_numbers [Array<String>] List of phone numbers to check RCS capabilities for (E.164 format)
177
+ # @param request_options [Pinnacle::RequestOptions]
178
+ # @return [Pinnacle::Types::RCS_CAPABILITIES_RESULT]
179
+ # @example
180
+ # api = Pinnacle::Client.new(
181
+ # base_url: "https://api.example.com",
182
+ # environment: Pinnacle::Environment::DEFAULT,
183
+ # api_key: "YOUR_API_KEY"
184
+ # )
185
+ # api.rcs.get_capabilities(phone_numbers: ["+12345678901", "+19876543210"])
186
+ def get_capabilities(phone_numbers:, request_options: nil)
187
+ Async do
188
+ response = @request_client.conn.post do |req|
189
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
190
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
191
+ req.headers = {
192
+ **(req.headers || {}),
193
+ **@request_client.get_headers,
194
+ **(request_options&.additional_headers || {})
195
+ }.compact
196
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
197
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
198
+ end
199
+ req.body = { **(request_options&.additional_body_parameters || {}), phoneNumbers: phone_numbers }.compact
200
+ req.url "#{@request_client.get_url(request_options: request_options)}/rcs/capabilities"
201
+ end
202
+ parsed_json = JSON.parse(response.body)
203
+ parsed_json&.transform_values do |value|
204
+ value = value.to_json
205
+ Pinnacle::Types::RcsCapability.from_json(json_object: value)
206
+ end
207
+ end
208
+ end
209
+
210
+ # Whitelist a phone number for testing with your test RCS agent.
211
+ # ## Overview
212
+ # During development and testing, RCS agents can only send messages to whitelisted
213
+ # phone numbers.
214
+ # Use this endpoint to add test devices to your agent's whitelist before sending
215
+ # test messages.
216
+ # ## Verification Process
217
+ # After whitelisting a number, you'll need to complete verification:
218
+ # 1. Check the test device for an "RBM Tester Management" request
219
+ # 2. Accept the request on the device
220
+ # 3. Enter the 4-digit verification code in the Pinnacle dashboard at:
221
+ # ```
222
+ # .pinnacle.sh/dashboard/brands/{brandId}?campaignId={campaignId}&campaignType=RCS
223
+ # ```
224
+ # > **Important Notes**
225
+ # >
226
+ # > - **Testing only:** This is only required for test agents. Production agents
227
+ # can message any RCS-enabled number
228
+ # > - **AT&T limitation:** Whitelisting may currently fail for AT&T numbers
229
+ # > - **Verification required:** The whitelist request isn't complete until you
230
+ # verify the device.
231
+ #
232
+ # @param agent_id [String] The RCS agent ID (must be prefixed with 'agent_')
233
+ # @param phone_number [String] Phone number to whitelist for testing (E.164 format)
234
+ # @param request_options [Pinnacle::RequestOptions]
235
+ # @return [Pinnacle::Types::RcsWhitelistResponse]
236
+ # @example
237
+ # api = Pinnacle::Client.new(
238
+ # base_url: "https://api.example.com",
239
+ # environment: Pinnacle::Environment::DEFAULT,
240
+ # api_key: "YOUR_API_KEY"
241
+ # )
242
+ # api.rcs.whitelist(agent_id: "agent_XXXXXXXXXXXX", phone_number: "+12345678901")
243
+ def whitelist(agent_id:, phone_number:, request_options: nil)
244
+ Async do
245
+ response = @request_client.conn.post do |req|
246
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
247
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
248
+ req.headers = {
249
+ **(req.headers || {}),
250
+ **@request_client.get_headers,
251
+ **(request_options&.additional_headers || {})
252
+ }.compact
253
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
254
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
255
+ end
256
+ req.body = {
257
+ **(request_options&.additional_body_parameters || {}),
258
+ agentId: agent_id,
259
+ phoneNumber: phone_number
260
+ }.compact
261
+ req.url "#{@request_client.get_url(request_options: request_options)}/rcs/whitelist"
262
+ end
263
+ Pinnacle::Types::RcsWhitelistResponse.from_json(json_object: response.body)
264
+ end
265
+ end
266
+
267
+ # Generate a link for initiating an RCS conversation with your agent.
268
+ # Users can click these links to start conversations with your RCS agent directly
269
+ # from websites, emails, or other applications.
270
+ #
271
+ # @param agent_id [String] The RCS agent ID (must be prefixed with 'agent_')
272
+ # @param test_mode [Boolean] Link to the test agent or the production agent if false
273
+ # @param phone_number [String] Fallback phone number (E.164 format) to use if the phone number does not support
274
+ # RCS. If not provided, no url will be generated.
275
+ # @param body [String] Optional message body to pre-fill after the user clicks the link
276
+ # @param request_options [Pinnacle::RequestOptions]
277
+ # @return [Pinnacle::Types::RcsLinkResult]
278
+ # @example
279
+ # api = Pinnacle::Client.new(
280
+ # base_url: "https://api.example.com",
281
+ # environment: Pinnacle::Environment::DEFAULT,
282
+ # api_key: "YOUR_API_KEY"
283
+ # )
284
+ # api.rcs.get_link(
285
+ # agent_id: "agent_XXXXXXXXXXXX",
286
+ # test_mode: false,
287
+ # phone_number: "+12345678901",
288
+ # body: "Hello, I need help with my order"
289
+ # )
290
+ def get_link(agent_id:, test_mode: nil, phone_number: nil, body: nil, request_options: nil)
291
+ Async do
292
+ response = @request_client.conn.post do |req|
293
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
294
+ req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
295
+ req.headers = {
296
+ **(req.headers || {}),
297
+ **@request_client.get_headers,
298
+ **(request_options&.additional_headers || {})
299
+ }.compact
300
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
301
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
302
+ end
303
+ req.body = {
304
+ **(request_options&.additional_body_parameters || {}),
305
+ agentId: agent_id,
306
+ testMode: test_mode,
307
+ phoneNumber: phone_number,
308
+ body: body
309
+ }.compact
310
+ req.url "#{@request_client.get_url(request_options: request_options)}/rcs/link"
311
+ end
312
+ Pinnacle::Types::RcsLinkResult.from_json(json_object: response.body)
313
+ end
314
+ end
315
+ end
316
+ end
@@ -84,9 +84,9 @@ module Pinnacle
84
84
  Pinnacle::Types::TollFreeCampaignStatus.from_json(json_object: response.body)
85
85
  end
86
86
 
87
- # Retrieve a DLC campaign's status.
87
+ # Retrieve a 10DLC campaign's status.
88
88
  #
89
- # @param campaign_id [Integer] ID of the DLC campaign.
89
+ # @param campaign_id [Integer] ID of the 10DLC campaign.
90
90
  # @param request_options [Pinnacle::RequestOptions]
91
91
  # @return [Pinnacle::Types::DlcCampaignStatus]
92
92
  # @example
@@ -260,9 +260,9 @@ module Pinnacle
260
260
  end
261
261
  end
262
262
 
263
- # Retrieve a DLC campaign's status.
263
+ # Retrieve a 10DLC campaign's status.
264
264
  #
265
- # @param campaign_id [Integer] ID of the DLC campaign.
265
+ # @param campaign_id [Integer] ID of the 10DLC campaign.
266
266
  # @param request_options [Pinnacle::RequestOptions]
267
267
  # @return [Pinnacle::Types::DlcCampaignStatus]
268
268
  # @example