Class: Pinnacle::Company

Inherits:
Object
  • Object
show all
Defined in:
lib/rcs/types/company.rb,
lib/rcs/company/types/company_update_response.rb,
lib/rcs/company/types/company_register_response.rb,
lib/rcs/company/types/company_update_response_brand.rb,
lib/rcs/company/types/company_register_response_brand.rb

Defined Under Namespace

Classes: CompanyRegisterResponse, CompanyRegisterResponseBrand, CompanyUpdateResponse, CompanyUpdateResponseBrand

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: OMIT, created_at: OMIT, name: OMIT, category: OMIT, address: OMIT, ein: OMIT, description: OMIT, 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) ⇒ Pinnacle::Company

Parameters:

  • id (Integer) (defaults to: OMIT)

    The unique identifier for the company

  • created_at (DateTime) (defaults to: OMIT)

    The date and time when the company was created

  • name (String) (defaults to: OMIT)

    The name of the company

  • category (Pinnacle::CompanyCategory) (defaults to: OMIT)

    The category of the company

  • address (String) (defaults to: OMIT)

    The address of the company

  • ein (String) (defaults to: OMIT)

    The Employer Identification Number (EIN) of the company

  • description (String) (defaults to: OMIT)

    A description of the company

  • brand_color (String) (defaults to: OMIT)

    The brand color of the company

  • logo_url (String) (defaults to: OMIT)

    The URL of the company’s logo

  • hero_url (String) (defaults to: OMIT)

    The URL of the company’s hero image

  • primary_website_url (String) (defaults to: OMIT)

    The primary website URL of the company

  • primary_website_label (String) (defaults to: OMIT)

    The label for the primary website URL

  • primary_phone (String) (defaults to: OMIT)

    The primary phone number of the company

  • primary_phone_label (String) (defaults to: OMIT)

    The label for the primary phone number

  • primary_email (String) (defaults to: OMIT)

    The primary email address of the company

  • primary_email_label (String) (defaults to: OMIT)

    The label for the primary email address

  • privacy_policy_url (String) (defaults to: OMIT)

    The URL of the company’s privacy policy

  • tos_url (String) (defaults to: OMIT)

    The URL of the company’s terms of service

  • poc_name (String) (defaults to: OMIT)

    The name of the point of contact

  • poc_title (String) (defaults to: OMIT)

    The title of the point of contact

  • poc_email (String) (defaults to: OMIT)

    The email address of the point of contact

  • opt_in (String) (defaults to: OMIT)

    Explain how users will opt in to receive messages.

  • opt_out (String) (defaults to: OMIT)

    Explain how users will opt out of receiving messages.

  • opt_out_keywords (Array<String>) (defaults to: OMIT)

    Please provide the unique keywords to opt out. Each keyword should not contain spaces.

  • agent_use_case (String) (defaults to: OMIT)

    Please define what your agent will do.

  • expected_agent_responses (String) (defaults to: OMIT)

    Please provide some example messages that your agent will send.

  • test_numbers (Array<String>) (defaults to: OMIT)

    A list of test phone numbers

  • status (String) (defaults to: OMIT)

    The approval status of the company

  • additional_websites (Array<Pinnacle::CompanyAdditionalWebsitesItem>) (defaults to: OMIT)

    A list of additional websites

  • additional_emails (Array<Pinnacle::CompanyAdditionalEmailsItem>) (defaults to: OMIT)

    A list of additional email addresses

  • additional_phone_numbers (Array<Pinnacle::CompanyAdditionalPhoneNumbersItem>) (defaults to: OMIT)

    A list of additional phone numbers

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/rcs/types/company.rb', line 118

