Class: Gusto::TaxRequirementApplicableIfItem
- Inherits:
-
Object
- Object
- Gusto::TaxRequirementApplicableIfItem
- Defined in:
- lib/fern_gusto/types/tax_requirement_applicable_if_item.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #key ⇒ String readonly
-
#value ⇒ Gusto::TaxRequirementApplicableIfItemValue
readonly
The required value of the requirement identified by ‘key`.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(key: OMIT, value: OMIT, additional_properties: nil) ⇒ Gusto::TaxRequirementApplicableIfItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(key: OMIT, value: OMIT, additional_properties: nil) ⇒ Gusto::TaxRequirementApplicableIfItem
24 25 26 27 28 29 30 31 |
# File 'lib/fern_gusto/types/tax_requirement_applicable_if_item.rb', line 24 def initialize(key: OMIT, value: OMIT, additional_properties: nil) @key = key if key != OMIT @value = value if value != OMIT @additional_properties = additional_properties @_field_set = { "key": key, "value": value }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
13 14 15 |
# File 'lib/fern_gusto/types/tax_requirement_applicable_if_item.rb', line 13 def additional_properties @additional_properties end |
#key ⇒ String (readonly)
9 10 11 |
# File 'lib/fern_gusto/types/tax_requirement_applicable_if_item.rb', line 9 def key @key end |
#value ⇒ Gusto::TaxRequirementApplicableIfItemValue (readonly)
Returns The required value of the requirement identified by ‘key`.
11 12 13 |
# File 'lib/fern_gusto/types/tax_requirement_applicable_if_item.rb', line 11 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::TaxRequirementApplicableIfItem
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/fern_gusto/types/tax_requirement_applicable_if_item.rb', line 36 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) key = parsed_json["key"] unless parsed_json["value"].nil? value = parsed_json["value"].to_json value = Gusto::TaxRequirementApplicableIfItemValue.from_json(json_object: value) else value = nil end new( key: key, value: value, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
64 65 66 67 |
# File 'lib/fern_gusto/types/tax_requirement_applicable_if_item.rb', line 64 def self.validate_raw(obj:) obj.key&.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.") obj.value.nil? || Gusto::TaxRequirementApplicableIfItemValue.validate_raw(obj: obj.value) end |
Instance Method Details
#to_json ⇒ String
55 56 57 |
# File 'lib/fern_gusto/types/tax_requirement_applicable_if_item.rb', line 55 def to_json @_field_set&.to_json end |