Class: Gusto::PayrollCompanyTaxesTypeItem

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: OMIT, employer: OMIT, amount: OMIT, additional_properties: nil) ⇒ Gusto::PayrollCompanyTaxesTypeItem

Parameters:

  • name (String) (defaults to: OMIT)

    The tax name

  • employer (Boolean) (defaults to: OMIT)

    Whether this tax is an employer or employee tax

  • amount (String) (defaults to: OMIT)

    The amount of this tax for the payroll

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



26
27
28
29
30
31
32
33
34
# File 'lib/fern_gusto/types/payroll_company_taxes_type_item.rb', line 26

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



14
15
16
# File 'lib/fern_gusto/types/payroll_company_taxes_type_item.rb', line 14

def additional_properties
  @additional_properties
end

#amountString (readonly)

Returns The amount of this tax for the payroll.

Returns:

  • (String)

    The amount of this tax for the payroll



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

def amount
  @amount
end

#employerBoolean (readonly)

Returns Whether this tax is an employer or employee tax.

Returns:

  • (Boolean)

    Whether this tax is an employer or employee tax



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

def employer
  @employer
end

#nameString (readonly)

Returns The tax name.

Returns:

  • (String)

    The tax name



8
9
10
# File 'lib/fern_gusto/types/payroll_company_taxes_type_item.rb', line 8

def name
  @name
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::PayrollCompanyTaxesTypeItem

Parameters:

  • json_object (String)

Returns:



39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/fern_gusto/types/payroll_company_taxes_type_item.rb', line 39

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

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


64
65
66
67
68
# File 'lib/fern_gusto/types/payroll_company_taxes_type_item.rb', line 64

def self.validate_raw(obj:)
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.employer&.is_a?(Boolean) != false || raise("Passed value for field obj.employer is not the expected type, validation failed.")
  obj.amount&.is_a?(String) != false || raise("Passed value for field obj.amount is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


55
56
57
# File 'lib/fern_gusto/types/payroll_company_taxes_type_item.rb', line 55

def to_json
  @_field_set&.to_json
end