Class: GetCollectionsCollectionIDRequestsRequestIDResponse401

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



7790
7791
7792
7793
7794
7795
# File 'lib/schemas.rb', line 7790

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

.from_json!(json) ⇒ Object



7797
7798
7799
# File 'lib/schemas.rb', line 7797

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

Instance Method Details

#to_dynamicObject



7801
7802
7803
7804
7805
# File 'lib/schemas.rb', line 7801

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

#to_json(options = nil) ⇒ Object



7807
7808
7809
# File 'lib/schemas.rb', line 7807

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