Class: Gusto::UnprocessableEntityErrorBodyErrors

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/types/unprocessable_entity_error_body_errors.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base: OMIT, additional_properties: nil) ⇒ Gusto::UnprocessableEntityErrorBodyErrors

Parameters:



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#baseArray<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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

  • (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_jsonString

Returns:

  • (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