Class: PostApisAPIIDSchemasResponse500

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



19876
19877
19878
19879
19880
19881
19882
19883
# File 'lib/schemas.rb', line 19876

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    detail:                                    d["detail"],
    title:                                     d["title"],
    post_apis_api_id_schemas_response500_type: d["type"],
  )
end

.from_json!(json) ⇒ Object



19885
19886
19887
# File 'lib/schemas.rb', line 19885

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

Instance Method Details

#to_dynamicObject



19889
19890
19891
19892
19893
19894
19895
# File 'lib/schemas.rb', line 19889

def to_dynamic
  {
    "detail" => detail,
    "title"  => title,
    "type"   => post_apis_api_id_schemas_response500_type,
  }
end

#to_json(options = nil) ⇒ Object



19897
19898
19899
# File 'lib/schemas.rb', line 19897

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