rcs 1.0.15 → 1.0.17
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/company/client.rb +20 -116
- data/lib/rcs/company/types/company_register_request.rb +56 -0
- data/lib/rcs/company/types/company_register_request_company.rb +128 -0
- data/lib/rcs/company/types/company_register_request_company_id.rb +58 -0
- data/lib/rcs/tools/client.rb +211 -0
- data/lib/rcs/tools/types/tools_shorten_url_response.rb +70 -0
- data/lib/rcs/tools/types/tools_upload_url_response.rb +69 -0
- data/lib/rcs.rb +7 -0
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +5 -0
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f88305d84f5dfa29571c3467c8a95a150d51c629a7e6415a4eeeabcf9540141
|
4
|
+
data.tar.gz: 4b71e04b5d4d3971d3efe9d20d4154034bc7f4ff6d835aa46944198609fd1a77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2d0b8bfb3e1a1dd1a410c3348704fac00487ec00dd08d214ffbda3f2b30bb0b3b7cfa0edc09cd75c9ecaf5503cb4320d037009b4d9825cdd019dcb03b1e1bb4
|
7
|
+
data.tar.gz: d4b30f94e9bdeaa2693ebca2abc8cf599bce2de7400b4c71a4a3a6376f6748192aea5cd080e971ce6982709d82938fc7553c21e29eaf9f128120e7e16eaab721
|
data/lib/rcs/company/client.rb
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
require_relative "../../requests"
|
4
4
|
require_relative "../types/company"
|
5
5
|
require "json"
|
6
|
-
require_relative "
|
6
|
+
require_relative "types/company_register_request"
|
7
|
+
require_relative "types/company_register_response"
|
7
8
|
require_relative "../types/company_contact"
|
8
9
|
require_relative "../types/messaging"
|
9
10
|
require_relative "../types/point_of_contact"
|
10
11
|
require_relative "../types/optionals"
|
11
|
-
require_relative "types/company_register_response"
|
12
12
|
require_relative "types/company_update_response"
|
13
13
|
require "async"
|
14
14
|
|
@@ -65,39 +65,7 @@ module Pinnacle
|
|
65
65
|
|
66
66
|
# Register a company for RCS with the Pinnacle platform
|
67
67
|
#
|
68
|
-
# @param
|
69
|
-
# * :name (String)
|
70
|
-
# * :category (Pinnacle::CompanyCategory)
|
71
|
-
# * :address (String)
|
72
|
-
# * :ein (String)
|
73
|
-
# * :description (String)
|
74
|
-
# * :brand_color (String)
|
75
|
-
# * :logo_url (String)
|
76
|
-
# * :hero_url (String)
|
77
|
-
# @param company_contact [Hash] Request of type Pinnacle::CompanyContact, as a Hash
|
78
|
-
# * :primary_website_url (String)
|
79
|
-
# * :primary_website_label (String)
|
80
|
-
# * :primary_phone (String)
|
81
|
-
# * :primary_phone_label (String)
|
82
|
-
# * :primary_email (String)
|
83
|
-
# * :primary_email_label (String)
|
84
|
-
# * :privacy_policy_url (String)
|
85
|
-
# * :tos_url (String)
|
86
|
-
# @param messaging [Hash] Request of type Pinnacle::Messaging, as a Hash
|
87
|
-
# * :opt_in (String)
|
88
|
-
# * :opt_out (String)
|
89
|
-
# * :opt_out_keywords (Array<String>)
|
90
|
-
# * :agent_use_case (String)
|
91
|
-
# * :expected_agent_responses (String)
|
92
|
-
# @param point_of_contact [Hash] Request of type Pinnacle::PointOfContact, as a Hash
|
93
|
-
# * :poc_name (String)
|
94
|
-
# * :poc_title (String)
|
95
|
-
# * :poc_email (String)
|
96
|
-
# @param optionals [Hash] Request of type Pinnacle::Optionals, as a Hash
|
97
|
-
# * :additional_websites (Array<Pinnacle::AdditionalWebsite>)
|
98
|
-
# * :additional_phone_numbers (Array<Pinnacle::AdditionalPhoneNumber>)
|
99
|
-
# * :additional_emails (Array<Pinnacle::AdditionalEmail>)
|
100
|
-
# * :test_numbers (Array<String>)
|
68
|
+
# @param request [Pinnacle::Company::CompanyRegisterRequestCompanyId, Pinnacle::Company::CompanyRegisterRequestCompany]
|
101
69
|
# @param request_options [Pinnacle::RequestOptions]
|
102
70
|
# @return [Pinnacle::Company::CompanyRegisterResponse]
|
103
71
|
# @example
|
@@ -106,18 +74,8 @@ module Pinnacle
|
|
106
74
|
# environment: Pinnacle::Environment::DEFAULT,
|
107
75
|
# api_key: "YOUR_API_KEY"
|
108
76
|
# )
|
109
|
-
# api.company.register(
|
110
|
-
|
111
|
-
# company_contact: { primary_website_url: "primaryWebsiteUrl", primary_website_label: "primaryWebsiteLabel", primary_phone: "primaryPhone", primary_phone_label: "primaryPhoneLabel", primary_email: "primaryEmail", primary_email_label: "primaryEmailLabel", privacy_policy_url: "privacyPolicyUrl", tos_url: "tosUrl" },
|
112
|
-
# messaging: { opt_in: "By opting in, you agree to receive messages from Pinnacle, including updates and promotions. Reply “STOP” to unsubscribe. Standard message and data rates may apply.", opt_out: "Reply with keywords like STOP or UNSUBSCRIBE to opt-out. A confirmation message will be sent, and no further messages will be received unless you re-subscribe.", opt_out_keywords: ["STOP", "UNSUBSCRIBE"], agent_use_case: "Pinnacle’s agent assists with product updates, promotions, order tracking, and support. It answers FAQs, provides order updates, and helps with opt-in/out processes. Escalates to live support when needed.", expected_agent_responses: "General Inquiry: “How can I assist you today?”
|
113
|
-
# Order Status: “Provide your order number.”
|
114
|
-
# Opt-In: “You’re now subscribed!”
|
115
|
-
# Opt-Out: “You have unsubscribed.”
|
116
|
-
# Escalation: “Connecting to a live agent.”
|
117
|
-
# " },
|
118
|
-
# point_of_contact: { poc_name: "pocName", poc_title: "pocTitle", poc_email: "pocEmail" }
|
119
|
-
# )
|
120
|
-
def register(company:, company_contact:, messaging:, point_of_contact:, optionals: nil, request_options: nil)
|
77
|
+
# api.company.register(request: { company_id: "companyId" })
|
78
|
+
def register(request:, request_options: nil)
|
121
79
|
response = @request_client.conn.post do |req|
|
122
80
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
123
81
|
req.headers["PINNACLE-API-Key"] = request_options.api_key unless request_options&.api_key.nil?
|
@@ -129,14 +87,7 @@ module Pinnacle
|
|
129
87
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
130
88
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
131
89
|
end
|
132
|
-
req.body = {
|
133
|
-
**(request_options&.additional_body_parameters || {}),
|
134
|
-
company: company,
|
135
|
-
companyContact: company_contact,
|
136
|
-
messaging: messaging,
|
137
|
-
pointOfContact: point_of_contact,
|
138
|
-
optionals: optionals
|
139
|
-
}.compact
|
90
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
140
91
|
req.url "#{@request_client.get_url(request_options: request_options)}/company/register"
|
141
92
|
end
|
142
93
|
Pinnacle::Company::CompanyRegisterResponse.from_json(json_object: response.body)
|
@@ -144,7 +95,8 @@ module Pinnacle
|
|
144
95
|
|
145
96
|
# Update a company on the Pinnacle platform
|
146
97
|
#
|
147
|
-
# @param company_id [String]
|
98
|
+
# @param company_id [String] Optional company ID. If provided, updates existing company. If not provided,
|
99
|
+
# creates a new company.
|
148
100
|
# @param company [Hash] Request of type Pinnacle::Company, as a Hash
|
149
101
|
# * :id (Integer)
|
150
102
|
# * :created_at (DateTime)
|
@@ -209,9 +161,9 @@ module Pinnacle
|
|
209
161
|
# environment: Pinnacle::Environment::DEFAULT,
|
210
162
|
# api_key: "YOUR_API_KEY"
|
211
163
|
# )
|
212
|
-
# api.company.update
|
213
|
-
def update(company_id
|
214
|
-
request_options: nil)
|
164
|
+
# api.company.update
|
165
|
+
def update(company_id: nil, company: nil, company_contact: nil, messaging: nil, point_of_contact: nil,
|
166
|
+
optionals: nil, request_options: nil)
|
215
167
|
response = @request_client.conn.post do |req|
|
216
168
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
217
169
|
req.headers["PINNACLE-API-Key"] = request_options.api_key unless request_options&.api_key.nil?
|
@@ -292,39 +244,7 @@ module Pinnacle
|
|
292
244
|
|
293
245
|
# Register a company for RCS with the Pinnacle platform
|
294
246
|
#
|
295
|
-
# @param
|
296
|
-
# * :name (String)
|
297
|
-
# * :category (Pinnacle::CompanyCategory)
|
298
|
-
# * :address (String)
|
299
|
-
# * :ein (String)
|
300
|
-
# * :description (String)
|
301
|
-
# * :brand_color (String)
|
302
|
-
# * :logo_url (String)
|
303
|
-
# * :hero_url (String)
|
304
|
-
# @param company_contact [Hash] Request of type Pinnacle::CompanyContact, as a Hash
|
305
|
-
# * :primary_website_url (String)
|
306
|
-
# * :primary_website_label (String)
|
307
|
-
# * :primary_phone (String)
|
308
|
-
# * :primary_phone_label (String)
|
309
|
-
# * :primary_email (String)
|
310
|
-
# * :primary_email_label (String)
|
311
|
-
# * :privacy_policy_url (String)
|
312
|
-
# * :tos_url (String)
|
313
|
-
# @param messaging [Hash] Request of type Pinnacle::Messaging, as a Hash
|
314
|
-
# * :opt_in (String)
|
315
|
-
# * :opt_out (String)
|
316
|
-
# * :opt_out_keywords (Array<String>)
|
317
|
-
# * :agent_use_case (String)
|
318
|
-
# * :expected_agent_responses (String)
|
319
|
-
# @param point_of_contact [Hash] Request of type Pinnacle::PointOfContact, as a Hash
|
320
|
-
# * :poc_name (String)
|
321
|
-
# * :poc_title (String)
|
322
|
-
# * :poc_email (String)
|
323
|
-
# @param optionals [Hash] Request of type Pinnacle::Optionals, as a Hash
|
324
|
-
# * :additional_websites (Array<Pinnacle::AdditionalWebsite>)
|
325
|
-
# * :additional_phone_numbers (Array<Pinnacle::AdditionalPhoneNumber>)
|
326
|
-
# * :additional_emails (Array<Pinnacle::AdditionalEmail>)
|
327
|
-
# * :test_numbers (Array<String>)
|
247
|
+
# @param request [Pinnacle::Company::CompanyRegisterRequestCompanyId, Pinnacle::Company::CompanyRegisterRequestCompany]
|
328
248
|
# @param request_options [Pinnacle::RequestOptions]
|
329
249
|
# @return [Pinnacle::Company::CompanyRegisterResponse]
|
330
250
|
# @example
|
@@ -333,18 +253,8 @@ module Pinnacle
|
|
333
253
|
# environment: Pinnacle::Environment::DEFAULT,
|
334
254
|
# api_key: "YOUR_API_KEY"
|
335
255
|
# )
|
336
|
-
# api.company.register(
|
337
|
-
|
338
|
-
# company_contact: { primary_website_url: "primaryWebsiteUrl", primary_website_label: "primaryWebsiteLabel", primary_phone: "primaryPhone", primary_phone_label: "primaryPhoneLabel", primary_email: "primaryEmail", primary_email_label: "primaryEmailLabel", privacy_policy_url: "privacyPolicyUrl", tos_url: "tosUrl" },
|
339
|
-
# messaging: { opt_in: "By opting in, you agree to receive messages from Pinnacle, including updates and promotions. Reply “STOP” to unsubscribe. Standard message and data rates may apply.", opt_out: "Reply with keywords like STOP or UNSUBSCRIBE to opt-out. A confirmation message will be sent, and no further messages will be received unless you re-subscribe.", opt_out_keywords: ["STOP", "UNSUBSCRIBE"], agent_use_case: "Pinnacle’s agent assists with product updates, promotions, order tracking, and support. It answers FAQs, provides order updates, and helps with opt-in/out processes. Escalates to live support when needed.", expected_agent_responses: "General Inquiry: “How can I assist you today?”
|
340
|
-
# Order Status: “Provide your order number.”
|
341
|
-
# Opt-In: “You’re now subscribed!”
|
342
|
-
# Opt-Out: “You have unsubscribed.”
|
343
|
-
# Escalation: “Connecting to a live agent.”
|
344
|
-
# " },
|
345
|
-
# point_of_contact: { poc_name: "pocName", poc_title: "pocTitle", poc_email: "pocEmail" }
|
346
|
-
# )
|
347
|
-
def register(company:, company_contact:, messaging:, point_of_contact:, optionals: nil, request_options: nil)
|
256
|
+
# api.company.register(request: { company_id: "companyId" })
|
257
|
+
def register(request:, request_options: nil)
|
348
258
|
Async do
|
349
259
|
response = @request_client.conn.post do |req|
|
350
260
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
@@ -357,14 +267,7 @@ module Pinnacle
|
|
357
267
|
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
358
268
|
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
359
269
|
end
|
360
|
-
req.body = {
|
361
|
-
**(request_options&.additional_body_parameters || {}),
|
362
|
-
company: company,
|
363
|
-
companyContact: company_contact,
|
364
|
-
messaging: messaging,
|
365
|
-
pointOfContact: point_of_contact,
|
366
|
-
optionals: optionals
|
367
|
-
}.compact
|
270
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
368
271
|
req.url "#{@request_client.get_url(request_options: request_options)}/company/register"
|
369
272
|
end
|
370
273
|
Pinnacle::Company::CompanyRegisterResponse.from_json(json_object: response.body)
|
@@ -373,7 +276,8 @@ module Pinnacle
|
|
373
276
|
|
374
277
|
# Update a company on the Pinnacle platform
|
375
278
|
#
|
376
|
-
# @param company_id [String]
|
279
|
+
# @param company_id [String] Optional company ID. If provided, updates existing company. If not provided,
|
280
|
+
# creates a new company.
|
377
281
|
# @param company [Hash] Request of type Pinnacle::Company, as a Hash
|
378
282
|
# * :id (Integer)
|
379
283
|
# * :created_at (DateTime)
|
@@ -438,9 +342,9 @@ module Pinnacle
|
|
438
342
|
# environment: Pinnacle::Environment::DEFAULT,
|
439
343
|
# api_key: "YOUR_API_KEY"
|
440
344
|
# )
|
441
|
-
# api.company.update
|
442
|
-
def update(company_id
|
443
|
-
request_options: nil)
|
345
|
+
# api.company.update
|
346
|
+
def update(company_id: nil, company: nil, company_contact: nil, messaging: nil, point_of_contact: nil,
|
347
|
+
optionals: nil, request_options: nil)
|
444
348
|
Async do
|
445
349
|
response = @request_client.conn.post do |req|
|
446
350
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "company_register_request_company_id"
|
5
|
+
require_relative "company_register_request_company"
|
6
|
+
|
7
|
+
module Pinnacle
|
8
|
+
class Company
|
9
|
+
class CompanyRegisterRequest
|
10
|
+
# Deserialize a JSON object to an instance of CompanyRegisterRequest
|
11
|
+
#
|
12
|
+
# @param json_object [String]
|
13
|
+
# @return [Pinnacle::Company::CompanyRegisterRequest]
|
14
|
+
def self.from_json(json_object:)
|
15
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
16
|
+
begin
|
17
|
+
Pinnacle::Company::CompanyRegisterRequestCompanyId.validate_raw(obj: struct)
|
18
|
+
return Pinnacle::Company::CompanyRegisterRequestCompanyId.from_json(json_object: struct) unless struct.nil?
|
19
|
+
|
20
|
+
return nil
|
21
|
+
rescue StandardError
|
22
|
+
# noop
|
23
|
+
end
|
24
|
+
begin
|
25
|
+
Pinnacle::Company::CompanyRegisterRequestCompany.validate_raw(obj: struct)
|
26
|
+
return Pinnacle::Company::CompanyRegisterRequestCompany.from_json(json_object: struct) unless struct.nil?
|
27
|
+
|
28
|
+
return nil
|
29
|
+
rescue StandardError
|
30
|
+
# noop
|
31
|
+
end
|
32
|
+
struct
|
33
|
+
end
|
34
|
+
|
35
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
36
|
+
# hash and check each fields type against the current object's property
|
37
|
+
# definitions.
|
38
|
+
#
|
39
|
+
# @param obj [Object]
|
40
|
+
# @return [Void]
|
41
|
+
def self.validate_raw(obj:)
|
42
|
+
begin
|
43
|
+
return Pinnacle::Company::CompanyRegisterRequestCompanyId.validate_raw(obj: obj)
|
44
|
+
rescue StandardError
|
45
|
+
# noop
|
46
|
+
end
|
47
|
+
begin
|
48
|
+
return Pinnacle::Company::CompanyRegisterRequestCompany.validate_raw(obj: obj)
|
49
|
+
rescue StandardError
|
50
|
+
# noop
|
51
|
+
end
|
52
|
+
raise("Passed value matched no type within the union, validation failed.")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../types/company_details"
|
4
|
+
require_relative "../../types/company_contact"
|
5
|
+
require_relative "../../types/messaging"
|
6
|
+
require_relative "../../types/point_of_contact"
|
7
|
+
require_relative "../../types/optionals"
|
8
|
+
require "ostruct"
|
9
|
+
require "json"
|
10
|
+
|
11
|
+
module Pinnacle
|
12
|
+
class Company
|
13
|
+
# Register a new company
|
14
|
+
class CompanyRegisterRequestCompany
|
15
|
+
# @return [Pinnacle::CompanyDetails]
|
16
|
+
attr_reader :company
|
17
|
+
# @return [Pinnacle::CompanyContact]
|
18
|
+
attr_reader :company_contact
|
19
|
+
# @return [Pinnacle::Messaging]
|
20
|
+
attr_reader :messaging
|
21
|
+
# @return [Pinnacle::PointOfContact]
|
22
|
+
attr_reader :point_of_contact
|
23
|
+
# @return [Pinnacle::Optionals]
|
24
|
+
attr_reader :optionals
|
25
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
attr_reader :additional_properties
|
27
|
+
# @return [Object]
|
28
|
+
attr_reader :_field_set
|
29
|
+
protected :_field_set
|
30
|
+
|
31
|
+
OMIT = Object.new
|
32
|
+
|
33
|
+
# @param company [Pinnacle::CompanyDetails]
|
34
|
+
# @param company_contact [Pinnacle::CompanyContact]
|
35
|
+
# @param messaging [Pinnacle::Messaging]
|
36
|
+
# @param point_of_contact [Pinnacle::PointOfContact]
|
37
|
+
# @param optionals [Pinnacle::Optionals]
|
38
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
39
|
+
# @return [Pinnacle::Company::CompanyRegisterRequestCompany]
|
40
|
+
def initialize(company:, company_contact:, messaging:, point_of_contact:, optionals: OMIT,
|
41
|
+
additional_properties: nil)
|
42
|
+
@company = company
|
43
|
+
@company_contact = company_contact
|
44
|
+
@messaging = messaging
|
45
|
+
@point_of_contact = point_of_contact
|
46
|
+
@optionals = optionals if optionals != OMIT
|
47
|
+
@additional_properties = additional_properties
|
48
|
+
@_field_set = {
|
49
|
+
"company": company,
|
50
|
+
"companyContact": company_contact,
|
51
|
+
"messaging": messaging,
|
52
|
+
"pointOfContact": point_of_contact,
|
53
|
+
"optionals": optionals
|
54
|
+
}.reject do |_k, v|
|
55
|
+
v == OMIT
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Deserialize a JSON object to an instance of CompanyRegisterRequestCompany
|
60
|
+
#
|
61
|
+
# @param json_object [String]
|
62
|
+
# @return [Pinnacle::Company::CompanyRegisterRequestCompany]
|
63
|
+
def self.from_json(json_object:)
|
64
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
65
|
+
parsed_json = JSON.parse(json_object)
|
66
|
+
if parsed_json["company"].nil?
|
67
|
+
company = nil
|
68
|
+
else
|
69
|
+
company = parsed_json["company"].to_json
|
70
|
+
company = Pinnacle::CompanyDetails.from_json(json_object: company)
|
71
|
+
end
|
72
|
+
if parsed_json["companyContact"].nil?
|
73
|
+
company_contact = nil
|
74
|
+
else
|
75
|
+
company_contact = parsed_json["companyContact"].to_json
|
76
|
+
company_contact = Pinnacle::CompanyContact.from_json(json_object: company_contact)
|
77
|
+
end
|
78
|
+
if parsed_json["messaging"].nil?
|
79
|
+
messaging = nil
|
80
|
+
else
|
81
|
+
messaging = parsed_json["messaging"].to_json
|
82
|
+
messaging = Pinnacle::Messaging.from_json(json_object: messaging)
|
83
|
+
end
|
84
|
+
if parsed_json["pointOfContact"].nil?
|
85
|
+
point_of_contact = nil
|
86
|
+
else
|
87
|
+
point_of_contact = parsed_json["pointOfContact"].to_json
|
88
|
+
point_of_contact = Pinnacle::PointOfContact.from_json(json_object: point_of_contact)
|
89
|
+
end
|
90
|
+
if parsed_json["optionals"].nil?
|
91
|
+
optionals = nil
|
92
|
+
else
|
93
|
+
optionals = parsed_json["optionals"].to_json
|
94
|
+
optionals = Pinnacle::Optionals.from_json(json_object: optionals)
|
95
|
+
end
|
96
|
+
new(
|
97
|
+
company: company,
|
98
|
+
company_contact: company_contact,
|
99
|
+
messaging: messaging,
|
100
|
+
point_of_contact: point_of_contact,
|
101
|
+
optionals: optionals,
|
102
|
+
additional_properties: struct
|
103
|
+
)
|
104
|
+
end
|
105
|
+
|
106
|
+
# Serialize an instance of CompanyRegisterRequestCompany to a JSON object
|
107
|
+
#
|
108
|
+
# @return [String]
|
109
|
+
def to_json(*_args)
|
110
|
+
@_field_set&.to_json
|
111
|
+
end
|
112
|
+
|
113
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
114
|
+
# hash and check each fields type against the current object's property
|
115
|
+
# definitions.
|
116
|
+
#
|
117
|
+
# @param obj [Object]
|
118
|
+
# @return [Void]
|
119
|
+
def self.validate_raw(obj:)
|
120
|
+
Pinnacle::CompanyDetails.validate_raw(obj: obj.company)
|
121
|
+
Pinnacle::CompanyContact.validate_raw(obj: obj.company_contact)
|
122
|
+
Pinnacle::Messaging.validate_raw(obj: obj.messaging)
|
123
|
+
Pinnacle::PointOfContact.validate_raw(obj: obj.point_of_contact)
|
124
|
+
obj.optionals.nil? || Pinnacle::Optionals.validate_raw(obj: obj.optionals)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
class Company
|
8
|
+
# Register an existing company
|
9
|
+
class CompanyRegisterRequestCompanyId
|
10
|
+
# @return [String] ID of an existing company to register
|
11
|
+
attr_reader :company_id
|
12
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
attr_reader :additional_properties
|
14
|
+
# @return [Object]
|
15
|
+
attr_reader :_field_set
|
16
|
+
protected :_field_set
|
17
|
+
|
18
|
+
OMIT = Object.new
|
19
|
+
|
20
|
+
# @param company_id [String] ID of an existing company to register
|
21
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
22
|
+
# @return [Pinnacle::Company::CompanyRegisterRequestCompanyId]
|
23
|
+
def initialize(company_id:, additional_properties: nil)
|
24
|
+
@company_id = company_id
|
25
|
+
@additional_properties = additional_properties
|
26
|
+
@_field_set = { "companyId": company_id }
|
27
|
+
end
|
28
|
+
|
29
|
+
# Deserialize a JSON object to an instance of CompanyRegisterRequestCompanyId
|
30
|
+
#
|
31
|
+
# @param json_object [String]
|
32
|
+
# @return [Pinnacle::Company::CompanyRegisterRequestCompanyId]
|
33
|
+
def self.from_json(json_object:)
|
34
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
35
|
+
parsed_json = JSON.parse(json_object)
|
36
|
+
company_id = parsed_json["companyId"]
|
37
|
+
new(company_id: company_id, additional_properties: struct)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Serialize an instance of CompanyRegisterRequestCompanyId to a JSON object
|
41
|
+
#
|
42
|
+
# @return [String]
|
43
|
+
def to_json(*_args)
|
44
|
+
@_field_set&.to_json
|
45
|
+
end
|
46
|
+
|
47
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
48
|
+
# hash and check each fields type against the current object's property
|
49
|
+
# definitions.
|
50
|
+
#
|
51
|
+
# @param obj [Object]
|
52
|
+
# @return [Void]
|
53
|
+
def self.validate_raw(obj:)
|
54
|
+
obj.company_id.is_a?(String) != false || raise("Passed value for field obj.company_id is not the expected type, validation failed.")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,211 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../requests"
|
4
|
+
require "date"
|
5
|
+
require_relative "types/tools_shorten_url_response"
|
6
|
+
require_relative "types/tools_upload_url_response"
|
7
|
+
require "async"
|
8
|
+
|
9
|
+
module Pinnacle
|
10
|
+
class ToolsClient
|
11
|
+
# @return [Pinnacle::RequestClient]
|
12
|
+
attr_reader :request_client
|
13
|
+
|
14
|
+
# @param request_client [Pinnacle::RequestClient]
|
15
|
+
# @return [Pinnacle::ToolsClient]
|
16
|
+
def initialize(request_client:)
|
17
|
+
@request_client = request_client
|
18
|
+
end
|
19
|
+
|
20
|
+
# Create a shortened URL with an optional expiration date (default and max
|
21
|
+
# expiration is 90 days). The shortened URL will redirect to the original URL and
|
22
|
+
# will have the following format https://urls.p1n.io/ABCD5678.
|
23
|
+
#
|
24
|
+
# @param url [String] The URL to be shortened. Must be a valid URL with either http or https protocol.
|
25
|
+
# @param expires_at [DateTime] Optional expiration date for the shortened URL in ISO 8601 format. Default and
|
26
|
+
# max expiration is 90 days.
|
27
|
+
# @param request_options [Pinnacle::RequestOptions]
|
28
|
+
# @return [Pinnacle::Tools::ToolsShortenUrlResponse]
|
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.tools.shorten_url(url: "https://example.com")
|
36
|
+
def shorten_url(url:, expires_at: nil, 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 || {}), url: url, expiresAt: expires_at }.compact
|
49
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/tools/urls/shorten"
|
50
|
+
end
|
51
|
+
Pinnacle::Tools::ToolsShortenUrlResponse.from_json(json_object: response.body)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Generate signed upload (expires in 2 hours) and download URLs for a file
|
55
|
+
# (expires in 1 hour).
|
56
|
+
# See the [Upload](/api-reference/upload) page for native Python and Typescript
|
57
|
+
# SDKs.
|
58
|
+
#
|
59
|
+
# @param content_type [String] The MIME type of the file.
|
60
|
+
# Supported types are audio/basic, audio/L24, audio/mp4, audio/mpeg, audio/mpg,
|
61
|
+
# audio/mp3, audio/ogg, audio/aac, audio/vndrn-realaudio, audio/vndwave,
|
62
|
+
# audio/3gpp, audio/3gpp2, audio/ac3, audio/webm, audio/amrnb, audio/amr,
|
63
|
+
# video/mpeg, video/mp4, video/quicktime, video/webm, video/3gpp, video/3gpp2,
|
64
|
+
# video/3gpptt, video/H261, video/H263, video/H2631998, video/H2632000,
|
65
|
+
# video/H264, video/m4v, video/mpeg4, video/webm, image/jpeg, image/gif,
|
66
|
+
# image/png, image/gif, image/bmp, image/tiff, image/webp, text/vcard,
|
67
|
+
# text/xvcard, text/csv, text/rtf, text/richtext, text/calendar, text/directory,
|
68
|
+
# application/ogg, application/pdf, application/vcard,
|
69
|
+
# application/vndapple.pkpass.
|
70
|
+
# @param size [Integer] The size of the file in bytes. Should be less than 100 MB.
|
71
|
+
# @param name [String] The name of the file.
|
72
|
+
# @param request_options [Pinnacle::RequestOptions]
|
73
|
+
# @return [Pinnacle::Tools::ToolsUploadUrlResponse]
|
74
|
+
# @example
|
75
|
+
# api = Pinnacle::Client.new(
|
76
|
+
# base_url: "https://api.example.com",
|
77
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
78
|
+
# api_key: "YOUR_API_KEY"
|
79
|
+
# )
|
80
|
+
# api.tools.upload_url(
|
81
|
+
# content_type: "image/png",
|
82
|
+
# size: 1024,
|
83
|
+
# name: "example.png"
|
84
|
+
# )
|
85
|
+
def upload_url(content_type:, size:, name:, request_options: nil)
|
86
|
+
response = @request_client.conn.post do |req|
|
87
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
88
|
+
req.headers["PINNACLE-API-Key"] = request_options.api_key unless request_options&.api_key.nil?
|
89
|
+
req.headers = {
|
90
|
+
**(req.headers || {}),
|
91
|
+
**@request_client.get_headers,
|
92
|
+
**(request_options&.additional_headers || {})
|
93
|
+
}.compact
|
94
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
95
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
96
|
+
end
|
97
|
+
req.body = {
|
98
|
+
**(request_options&.additional_body_parameters || {}),
|
99
|
+
contentType: content_type,
|
100
|
+
size: size,
|
101
|
+
name: name
|
102
|
+
}.compact
|
103
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/tools/uploadUrl"
|
104
|
+
end
|
105
|
+
Pinnacle::Tools::ToolsUploadUrlResponse.from_json(json_object: response.body)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
class AsyncToolsClient
|
110
|
+
# @return [Pinnacle::AsyncRequestClient]
|
111
|
+
attr_reader :request_client
|
112
|
+
|
113
|
+
# @param request_client [Pinnacle::AsyncRequestClient]
|
114
|
+
# @return [Pinnacle::AsyncToolsClient]
|
115
|
+
def initialize(request_client:)
|
116
|
+
@request_client = request_client
|
117
|
+
end
|
118
|
+
|
119
|
+
# Create a shortened URL with an optional expiration date (default and max
|
120
|
+
# expiration is 90 days). The shortened URL will redirect to the original URL and
|
121
|
+
# will have the following format https://urls.p1n.io/ABCD5678.
|
122
|
+
#
|
123
|
+
# @param url [String] The URL to be shortened. Must be a valid URL with either http or https protocol.
|
124
|
+
# @param expires_at [DateTime] Optional expiration date for the shortened URL in ISO 8601 format. Default and
|
125
|
+
# max expiration is 90 days.
|
126
|
+
# @param request_options [Pinnacle::RequestOptions]
|
127
|
+
# @return [Pinnacle::Tools::ToolsShortenUrlResponse]
|
128
|
+
# @example
|
129
|
+
# api = Pinnacle::Client.new(
|
130
|
+
# base_url: "https://api.example.com",
|
131
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
132
|
+
# api_key: "YOUR_API_KEY"
|
133
|
+
# )
|
134
|
+
# api.tools.shorten_url(url: "https://example.com")
|
135
|
+
def shorten_url(url:, expires_at: nil, request_options: nil)
|
136
|
+
Async do
|
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 = { **(request_options&.additional_body_parameters || {}), url: url, expiresAt: expires_at }.compact
|
149
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/tools/urls/shorten"
|
150
|
+
end
|
151
|
+
Pinnacle::Tools::ToolsShortenUrlResponse.from_json(json_object: response.body)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# Generate signed upload (expires in 2 hours) and download URLs for a file
|
156
|
+
# (expires in 1 hour).
|
157
|
+
# See the [Upload](/api-reference/upload) page for native Python and Typescript
|
158
|
+
# SDKs.
|
159
|
+
#
|
160
|
+
# @param content_type [String] The MIME type of the file.
|
161
|
+
# Supported types are audio/basic, audio/L24, audio/mp4, audio/mpeg, audio/mpg,
|
162
|
+
# audio/mp3, audio/ogg, audio/aac, audio/vndrn-realaudio, audio/vndwave,
|
163
|
+
# audio/3gpp, audio/3gpp2, audio/ac3, audio/webm, audio/amrnb, audio/amr,
|
164
|
+
# video/mpeg, video/mp4, video/quicktime, video/webm, video/3gpp, video/3gpp2,
|
165
|
+
# video/3gpptt, video/H261, video/H263, video/H2631998, video/H2632000,
|
166
|
+
# video/H264, video/m4v, video/mpeg4, video/webm, image/jpeg, image/gif,
|
167
|
+
# image/png, image/gif, image/bmp, image/tiff, image/webp, text/vcard,
|
168
|
+
# text/xvcard, text/csv, text/rtf, text/richtext, text/calendar, text/directory,
|
169
|
+
# application/ogg, application/pdf, application/vcard,
|
170
|
+
# application/vndapple.pkpass.
|
171
|
+
# @param size [Integer] The size of the file in bytes. Should be less than 100 MB.
|
172
|
+
# @param name [String] The name of the file.
|
173
|
+
# @param request_options [Pinnacle::RequestOptions]
|
174
|
+
# @return [Pinnacle::Tools::ToolsUploadUrlResponse]
|
175
|
+
# @example
|
176
|
+
# api = Pinnacle::Client.new(
|
177
|
+
# base_url: "https://api.example.com",
|
178
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
179
|
+
# api_key: "YOUR_API_KEY"
|
180
|
+
# )
|
181
|
+
# api.tools.upload_url(
|
182
|
+
# content_type: "image/png",
|
183
|
+
# size: 1024,
|
184
|
+
# name: "example.png"
|
185
|
+
# )
|
186
|
+
def upload_url(content_type:, size:, name:, 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 = {
|
200
|
+
**(request_options&.additional_body_parameters || {}),
|
201
|
+
contentType: content_type,
|
202
|
+
size: size,
|
203
|
+
name: name
|
204
|
+
}.compact
|
205
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/tools/uploadUrl"
|
206
|
+
end
|
207
|
+
Pinnacle::Tools::ToolsUploadUrlResponse.from_json(json_object: response.body)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module Pinnacle
|
8
|
+
class Tools
|
9
|
+
class ToolsShortenUrlResponse
|
10
|
+
# @return [String] The shortened URL.
|
11
|
+
attr_reader :shortened_url
|
12
|
+
# @return [DateTime] The expiration date of the shortened URL, if provided.
|
13
|
+
attr_reader :expires_at
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param shortened_url [String] The shortened URL.
|
23
|
+
# @param expires_at [DateTime] The expiration date of the shortened URL, if provided.
|
24
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
+
# @return [Pinnacle::Tools::ToolsShortenUrlResponse]
|
26
|
+
def initialize(shortened_url: OMIT, expires_at: OMIT, additional_properties: nil)
|
27
|
+
@shortened_url = shortened_url if shortened_url != OMIT
|
28
|
+
@expires_at = expires_at if expires_at != OMIT
|
29
|
+
@additional_properties = additional_properties
|
30
|
+
@_field_set = { "shortenedUrl": shortened_url, "expiresAt": expires_at }.reject do |_k, v|
|
31
|
+
v == OMIT
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Deserialize a JSON object to an instance of ToolsShortenUrlResponse
|
36
|
+
#
|
37
|
+
# @param json_object [String]
|
38
|
+
# @return [Pinnacle::Tools::ToolsShortenUrlResponse]
|
39
|
+
def self.from_json(json_object:)
|
40
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
41
|
+
parsed_json = JSON.parse(json_object)
|
42
|
+
shortened_url = parsed_json["shortenedUrl"]
|
43
|
+
expires_at = (DateTime.parse(parsed_json["expiresAt"]) unless parsed_json["expiresAt"].nil?)
|
44
|
+
new(
|
45
|
+
shortened_url: shortened_url,
|
46
|
+
expires_at: expires_at,
|
47
|
+
additional_properties: struct
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Serialize an instance of ToolsShortenUrlResponse to a JSON object
|
52
|
+
#
|
53
|
+
# @return [String]
|
54
|
+
def to_json(*_args)
|
55
|
+
@_field_set&.to_json
|
56
|
+
end
|
57
|
+
|
58
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
59
|
+
# hash and check each fields type against the current object's property
|
60
|
+
# definitions.
|
61
|
+
#
|
62
|
+
# @param obj [Object]
|
63
|
+
# @return [Void]
|
64
|
+
def self.validate_raw(obj:)
|
65
|
+
obj.shortened_url&.is_a?(String) != false || raise("Passed value for field obj.shortened_url is not the expected type, validation failed.")
|
66
|
+
obj.expires_at&.is_a?(DateTime) != false || raise("Passed value for field obj.expires_at is not the expected type, validation failed.")
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
class Tools
|
8
|
+
class ToolsUploadUrlResponse
|
9
|
+
# @return [String] The URL to upload the file.
|
10
|
+
attr_reader :upload
|
11
|
+
# @return [String] The URL to download the file.
|
12
|
+
attr_reader :download
|
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 upload [String] The URL to upload the file.
|
22
|
+
# @param download [String] The URL to download the file.
|
23
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
24
|
+
# @return [Pinnacle::Tools::ToolsUploadUrlResponse]
|
25
|
+
def initialize(upload: OMIT, download: OMIT, additional_properties: nil)
|
26
|
+
@upload = upload if upload != OMIT
|
27
|
+
@download = download if download != OMIT
|
28
|
+
@additional_properties = additional_properties
|
29
|
+
@_field_set = { "upload": upload, "download": download }.reject do |_k, v|
|
30
|
+
v == OMIT
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# Deserialize a JSON object to an instance of ToolsUploadUrlResponse
|
35
|
+
#
|
36
|
+
# @param json_object [String]
|
37
|
+
# @return [Pinnacle::Tools::ToolsUploadUrlResponse]
|
38
|
+
def self.from_json(json_object:)
|
39
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
40
|
+
parsed_json = JSON.parse(json_object)
|
41
|
+
upload = parsed_json["upload"]
|
42
|
+
download = parsed_json["download"]
|
43
|
+
new(
|
44
|
+
upload: upload,
|
45
|
+
download: download,
|
46
|
+
additional_properties: struct
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Serialize an instance of ToolsUploadUrlResponse to a JSON object
|
51
|
+
#
|
52
|
+
# @return [String]
|
53
|
+
def to_json(*_args)
|
54
|
+
@_field_set&.to_json
|
55
|
+
end
|
56
|
+
|
57
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
58
|
+
# hash and check each fields type against the current object's property
|
59
|
+
# definitions.
|
60
|
+
#
|
61
|
+
# @param obj [Object]
|
62
|
+
# @return [Void]
|
63
|
+
def self.validate_raw(obj:)
|
64
|
+
obj.upload&.is_a?(String) != false || raise("Passed value for field obj.upload is not the expected type, validation failed.")
|
65
|
+
obj.download&.is_a?(String) != false || raise("Passed value for field obj.download is not the expected type, validation failed.")
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
data/lib/rcs.rb
CHANGED
@@ -5,6 +5,7 @@ require_relative "types_export"
|
|
5
5
|
require_relative "requests"
|
6
6
|
require_relative "rcs/company/client"
|
7
7
|
require_relative "rcs/send/client"
|
8
|
+
require_relative "rcs/tools/client"
|
8
9
|
require_relative "rcs/types/rcs_functionalities"
|
9
10
|
|
10
11
|
module Pinnacle
|
@@ -13,6 +14,8 @@ module Pinnacle
|
|
13
14
|
attr_reader :company
|
14
15
|
# @return [Pinnacle::SendClient]
|
15
16
|
attr_reader :send
|
17
|
+
# @return [Pinnacle::ToolsClient]
|
18
|
+
attr_reader :tools
|
16
19
|
|
17
20
|
# @param base_url [String]
|
18
21
|
# @param environment [Pinnacle::Environment]
|
@@ -31,6 +34,7 @@ module Pinnacle
|
|
31
34
|
)
|
32
35
|
@company = Pinnacle::CompanyClient.new(request_client: @request_client)
|
33
36
|
@send = Pinnacle::SendClient.new(request_client: @request_client)
|
37
|
+
@tools = Pinnacle::ToolsClient.new(request_client: @request_client)
|
34
38
|
end
|
35
39
|
|
36
40
|
# Retrieve the RCS functionality of a phone number. For example checks if a phone
|
@@ -71,6 +75,8 @@ module Pinnacle
|
|
71
75
|
attr_reader :company
|
72
76
|
# @return [Pinnacle::AsyncSendClient]
|
73
77
|
attr_reader :send
|
78
|
+
# @return [Pinnacle::AsyncToolsClient]
|
79
|
+
attr_reader :tools
|
74
80
|
|
75
81
|
# @param base_url [String]
|
76
82
|
# @param environment [Pinnacle::Environment]
|
@@ -89,6 +95,7 @@ module Pinnacle
|
|
89
95
|
)
|
90
96
|
@company = Pinnacle::AsyncCompanyClient.new(request_client: @async_request_client)
|
91
97
|
@send = Pinnacle::AsyncSendClient.new(request_client: @async_request_client)
|
98
|
+
@tools = Pinnacle::AsyncToolsClient.new(request_client: @async_request_client)
|
92
99
|
end
|
93
100
|
|
94
101
|
# Retrieve the RCS functionality of a phone number. For example checks if a phone
|
data/lib/requests.rb
CHANGED
@@ -43,7 +43,7 @@ module Pinnacle
|
|
43
43
|
|
44
44
|
# @return [Hash{String => String}]
|
45
45
|
def get_headers
|
46
|
-
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "rcs", "X-Fern-SDK-Version": "1.0.
|
46
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "rcs", "X-Fern-SDK-Version": "1.0.17" }
|
47
47
|
headers["PINNACLE-API-Key"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
|
48
48
|
headers
|
49
49
|
end
|
@@ -87,7 +87,7 @@ module Pinnacle
|
|
87
87
|
|
88
88
|
# @return [Hash{String => String}]
|
89
89
|
def get_headers
|
90
|
-
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "rcs", "X-Fern-SDK-Version": "1.0.
|
90
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "rcs", "X-Fern-SDK-Version": "1.0.17" }
|
91
91
|
headers["PINNACLE-API-Key"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
|
92
92
|
headers
|
93
93
|
end
|
data/lib/types_export.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "rcs/company/types/company_register_request_company_id"
|
4
|
+
require_relative "rcs/company/types/company_register_request_company"
|
5
|
+
require_relative "rcs/company/types/company_register_request"
|
3
6
|
require_relative "rcs/company/types/company_register_response_brand"
|
4
7
|
require_relative "rcs/company/types/company_register_response"
|
5
8
|
require_relative "rcs/company/types/company_update_response_brand"
|
@@ -8,6 +11,8 @@ require_relative "rcs/send/types/rcs_fallback"
|
|
8
11
|
require_relative "rcs/send/types/send_rcs_response"
|
9
12
|
require_relative "rcs/send/types/send_sms_response"
|
10
13
|
require_relative "rcs/send/types/send_mms_response"
|
14
|
+
require_relative "rcs/tools/types/tools_shorten_url_response"
|
15
|
+
require_relative "rcs/tools/types/tools_upload_url_response"
|
11
16
|
require_relative "rcs/types/bad_request_error_body"
|
12
17
|
require_relative "rcs/types/unauthorized_error_body"
|
13
18
|
require_relative "rcs/types/internal_server_error_body"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http-faraday
|
@@ -100,6 +100,9 @@ files:
|
|
100
100
|
- lib/gemconfig.rb
|
101
101
|
- lib/rcs.rb
|
102
102
|
- lib/rcs/company/client.rb
|
103
|
+
- lib/rcs/company/types/company_register_request.rb
|
104
|
+
- lib/rcs/company/types/company_register_request_company.rb
|
105
|
+
- lib/rcs/company/types/company_register_request_company_id.rb
|
103
106
|
- lib/rcs/company/types/company_register_response.rb
|
104
107
|
- lib/rcs/company/types/company_register_response_brand.rb
|
105
108
|
- lib/rcs/company/types/company_update_response.rb
|
@@ -109,6 +112,9 @@ files:
|
|
109
112
|
- lib/rcs/send/types/send_mms_response.rb
|
110
113
|
- lib/rcs/send/types/send_rcs_response.rb
|
111
114
|
- lib/rcs/send/types/send_sms_response.rb
|
115
|
+
- lib/rcs/tools/client.rb
|
116
|
+
- lib/rcs/tools/types/tools_shorten_url_response.rb
|
117
|
+
- lib/rcs/tools/types/tools_upload_url_response.rb
|
112
118
|
- lib/rcs/types/action.rb
|
113
119
|
- lib/rcs/types/action_lat_long.rb
|
114
120
|
- lib/rcs/types/action_type.rb
|
@@ -151,7 +157,7 @@ metadata:
|
|
151
157
|
homepage_uri: https://github.com/pinnacle-dev/rcs-ruby
|
152
158
|
source_code_uri: https://github.com/pinnacle-dev/rcs-ruby
|
153
159
|
changelog_uri: https://github.com/pinnacle-dev/rcs-ruby/blob/master/CHANGELOG.md
|
154
|
-
post_install_message:
|
160
|
+
post_install_message:
|
155
161
|
rdoc_options: []
|
156
162
|
require_paths:
|
157
163
|
- lib
|
@@ -167,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
173
|
version: '0'
|
168
174
|
requirements: []
|
169
175
|
rubygems_version: 3.1.6
|
170
|
-
signing_key:
|
176
|
+
signing_key:
|
171
177
|
specification_version: 4
|
172
178
|
summary: ''
|
173
179
|
test_files: []
|