Class: Gusto::Companies::CompanyPrimarySignatory
- Inherits:
-
Object
- Object
- Gusto::Companies::CompanyPrimarySignatory
- Defined in:
- lib/fern_gusto/companies/types/company_primary_signatory.rb
Overview
The primary signatory of the company.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #email ⇒ String readonly
- #first_name ⇒ String readonly
- #home_address ⇒ Gusto::Companies::CompanyPrimarySignatoryHomeAddress readonly
- #last_name ⇒ String readonly
- #middle_initial ⇒ String readonly
- #phone ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(first_name: OMIT, middle_initial: OMIT, last_name: OMIT, phone: OMIT, email: OMIT, home_address: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompanyPrimarySignatory constructor
- #to_json ⇒ String
Constructor Details
#initialize(first_name: OMIT, middle_initial: OMIT, last_name: OMIT, phone: OMIT, email: OMIT, home_address: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompanyPrimarySignatory
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory.rb', line 38 def initialize(first_name: OMIT, middle_initial: OMIT, last_name: OMIT, phone: OMIT, email: OMIT, home_address: OMIT, additional_properties: nil) @first_name = first_name if first_name != OMIT @middle_initial = middle_initial if middle_initial != OMIT @last_name = last_name if last_name != OMIT @phone = phone if phone != OMIT @email = email if email != OMIT @home_address = home_address if home_address != OMIT @additional_properties = additional_properties @_field_set = { "first_name": first_name, "middle_initial": middle_initial, "last_name": last_name, "phone": phone, "email": email, "home_address": home_address }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
23 24 25 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory.rb', line 23 def additional_properties @additional_properties end |
#email ⇒ String (readonly)
19 20 21 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory.rb', line 19 def email @email end |
#first_name ⇒ String (readonly)
11 12 13 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory.rb', line 11 def first_name @first_name end |
#home_address ⇒ Gusto::Companies::CompanyPrimarySignatoryHomeAddress (readonly)
21 22 23 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory.rb', line 21 def home_address @home_address end |
#last_name ⇒ String (readonly)
15 16 17 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory.rb', line 15 def last_name @last_name end |
#middle_initial ⇒ String (readonly)
13 14 15 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory.rb', line 13 def middle_initial @middle_initial end |
#phone ⇒ String (readonly)
17 18 19 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory.rb', line 17 def phone @phone end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::Companies::CompanyPrimarySignatory
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory.rb', line 54 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) first_name = parsed_json["first_name"] middle_initial = parsed_json["middle_initial"] last_name = parsed_json["last_name"] phone = parsed_json["phone"] email = parsed_json["email"] unless parsed_json["home_address"].nil? home_address = parsed_json["home_address"].to_json home_address = Gusto::Companies::CompanyPrimarySignatoryHomeAddress.from_json(json_object: home_address) else home_address = nil end new( first_name: first_name, middle_initial: middle_initial, last_name: last_name, phone: phone, email: email, home_address: home_address, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
90 91 92 93 94 95 96 97 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory.rb', line 90 def self.validate_raw(obj:) obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.") obj.middle_initial&.is_a?(String) != false || raise("Passed value for field obj.middle_initial is not the expected type, validation failed.") obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.") obj.phone&.is_a?(String) != false || raise("Passed value for field obj.phone is not the expected type, validation failed.") obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.") obj.home_address.nil? || Gusto::Companies::CompanyPrimarySignatoryHomeAddress.validate_raw(obj: obj.home_address) end |
Instance Method Details
#to_json ⇒ String
81 82 83 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory.rb', line 81 def to_json @_field_set&.to_json end |