Class: PostApisAPIIDVersionsResponse500

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



20118
20119
20120
20121
20122
20123
20124
20125
# File 'lib/schemas.rb', line 20118

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

.from_json!(json) ⇒ Object



20127
20128
20129
# File 'lib/schemas.rb', line 20127

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

Instance Method Details

#to_dynamicObject



20131
20132
20133
20134
20135
20136
20137
# File 'lib/schemas.rb', line 20131

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

#to_json(options = nil) ⇒ Object



20139
20140
20141
# File 'lib/schemas.rb', line 20139

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