Class: GetEnvironmentsResponse429

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



10144
10145
10146
10147
10148
10149
10150
# File 'lib/schemas.rb', line 10144

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

.from_json!(json) ⇒ Object



10152
10153
10154
# File 'lib/schemas.rb', line 10152

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

Instance Method Details

#to_dynamicObject



10156
10157
10158
10159
10160
10161
# File 'lib/schemas.rb', line 10156

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

#to_json(options = nil) ⇒ Object



10163
10164
10165
# File 'lib/schemas.rb', line 10163

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