Class: PostImportOpenapiResponse500Error

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



23726
23727
23728
23729
23730
23731
23732
# File 'lib/schemas.rb', line 23726

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    message:                                    d["message"],
    post_import_openapi_response500_error_name: d["name"],
  )
end

.from_json!(json) ⇒ Object



23734
23735
23736
# File 'lib/schemas.rb', line 23734

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

Instance Method Details

#to_dynamicObject



23738
23739
23740
23741
23742
23743
# File 'lib/schemas.rb', line 23738

def to_dynamic
  {
    "message" => message,
    "name"    => post_import_openapi_response500_error_name,
  }
end

#to_json(options = nil) ⇒ Object



23745
23746
23747
# File 'lib/schemas.rb', line 23745

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