Class: DeleteCollectionsCollectionIDResponse429

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



1526
1527
1528
1529
1530
1531
1532
# File 'lib/schemas.rb', line 1526

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

.from_json!(json) ⇒ Object



1534
1535
1536
# File 'lib/schemas.rb', line 1534

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

Instance Method Details

#to_dynamicObject



1538
1539
1540
1541
1542
1543
# File 'lib/schemas.rb', line 1538

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

#to_json(options = nil) ⇒ Object



1545
1546
1547
# File 'lib/schemas.rb', line 1545

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