Class: Gusto::Companies::ExternalPayrolls::ExternalPayrollsUpdateRequestExternalPayrollItemsItemTaxesItem
- Inherits:
-
Object
- Object
- Gusto::Companies::ExternalPayrolls::ExternalPayrollsUpdateRequestExternalPayrollItemsItemTaxesItem
- 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
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#amount ⇒ String
readonly
The amount of the tax.
-
#tax_id ⇒ Integer
readonly
The ID of the tax.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::Companies::ExternalPayrolls::ExternalPayrollsUpdateRequestExternalPayrollItemsItemTaxesItem
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(amount: OMIT, tax_id: OMIT, additional_properties: nil) ⇒ Gusto::Companies::ExternalPayrolls::ExternalPayrollsUpdateRequestExternalPayrollItemsItemTaxesItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(amount: OMIT, tax_id: OMIT, additional_properties: nil) ⇒ Gusto::Companies::ExternalPayrolls::ExternalPayrollsUpdateRequestExternalPayrollItemsItemTaxesItem
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_properties ⇒ OpenStruct (readonly)
Returns 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 |
#amount ⇒ String (readonly)
Returns 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_id ⇒ Integer (readonly)
Returns 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
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_json ⇒ 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 |