Class: DeleteCollectionsCollectionIDRequestsRequestIDResponse401

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



1150
1151
1152
1153
1154
1155
# File 'lib/schemas.rb', line 1150

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

.from_json!(json) ⇒ Object



1157
1158
1159
# File 'lib/schemas.rb', line 1157

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

Instance Method Details

#to_dynamicObject



1161
1162
1163
1164
1165
# File 'lib/schemas.rb', line 1161

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

#to_json(options = nil) ⇒ Object



1167
1168
1169
# File 'lib/schemas.rb', line 1167

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