def initialize(id: OMIT, created_at: OMIT, name: OMIT, category: OMIT, address: OMIT, ein: OMIT, description: OMIT,
               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)
  @id = id if id != OMIT
  @created_at = created_at if created_at != OMIT
  @name = name if name != OMIT
  @category = category if category != OMIT
  @address = address if address != OMIT
  @ein = ein if ein != OMIT
  @description = description if description != OMIT
  @brand_color = brand_color if brand_color != OMIT
  @logo_url = logo_url if logo_url != OMIT
  @hero_url = hero_url if hero_url != OMIT
  @primary_website_url = primary_website_url if primary_website_url != OMIT
  @primary_website_label = primary_website_label if primary_website_label != OMIT
  @primary_phone = primary_phone if primary_phone != OMIT
  @primary_phone_label = primary_phone_label if primary_phone_label != OMIT
  @primary_email = primary_email if primary_email != OMIT
  @primary_email_label = primary_email_label if primary_email_label != OMIT
  @privacy_policy_url = privacy_policy_url if privacy_policy_url != OMIT
  @tos_url = tos_url if tos_url != OMIT
  @poc_name = poc_name if poc_name != OMIT
  @poc_title = poc_title if poc_title != OMIT
  @poc_email = poc_email if poc_email != OMIT
  @opt_in = opt_in if opt_in != OMIT
  @opt_out = opt_out if opt_out != OMIT
  @opt_out_keywords = opt_out_keywords if opt_out_keywords != OMIT
  @agent_use_case = agent_use_case if agent_use_case != OMIT
  @expected_agent_responses = expected_agent_responses if expected_agent_responses != OMIT
  @test_numbers = test_numbers if test_numbers != OMIT
  @status = status if status != OMIT
  @additional_websites = additional_websites if additional_websites != OMIT
  @additional_emails = additional_emails if additional_emails != OMIT
  @additional_phone_numbers = additional_phone_numbers if additional_phone_numbers != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "id": id,
    "createdAt": created_at,
    "name": name,
    "category": category,
    "address": address,
    "ein": ein,
    "description": description,
    "brandColor": brand_color,
    "logoUrl": logo_url,
    "heroUrl": hero_url,
    "primaryWebsiteUrl": primary_website_url,
    "primaryWebsiteLabel": primary_website_label,
    "primaryPhone": primary_phone,
    "primaryPhoneLabel": primary_phone_label,
    "primaryEmail": primary_email,
    "primaryEmailLabel": primary_email_label,
    "privacyPolicyUrl": privacy_policy_url,
    "tosUrl": tos_url,
    "pocName": poc_name,
    "pocTitle": poc_title,
    "pocEmail": poc_email,
    "optIn": opt_in,
    "optOut": opt_out,
    "optOutKeywords": opt_out_keywords,
    "agentUseCase": agent_use_case,
    "expectedAgentResponses": expected_agent_responses,
    "testNumbers": test_numbers,
    "status": status,
    "additionalWebsites": additional_websites,
    "additionalEmails": additional_emails,
    "additionalPhoneNumbers": additional_phone_numbers
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_emailsArray<Pinnacle::CompanyAdditionalEmailsItem> (readonly)

Returns A list of additional email addresses.

Returns:



73
74
75
# File 'lib/rcs/types/company.rb', line 73

def additional_emails
  @additional_emails
end

#additional_phone_numbersArray<Pinnacle::CompanyAdditionalPhoneNumbersItem> (readonly)

Returns A list of additional phone numbers.

Returns:



75
76
77
# File 'lib/rcs/types/company.rb', line 75

def additional_phone_numbers
  @additional_phone_numbers
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



77
78
79
# File 'lib/rcs/types/company.rb', line 77

def additional_properties
  @additional_properties
end

#additional_websitesArray<Pinnacle::CompanyAdditionalWebsitesItem> (readonly)

Returns A list of additional websites.

Returns:



71
72
73
# File 'lib/rcs/types/company.rb', line 71

def additional_websites
  @additional_websites
end

#addressString (readonly)

Returns The address of the company.

Returns:

  • (String)

    The address of the company



22
23
24
# File 'lib/rcs/types/company.rb', line 22

def address
  @address
end

#agent_use_caseString (readonly)

Returns Please define what your agent will do.

Returns:

  • (String)

    Please define what your agent will do.



63
64
65
# File 'lib/rcs/types/company.rb', line 63

def agent_use_case
  @agent_use_case
end

#brand_colorString (readonly)

Returns The brand color of the company.

Returns:

  • (String)

    The brand color of the company



28
29
30
# File 'lib/rcs/types/company.rb', line 28

def brand_color
  @brand_color
end

#categoryPinnacle::CompanyCategory (readonly)

Returns The category of the company.

Returns:



20
21
22
# File 'lib/rcs/types/company.rb', line 20

def category
  @category
