Class: Gusto::EntityErrorObjectErrorsItem
- Inherits:
-
Object
- Object
- Gusto::EntityErrorObjectErrorsItem
- Defined in:
- lib/fern_gusto/types/entity_error_object_errors_item.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#category ⇒ Object
readonly
errors.
-
#error_key ⇒ Object
readonly
attribute/parameter related to the error.
-
#message ⇒ Object
readonly
end user.
-
#metadata ⇒ Object
readonly
example, to identify an entity ‘entity_type` and `entity_uuid` will be provided.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(error_key: OMIT, category: OMIT, message: OMIT, metadata: OMIT, additional_properties: nil) ⇒ Gusto::EntityErrorObjectErrorsItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(error_key: OMIT, category: OMIT, message: OMIT, metadata: OMIT, additional_properties: nil) ⇒ Gusto::EntityErrorObjectErrorsItem
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/fern_gusto/types/entity_error_object_errors_item.rb', line 41 def initialize(error_key: OMIT, category: OMIT, message: OMIT, metadata: OMIT, additional_properties: nil) @error_key = error_key if error_key != OMIT @category = category if category != OMIT @message = if != OMIT @metadata = if != OMIT @additional_properties = additional_properties @_field_set = { "error_key": error_key, "category": category, "message": , "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.
22 23 24 |
# File 'lib/fern_gusto/types/entity_error_object_errors_item.rb', line 22 def additional_properties @additional_properties end |
#category ⇒ Object (readonly)
errors.
14 15 16 |
# File 'lib/fern_gusto/types/entity_error_object_errors_item.rb', line 14 def category @category end |
#error_key ⇒ Object (readonly)
attribute/parameter related to the error.
9 10 11 |
# File 'lib/fern_gusto/types/entity_error_object_errors_item.rb', line 9 def error_key @error_key end |
#message ⇒ Object (readonly)
end user.
17 18 19 |
# File 'lib/fern_gusto/types/entity_error_object_errors_item.rb', line 17 def @message end |
#metadata ⇒ Object (readonly)
example, to identify an entity ‘entity_type` and `entity_uuid` will be provided.
20 21 22 |
# File 'lib/fern_gusto/types/entity_error_object_errors_item.rb', line 20 def @metadata end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::EntityErrorObjectErrorsItem
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/fern_gusto/types/entity_error_object_errors_item.rb', line 55 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) error_key = parsed_json["error_key"] category = parsed_json["category"] = parsed_json["message"] = parsed_json["metadata"] new( error_key: error_key, category: category, message: , metadata: , additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
82 83 84 85 86 87 |
# File 'lib/fern_gusto/types/entity_error_object_errors_item.rb', line 82 def self.validate_raw(obj:) obj.error_key&.is_a?(String) != false || raise("Passed value for field obj.error_key is not the expected type, validation failed.") obj.category&.is_a?(String) != false || raise("Passed value for field obj.category is not the expected type, validation failed.") obj.&.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.") obj.&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
73 74 75 |
# File 'lib/fern_gusto/types/entity_error_object_errors_item.rb', line 73 def to_json @_field_set&.to_json end |