Class: GetApisResponse422

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



6825
6826
6827
6828
6829
6830
6831
6832
# File 'lib/schemas.rb', line 6825

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

.from_json!(json) ⇒ Object



6834
6835
6836
# File 'lib/schemas.rb', line 6834

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

Instance Method Details

#to_dynamicObject



6838
6839
6840
6841
6842
6843
6844
# File 'lib/schemas.rb', line 6838

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

#to_json(options = nil) ⇒ Object



6846
6847
6848
# File 'lib/schemas.rb', line 6846

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