Class: Gusto::UnprocessableEntityErrorBodyErrors
- Inherits:
-
Object
- Object
- Gusto::UnprocessableEntityErrorBodyErrors
- Defined in:
- lib/fern_gusto/types/unprocessable_entity_error_body_errors.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #base ⇒ Array<Gusto::UnprocessableEntityErrorBodyErrorsBaseItem> readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(base: OMIT, additional_properties: nil) ⇒ Gusto::UnprocessableEntityErrorBodyErrors constructor
- #to_json ⇒ String
Constructor Details
#initialize(base: OMIT, additional_properties: nil) ⇒ Gusto::UnprocessableEntityErrorBodyErrors
21 22 23 24 25 26 27 |
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors.rb', line 21 def initialize(base: OMIT, additional_properties: nil) @base = base if base != OMIT @additional_properties = additional_properties @_field_set = { "base": base }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
11 12 13 |
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors.rb', line 11 def additional_properties @additional_properties end |
#base ⇒ Array<Gusto::UnprocessableEntityErrorBodyErrorsBaseItem> (readonly)
9 10 11 |
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors.rb', line 9 def base @base end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::UnprocessableEntityErrorBodyErrors
32 33 34 35 36 37 38 39 40 |
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors.rb', line 32 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) base = parsed_json["base"]&.map do | item | item = item.to_json Gusto::UnprocessableEntityErrorBodyErrorsBaseItem.from_json(json_object: item) end new(base: base, additional_properties: struct) end |
.validate_raw(obj:) ⇒ Void
53 54 55 |
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors.rb', line 53 def self.validate_raw(obj:) obj.base&.is_a?(Array) != false || raise("Passed value for field obj.base is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
44 45 46 |
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors.rb', line 44 def to_json @_field_set&.to_json end |