Class: GetEnvironmentsResponse500

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



10203
10204
10205
10206
10207
10208
# File 'lib/schemas.rb', line 10203

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

.from_json!(json) ⇒ Object



10210
10211
10212
# File 'lib/schemas.rb', line 10210

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

Instance Method Details

#to_dynamicObject



10214
10215
10216
10217
10218
# File 'lib/schemas.rb', line 10214

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

#to_json(options = nil) ⇒ Object



10220
10221
10222
# File 'lib/schemas.rb', line 10220

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