rcs 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/lib/environment.rb +7 -0
  3. data/lib/gemconfig.rb +14 -0
  4. data/lib/rcs/company/client.rb +416 -0
  5. data/lib/rcs/company/types/company_register_response.rb +63 -0
  6. data/lib/rcs/company/types/company_register_response_brand.rb +67 -0
  7. data/lib/rcs/company/types/company_update_response.rb +63 -0
  8. data/lib/rcs/company/types/company_update_response_brand.rb +67 -0
  9. data/lib/rcs/send/client.rb +343 -0
  10. data/lib/rcs/send/types/send_mms_response.rb +67 -0
  11. data/lib/rcs/send/types/send_rcs_response.rb +67 -0
  12. data/lib/rcs/send/types/send_sms_response.rb +67 -0
  13. data/lib/rcs/types/action.rb +146 -0
  14. data/lib/rcs/types/action_lat_long.rb +68 -0
  15. data/lib/rcs/types/action_type.rb +16 -0
  16. data/lib/rcs/types/additional_email.rb +65 -0
  17. data/lib/rcs/types/additional_phone_number.rb +65 -0
  18. data/lib/rcs/types/additional_website.rb +65 -0
  19. data/lib/rcs/types/bad_request_error_body.rb +57 -0
  20. data/lib/rcs/types/card.rb +90 -0
  21. data/lib/rcs/types/company.rb +268 -0
  22. data/lib/rcs/types/company_additional_emails_item.rb +67 -0
  23. data/lib/rcs/types/company_additional_phone_numbers_item.rb +67 -0
  24. data/lib/rcs/types/company_additional_websites_item.rb +67 -0
  25. data/lib/rcs/types/company_contact.rb +117 -0
  26. data/lib/rcs/types/company_details.rb +110 -0
  27. data/lib/rcs/types/forbidden_error_body.rb +57 -0
  28. data/lib/rcs/types/internal_server_error_body.rb +57 -0
  29. data/lib/rcs/types/optionals.rb +99 -0
  30. data/lib/rcs/types/point_of_contact.rb +72 -0
  31. data/lib/rcs/types/rcs_functionalities.rb +117 -0
  32. data/lib/rcs/types/unauthorized_error_body.rb +57 -0
  33. data/lib/rcs.rb +126 -0
  34. data/lib/requests.rb +163 -0
  35. data/lib/types_export.rb +29 -0
  36. metadata +158 -0
