Class: Cadenya::Types::CreateWidgetRequest

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(workspace_id: nil, metadata: nil, spec: nil) ⇒ CreateWidgetRequest

Returns a new instance of CreateWidgetRequest.



1938
1939
1940
1941
1942
# File 'lib/cadenya/types.rb', line 1938

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

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata.



1936
1937
1938
# File 'lib/cadenya/types.rb', line 1936

def 
  @metadata
end

#specObject (readonly)

Returns the value of attribute spec.



1936
1937
1938
# File 'lib/cadenya/types.rb', line 1936

def spec
  @spec
end

#workspace_idObject (readonly)

Returns the value of attribute workspace_id.



1936
1937
1938
# File 'lib/cadenya/types.rb', line 1936

def workspace_id
  @workspace_id
end

Class Method Details

.from_json(data) ⇒ Object



1944
1945
1946
1947
1948
1949
1950
# File 'lib/cadenya/types.rb', line 1944

def self.from_json(data)
  new(
    workspace_id: data["workspaceId"],
    metadata: data["metadata"].nil? ? nil : Types::CreateResourceMetadata.from_json(data["metadata"]),
    spec: data["spec"].nil? ? nil : Types::WidgetSpec.from_json(data["spec"]),
  )
end

Instance Method Details

#to_hObject



1952
1953
1954
1955
1956
1957
1958
# File 'lib/cadenya/types.rb', line 1952

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