Class: DeleteMocksMockIDResponse404

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



2389
2390
2391
2392
2393
2394
# File 'lib/schemas.rb', line 2389

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

.from_json!(json) ⇒ Object



2396
2397
2398
# File 'lib/schemas.rb', line 2396

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

Instance Method Details

#to_dynamicObject



2400
2401
2402
2403
2404
# File 'lib/schemas.rb', line 2400

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

#to_json(options = nil) ⇒ Object



2406
2407
2408
# File 'lib/schemas.rb', line 2406

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