Class: PostMocksResponse400

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



24814
24815
24816
24817
24818
24819
# File 'lib/schemas.rb', line 24814

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    error: d["error"] ? PostMocksResponse400Error.from_dynamic!(d["error"]) : nil,
  )
end

.from_json!(json) ⇒ Object



24821
24822
24823
# File 'lib/schemas.rb', line 24821

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

Instance Method Details

#to_dynamicObject



24825
24826
24827
24828
24829
# File 'lib/schemas.rb', line 24825

def to_dynamic
  {
    "error" => error&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



24831
24832
24833
# File 'lib/schemas.rb', line 24831

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