Class: Gusto::TaxRequirementMetadataOptionsItem
- Inherits:
-
Object
- Object
- Gusto::TaxRequirementMetadataOptionsItem
- Defined in:
- lib/fern_gusto/types/tax_requirement_metadata_options_item.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#label ⇒ String
readonly
A customer facing label for the answer.
-
#short_label ⇒ String
readonly
A less verbose label that may sometimes be available.
-
#value ⇒ String
readonly
The actual value to be submitted.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(label:, value:, short_label: OMIT, additional_properties: nil) ⇒ Gusto::TaxRequirementMetadataOptionsItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(label:, value:, short_label: OMIT, additional_properties: nil) ⇒ Gusto::TaxRequirementMetadataOptionsItem
26 27 28 29 30 31 32 33 34 |
# File 'lib/fern_gusto/types/tax_requirement_metadata_options_item.rb', line 26 def initialize(label:, value:, short_label: OMIT, additional_properties: nil) @label = label @value = value @short_label = short_label if short_label != OMIT @additional_properties = additional_properties @_field_set = { "label": label, "value": value, "short_label": short_label }.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/tax_requirement_metadata_options_item.rb', line 14 def additional_properties @additional_properties end |
#label ⇒ String (readonly)
Returns A customer facing label for the answer.
8 9 10 |
# File 'lib/fern_gusto/types/tax_requirement_metadata_options_item.rb', line 8 def label @label end |
#short_label ⇒ String (readonly)
Returns A less verbose label that may sometimes be available.
12 13 14 |
# File 'lib/fern_gusto/types/tax_requirement_metadata_options_item.rb', line 12 def short_label @short_label end |
#value ⇒ String (readonly)
Returns The actual value to be submitted.
10 11 12 |
# File 'lib/fern_gusto/types/tax_requirement_metadata_options_item.rb', line 10 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::TaxRequirementMetadataOptionsItem
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/fern_gusto/types/tax_requirement_metadata_options_item.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) label = parsed_json["label"] value = parsed_json["value"] short_label = parsed_json["short_label"] new( label: label, value: value, short_label: short_label, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
64 65 66 67 68 |
# File 'lib/fern_gusto/types/tax_requirement_metadata_options_item.rb', line 64 def self.validate_raw(obj:) obj.label.is_a?(String) != false || raise("Passed value for field obj.label 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.short_label&.is_a?(String) != false || raise("Passed value for field obj.short_label is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
55 56 57 |
# File 'lib/fern_gusto/types/tax_requirement_metadata_options_item.rb', line 55 def to_json @_field_set&.to_json end |