Class: Gusto::TaxRequirementSet
- Inherits:
-
Object
- Object
- Gusto::TaxRequirementSet
- Defined in:
- lib/fern_gusto/types/tax_requirement_set.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #effective_from ⇒ Gusto::TAX_REQUIREMENT_EFFECTIVE_FROM readonly
- #key ⇒ String readonly
-
#label ⇒ String
readonly
Customer facing label for the requirement set, e.g.
- #requirements ⇒ Array<Gusto::TaxRequirement> readonly
- #state ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(state: OMIT, key: OMIT, label: OMIT, effective_from: OMIT, requirements: OMIT, additional_properties: nil) ⇒ Gusto::TaxRequirementSet constructor
- #to_json ⇒ String
Constructor Details
#initialize(state: OMIT, key: OMIT, label: OMIT, effective_from: OMIT, requirements: OMIT, additional_properties: nil) ⇒ Gusto::TaxRequirementSet
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/fern_gusto/types/tax_requirement_set.rb', line 35 def initialize(state: OMIT, key: OMIT, label: OMIT, effective_from: OMIT, requirements: OMIT, additional_properties: nil) @state = state if state != OMIT @key = key if key != OMIT @label = label if label != OMIT @effective_from = effective_from if effective_from != OMIT @requirements = requirements if requirements != OMIT @additional_properties = additional_properties @_field_set = { "state": state, "key": key, "label": label, "effective_from": effective_from, "requirements": requirements }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/fern_gusto/types/tax_requirement_set.rb', line 21 def additional_properties @additional_properties end |
#effective_from ⇒ Gusto::TAX_REQUIREMENT_EFFECTIVE_FROM (readonly)
17 18 19 |
# File 'lib/fern_gusto/types/tax_requirement_set.rb', line 17 def effective_from @effective_from end |
#key ⇒ String (readonly)
13 14 15 |
# File 'lib/fern_gusto/types/tax_requirement_set.rb', line 13 def key @key end |
#label ⇒ String (readonly)
Returns Customer facing label for the requirement set, e.g. “Registrations”.
15 16 17 |
# File 'lib/fern_gusto/types/tax_requirement_set.rb', line 15 def label @label end |
#requirements ⇒ Array<Gusto::TaxRequirement> (readonly)
19 20 21 |
# File 'lib/fern_gusto/types/tax_requirement_set.rb', line 19 def requirements @requirements end |
#state ⇒ String (readonly)
11 12 13 |
# File 'lib/fern_gusto/types/tax_requirement_set.rb', line 11 def state @state end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::TaxRequirementSet
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/fern_gusto/types/tax_requirement_set.rb', line 50 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) state = parsed_json["state"] key = parsed_json["key"] label = parsed_json["label"] effective_from = parsed_json["effective_from"] requirements = parsed_json["requirements"]&.map do | item | item = item.to_json Gusto::TaxRequirement.from_json(json_object: item) end new( state: state, key: key, label: label, effective_from: effective_from, requirements: requirements, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
82 83 84 85 86 87 88 |
# File 'lib/fern_gusto/types/tax_requirement_set.rb', line 82 def self.validate_raw(obj:) obj.state&.is_a?(String) != false || raise("Passed value for field obj.state is not the expected type, validation failed.") obj.key&.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.") obj.label&.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.") obj.effective_from&.is_a?(String) != false || raise("Passed value for field obj.effective_from is not the expected type, validation failed.") obj.requirements&.is_a?(Array) != false || raise("Passed value for field obj.requirements is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
73 74 75 |
# File 'lib/fern_gusto/types/tax_requirement_set.rb', line 73 def to_json @_field_set&.to_json end |