Class: PostEnvironmentsResponse400

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



23253
23254
23255
23256
23257
23258
# File 'lib/schemas.rb', line 23253

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

.from_json!(json) ⇒ Object



23260
23261
23262
# File 'lib/schemas.rb', line 23260

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

Instance Method Details

#to_dynamicObject



23264
23265
23266
23267
23268
# File 'lib/schemas.rb', line 23264

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

#to_json(options = nil) ⇒ Object



23270
23271
23272
# File 'lib/schemas.rb', line 23270

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