end

#created_atDateTime (readonly)

Returns The date and time when the company was created.

Returns:

  • (DateTime)

    The date and time when the company was created



16
17
18
# File 'lib/rcs/types/company.rb', line 16

def created_at
  @created_at
end

#descriptionString (readonly)

Returns A description of the company.

Returns:

  • (String)

    A description of the company



26
27
28
# File 'lib/rcs/types/company.rb', line 26

def description
  @description
end

#einString (readonly)

Returns The Employer Identification Number (EIN) of the company.

Returns:

  • (String)

    The Employer Identification Number (EIN) of the company



24
25
26
# File 'lib/rcs/types/company.rb', line 24

def ein
  @ein
end

#expected_agent_responsesString (readonly)

Returns Please provide some example messages that your agent will send.

Returns:

  • (String)

    Please provide some example messages that your agent will send.



65
66
67
# File 'lib/rcs/types/company.rb', line 65

def expected_agent_responses
  @expected_agent_responses
end

#hero_urlString (readonly)

Returns The URL of the company’s hero image.

Returns:

  • (String)

    The URL of the company’s hero image



32
33
34
# File 'lib/rcs/types/company.rb', line 32

def hero_url
  @hero_url
end

#idInteger (readonly)

Returns The unique identifier for the company.

Returns:

  • (Integer)

    The unique identifier for the company



14
15
16
# File 'lib/rcs/types/company.rb', line 14

def id
  @id
end

#logo_urlString (readonly)

Returns The URL of the company’s logo.

Returns:

  • (String)

    The URL of the company’s logo



30
31
32
# File 'lib/rcs/types/company.rb', line 30

def logo_url
  @logo_url
end

#nameString (readonly)

Returns The name of the company.

Returns:

  • (String)

    The name of the company



18
19
20
# File 'lib/rcs/types/company.rb', line 18

def name
  @name
end

#opt_inString (readonly)

Returns Explain how users will opt in to receive messages.

Returns:

  • (String)

    Explain how users will opt in to receive messages.



56
57
58
# File 'lib/rcs/types/company.rb', line 56

def opt_in
  @opt_in
end

#opt_outString (readonly)

Returns Explain how users will opt out of receiving messages.

Returns:

  • (String)

    Explain how users will opt out of receiving messages.



58
59
60
# File 'lib/rcs/types/company.rb', line 58

def opt_out
  @opt_out
end

#opt_out_keywordsArray<String> (readonly)

Returns Please provide the unique keywords to opt out. Each keyword should not contain spaces.

Returns:

  • (Array<String>)

    Please provide the unique keywords to opt out. Each keyword should not contain spaces.



61
62
63
# File 'lib/rcs/types/company.rb', line 61

def opt_out_keywords
  @opt_out_keywords
end

#poc_emailString (readonly)

Returns The email address of the point of contact.

Returns:

  • (String)

    The email address of the point of contact



54
55
56
# File 'lib/rcs/types/company.rb', line 54

def poc_email
  @poc_email
end

#poc_nameString (readonly)

Returns The name of the point of contact.

Returns:

  • (String)

    The name of the point of contact



50
51
52
# File 'lib/rcs/types/company.rb', line 50

def poc_name
  @poc_name
end

#poc_titleString (readonly)

Returns The title of the point of contact.

Returns:

  • (String)

    The title of the point of contact



52
53
54
# File 'lib/rcs/types/company.rb', line 52

def poc_title
  @poc_title
end

#primary_emailString (readonly)

Returns The primary email address of the company.

Returns:

  • (String)

    The primary email address of the company



42
43
44
# File 'lib/rcs/types/company.rb', line 42

def primary_email
  @primary_email
end

#primary_email_labelString (readonly)

Returns The label for the primary email address.

Returns:

  • (String)

    The label for the primary email address



44
45
46
# File 'lib/rcs/types/company.rb', line 44

def primary_email_label
  @primary_email_label
end

#primary_phoneString (readonly)

Returns The primary phone number of the company.

Returns:

  • (String)

    The primary phone number of the company



38
39
40
# File 'lib/rcs/types/company.rb', line 38

def primary_phone
  @primary_phone
end

#primary_phone_labelString (readonly)

Returns The label for the primary phone number.

