Class: Gusto::Companies::CompanyPrimaryPayrollAdmin

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(first_name: OMIT, last_name: OMIT, phone: OMIT, email: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompanyPrimaryPayrollAdmin

Parameters:

  • first_name (String) (defaults to: OMIT)
  • last_name (String) (defaults to: OMIT)
  • phone (String) (defaults to: OMIT)
  • email (String) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#emailString (readonly)

Returns:

  • (String)


16
17
18
# File 'lib/fern_gusto/companies/types/company_primary_payroll_admin.rb', line 16

def email
  @email
end

#first_nameString (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/fern_gusto/companies/types/company_primary_payroll_admin.rb', line 10

def first_name
  @first_name
end

#last_nameString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/fern_gusto/companies/types/company_primary_payroll_admin.rb', line 12

def last_name
  @last_name
end

#phoneString (readonly)

Returns:

  • (String)


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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

  • (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_jsonString

Returns:

  • (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