Class: Gusto::UnprocessableEntityErrorBodyErrorsBaseItem

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type: OMIT, message: OMIT, full_message: OMIT, additional_properties: nil) ⇒ Gusto::UnprocessableEntityErrorBodyErrorsBaseItem

Parameters:

  • type (String) (defaults to: OMIT)
  • message (String) (defaults to: OMIT)
  • full_message (String) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



26
27
28
29
30
31
32
33
34
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors_base_item.rb', line 26

def initialize(type: OMIT, message: OMIT, full_message: OMIT, additional_properties: nil)
  @type = type if type != OMIT
  @message = message if message != OMIT
  @full_message = full_message if full_message != OMIT
  @additional_properties = additional_properties
  @_field_set = { "type": type, "message": message, "full_message": full_message }.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



14
15
16
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors_base_item.rb', line 14

def additional_properties
  @additional_properties
end

#full_messageString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors_base_item.rb', line 12

def full_message
  @full_message
end

#messageString (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors_base_item.rb', line 10

def message
  @message
end

#typeString (readonly)

Returns:

  • (String)


8
9
10
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors_base_item.rb', line 8

def type
  @type
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::UnprocessableEntityErrorBodyErrorsBaseItem

Parameters:

  • json_object (String)

Returns:



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors_base_item.rb', line 40

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  type = parsed_json["type"]
  message = parsed_json["message"]
  full_message = parsed_json["full_message"]
  new(
    type: type,
    message: message,
    full_message: full_message,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


66
67
68
69
70
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors_base_item.rb', line 66

def self.validate_raw(obj:)
  obj.type&.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
  obj.message&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
  obj.full_message&.is_a?(String) != false || raise("Passed value for field obj.full_message is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


57
58
59
# File 'lib/fern_gusto/types/unprocessable_entity_error_body_errors_base_item.rb', line 57

def to_json
  @_field_set&.to_json
end