@@ -0,0 +1,268 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "date"
4
+ require_relative "company_additional_websites_item"
5
+ require_relative "company_additional_emails_item"
6
+ require_relative "company_additional_phone_numbers_item"
7
+ require "ostruct"
8
+ require "json"
9
+
10
+ module Pinnacle
11
+ class Company
12
+ # @return [Integer] The unique identifier for the company
13
+ attr_reader :id
14
+ # @return [DateTime] The date and time when the company was created
15
+ attr_reader :created_at
16
+ # @return [String] The name of the company
17
+ attr_reader :name
18
+ # @return [String] The address of the company
19
+ attr_reader :address
20
+ # @return [String] The Employer Identification Number (EIN) of the company
21
+ attr_reader :ein
22
+ # @return [String] A description of the company
23
+ attr_reader :description
24
+ # @return [String] The brand color of the company
25
+ attr_reader :brand_color
26
+ # @return [String] The URL of the company's logo
27
+ attr_reader :logo_url
28
+ # @return [String] The URL of the company's hero image
29
+ attr_reader :hero_url
30
+ # @return [String] The primary website URL of the company
31
+ attr_reader :primary_website_url
32
+ # @return [String] The label for the primary website URL
33
+ attr_reader :primary_website_label
34
+ # @return [String] The primary phone number of the company
35
+ attr_reader :primary_phone
36
+ # @return [String] The label for the primary phone number
37
+ attr_reader :primary_phone_label
38
+ # @return [String] The primary email address of the company
39
+ attr_reader :primary_email
40
+ # @return [String] The label for the primary email address
41
+ attr_reader :primary_email_label
42
+ # @return [String] The URL of the company's privacy policy
43
+ attr_reader :privacy_policy_url
44
+ # @return [String] The URL of the company's terms of service
45
+ attr_reader :tos_url
46
+ # @return [String] The name of the point of contact
47
+ attr_reader :poc_name
48
+ # @return [String] The title of the point of contact
49
+ attr_reader :poc_title
50
+ # @return [String] The email address of the point of contact
51
+ attr_reader :poc_email
52
+ # @return [Array<String>] A list of test phone numbers
53
+ attr_reader :test_numbers
54
+ # @return [String] The approval status of the company
55
+ attr_reader :status
56
+ # @return [Array<Pinnacle::CompanyAdditionalWebsitesItem>] A list of additional websites
57
+ attr_reader :additional_websites
58
+ # @return [Array<Pinnacle::CompanyAdditionalEmailsItem>] A list of additional email addresses
59
+ attr_reader :additional_emails
60
+ # @return [Array<Pinnacle::CompanyAdditionalPhoneNumbersItem>] A list of additional phone numbers
61
+ attr_reader :additional_phone_numbers
62
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
63
+ attr_reader :additional_properties
64
+ # @return [Object]
65
+ attr_reader :_field_set
66
+ protected :_field_set
67
+
68
+ OMIT = Object.new
69
+
70
+ # @param id [Integer] The unique identifier for the company
71
+ # @param created_at [DateTime] The date and time when the company was created
72
+ # @param name [String] The name of the company
73
+ # @param address [String] The address of the company
74
+ # @param ein [String] The Employer Identification Number (EIN) of the company
75
+ # @param description [String] A description of the company
76
+ # @param brand_color [String] The brand color of the company
77
+ # @param logo_url [String] The URL of the company's logo
78
+ # @param hero_url [String] The URL of the company's hero image
79
+ # @param primary_website_url [String] The primary website URL of the company
80
+ # @param primary_website_label [String] The label for the primary website URL
81
+ # @param primary_phone [String] The primary phone number of the company
82
+ # @param primary_phone_label [String] The label for the primary phone number
83
+ # @param primary_email [String] The primary email address of the company
84
+ # @param primary_email_label [String] The label for the primary email address
85
+ # @param privacy_policy_url [String] The URL of the company's privacy policy
86
+ # @param tos_url [String] The URL of the company's terms of service
87
+ # @param poc_name [String] The name of the point of contact
88
+ # @param poc_title [String] The title of the point of contact
89
+ # @param poc_email [String] The email address of the point of contact
90
+ # @param test_numbers [Array<String>] A list of test phone numbers
91
+ # @param status [String] The approval status of the company
92
+ # @param additional_websites [Array<Pinnacle::CompanyAdditionalWebsitesItem>] A list of additional websites
93
+ # @param additional_emails [Array<Pinnacle::CompanyAdditionalEmailsItem>] A list of additional email addresses
94
+ # @param additional_phone_numbers [Array<Pinnacle::CompanyAdditionalPhoneNumbersItem>] A list of additional phone numbers
95
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
96
+ # @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)
99
+ @id = id if id != OMIT
100
+ @created_at = created_at if created_at != OMIT
101
+ @name = name if name != OMIT
102
+ @address = address if address != OMIT
103
+ @ein = ein if ein != OMIT
104
+ @description = description if description != OMIT
105
+ @brand_color = brand_color if brand_color != OMIT
106
+ @logo_url = logo_url if logo_url != OMIT
107
+ @hero_url = hero_url if hero_url != OMIT
108
+ @primary_website_url = primary_website_url if primary_website_url != OMIT
109
+ @primary_website_label = primary_website_label if primary_website_label != OMIT
110
+ @primary_phone = primary_phone if primary_phone != OMIT
111
+ @primary_phone_label = primary_phone_label if primary_phone_label != OMIT
112
+ @primary_email = primary_email if primary_email != OMIT
113
+ @primary_email_label = primary_email_label if primary_email_label != OMIT
114
+ @privacy_policy_url = privacy_policy_url if privacy_policy_url != OMIT
115
+ @tos_url = tos_url if tos_url != OMIT
116
+ @poc_name = poc_name if poc_name != OMIT
117
+ @poc_title = poc_title if poc_title != OMIT
118
+ @poc_email = poc_email if poc_email != OMIT
119
+ @test_numbers = test_numbers if test_numbers != OMIT
120
+ @status = status if status != OMIT
121
+ @additional_websites = additional_websites if additional_websites != OMIT
122
+ @additional_emails = additional_emails if additional_emails != OMIT
123
+ @additional_phone_numbers = additional_phone_numbers if additional_phone_numbers != OMIT
124
+ @additional_properties = additional_properties
125
+ @_field_set = {
126
+ "id": id,
127
+ "createdAt": created_at,
128
+ "name": name,
129
+ "address": address,
130
+ "ein": ein,
131
+ "description": description,
132
+ "brandColor": brand_color,
133
+ "logoUrl": logo_url,
134
+ "heroUrl": hero_url,
135
+ "primaryWebsiteUrl": primary_website_url,
136
+ "primaryWebsiteLabel": primary_website_label,
137
+ "primaryPhone": primary_phone,
138
+ "primaryPhoneLabel": primary_phone_label,
139
+ "primaryEmail": primary_email,
140
+ "primaryEmailLabel": primary_email_label,
141
+ "privacyPolicyUrl": privacy_policy_url,
142
+ "tosUrl": tos_url,
143
+ "pocName": poc_name,
144
+ "pocTitle": poc_title,
145
+ "pocEmail": poc_email,
146
+ "testNumbers": test_numbers,
147
+ "status": status,
148
+ "additionalWebsites": additional_websites,
149
+ "additionalEmails": additional_emails,
150
+ "additionalPhoneNumbers": additional_phone_numbers
151
+ }.reject do |_k, v|
152
+ v == OMIT
153
+ end
154
+ end
155
+
156
+ # Deserialize a JSON object to an instance of Company
157
+ #
158
+ # @param json_object [String]
159
+ # @return [Pinnacle::Company]
160
+ def self.from_json(json_object:)
161
+ struct = JSON.parse(json_object, object_class: OpenStruct)
162
+ parsed_json = JSON.parse(json_object)
163
+ id = parsed_json["id"]
164
+ created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
165
+ name = parsed_json["name"]
166
+ address = parsed_json["address"]
167
+ ein = parsed_json["ein"]
168
+ description = parsed_json["description"]
169
+ brand_color = parsed_json["brandColor"]
170
+ logo_url = parsed_json["logoUrl"]
171
+ hero_url = parsed_json["heroUrl"]
172
+ primary_website_url = parsed_json["primaryWebsiteUrl"]
173
+ primary_website_label = parsed_json["primaryWebsiteLabel"]
174
+ primary_phone = parsed_json["primaryPhone"]
175
+ primary_phone_label = parsed_json["primaryPhoneLabel"]
176
+ primary_email = parsed_json["primaryEmail"]
177
+ primary_email_label = parsed_json["primaryEmailLabel"]
178
+ privacy_policy_url = parsed_json["privacyPolicyUrl"]
179
+ tos_url = parsed_json["tosUrl"]
180
+ poc_name = parsed_json["pocName"]
181
+ poc_title = parsed_json["pocTitle"]
182
+ poc_email = parsed_json["pocEmail"]
183
+ test_numbers = parsed_json["testNumbers"]
184
+ status = parsed_json["status"]
185
+ additional_websites = parsed_json["additionalWebsites"]&.map do |item|
186
+ item = item.to_json
187
+ Pinnacle::CompanyAdditionalWebsitesItem.from_json(json_object: item)
188
+ end
189
+ additional_emails = parsed_json["additionalEmails"]&.map do |item|
190
+ item = item.to_json
191
+ Pinnacle::CompanyAdditionalEmailsItem.from_json(json_object: item)
192
+ end
193
+ additional_phone_numbers = parsed_json["additionalPhoneNumbers"]&.map do |item|
194
+ item = item.to_json
195
+ Pinnacle::CompanyAdditionalPhoneNumbersItem.from_json(json_object: item)
196
+ end
197
+ new(
198
+ id: id,
199
+ created_at: created_at,
200
+ name: name,
201
+ address: address,
202
+ ein: ein,
203
+ description: description,
204
+ brand_color: brand_color,
205
+ logo_url: logo_url,
206
+ hero_url: hero_url,
207
+ primary_website_url: primary_website_url,
208
+ primary_website_label: primary_website_label,
209
+ primary_phone: primary_phone,
210
+ primary_phone_label: primary_phone_label,
211
+ primary_email: primary_email,
212
+ primary_email_label: primary_email_label,
213
+ privacy_policy_url: privacy_policy_url,
214
+ tos_url: tos_url,
215
+ poc_name: poc_name,
216
+ poc_title: poc_title,
217
+ poc_email: poc_email,
218
+ test_numbers: test_numbers,
219
+ status: status,
220
+ additional_websites: additional_websites,
221
+ additional_emails: additional_emails,
222
+ additional_phone_numbers: additional_phone_numbers,
223
+ additional_properties: struct
224
+ )
225
+ end
226
+
227
+ # Serialize an instance of Company to a JSON object
228
+ #
229
+ # @return [String]
230
+ def to_json(*_args)
231
+ @_field_set&.to_json
232
+ end
233
+
234
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
235
+ # hash and check each fields type against the current object's property
236
+ # definitions.
237
+ #
238
+ # @param obj [Object]
239
+ # @return [Void]
240
+ def self.validate_raw(obj:)
241
+ obj.id&.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
242
+ obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
243
+ obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
244
+ obj.address&.is_a?(String) != false || raise("Passed value for field obj.address is not the expected type, validation failed.")
245
+ obj.ein&.is_a?(String) != false || raise("Passed value for field obj.ein is not the expected type, validation failed.")
246
+ obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
247
+ obj.brand_color&.is_a?(String) != false || raise("Passed value for field obj.brand_color is not the expected type, validation failed.")
248
+ obj.logo_url&.is_a?(String) != false || raise("Passed value for field obj.logo_url is not the expected type, validation failed.")
249
+ obj.hero_url&.is_a?(String) != false || raise("Passed value for field obj.hero_url is not the expected type, validation failed.")
250
+ obj.primary_website_url&.is_a?(String) != false || raise("Passed value for field obj.primary_website_url is not the expected type, validation failed.")
251
+ obj.primary_website_label&.is_a?(String) != false || raise("Passed value for field obj.primary_website_label is not the expected type, validation failed.")
252
+ obj.primary_phone&.is_a?(String) != false || raise("Passed value for field obj.primary_phone is not the expected type, validation failed.")
253
+ obj.primary_phone_label&.is_a?(String) != false || raise("Passed value for field obj.primary_phone_label is not the expected type, validation failed.")
254
+ obj.primary_email&.is_a?(String) != false || raise("Passed value for field obj.primary_email is not the expected type, validation failed.")
255
+ obj.primary_email_label&.is_a?(String) != false || raise("Passed value for field obj.primary_email_label is not the expected type, validation failed.")
256
+ obj.privacy_policy_url&.is_a?(String) != false || raise("Passed value for field obj.privacy_policy_url is not the expected type, validation failed.")
257
+ obj.tos_url&.is_a?(String) != false || raise("Passed value for field obj.tos_url is not the expected type, validation failed.")
258
+ obj.poc_name&.is_a?(String) != false || raise("Passed value for field obj.poc_name is not the expected type, validation failed.")
259
+ obj.poc_title&.is_a?(String) != false || raise("Passed value for field obj.poc_title is not the expected type, validation failed.")
260
+ obj.poc_email&.is_a?(String) != false || raise("Passed value for field obj.poc_email is not the expected type, validation failed.")
261
+ obj.test_numbers&.is_a?(Array) != false || raise("Passed value for field obj.test_numbers is not the expected type, validation failed.")
262
+ obj.status&.is_a?(String) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
263
+ obj.additional_websites&.is_a?(Array) != false || raise("Passed value for field obj.additional_websites is not the expected type, validation failed.")
264
+ obj.additional_emails&.is_a?(Array) != false || raise("Passed value for field obj.additional_emails is not the expected type, validation failed.")
265
+ obj.additional_phone_numbers&.is_a?(Array) != false || raise("Passed value for field obj.additional_phone_numbers is not the expected type, validation failed.")
266
+ end
267
+ end
268
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ class CompanyAdditionalEmailsItem
8
+ # @return [String] The additional email address
9
+ attr_reader :email
10
+ # @return [String] The label for the additional email address
11
+ attr_reader :label
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 email [String] The additional email address
21
+ # @param label [String] The label for the additional email address
22
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
23
+ # @return [Pinnacle::CompanyAdditionalEmailsItem]
24
+ def initialize(email: OMIT, label: OMIT, additional_properties: nil)
25
+ @email = email if email != OMIT
26
+ @label = label if label != OMIT
27
+ @additional_properties = additional_properties
28
+ @_field_set = { "email": email, "label": label }.reject do |_k, v|
29
+ v == OMIT
30
+ end
31
+ end
32
+
33
+ # Deserialize a JSON object to an instance of CompanyAdditionalEmailsItem
34
+ #
35
+ # @param json_object [String]
36
+ # @return [Pinnacle::CompanyAdditionalEmailsItem]
37
+ def self.from_json(json_object:)
38
+ struct = JSON.parse(json_object, object_class: OpenStruct)
39
+ parsed_json = JSON.parse(json_object)
40
+ email = parsed_json["email"]
41
+ label = parsed_json["label"]
42
+ new(
43
+ email: email,
44
+ label: label,
45
+ additional_properties: struct
46
+ )
47
+ end
48
+
49
+ # Serialize an instance of CompanyAdditionalEmailsItem to a JSON object
50
+ #
51
+ # @return [String]
52
+ def to_json(*_args)
53
+ @_field_set&.to_json
54
+ end
55
+
56
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
57
+ # hash and check each fields type against the current object's property
58
+ # definitions.
59
+ #
60
+ # @param obj [Object]
61
+ # @return [Void]
62
+ def self.validate_raw(obj:)
63
+ obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
64
+ obj.label&.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.")
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ class CompanyAdditionalPhoneNumbersItem
8
+ # @return [String] The label for the additional phone number
9
+ attr_reader :label
10
+ # @return [String] The additional phone number
11
+ attr_reader :phone
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 label [String] The label for the additional phone number
21
+ # @param phone [String] The additional phone number
22
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
23
+ # @return [Pinnacle::CompanyAdditionalPhoneNumbersItem]
24
+ def initialize(label: OMIT, phone: OMIT, additional_properties: nil)
25
+ @label = label if label != OMIT
26
+ @phone = phone if phone != OMIT
27
+ @additional_properties = additional_properties
28
+ @_field_set = { "label": label, "phone": phone }.reject do |_k, v|
29
+ v == OMIT
30
+ end
31
+ end
32
+
33
+ # Deserialize a JSON object to an instance of CompanyAdditionalPhoneNumbersItem
34
+ #
35
+ # @param json_object [String]
36
+ # @return [Pinnacle::CompanyAdditionalPhoneNumbersItem]
37
+ def self.from_json(json_object:)
38
+ struct = JSON.parse(json_object, object_class: OpenStruct)
39
+ parsed_json = JSON.parse(json_object)
40
+ label = parsed_json["label"]
41
+ phone = parsed_json["phone"]
42
+ new(
43
+ label: label,
44
+ phone: phone,
45
+ additional_properties: struct
46
+ )
47
+ end
48
+
49
+ # Serialize an instance of CompanyAdditionalPhoneNumbersItem to a JSON object
50
+ #
51
+ # @return [String]
52
+ def to_json(*_args)
53
+ @_field_set&.to_json
54
+ end
55
+
56
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
57
+ # hash and check each fields type against the current object's property
58
+ # definitions.
59
+ #
60
+ # @param obj [Object]
61
+ # @return [Void]
62
+ def self.validate_raw(obj:)
63
+ obj.label&.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.")
64
+ obj.phone&.is_a?(String) != false || raise("Passed value for field obj.phone is not the expected type, validation failed.")
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ class CompanyAdditionalWebsitesItem
8
+ # @return [String] The URL of the additional website
9
+ attr_reader :url
10
+ # @return [String] The label for the additional website
11
+ attr_reader :label
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 url [String] The URL of the additional website
21
+ # @param label [String] The label for the additional website
22
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
23
+ # @return [Pinnacle::CompanyAdditionalWebsitesItem]
24
+ def initialize(url: OMIT, label: OMIT, additional_properties: nil)
25
+ @url = url if url != OMIT
26
+ @label = label if label != OMIT
27
+ @additional_properties = additional_properties
28
+ @_field_set = { "url": url, "label": label }.reject do |_k, v|
29
+ v == OMIT
30
+ end
31
+ end
32
+
33
+ # Deserialize a JSON object to an instance of CompanyAdditionalWebsitesItem
34
+ #
35
+ # @param json_object [String]
36
+ # @return [Pinnacle::CompanyAdditionalWebsitesItem]
37
+ def self.from_json(json_object:)
38
+ struct = JSON.parse(json_object, object_class: OpenStruct)
39
+ parsed_json = JSON.parse(json_object)
40
+ url = parsed_json["url"]
41
+ label = parsed_json["label"]
42
+ new(
43
+ url: url,
44
+ label: label,
45
+ additional_properties: struct
46
+ )
47
+ end
48
+
49
+ # Serialize an instance of CompanyAdditionalWebsitesItem to a JSON object
50
+ #
51
+ # @return [String]
52
+ def to_json(*_args)
53
+ @_field_set&.to_json
54
+ end
55
+
56
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
57
+ # hash and check each fields type against the current object's property
58
+ # definitions.
59
+ #
60
+ # @param obj [Object]
61
+ # @return [Void]
62
+ def self.validate_raw(obj:)
63
+ obj.url&.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
64
+ obj.label&.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.")
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,117 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Pinnacle
7
+ class CompanyContact
8
+ # @return [String] Primary website URL.
9
+ attr_reader :primary_website_url
10
+ # @return [String] Label for the primary website.
11
+ attr_reader :primary_website_label
12
+ # @return [String] Primary phone number in international format.
13
+ attr_reader :primary_phone
14
+ # @return [String] Label for the primary phone number.
15
+ attr_reader :primary_phone_label
16
+ # @return [String] Primary email address.
17
+ attr_reader :primary_email
18
+ # @return [String] Label for the primary email address.
19
+ attr_reader :primary_email_label
20
+ # @return [String] URL of the privacy policy.
21
+ attr_reader :privacy_policy_url
22
+ # @return [String] URL of the terms of service.
23
+ attr_reader :tos_url
24
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
25
+ attr_reader :additional_properties
26
+ # @return [Object]
27
+ attr_reader :_field_set
28
+ protected :_field_set
29
+
30
+ OMIT = Object.new
31
+
32
+ # @param primary_website_url [String] Primary website URL.
33
+ # @param primary_website_label [String] Label for the primary website.
34
+ # @param primary_phone [String] Primary phone number in international format.
35
+ # @param primary_phone_label [String] Label for the primary phone number.
36
+ # @param primary_email [String] Primary email address.
37
+ # @param primary_email_label [String] Label for the primary email address.
38
+ # @param privacy_policy_url [String] URL of the privacy policy.
39
+ # @param tos_url [String] URL of the terms of service.
40
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
41
+ # @return [Pinnacle::CompanyContact]
42
+ def initialize(primary_website_url:, primary_website_label:, primary_phone:, primary_phone_label:, primary_email:,
43
+ primary_email_label:, privacy_policy_url:, tos_url:, additional_properties: nil)
44
+ @primary_website_url = primary_website_url
45
+ @primary_website_label = primary_website_label
46
+ @primary_phone = primary_phone
47
+ @primary_phone_label = primary_phone_label
48
+ @primary_email = primary_email
49
+ @primary_email_label = primary_email_label
50
+ @privacy_policy_url = privacy_policy_url
51
+ @tos_url = tos_url
52
+ @additional_properties = additional_properties
53
+ @_field_set = {
54
+ "primaryWebsiteUrl": primary_website_url,
55
+ "primaryWebsiteLabel": primary_website_label,
56
+ "primaryPhone": primary_phone,
57
+ "primaryPhoneLabel": primary_phone_label,
58
+ "primaryEmail": primary_email,
59
+ "primaryEmailLabel": primary_email_label,
60
+ "privacyPolicyUrl": privacy_policy_url,
61
+ "tosUrl": tos_url
62
+ }
63
+ end
64
+
65
+ # Deserialize a JSON object to an instance of CompanyContact
66
+ #
67
+ # @param json_object [String]
68
+ # @return [Pinnacle::CompanyContact]
69
+ def self.from_json(json_object:)
70
+ struct = JSON.parse(json_object, object_class: OpenStruct)
71
+ parsed_json = JSON.parse(json_object)
72
+ primary_website_url = parsed_json["primaryWebsiteUrl"]
73
+ primary_website_label = parsed_json["primaryWebsiteLabel"]
74
+ primary_phone = parsed_json["primaryPhone"]
75
+ primary_phone_label = parsed_json["primaryPhoneLabel"]
76
+ primary_email = parsed_json["primaryEmail"]
77
+ primary_email_label = parsed_json["primaryEmailLabel"]
78
+ privacy_policy_url = parsed_json["privacyPolicyUrl"]
79
+ tos_url = parsed_json["tosUrl"]
80
+ new(
81
+ primary_website_url: primary_website_url,
82
+ primary_website_label: primary_website_label,
83
+ primary_phone: primary_phone,
84
+ primary_phone_label: primary_phone_label,
85
+ primary_email: primary_email,
86
+ primary_email_label: primary_email_label,
87
+ privacy_policy_url: privacy_policy_url,
88
+ tos_url: tos_url,
89
+ additional_properties: struct
90
+ )
91
+ end
92
+
93
+ # Serialize an instance of CompanyContact to a JSON object
94
+ #
95
+ # @return [String]
96
+ def to_json(*_args)
97
+ @_field_set&.to_json
98
+ end
99
+
100
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
101
+ # hash and check each fields type against the current object's property
102
+ # definitions.
103
+ #
104
+ # @param obj [Object]
105
+ # @return [Void]
106
+ def self.validate_raw(obj:)
107
+ obj.primary_website_url.is_a?(String) != false || raise("Passed value for field obj.primary_website_url is not the expected type, validation failed.")
108
+ obj.primary_website_label.is_a?(String) != false || raise("Passed value for field obj.primary_website_label is not the expected type, validation failed.")
109
+ obj.primary_phone.is_a?(String) != false || raise("Passed value for field obj.primary_phone is not the expected type, validation failed.")
110
+ obj.primary_phone_label.is_a?(String) != false || raise("Passed value for field obj.primary_phone_label is not the expected type, validation failed.")
111
+ obj.primary_email.is_a?(String) != false || raise("Passed value for field obj.primary_email is not the expected type, validation failed.")
112
+ obj.primary_email_label.is_a?(String) != false || raise("Passed value for field obj.primary_email_label is not the expected type, validation failed.")
113
+ obj.privacy_policy_url.is_a?(String) != false || raise("Passed value for field obj.privacy_policy_url is not the expected type, validation failed.")
114
+ obj.tos_url.is_a?(String) != false || raise("Passed value for field obj.tos_url is not the expected type, validation failed.")
115
+ end
116
+ end
117
+ end