Class: Gusto::Companies::ExternalPayrolls::ExternalPayrollsUpdateRequestExternalPayrollItemsItemTaxesItem

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(amount: OMIT, tax_id: OMIT, additional_properties: nil) ⇒ Gusto::Companies::ExternalPayrolls::ExternalPayrollsUpdateRequestExternalPayrollItemsItemTaxesItem

Parameters:

  • amount (String) (defaults to: OMIT)

    The amount of the tax.

  • tax_id (Integer) (defaults to: OMIT)

    The ID of the tax.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



25
26
27
28
29
30
31
32
# File 'lib/fern_gusto/companies/external_payrolls/types/external_payrolls_update_request_external_payroll_items_item_taxes_item.rb', line 25

def initialize(amount: OMIT, tax_id: OMIT, additional_properties: nil)
  @amount = amount if amount != OMIT
  @tax_id = tax_id if tax_id != OMIT
  @additional_properties = additional_properties
  @_field_set = { "amount": amount, "tax_id": tax_id }.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/companies/external_payrolls/types/external_payrolls_update_request_external_payroll_items_item_taxes_item.rb', line 14

def additional_properties
  @additional_properties
end

#amountString (readonly)

Returns The amount of the tax.

Returns:

  • (String)

    The amount of the tax.



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

def amount
  @amount
end

#tax_idInteger (readonly)

Returns The ID of the tax.

Returns:

  • (Integer)

    The ID of the tax.



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

def tax_id
  @tax_id
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::Companies::ExternalPayrolls::ExternalPayrollsUpdateRequestExternalPayrollItemsItemTaxesItem



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/fern_gusto/companies/external_payrolls/types/external_payrolls_update_request_external_payroll_items_item_taxes_item.rb', line 38

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

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


62
63
64
65
# File 'lib/fern_gusto/companies/external_payrolls/types/external_payrolls_update_request_external_payroll_items_item_taxes_item.rb', line 62

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

Instance Method Details

#to_jsonString

Returns:

  • (String)


53
54
55
# File 'lib/fern_gusto/companies/external_payrolls/types/external_payrolls_update_request_external_payroll_items_item_taxes_item.rb', line 53

def to_json
  @_field_set&.to_json
end