rcs 1.0.14 → 1.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rcs/company/client.rb +61 -6
- data/lib/rcs/types/company.rb +53 -2
- data/lib/rcs/types/company_category.rb +20 -0
- data/lib/rcs/types/company_details.rb +11 -1
- data/lib/rcs/types/inbound_action_message.rb +117 -0
- data/lib/rcs/types/inbound_location_message.rb +106 -0
- data/lib/rcs/types/inbound_location_message_coordinates.rb +65 -0
- data/lib/rcs/types/inbound_media_message.rb +112 -0
- data/lib/rcs/types/inbound_message.rb +88 -0
- data/lib/rcs/types/inbound_message_message_type.rb +10 -0
- data/lib/rcs/types/inbound_message_metadata.rb +79 -0
- data/lib/rcs/types/inbound_text_message.rb +100 -0
- data/lib/rcs/types/media_payload.rb +65 -0
- data/lib/rcs/types/message_metadata.rb +56 -0
- data/lib/rcs/types/messaging.rb +95 -0
- data/lib/rcs/types/sender_metadata.rb +74 -0
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +13 -0
- metadata +15 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd6b24540486cc673f369e84cd9c3a56d58837b4143a11f79b0b8ad8d7056ee4
|
4
|
+
data.tar.gz: 708a541bf38d32fde5b6ef6d6338d9e3494f681f60d5811dbbc384e0bb58cf02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4fc78e103e1274d2ceac57826ce3bd7772901e5222fe486d2e133e3b2bd3570e26506db5438e699986b0a1bbdd9c0ae843e1e5fb8eef5f997e8df22886a2b8f
|
7
|
+
data.tar.gz: cf3dfa9bc7e5ad188baefef9983d6f1ac5230eafa3d08c9a9006581feb5f774bfd6213acdf0191f80f7985385fab06e2dccd6f8b00c684f637079052d2bd57c1
|
data/lib/rcs/company/client.rb
CHANGED
@@ -5,6 +5,7 @@ require_relative "../types/company"
|
|
5
5
|
require "json"
|
6
6
|
require_relative "../types/company_details"
|
7
7
|
require_relative "../types/company_contact"
|
8
|
+
require_relative "../types/messaging"
|
8
9
|
require_relative "../types/point_of_contact"
|
9
10
|
require_relative "../types/optionals"
|
10
11
|
require_relative "types/company_register_response"
|
@@ -66,6 +67,7 @@ module Pinnacle
|
|
66
67
|
#
|
67
68
|
# @param company [Hash] Request of type Pinnacle::CompanyDetails, as a Hash
|
68
69
|
# * :name (String)
|
70
|
+
# * :category (Pinnacle::CompanyCategory)
|
69
71
|
# * :address (String)
|
70
72
|
# * :ein (String)
|
71
73
|
# * :description (String)
|
@@ -81,6 +83,12 @@ module Pinnacle
|
|
81
83
|
# * :primary_email_label (String)
|
82
84
|
# * :privacy_policy_url (String)
|
83
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)
|
84
92
|
# @param point_of_contact [Hash] Request of type Pinnacle::PointOfContact, as a Hash
|
85
93
|
# * :poc_name (String)
|
86
94
|
# * :poc_title (String)
|
@@ -99,11 +107,17 @@ module Pinnacle
|
|
99
107
|
# api_key: "YOUR_API_KEY"
|
100
108
|
# )
|
101
109
|
# api.company.register(
|
102
|
-
# company: { name: "name", address: "address", ein: "ein", description: "description", brand_color: "brandColor", logo_url: "logoUrl", hero_url: "heroUrl" },
|
110
|
+
# company: { name: "name", category: ENTERTAINMENT, address: "address", ein: "ein", description: "description", brand_color: "brandColor", logo_url: "logoUrl", hero_url: "heroUrl" },
|
103
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
|
+
# " },
|
104
118
|
# point_of_contact: { poc_name: "pocName", poc_title: "pocTitle", poc_email: "pocEmail" }
|
105
119
|
# )
|
106
|
-
def register(company:, company_contact:, point_of_contact:, optionals: nil, request_options: nil)
|
120
|
+
def register(company:, company_contact:, messaging:, point_of_contact:, optionals: nil, request_options: nil)
|
107
121
|
response = @request_client.conn.post do |req|
|
108
122
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
109
123
|
req.headers["PINNACLE-API-Key"] = request_options.api_key unless request_options&.api_key.nil?
|
@@ -119,6 +133,7 @@ module Pinnacle
|
|
119
133
|
**(request_options&.additional_body_parameters || {}),
|
120
134
|
company: company,
|
121
135
|
companyContact: company_contact,
|
136
|
+
messaging: messaging,
|
122
137
|
pointOfContact: point_of_contact,
|
123
138
|
optionals: optionals
|
124
139
|
}.compact
|
@@ -134,6 +149,7 @@ module Pinnacle
|
|
134
149
|
# * :id (Integer)
|
135
150
|
# * :created_at (DateTime)
|
136
151
|
# * :name (String)
|
152
|
+
# * :category (Pinnacle::CompanyCategory)
|
137
153
|
# * :address (String)
|
138
154
|
# * :ein (String)
|
139
155
|
# * :description (String)
|
@@ -151,6 +167,11 @@ module Pinnacle
|
|
151
167
|
# * :poc_name (String)
|
152
168
|
# * :poc_title (String)
|
153
169
|
# * :poc_email (String)
|
170
|
+
# * :opt_in (String)
|
171
|
+
# * :opt_out (String)
|
172
|
+
# * :opt_out_keywords (Array<String>)
|
173
|
+
# * :agent_use_case (String)
|
174
|
+
# * :expected_agent_responses (String)
|
154
175
|
# * :test_numbers (Array<String>)
|
155
176
|
# * :status (String)
|
156
177
|
# * :additional_websites (Array<Pinnacle::CompanyAdditionalWebsitesItem>)
|
@@ -165,6 +186,12 @@ module Pinnacle
|
|
165
186
|
# * :primary_email_label (String)
|
166
187
|
# * :privacy_policy_url (String)
|
167
188
|
# * :tos_url (String)
|
189
|
+
# @param messaging [Hash] Request of type Pinnacle::Messaging, as a Hash
|
190
|
+
# * :opt_in (String)
|
191
|
+
# * :opt_out (String)
|
192
|
+
# * :opt_out_keywords (Array<String>)
|
193
|
+
# * :agent_use_case (String)
|
194
|
+
# * :expected_agent_responses (String)
|
168
195
|
# @param point_of_contact [Hash] Request of type Pinnacle::PointOfContact, as a Hash
|
169
196
|
# * :poc_name (String)
|
170
197
|
# * :poc_title (String)
|
@@ -183,7 +210,7 @@ module Pinnacle
|
|
183
210
|
# api_key: "YOUR_API_KEY"
|
184
211
|
# )
|
185
212
|
# api.company.update(company_id: "companyId")
|
186
|
-
def update(company_id:, company: nil, company_contact: nil, point_of_contact: nil, optionals: nil,
|
213
|
+
def update(company_id:, company: nil, company_contact: nil, messaging: nil, point_of_contact: nil, optionals: nil,
|
187
214
|
request_options: nil)
|
188
215
|
response = @request_client.conn.post do |req|
|
189
216
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
@@ -201,6 +228,7 @@ module Pinnacle
|
|
201
228
|
companyId: company_id,
|
202
229
|
company: company,
|
203
230
|
companyContact: company_contact,
|
231
|
+
messaging: messaging,
|
204
232
|
pointOfContact: point_of_contact,
|
205
233
|
optionals: optionals
|
206
234
|
}.compact
|
@@ -266,6 +294,7 @@ module Pinnacle
|
|
266
294
|
#
|
267
295
|
# @param company [Hash] Request of type Pinnacle::CompanyDetails, as a Hash
|
268
296
|
# * :name (String)
|
297
|
+
# * :category (Pinnacle::CompanyCategory)
|
269
298
|
# * :address (String)
|
270
299
|
# * :ein (String)
|
271
300
|
# * :description (String)
|
@@ -281,6 +310,12 @@ module Pinnacle
|
|
281
310
|
# * :primary_email_label (String)
|
282
311
|
# * :privacy_policy_url (String)
|
283
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)
|
284
319
|
# @param point_of_contact [Hash] Request of type Pinnacle::PointOfContact, as a Hash
|
285
320
|
# * :poc_name (String)
|
286
321
|
# * :poc_title (String)
|
@@ -299,11 +334,17 @@ module Pinnacle
|
|
299
334
|
# api_key: "YOUR_API_KEY"
|
300
335
|
# )
|
301
336
|
# api.company.register(
|
302
|
-
# company: { name: "name", address: "address", ein: "ein", description: "description", brand_color: "brandColor", logo_url: "logoUrl", hero_url: "heroUrl" },
|
337
|
+
# company: { name: "name", category: ENTERTAINMENT, address: "address", ein: "ein", description: "description", brand_color: "brandColor", logo_url: "logoUrl", hero_url: "heroUrl" },
|
303
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
|
+
# " },
|
304
345
|
# point_of_contact: { poc_name: "pocName", poc_title: "pocTitle", poc_email: "pocEmail" }
|
305
346
|
# )
|
306
|
-
def register(company:, company_contact:, point_of_contact:, optionals: nil, request_options: nil)
|
347
|
+
def register(company:, company_contact:, messaging:, point_of_contact:, optionals: nil, request_options: nil)
|
307
348
|
Async do
|
308
349
|
response = @request_client.conn.post do |req|
|
309
350
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
@@ -320,6 +361,7 @@ module Pinnacle
|
|
320
361
|
**(request_options&.additional_body_parameters || {}),
|
321
362
|
company: company,
|
322
363
|
companyContact: company_contact,
|
364
|
+
messaging: messaging,
|
323
365
|
pointOfContact: point_of_contact,
|
324
366
|
optionals: optionals
|
325
367
|
}.compact
|
@@ -336,6 +378,7 @@ module Pinnacle
|
|
336
378
|
# * :id (Integer)
|
337
379
|
# * :created_at (DateTime)
|
338
380
|
# * :name (String)
|
381
|
+
# * :category (Pinnacle::CompanyCategory)
|
339
382
|
# * :address (String)
|
340
383
|
# * :ein (String)
|
341
384
|
# * :description (String)
|
@@ -353,6 +396,11 @@ module Pinnacle
|
|
353
396
|
# * :poc_name (String)
|
354
397
|
# * :poc_title (String)
|
355
398
|
# * :poc_email (String)
|
399
|
+
# * :opt_in (String)
|
400
|
+
# * :opt_out (String)
|
401
|
+
# * :opt_out_keywords (Array<String>)
|
402
|
+
# * :agent_use_case (String)
|
403
|
+
# * :expected_agent_responses (String)
|
356
404
|
# * :test_numbers (Array<String>)
|
357
405
|
# * :status (String)
|
358
406
|
# * :additional_websites (Array<Pinnacle::CompanyAdditionalWebsitesItem>)
|
@@ -367,6 +415,12 @@ module Pinnacle
|
|
367
415
|
# * :primary_email_label (String)
|
368
416
|
# * :privacy_policy_url (String)
|
369
417
|
# * :tos_url (String)
|
418
|
+
# @param messaging [Hash] Request of type Pinnacle::Messaging, as a Hash
|
419
|
+
# * :opt_in (String)
|
420
|
+
# * :opt_out (String)
|
421
|
+
# * :opt_out_keywords (Array<String>)
|
422
|
+
# * :agent_use_case (String)
|
423
|
+
# * :expected_agent_responses (String)
|
370
424
|
# @param point_of_contact [Hash] Request of type Pinnacle::PointOfContact, as a Hash
|
371
425
|
# * :poc_name (String)
|
372
426
|
# * :poc_title (String)
|
@@ -385,7 +439,7 @@ module Pinnacle
|
|
385
439
|
# api_key: "YOUR_API_KEY"
|
386
440
|
# )
|
387
441
|
# api.company.update(company_id: "companyId")
|
388
|
-
def update(company_id:, company: nil, company_contact: nil, point_of_contact: nil, optionals: nil,
|
442
|
+
def update(company_id:, company: nil, company_contact: nil, messaging: nil, point_of_contact: nil, optionals: nil,
|
389
443
|
request_options: nil)
|
390
444
|
Async do
|
391
445
|
response = @request_client.conn.post do |req|
|
@@ -404,6 +458,7 @@ module Pinnacle
|
|
404
458
|
companyId: company_id,
|
405
459
|
company: company,
|
406
460
|
companyContact: company_contact,
|
461
|
+
messaging: messaging,
|
407
462
|
pointOfContact: point_of_contact,
|
408
463
|
optionals: optionals
|
409
464
|
}.compact
|
data/lib/rcs/types/company.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "date"
|
4
|
+
require_relative "company_category"
|
4
5
|
require_relative "company_additional_websites_item"
|
5
6
|
require_relative "company_additional_emails_item"
|
6
7
|
require_relative "company_additional_phone_numbers_item"
|
@@ -15,6 +16,8 @@ module Pinnacle
|
|
15
16
|
attr_reader :created_at
|
16
17
|
# @return [String] The name of the company
|
17
18
|
attr_reader :name
|
19
|
+
# @return [Pinnacle::CompanyCategory] The category of the company
|
20
|
+
attr_reader :category
|
18
21
|
# @return [String] The address of the company
|
19
22
|
attr_reader :address
|
20
23
|
# @return [String] The Employer Identification Number (EIN) of the company
|
@@ -49,6 +52,17 @@ module Pinnacle
|
|
49
52
|
attr_reader :poc_title
|
50
53
|
# @return [String] The email address of the point of contact
|
51
54
|
attr_reader :poc_email
|
55
|
+
# @return [String] Explain how users will opt in to receive messages.
|
56
|
+
attr_reader :opt_in
|
57
|
+
# @return [String] Explain how users will opt out of receiving messages.
|
58
|
+
attr_reader :opt_out
|
59
|
+
# @return [Array<String>] Please provide the unique keywords to opt out. Each keyword should not contain
|
60
|
+
# spaces.
|
61
|
+
attr_reader :opt_out_keywords
|
62
|
+
# @return [String] Please define what your agent will do.
|
63
|
+
attr_reader :agent_use_case
|
64
|
+
# @return [String] Please provide some example messages that your agent will send.
|
65
|
+
attr_reader :expected_agent_responses
|
52
66
|
# @return [Array<String>] A list of test phone numbers
|
53
67
|
attr_reader :test_numbers
|
54
68
|
# @return [String] The approval status of the company
|
@@ -70,6 +84,7 @@ module Pinnacle
|
|
70
84
|
# @param id [Integer] The unique identifier for the company
|
71
85
|
# @param created_at [DateTime] The date and time when the company was created
|
72
86
|
# @param name [String] The name of the company
|
87
|
+
# @param category [Pinnacle::CompanyCategory] The category of the company
|
73
88
|
# @param address [String] The address of the company
|
74
89
|
# @param ein [String] The Employer Identification Number (EIN) of the company
|
75
90
|
# @param description [String] A description of the company
|
@@ -87,6 +102,12 @@ module Pinnacle
|
|
87
102
|
# @param poc_name [String] The name of the point of contact
|
88
103
|
# @param poc_title [String] The title of the point of contact
|
89
104
|
# @param poc_email [String] The email address of the point of contact
|
105
|
+
# @param opt_in [String] Explain how users will opt in to receive messages.
|
106
|
+
# @param opt_out [String] Explain how users will opt out of receiving messages.
|
107
|
+
# @param opt_out_keywords [Array<String>] Please provide the unique keywords to opt out. Each keyword should not contain
|
108
|
+
# spaces.
|
109
|
+
# @param agent_use_case [String] Please define what your agent will do.
|
110
|
+
# @param expected_agent_responses [String] Please provide some example messages that your agent will send.
|
90
111
|
# @param test_numbers [Array<String>] A list of test phone numbers
|
91
112
|
# @param status [String] The approval status of the company
|
92
113
|
# @param additional_websites [Array<Pinnacle::CompanyAdditionalWebsitesItem>] A list of additional websites
|
@@ -94,11 +115,12 @@ module Pinnacle
|
|
94
115
|
# @param additional_phone_numbers [Array<Pinnacle::CompanyAdditionalPhoneNumbersItem>] A list of additional phone numbers
|
95
116
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
96
117
|
# @return [Pinnacle::Company]
|
97
|
-
def initialize(id: OMIT, created_at: OMIT, name: OMIT, address: OMIT, ein: OMIT, description: OMIT,
|
98
|
-
brand_color: OMIT, logo_url: OMIT, hero_url: OMIT, primary_website_url: OMIT, primary_website_label: OMIT, primary_phone: OMIT, primary_phone_label: OMIT, primary_email: OMIT, primary_email_label: OMIT, privacy_policy_url: OMIT, tos_url: OMIT, poc_name: OMIT, poc_title: OMIT, poc_email: OMIT, test_numbers: OMIT, status: OMIT, additional_websites: OMIT, additional_emails: OMIT, additional_phone_numbers: OMIT, additional_properties: nil)
|
118
|
+
def initialize(id: OMIT, created_at: OMIT, name: OMIT, category: OMIT, address: OMIT, ein: OMIT, description: OMIT,
|
119
|
+
brand_color: OMIT, logo_url: OMIT, hero_url: OMIT, primary_website_url: OMIT, primary_website_label: OMIT, primary_phone: OMIT, primary_phone_label: OMIT, primary_email: OMIT, primary_email_label: OMIT, privacy_policy_url: OMIT, tos_url: OMIT, poc_name: OMIT, poc_title: OMIT, poc_email: OMIT, opt_in: OMIT, opt_out: OMIT, opt_out_keywords: OMIT, agent_use_case: OMIT, expected_agent_responses: OMIT, test_numbers: OMIT, status: OMIT, additional_websites: OMIT, additional_emails: OMIT, additional_phone_numbers: OMIT, additional_properties: nil)
|
99
120
|
@id = id if id != OMIT
|
100
121
|
@created_at = created_at if created_at != OMIT
|
101
122
|
@name = name if name != OMIT
|
123
|
+
@category = category if category != OMIT
|
102
124
|
@address = address if address != OMIT
|
103
125
|
@ein = ein if ein != OMIT
|
104
126
|
@description = description if description != OMIT
|
@@ -116,6 +138,11 @@ module Pinnacle
|
|
116
138
|
@poc_name = poc_name if poc_name != OMIT
|
117
139
|
@poc_title = poc_title if poc_title != OMIT
|
118
140
|
@poc_email = poc_email if poc_email != OMIT
|
141
|
+
@opt_in = opt_in if opt_in != OMIT
|
142
|
+
@opt_out = opt_out if opt_out != OMIT
|
143
|
+
@opt_out_keywords = opt_out_keywords if opt_out_keywords != OMIT
|
144
|
+
@agent_use_case = agent_use_case if agent_use_case != OMIT
|
145
|
+
@expected_agent_responses = expected_agent_responses if expected_agent_responses != OMIT
|
119
146
|
@test_numbers = test_numbers if test_numbers != OMIT
|
120
147
|
@status = status if status != OMIT
|
121
148
|
@additional_websites = additional_websites if additional_websites != OMIT
|
@@ -126,6 +153,7 @@ module Pinnacle
|
|
126
153
|
"id": id,
|
127
154
|
"createdAt": created_at,
|
128
155
|
"name": name,
|
156
|
+
"category": category,
|
129
157
|
"address": address,
|
130
158
|
"ein": ein,
|
131
159
|
"description": description,
|
@@ -143,6 +171,11 @@ module Pinnacle
|
|
143
171
|
"pocName": poc_name,
|
144
172
|
"pocTitle": poc_title,
|
145
173
|
"pocEmail": poc_email,
|
174
|
+
"optIn": opt_in,
|
175
|
+
"optOut": opt_out,
|
176
|
+
"optOutKeywords": opt_out_keywords,
|
177
|
+
"agentUseCase": agent_use_case,
|
178
|
+
"expectedAgentResponses": expected_agent_responses,
|
146
179
|
"testNumbers": test_numbers,
|
147
180
|
"status": status,
|
148
181
|
"additionalWebsites": additional_websites,
|
@@ -163,6 +196,7 @@ module Pinnacle
|
|
163
196
|
id = parsed_json["id"]
|
164
197
|
created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
|
165
198
|
name = parsed_json["name"]
|
199
|
+
category = parsed_json["category"]
|
166
200
|
address = parsed_json["address"]
|
167
201
|
ein = parsed_json["ein"]
|
168
202
|
description = parsed_json["description"]
|
@@ -180,6 +214,11 @@ module Pinnacle
|
|
180
214
|
poc_name = parsed_json["pocName"]
|
181
215
|
poc_title = parsed_json["pocTitle"]
|
182
216
|
poc_email = parsed_json["pocEmail"]
|
217
|
+
opt_in = parsed_json["optIn"]
|
218
|
+
opt_out = parsed_json["optOut"]
|
219
|
+
opt_out_keywords = parsed_json["optOutKeywords"]
|
220
|
+
agent_use_case = parsed_json["agentUseCase"]
|
221
|
+
expected_agent_responses = parsed_json["expectedAgentResponses"]
|
183
222
|
test_numbers = parsed_json["testNumbers"]
|
184
223
|
status = parsed_json["status"]
|
185
224
|
additional_websites = parsed_json["additionalWebsites"]&.map do |item|
|
@@ -198,6 +237,7 @@ module Pinnacle
|
|
198
237
|
id: id,
|
199
238
|
created_at: created_at,
|
200
239
|
name: name,
|
240
|
+
category: category,
|
201
241
|
address: address,
|
202
242
|
ein: ein,
|
203
243
|
description: description,
|
@@ -215,6 +255,11 @@ module Pinnacle
|
|
215
255
|
poc_name: poc_name,
|
216
256
|
poc_title: poc_title,
|
217
257
|
poc_email: poc_email,
|
258
|
+
opt_in: opt_in,
|
259
|
+
opt_out: opt_out,
|
260
|
+
opt_out_keywords: opt_out_keywords,
|
261
|
+
agent_use_case: agent_use_case,
|
262
|
+
expected_agent_responses: expected_agent_responses,
|
218
263
|
test_numbers: test_numbers,
|
219
264
|
status: status,
|
220
265
|
additional_websites: additional_websites,
|
@@ -241,6 +286,7 @@ module Pinnacle
|
|
241
286
|
obj.id&.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
242
287
|
obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
243
288
|
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
289
|
+
obj.category&.is_a?(Pinnacle::CompanyCategory) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
|
244
290
|
obj.address&.is_a?(String) != false || raise("Passed value for field obj.address is not the expected type, validation failed.")
|
245
291
|
obj.ein&.is_a?(String) != false || raise("Passed value for field obj.ein is not the expected type, validation failed.")
|
246
292
|
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
@@ -258,6 +304,11 @@ module Pinnacle
|
|
258
304
|
obj.poc_name&.is_a?(String) != false || raise("Passed value for field obj.poc_name is not the expected type, validation failed.")
|
259
305
|
obj.poc_title&.is_a?(String) != false || raise("Passed value for field obj.poc_title is not the expected type, validation failed.")
|
260
306
|
obj.poc_email&.is_a?(String) != false || raise("Passed value for field obj.poc_email is not the expected type, validation failed.")
|
307
|
+
obj.opt_in&.is_a?(String) != false || raise("Passed value for field obj.opt_in is not the expected type, validation failed.")
|
308
|
+
obj.opt_out&.is_a?(String) != false || raise("Passed value for field obj.opt_out is not the expected type, validation failed.")
|
309
|
+
obj.opt_out_keywords&.is_a?(Array) != false || raise("Passed value for field obj.opt_out_keywords is not the expected type, validation failed.")
|
310
|
+
obj.agent_use_case&.is_a?(String) != false || raise("Passed value for field obj.agent_use_case is not the expected type, validation failed.")
|
311
|
+
obj.expected_agent_responses&.is_a?(String) != false || raise("Passed value for field obj.expected_agent_responses is not the expected type, validation failed.")
|
261
312
|
obj.test_numbers&.is_a?(Array) != false || raise("Passed value for field obj.test_numbers is not the expected type, validation failed.")
|
262
313
|
obj.status&.is_a?(String) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
263
314
|
obj.additional_websites&.is_a?(Array) != false || raise("Passed value for field obj.additional_websites is not the expected type, validation failed.")
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Pinnacle
|
4
|
+
class CompanyCategory
|
5
|
+
ENTERTAINMENT = "Entertainment"
|
6
|
+
FINANCE = "Finance"
|
7
|
+
FOOD_BEVERAGE = "Food & Beverage"
|
8
|
+
GAMES = "Games"
|
9
|
+
HEALTH = "Health"
|
10
|
+
MISC = "Misc"
|
11
|
+
NEWS = "News"
|
12
|
+
OTHER = "Other"
|
13
|
+
PRODUCTIVITY = "Productivity"
|
14
|
+
SHOPPING_RETAIL = "Shopping & Retail"
|
15
|
+
SOCIAL = "Social"
|
16
|
+
SPORTS = "Sports"
|
17
|
+
TRAVEL = "Travel"
|
18
|
+
UTILITIES = "Utilities"
|
19
|
+
end
|
20
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "company_category"
|
3
4
|
require "ostruct"
|
4
5
|
require "json"
|
5
6
|
|
@@ -7,6 +8,8 @@ module Pinnacle
|
|
7
8
|
class CompanyDetails
|
8
9
|
# @return [String] The name of the company.
|
9
10
|
attr_reader :name
|
11
|
+
# @return [Pinnacle::CompanyCategory] The category of the company.
|
12
|
+
attr_reader :category
|
10
13
|
# @return [String] The address of the company.
|
11
14
|
attr_reader :address
|
12
15
|
# @return [String] The EIN (Employer Identification Number) of the company.
|
@@ -29,6 +32,7 @@ module Pinnacle
|
|
29
32
|
OMIT = Object.new
|
30
33
|
|
31
34
|
# @param name [String] The name of the company.
|
35
|
+
# @param category [Pinnacle::CompanyCategory] The category of the company.
|
32
36
|
# @param address [String] The address of the company.
|
33
37
|
# @param ein [String] The EIN (Employer Identification Number) of the company.
|
34
38
|
# @param description [String] A description of the company.
|
@@ -38,8 +42,10 @@ module Pinnacle
|
|
38
42
|
# @param hero_url [String] URL of the company's hero image.
|
39
43
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
40
44
|
# @return [Pinnacle::CompanyDetails]
|
41
|
-
def initialize(name:, address:, ein:, description:, brand_color:, logo_url:, hero_url:,
|
45
|
+
def initialize(name:, category:, address:, ein:, description:, brand_color:, logo_url:, hero_url:,
|
46
|
+
additional_properties: nil)
|
42
47
|
@name = name
|
48
|
+
@category = category
|
43
49
|
@address = address
|
44
50
|
@ein = ein
|
45
51
|
@description = description
|
@@ -49,6 +55,7 @@ module Pinnacle
|
|
49
55
|
@additional_properties = additional_properties
|
50
56
|
@_field_set = {
|
51
57
|
"name": name,
|
58
|
+
"category": category,
|
52
59
|
"address": address,
|
53
60
|
"ein": ein,
|
54
61
|
"description": description,
|
@@ -66,6 +73,7 @@ module Pinnacle
|
|
66
73
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
67
74
|
parsed_json = JSON.parse(json_object)
|
68
75
|
name = parsed_json["name"]
|
76
|
+
category = parsed_json["category"]
|
69
77
|
address = parsed_json["address"]
|
70
78
|
ein = parsed_json["ein"]
|
71
79
|
description = parsed_json["description"]
|
@@ -74,6 +82,7 @@ module Pinnacle
|
|
74
82
|
hero_url = parsed_json["heroUrl"]
|
75
83
|
new(
|
76
84
|
name: name,
|
85
|
+
category: category,
|
77
86
|
address: address,
|
78
87
|
ein: ein,
|
79
88
|
description: description,
|
@@ -99,6 +108,7 @@ module Pinnacle
|
|
99
108
|
# @return [Void]
|
100
109
|
def self.validate_raw(obj:)
|
101
110
|
obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
111
|
+
obj.category.is_a?(Pinnacle::CompanyCategory) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
|
102
112
|
obj.address.is_a?(String) != false || raise("Passed value for field obj.address is not the expected type, validation failed.")
|
103
113
|
obj.ein.is_a?(String) != false || raise("Passed value for field obj.ein is not the expected type, validation failed.")
|
104
114
|
obj.description.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
@@ -0,0 +1,117 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "inbound_message_metadata"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module Pinnacle
|
8
|
+
class InboundActionMessage
|
9
|
+
# @return [String]
|
10
|
+
attr_reader :message_type
|
11
|
+
# @return [String]
|
12
|
+
attr_reader :action_title
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :payload
|
15
|
+
# @return [String]
|
16
|
+
attr_reader :action_metadata
|
17
|
+
# @return [String]
|
18
|
+
attr_reader :from
|
19
|
+
# @return [String]
|
20
|
+
attr_reader :to
|
21
|
+
# @return [Pinnacle::InboundMessageMetadata]
|
22
|
+
attr_reader :metadata
|
23
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
24
|
+
attr_reader :additional_properties
|
25
|
+
# @return [Object]
|
26
|
+
attr_reader :_field_set
|
27
|
+
protected :_field_set
|
28
|
+
|
29
|
+
OMIT = Object.new
|
30
|
+
|
31
|
+
# @param message_type [String]
|
32
|
+
# @param action_title [String]
|
33
|
+
# @param payload [String]
|
34
|
+
# @param action_metadata [String]
|
35
|
+
# @param from [String]
|
36
|
+
# @param to [String]
|
37
|
+
# @param metadata [Pinnacle::InboundMessageMetadata]
|
38
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
39
|
+
# @return [Pinnacle::InboundActionMessage]
|
40
|
+
def initialize(action_title:, from:, to:, message_type: OMIT, payload: OMIT, action_metadata: OMIT, metadata: OMIT,
|
41
|
+
additional_properties: nil)
|
42
|
+
@message_type = message_type if message_type != OMIT
|
43
|
+
@action_title = action_title
|
44
|
+
@payload = payload if payload != OMIT
|
45
|
+
@action_metadata = action_metadata if action_metadata != OMIT
|
46
|
+
@from = from
|
47
|
+
@to = to
|
48
|
+
@metadata = metadata if metadata != OMIT
|
49
|
+
@additional_properties = additional_properties
|
50
|
+
@_field_set = {
|
51
|
+
"messageType": message_type,
|
52
|
+
"actionTitle": action_title,
|
53
|
+
"payload": payload,
|
54
|
+
"actionMetadata": action_metadata,
|
55
|
+
"from": from,
|
56
|
+
"to": to,
|
57
|
+
"metadata": metadata
|
58
|
+
}.reject do |_k, v|
|
59
|
+
v == OMIT
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Deserialize a JSON object to an instance of InboundActionMessage
|
64
|
+
#
|
65
|
+
# @param json_object [String]
|
66
|
+
# @return [Pinnacle::InboundActionMessage]
|
67
|
+
def self.from_json(json_object:)
|
68
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
69
|
+
parsed_json = JSON.parse(json_object)
|
70
|
+
message_type = parsed_json["messageType"]
|
71
|
+
action_title = parsed_json["actionTitle"]
|
72
|
+
payload = parsed_json["payload"]
|
73
|
+
action_metadata = parsed_json["actionMetadata"]
|
74
|
+
from = parsed_json["from"]
|
75
|
+
to = parsed_json["to"]
|
76
|
+
if parsed_json["metadata"].nil?
|
77
|
+
metadata = nil
|
78
|
+
else
|
79
|
+
metadata = parsed_json["metadata"].to_json
|
80
|
+
metadata = Pinnacle::InboundMessageMetadata.from_json(json_object: metadata)
|
81
|
+
end
|
82
|
+
new(
|
83
|
+
message_type: message_type,
|
84
|
+
action_title: action_title,
|
85
|
+
payload: payload,
|
86
|
+
action_metadata: action_metadata,
|
87
|
+
from: from,
|
88
|
+
to: to,
|
89
|
+
metadata: metadata,
|
90
|
+
additional_properties: struct
|
91
|
+
)
|
92
|
+
end
|
93
|
+
|
94
|
+
# Serialize an instance of InboundActionMessage to a JSON object
|
95
|
+
#
|
96
|
+
# @return [String]
|
97
|
+
def to_json(*_args)
|
98
|
+
@_field_set&.to_json
|
99
|
+
end
|
100
|
+
|
101
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
102
|
+
# hash and check each fields type against the current object's property
|
103
|
+
# definitions.
|
104
|
+
#
|
105
|
+
# @param obj [Object]
|
106
|
+
# @return [Void]
|
107
|
+
def self.validate_raw(obj:)
|
108
|
+
obj.message_type&.is_a?(String) != false || raise("Passed value for field obj.message_type is not the expected type, validation failed.")
|
109
|
+
obj.action_title.is_a?(String) != false || raise("Passed value for field obj.action_title is not the expected type, validation failed.")
|
110
|
+
obj.payload&.is_a?(String) != false || raise("Passed value for field obj.payload is not the expected type, validation failed.")
|
111
|
+
obj.action_metadata&.is_a?(String) != false || raise("Passed value for field obj.action_metadata is not the expected type, validation failed.")
|
112
|
+
obj.from.is_a?(String) != false || raise("Passed value for field obj.from is not the expected type, validation failed.")
|
113
|
+
obj.to.is_a?(String) != false || raise("Passed value for field obj.to is not the expected type, validation failed.")
|
114
|
+
obj.metadata.nil? || Pinnacle::InboundMessageMetadata.validate_raw(obj: obj.metadata)
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|