Returns:

  • (String)

    The label for the primary phone number



40
41
42
# File 'lib/rcs/types/company.rb', line 40

def primary_phone_label
  @primary_phone_label
end

#primary_website_labelString (readonly)

Returns The label for the primary website URL.

Returns:

  • (String)

    The label for the primary website URL



36
37
38
# File 'lib/rcs/types/company.rb', line 36

def primary_website_label
  @primary_website_label
end

#primary_website_urlString (readonly)

Returns The primary website URL of the company.

Returns:

  • (String)

    The primary website URL of the company



34
35
36
# File 'lib/rcs/types/company.rb', line 34

def primary_website_url
  @primary_website_url
end

#privacy_policy_urlString (readonly)

Returns The URL of the company’s privacy policy.

Returns:

  • (String)

    The URL of the company’s privacy policy



46
47
48
# File 'lib/rcs/types/company.rb', line 46

def privacy_policy_url
  @privacy_policy_url
end

#statusString (readonly)

Returns The approval status of the company.

Returns:

  • (String)

    The approval status of the company



69
70
71
# File 'lib/rcs/types/company.rb', line 69

def status
  @status
end

#test_numbersArray<String> (readonly)

Returns A list of test phone numbers.

Returns:

  • (Array<String>)

    A list of test phone numbers



67
68
69
# File 'lib/rcs/types/company.rb', line 67

def test_numbers
  @test_numbers
end

#tos_urlString (readonly)

Returns The URL of the company’s terms of service.

Returns:

  • (String)

    The URL of the company’s terms of service



48
49
50
# File 'lib/rcs/types/company.rb', line 48

def tos_url
  @tos_url
end

Class Method Details

.from_json(json_object:) ⇒ Pinnacle::Company

Deserialize a JSON object to an instance of Company

Parameters:

  • json_object (String)

