Class: PostApisAPIIDVersionsResponse422

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



20081
20082
20083
20084
20085
20086
20087
20088
# File 'lib/schemas.rb', line 20081

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

.from_json!(json) ⇒ Object



20090
20091
20092
# File 'lib/schemas.rb', line 20090

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

Instance Method Details

#to_dynamicObject



20094
20095
20096
20097
20098
20099
20100
# File 'lib/schemas.rb', line 20094

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

#to_json(options = nil) ⇒ Object



20102
20103
20104
# File 'lib/schemas.rb', line 20102

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