Class: Gusto::ExternalPayrolls::ExternalPayrollApplicableTaxesItem

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: OMIT, name: OMIT, employer_tax: OMIT, resident_tax: OMIT, additional_properties: nil) ⇒ Gusto::ExternalPayrolls::ExternalPayrollApplicableTaxesItem

Parameters:

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



36
37
38
39
40
41
42
43
44
45
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 36

def initialize(id: OMIT, name: OMIT, employer_tax: OMIT, resident_tax: OMIT, additional_properties: nil)
  @id = id if id != OMIT
  @name = name if name != OMIT
  @employer_tax = employer_tax if employer_tax != OMIT
  @resident_tax = resident_tax if resident_tax != OMIT
  @additional_properties = additional_properties
  @_field_set = { "id": id, "name": name, "employer_tax": employer_tax, "resident_tax": resident_tax }.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



20
21
22
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 20

def additional_properties
  @additional_properties
end

#employer_taxObject (readonly)

employer’s amount.



15
16
17
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 15

def employer_tax
  @employer_tax
end

#idInteger (readonly)

Returns:

  • (Integer)


9
10
11
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 9

def id
  @id
end

#nameString (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 11

def name
  @name
end

#resident_taxObject (readonly)

the employee is a resident or non-resident of the tax jurisdiction.



18
19
20
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 18

def resident_tax
  @resident_tax
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::ExternalPayrolls::ExternalPayrollApplicableTaxesItem

Parameters:

  • json_object (String)

Returns:



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 50

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  name = parsed_json["name"]
  employer_tax = parsed_json["employer_tax"]
  resident_tax = parsed_json["resident_tax"]
  new(
    id: id,
    name: name,
    employer_tax: employer_tax,
    resident_tax: resident_tax,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


77
78
79
80
81
82
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 77

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.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.employer_tax&.is_a?(Boolean) != false || raise("Passed value for field obj.employer_tax is not the expected type, validation failed.")
  obj.resident_tax&.is_a?(Boolean) != false || raise("Passed value for field obj.resident_tax is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


68
69
70
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_applicable_taxes_item.rb', line 68

def to_json
  @_field_set&.to_json
end