Class: GetMocksResponse401Error

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



12284
12285
12286
12287
12288
12289
12290
# File 'lib/schemas.rb', line 12284

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    message:                          d["message"],
    get_mocks_response401_error_name: d["name"],
  )
end

.from_json!(json) ⇒ Object



12292
12293
12294
# File 'lib/schemas.rb', line 12292

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

Instance Method Details

#to_dynamicObject



12296
12297
12298
12299
12300
12301
# File 'lib/schemas.rb', line 12296

def to_dynamic
  {
    "message" => message,
    "name"    => get_mocks_response401_error_name,
  }
end

#to_json(options = nil) ⇒ Object



12303
12304
12305
# File 'lib/schemas.rb', line 12303

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