Class: PatchCollectionsCollectionIDResponse401

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



18129
18130
18131
18132
18133
18134
# File 'lib/schemas.rb', line 18129

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

.from_json!(json) ⇒ Object



18136
18137
18138
# File 'lib/schemas.rb', line 18136

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

Instance Method Details

#to_dynamicObject



18140
18141
18142
18143
18144
# File 'lib/schemas.rb', line 18140

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

#to_json(options = nil) ⇒ Object



18146
18147
18148
# File 'lib/schemas.rb', line 18146

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