Class: Gusto::Companies::CompanyPrimaryPayrollAdmin
- Inherits:
-
Object
- Object
- Gusto::Companies::CompanyPrimaryPayrollAdmin
- Defined in:
- lib/fern_gusto/companies/types/company_primary_payroll_admin.rb
Overview
The primary payroll admin 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
- #last_name ⇒ String readonly
- #phone ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(first_name: OMIT, last_name: OMIT, phone: OMIT, email: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompanyPrimaryPayrollAdmin constructor
- #to_json ⇒ String
Constructor Details
#initialize(first_name: OMIT, last_name: OMIT, phone: OMIT, email: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompanyPrimaryPayrollAdmin
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/fern_gusto/companies/types/company_primary_payroll_admin.rb', line 31 def initialize(first_name: OMIT, last_name: OMIT, phone: OMIT, email: OMIT, additional_properties: nil) @first_name = first_name if first_name != OMIT @last_name = last_name if last_name != OMIT @phone = phone if phone != OMIT @email = email if email != OMIT @additional_properties = additional_properties @_field_set = { "first_name": first_name, "last_name": last_name, "phone": phone, "email": email }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/fern_gusto/companies/types/company_primary_payroll_admin.rb', line 18 def additional_properties @additional_properties end |
#email ⇒ String (readonly)
16 17 18 |
# File 'lib/fern_gusto/companies/types/company_primary_payroll_admin.rb', line 16 def email @email end |
#first_name ⇒ String (readonly)
10 11 12 |
# File 'lib/fern_gusto/companies/types/company_primary_payroll_admin.rb', line 10 def first_name @first_name end |
#last_name ⇒ String (readonly)
12 13 14 |
# File 'lib/fern_gusto/companies/types/company_primary_payroll_admin.rb', line 12 def last_name @last_name end |
#phone ⇒ String (readonly)
14 15 16 |
# File 'lib/fern_gusto/companies/types/company_primary_payroll_admin.rb', line 14 def phone @phone end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::Companies::CompanyPrimaryPayrollAdmin
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/fern_gusto/companies/types/company_primary_payroll_admin.rb', line 45 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"] last_name = parsed_json["last_name"] phone = parsed_json["phone"] email = parsed_json["email"] new( first_name: first_name, last_name: last_name, phone: phone, email: email, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
72 73 74 75 76 77 |
# File 'lib/fern_gusto/companies/types/company_primary_payroll_admin.rb', line 72 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.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.") end |
Instance Method Details
#to_json ⇒ String
63 64 65 |
# File 'lib/fern_gusto/companies/types/company_primary_payroll_admin.rb', line 63 def to_json @_field_set&.to_json end |