Class: PostSecurityAPIValidationResponse429

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



27316
27317
27318
27319
27320
27321
27322
# File 'lib/schemas.rb', line 27316

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

.from_json!(json) ⇒ Object



27324
27325
27326
# File 'lib/schemas.rb', line 27324

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

Instance Method Details

#to_dynamicObject



27328
27329
27330
27331
27332
27333
# File 'lib/schemas.rb', line 27328

def to_dynamic
  {
    "error"   => error,
    "message" => message,
  }
end

#to_json(options = nil) ⇒ Object



27335
27336
27337
# File 'lib/schemas.rb', line 27335

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