Class: PostWorkspacesResponse429

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



27961
27962
27963
27964
27965
27966
27967
# File 'lib/schemas.rb', line 27961

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

.from_json!(json) ⇒ Object



27969
27970
27971
# File 'lib/schemas.rb', line 27969

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

Instance Method Details

#to_dynamicObject



27973
27974
27975
27976
27977
27978
# File 'lib/schemas.rb', line 27973

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

#to_json(options = nil) ⇒ Object



27980
27981
27982
# File 'lib/schemas.rb', line 27980

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