Class: GetCollectionsResponse429

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



9141
9142
9143
9144
9145
9146
9147
# File 'lib/schemas.rb', line 9141

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

.from_json!(json) ⇒ Object



9149
9150
9151
# File 'lib/schemas.rb', line 9149

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

Instance Method Details

#to_dynamicObject



9153
9154
9155
9156
9157
9158
# File 'lib/schemas.rb', line 9153

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

#to_json(options = nil) ⇒ Object



9160
9161
9162
# File 'lib/schemas.rb', line 9160

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