Returns:



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/rcs/types/company.rb', line 193

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
  name = parsed_json["name"]
  category = parsed_json["category"]
  address = parsed_json["address"]
  ein = parsed_json["ein"]
  description = parsed_json["description"]
  brand_color = parsed_json["brandColor"]
  logo_url = parsed_json["logoUrl"]
  hero_url = parsed_json["heroUrl"]
  primary_website_url = parsed_json["primaryWebsiteUrl"]
  primary_website_label = parsed_json["primaryWebsiteLabel"]
  primary_phone = parsed_json["primaryPhone"]
  primary_phone_label = parsed_json["primaryPhoneLabel"]
  primary_email = parsed_json["primaryEmail"]
  primary_email_label = parsed_json["primaryEmailLabel"]
  privacy_policy_url = parsed_json["privacyPolicyUrl"]
  tos_url = parsed_json["tosUrl"]
  poc_name = parsed_json["pocName"]
  poc_title = parsed_json["pocTitle"]
  poc_email = parsed_json["pocEmail"]
  opt_in = parsed_json["optIn"]
  opt_out = parsed_json["optOut"]
  opt_out_keywords = parsed_json["optOutKeywords"]
  agent_use_case = parsed_json["agentUseCase"]
  expected_agent_responses = parsed_json["expectedAgentResponses"]
  test_numbers = parsed_json["testNumbers"]
  status = parsed_json["status"]
  additional_websites = parsed_json["additionalWebsites"]&.map do |item|
    item = item.to_json
    Pinnacle::CompanyAdditionalWebsitesItem.from_json(json_object: item)
  end
  additional_emails = parsed_json["additionalEmails"]&.map do |item|
    item = item.to_json
    Pinnacle::CompanyAdditionalEmailsItem.from_json(json_object: item)
  end
  additional_phone_numbers = parsed_json["additionalPhoneNumbers"]&.map do |item|
    item = item.to_json
    Pinnacle::CompanyAdditionalPhoneNumbersItem.from_json(json_object: item)
  end
  new(
    id: id,
    created_at: created_at,
    name: name,
    category: category,
    address: address,
    ein: ein,
    description: description,
    brand_color: brand_color,
    logo_url: logo_url,
    hero_url: hero_url,
    primary_website_url: primary_website_url,
    primary_website_label: primary_website_label,
    primary_phone: primary_phone,
    primary_phone_label: primary_phone_label,
    primary_email: primary_email,
    primary_email_label: primary_email_label,
    privacy_policy_url: privacy_policy_url,
    tos_url: tos_url,
    poc_name: poc_name,
    poc_title: poc_title,
    poc_email: poc_email,
    opt_in: opt_in,
    opt_out: opt_out,
    opt_out_keywords: opt_out_keywords,
    agent_use_case: agent_use_case,
    expected_agent_responses: expected_agent_responses,
    test_numbers: test_numbers,
    status: status,
    additional_websites: additional_websites,
    additional_emails: additional_emails,
    additional_phone_numbers: additional_phone_numbers,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/rcs/types/company.rb', line 285

def self.validate_raw(obj:)
  obj.id&.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.category&.is_a?(Pinnacle::CompanyCategory) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
  obj.address&.is_a?(String) != false || raise("Passed value for field obj.address is not the expected type, validation failed.")
  obj.ein&.is_a?(String) != false || raise("Passed value for field obj.ein is not the expected type, validation failed.")
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
  obj.brand_color&.is_a?(String) != false || raise("Passed value for field obj.brand_color is not the expected type, validation failed.")
  obj.logo_url&.is_a?(String) != false || raise("Passed value for field obj.logo_url is not the expected type, validation failed.")
  obj.hero_url&.is_a?(String) != false || raise("Passed value for field obj.hero_url is not the expected type, validation failed.")
  obj.primary_website_url&.is_a?(String) != false || raise("Passed value for field obj.primary_website_url is not the expected type, validation failed.")
  obj.primary_website_label&.is_a?(String) != false || raise("Passed value for field obj.primary_website_label is not the expected type, validation failed.")
  obj.primary_phone&.is_a?(String) != false || raise("Passed value for field obj.primary_phone is not the expected type, validation failed.")
  obj.primary_phone_label&.is_a?(String) != false || raise("Passed value for field obj.primary_phone_label is not the expected type, validation failed.")
  obj.primary_email&.is_a?(String) != false || raise("Passed value for field obj.primary_email is not the expected type, validation failed.")
  obj.primary_email_label&.is_a?(String) != false || raise("Passed value for field obj.primary_email_label is not the expected type, validation failed.")
  obj.privacy_policy_url&.is_a?(String) != false || raise("Passed value for field obj.privacy_policy_url is not the expected type, validation failed.")
  obj.tos_url&.is_a?(String) != false || raise("Passed value for field obj.tos_url is not the expected type, validation failed.")
  obj.poc_name&.is_a?(String) != false || raise("Passed value for field obj.poc_name is not the expected type, validation failed.")
  obj.poc_title&.is_a?(String) != false || raise("Passed value for field obj.poc_title is not the expected type, validation failed.")
  obj.poc_email&.is_a?(String) != false || raise("Passed value for field obj.poc_email is not the expected type, validation failed.")
  obj.opt_in&.is_a?(String) != false || raise("Passed value for field obj.opt_in is not the expected type, validation failed.")
  obj.opt_out&.is_a?(String) != false || raise("Passed value for field obj.opt_out is not the expected type, validation failed.")
  obj.opt_out_keywords&.is_a?(Array) != false || raise("Passed value for field obj.opt_out_keywords is not the expected type, validation failed.")
  obj.agent_use_case&.is_a?(String) != false || raise("Passed value for field obj.agent_use_case is not the expected type, validation failed.")
  obj.expected_agent_responses&.is_a?(String) != false || raise("Passed value for field obj.expected_agent_responses is not the expected type, validation failed.")
  obj.test_numbers&.is_a?(Array) != false || raise("Passed value for field obj.test_numbers is not the expected type, validation failed.")
  obj.status&.is_a?(String) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
  obj.additional_websites&.is_a?(Array) != false || raise("Passed value for field obj.additional_websites is not the expected type, validation failed.")
  obj.additional_emails&.is_a?(Array) != false || raise("Passed value for field obj.additional_emails is not the expected type, validation failed.")
  obj.additional_phone_numbers&.is_a?(Array) != false || raise("Passed value for field obj.additional_phone_numbers is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of Company to a JSON object

Returns:

  • (String)


275
276
277
# File 'lib/rcs/types/company.rb', line 275

def to_json(*_args)
  @_field_set&.to_json
end