Class: PostImportOpenapiResponse400Error

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schemas.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



23578
23579
23580
23581
23582
23583
23584
23585
# File 'lib/schemas.rb', line 23578

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    details:                                    d["details"] ? PostImportOpenapiResponse400ErrorDetails.from_dynamic!(d["details"]) : nil,
    message:                                    d["message"],
    post_import_openapi_response400_error_name: d["name"],
  )
end

.from_json!(json) ⇒ Object



23587
23588
23589
# File 'lib/schemas.rb', line 23587

def self.from_json!(json)
  from_dynamic!(JSON.parse(json))
end

Instance Method Details

#to_dynamicObject



23591
23592
23593
23594
23595
23596
23597
# File 'lib/schemas.rb', line 23591

def to_dynamic
  {
    "details" => details&.to_dynamic,
    "message" => message,
    "name"    => post_import_openapi_response400_error_name,
  }
end

#to_json(options = nil) ⇒ Object



23599
23600
23601
# File 'lib/schemas.rb', line 23599

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end