Class: PostSecurityAPIValidationResponse400

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



27229
27230
27231
27232
27233
27234
# File 'lib/schemas.rb', line 27229

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

.from_json!(json) ⇒ Object



27236
27237
27238
# File 'lib/schemas.rb', line 27236

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

Instance Method Details

#to_dynamicObject



27240
27241
27242
27243
27244
# File 'lib/schemas.rb', line 27240

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

#to_json(options = nil) ⇒ Object



27246
27247
27248
# File 'lib/schemas.rb', line 27246

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