Class: DeleteCollectionsCollectionIDResponse404

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



1496
1497
1498
1499
1500
1501
# File 'lib/schemas.rb', line 1496

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

.from_json!(json) ⇒ Object



1503
1504
1505
# File 'lib/schemas.rb', line 1503

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

Instance Method Details

#to_dynamicObject



1507
1508
1509
1510
1511
# File 'lib/schemas.rb', line 1507

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

#to_json(options = nil) ⇒ Object



1513
1514
1515
# File 'lib/schemas.rb', line 1513

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