Class: Gusto::PayrollCompanyTaxesTypeItem
- Inherits:
-
Object
- Object
- Gusto::PayrollCompanyTaxesTypeItem
- Defined in:
- lib/fern_gusto/types/payroll_company_taxes_type_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 this tax for the payroll.
-
#employer ⇒ Boolean
readonly
Whether this tax is an employer or employee tax.
-
#name ⇒ String
readonly
The tax name.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(name: OMIT, employer: OMIT, amount: OMIT, additional_properties: nil) ⇒ Gusto::PayrollCompanyTaxesTypeItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(name: OMIT, employer: OMIT, amount: OMIT, additional_properties: nil) ⇒ Gusto::PayrollCompanyTaxesTypeItem
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_properties ⇒ OpenStruct (readonly)
Returns 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 |
#amount ⇒ String (readonly)
Returns 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 |
#employer ⇒ Boolean (readonly)
Returns 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 |
#name ⇒ String (readonly)
Returns 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
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
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_json ⇒ 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 |