Class: GetMocksResponse401

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



12311
12312
12313
12314
12315
12316
# File 'lib/schemas.rb', line 12311

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

.from_json!(json) ⇒ Object



12318
12319
12320
# File 'lib/schemas.rb', line 12318

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

Instance Method Details

#to_dynamicObject



12322
12323
12324
12325
12326
# File 'lib/schemas.rb', line 12322

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

#to_json(options = nil) ⇒ Object



12328
12329
12330
# File 'lib/schemas.rb', line 12328

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