Class: Cadenya::Types::WidgetSession

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, info: nil, state: nil, secrets: nil) ⇒ WidgetSession

Returns a new instance of WidgetSession.



7341
7342
7343
7344
7345
7346
7347
# File 'lib/cadenya/types.rb', line 7341

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

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



7339
7340
7341
# File 'lib/cadenya/types.rb', line 7339

def info
  @info
end

#metadataObject (readonly)

Returns the value of attribute metadata.



7339
7340
7341
# File 'lib/cadenya/types.rb', line 7339

def 
  @metadata
end

#secretsObject (readonly)

Returns the value of attribute secrets.



7339
7340
7341
# File 'lib/cadenya/types.rb', line 7339

def secrets
  @secrets
end

#specObject (readonly)

Returns the value of attribute spec.



7339
7340
7341
# File 'lib/cadenya/types.rb', line 7339

def spec
  @spec
end

#stateObject (readonly)

Returns the value of attribute state.



7339
7340
7341
# File 'lib/cadenya/types.rb', line 7339

def state
  @state
end

Class Method Details

.from_json(data) ⇒ Object



7349
7350
7351
7352
7353
7354
7355
7356
7357
# File 'lib/cadenya/types.rb', line 7349

def self.from_json(data)
  new(
    metadata: data["metadata"].nil? ? nil : Types::OperationMetadata.from_json(data["metadata"]),
    spec: data["spec"].nil? ? nil : Types::WidgetSessionSpec.from_json(data["spec"]),
    info: data["info"].nil? ? nil : Types::WidgetSessionInfo.from_json(data["info"]),
    state: data["state"],
    secrets: data["secrets"].nil? ? nil : (data["secrets"]).map { |item| Types::WidgetSession_Secret.from_json(item) },
  )
end

Instance Method Details

#to_hObject



7359
7360
7361
7362
7363
7364
7365
7366
7367
# File 'lib/cadenya/types.rb', line 7359

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