Class: PostEnvironmentsResponse500Error

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



23429
23430
23431
23432
23433
23434
23435
# File 'lib/schemas.rb', line 23429

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

.from_json!(json) ⇒ Object



23437
23438
23439
# File 'lib/schemas.rb', line 23437

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

Instance Method Details

#to_dynamicObject



23441
23442
23443
23444
23445
23446
# File 'lib/schemas.rb', line 23441

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

#to_json(options = nil) ⇒ Object



23448
23449
23450
# File 'lib/schemas.rb', line 23448

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