Class: Cadenya::Types::Workspace

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata: nil, spec: nil, status: nil, info: nil) ⇒ Workspace

Returns a new instance of Workspace.



7497
7498
7499
7500
7501
7502
# File 'lib/cadenya/types.rb', line 7497

def initialize(metadata: nil, spec: nil, status: nil, info: nil)
  @metadata = 
  @spec = spec
  @status = status
  @info = info
end

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



7495
7496
7497
# File 'lib/cadenya/types.rb', line 7495

def info
  @info
end

#metadataObject (readonly)

Returns the value of attribute metadata.



7495
7496
7497
# File 'lib/cadenya/types.rb', line 7495

def 
  @metadata
end

#specObject (readonly)

Returns the value of attribute spec.



7495
7496
7497
# File 'lib/cadenya/types.rb', line 7495

def spec
  @spec
end

#statusObject (readonly)

Returns the value of attribute status.



7495
7496
7497
# File 'lib/cadenya/types.rb', line 7495

def status
  @status
end

Class Method Details

.from_json(data) ⇒ Object



7504
7505
7506
7507
7508
7509
7510
7511
# File 'lib/cadenya/types.rb', line 7504

def self.from_json(data)
  new(
    metadata: data["metadata"].nil? ? nil : Types::AccountResourceMetadata.from_json(data["metadata"]),
    spec: data["spec"].nil? ? nil : Types::WorkspaceSpec.from_json(data["spec"]),
    status: data["status"],
    info: data["info"].nil? ? nil : Types::WorkspaceInfo.from_json(data["info"]),
  )
end

Instance Method Details

#to_hObject



7513
7514
7515
7516
7517
7518
7519
7520
# File 'lib/cadenya/types.rb', line 7513

def to_h
  {
    metadata: Util.plain(@metadata),
    spec: Util.plain(@spec),
    status: Util.plain(@status),
    info: Util.plain(@info),
  }.reject { |_k, v| v.nil? }
end