Class: Gusto::TaxRequirement
- Inherits:
-
Object
- Object
- Gusto::TaxRequirement
- Defined in:
- lib/fern_gusto/types/tax_requirement.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#applicable_if ⇒ Object
readonly
means the requirement is applicable.
-
#description ⇒ String
readonly
A more detailed customer facing description of the requirement.
- #key ⇒ String readonly
-
#label ⇒ String
readonly
A customer facing description of the requirement.
- #metadata ⇒ Gusto::TaxRequirementMetadata readonly
-
#value ⇒ String
readonly
The “answer”.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(key: OMIT, applicable_if: OMIT, label: OMIT, description: OMIT, value: OMIT, metadata: OMIT, additional_properties: nil) ⇒ Gusto::TaxRequirement constructor
- #to_json ⇒ String
Constructor Details
#initialize(key: OMIT, applicable_if: OMIT, label: OMIT, description: OMIT, value: OMIT, metadata: OMIT, additional_properties: nil) ⇒ Gusto::TaxRequirement
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fern_gusto/types/tax_requirement.rb', line 47 def initialize(key: OMIT, applicable_if: OMIT, label: OMIT, description: OMIT, value: OMIT, metadata: OMIT, additional_properties: nil) @key = key if key != OMIT @applicable_if = applicable_if if applicable_if != OMIT @label = label if label != OMIT @description = description if description != OMIT @value = value if value != OMIT @metadata = if != OMIT @additional_properties = additional_properties @_field_set = { "key": key, "applicable_if": applicable_if, "label": label, "description": description, "value": value, "metadata": }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
27 28 29 |
# File 'lib/fern_gusto/types/tax_requirement.rb', line 27 def additional_properties @additional_properties end |
#applicable_if ⇒ Object (readonly)
means the requirement is applicable.
17 18 19 |
# File 'lib/fern_gusto/types/tax_requirement.rb', line 17 def applicable_if @applicable_if end |
#description ⇒ String (readonly)
Returns A more detailed customer facing description of the requirement.
21 22 23 |
# File 'lib/fern_gusto/types/tax_requirement.rb', line 21 def description @description end |
#key ⇒ String (readonly)
10 11 12 |
# File 'lib/fern_gusto/types/tax_requirement.rb', line 10 def key @key end |
#label ⇒ String (readonly)
Returns A customer facing description of the requirement.
19 20 21 |
# File 'lib/fern_gusto/types/tax_requirement.rb', line 19 def label @label end |
#metadata ⇒ Gusto::TaxRequirementMetadata (readonly)
25 26 27 |
# File 'lib/fern_gusto/types/tax_requirement.rb', line 25 def @metadata end |
#value ⇒ String (readonly)
Returns The “answer”.
23 24 25 |
# File 'lib/fern_gusto/types/tax_requirement.rb', line 23 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::TaxRequirement
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/fern_gusto/types/tax_requirement.rb', line 63 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) key = parsed_json["key"] applicable_if = parsed_json["applicable_if"]&.map do | item | item = item.to_json Gusto::TaxRequirementApplicableIfItem.from_json(json_object: item) end label = parsed_json["label"] description = parsed_json["description"] value = parsed_json["value"] unless parsed_json["metadata"].nil? = parsed_json["metadata"].to_json = Gusto::TaxRequirementMetadata.from_json(json_object: ) else = nil end new( key: key, applicable_if: applicable_if, label: label, description: description, value: value, metadata: , additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
102 103 104 105 106 107 108 109 |
# File 'lib/fern_gusto/types/tax_requirement.rb', line 102 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.applicable_if&.is_a?(Array) != false || raise("Passed value for field obj.applicable_if 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.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") obj.value&.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") obj..nil? || Gusto::TaxRequirementMetadata.validate_raw(obj: obj.) end |
Instance Method Details
#to_json ⇒ String
93 94 95 |
# File 'lib/fern_gusto/types/tax_requirement.rb', line 93 def to_json @_field_set&.to_json end |