Class: GetEnvironmentsResponse404

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



10114
10115
10116
10117
10118
10119
# File 'lib/schemas.rb', line 10114

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

.from_json!(json) ⇒ Object



10121
10122
10123
# File 'lib/schemas.rb', line 10121

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

Instance Method Details

#to_dynamicObject



10125
10126
10127
10128
10129
# File 'lib/schemas.rb', line 10125

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

#to_json(options = nil) ⇒ Object



10131
10132
10133
# File 'lib/schemas.rb', line 10131

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