Class: GetApisAPIIDResponse422

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



4691
4692
4693
4694
4695
4696
4697
4698
# File 'lib/schemas.rb', line 4691

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

.from_json!(json) ⇒ Object



4700
4701
4702
# File 'lib/schemas.rb', line 4700

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

Instance Method Details

#to_dynamicObject



4704
4705
4706
4707
4708
4709
4710
# File 'lib/schemas.rb', line 4704

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

#to_json(options = nil) ⇒ Object



4712
4713
4714
# File 'lib/schemas.rb', line 4712

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