Class: PostEnvironmentsResponse429

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



23397
23398
23399
23400
23401
23402
23403
# File 'lib/schemas.rb', line 23397

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

.from_json!(json) ⇒ Object



23405
23406
23407
# File 'lib/schemas.rb', line 23405

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

Instance Method Details

#to_dynamicObject



23409
23410
23411
23412
23413
23414
# File 'lib/schemas.rb', line 23409

def to_dynamic
  {
    "error"   => error,
    "message" => message,
  }
end

#to_json(options = nil) ⇒ Object



23416
23417
23418
# File 'lib/schemas.rb', line 23416

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