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, 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, 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

  • 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

  • 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



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
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
# File 'lib/rcs/types/company.rb', line 97

def initialize(id: OMIT, created_at: OMIT, name: 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, 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
  @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
  @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,
    "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,
    "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:



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

def additional_emails
  @additional_emails
end

#additional_phone_numbersArray<Pinnacle::CompanyAdditionalPhoneNumbersItem> (readonly)

Returns A list of additional phone numbers.

Returns:



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

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



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

def additional_properties
  @additional_properties
end

#additional_websitesArray<Pinnacle::CompanyAdditionalWebsitesItem> (readonly)

Returns A list of additional websites.

Returns:



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

def additional_websites
  @additional_websites
end

#addressString (readonly)

Returns The address of the company.

Returns:

  • (String)

    The address of the company



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

def address
  @address
end

#brand_colorString (readonly)

Returns The brand color of the company.

Returns:

  • (String)

    The brand color of the company



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

def brand_color
  @brand_color
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



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

def created_at
  @created_at
end

#descriptionString (readonly)

Returns A description of the company.

Returns:

  • (String)

    A description of the company



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

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



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

def ein
  @ein
end

#hero_urlString (readonly)

Returns The URL of the company’s hero image.

Returns:

  • (String)

    The URL of the company’s hero image



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

def hero_url
  @hero_url
end

#idInteger (readonly)

Returns The unique identifier for the company.

Returns:

  • (Integer)

    The unique identifier for the company



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

def id
  @id
end

#logo_urlString (readonly)

Returns The URL of the company’s logo.

Returns:

  • (String)

    The URL of the company’s logo



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

def logo_url
  @logo_url
end

#nameString (readonly)

Returns The name of the company.

Returns:

  • (String)

    The name of the company



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

def name
  @name
end

#poc_emailString (readonly)

Returns The email address of the point of contact.

Returns:

  • (String)

    The email address of the point of contact



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

def status
  @status
end

#test_numbersArray<String> (readonly)

Returns A list of test phone numbers.

Returns:

  • (Array<String>)

    A list of test phone numbers



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

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



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

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:



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
188
189
190
191
192
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
# File 'lib/rcs/types/company.rb', line 160

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"]
  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"]
  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,
    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,
    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)


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
# File 'lib/rcs/types/company.rb', line 240

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.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.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)


230
231
232
# File 'lib/rcs/types/company.rb', line 230

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