Class: PostWorkspacesResponse401

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



27874
27875
27876
27877
27878
27879
# File 'lib/schemas.rb', line 27874

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

.from_json!(json) ⇒ Object



27881
27882
27883
# File 'lib/schemas.rb', line 27881

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

Instance Method Details

#to_dynamicObject



27885
27886
27887
27888
27889
# File 'lib/schemas.rb', line 27885

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

#to_json(options = nil) ⇒ Object



27891
27892
27893
# File 'lib/schemas.rb', line 27891

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