Class: GetEnvironmentsResponse500Error

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



10176
10177
10178
10179
10180
10181
10182
# File 'lib/schemas.rb', line 10176

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

.from_json!(json) ⇒ Object



10184
10185
10186
# File 'lib/schemas.rb', line 10184

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

Instance Method Details

#to_dynamicObject



10188
10189
10190
10191
10192
10193
# File 'lib/schemas.rb', line 10188

def to_dynamic
  {
    "message" => message,
    "name"    => get_environments_response500_error_name,
  }
end

#to_json(options = nil) ⇒ Object



10195
10196
10197
# File 'lib/schemas.rb', line 10195

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