Class: GetMocksResponse500

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



12400
12401
12402
12403
12404
12405
# File 'lib/schemas.rb', line 12400

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

.from_json!(json) ⇒ Object



12407
12408
12409
# File 'lib/schemas.rb', line 12407

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

Instance Method Details

#to_dynamicObject



12411
12412
12413
12414
12415
# File 'lib/schemas.rb', line 12411

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

#to_json(options = nil) ⇒ Object



12417
12418
12419
# File 'lib/schemas.rb', line 12417

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