Class: Cadenya::Types::CreateResourceMetadata

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(name: nil, external_id: nil, labels: nil) ⇒ CreateResourceMetadata

Returns a new instance of CreateResourceMetadata.



1802
1803
1804
1805
1806
# File 'lib/cadenya/types.rb', line 1802

def initialize(name: nil, external_id: nil, labels: nil)
  @name = name
  @external_id = external_id
  @labels = labels
end

Instance Attribute Details

#external_idObject (readonly)

Returns the value of attribute external_id.



1800
1801
1802
# File 'lib/cadenya/types.rb', line 1800

def external_id
  @external_id
end

#labelsObject (readonly)

Returns the value of attribute labels.



1800
1801
1802
# File 'lib/cadenya/types.rb', line 1800

def labels
  @labels
end

#nameObject (readonly)

Returns the value of attribute name.



1800
1801
1802
# File 'lib/cadenya/types.rb', line 1800

def name
  @name
end

Class Method Details

.from_json(data) ⇒ Object



1808
1809
1810
1811
1812
1813
1814
# File 'lib/cadenya/types.rb', line 1808

def self.from_json(data)
  new(
    name: data["name"],
    external_id: data["externalId"],
    labels: data["labels"],
  )
end

Instance Method Details

#to_hObject



1816
1817
1818
1819
1820
1821
1822
# File 'lib/cadenya/types.rb', line 1816

def to_h
  {
    name: Util.plain(@name),
    external_id: Util.plain(@external_id),
    labels: Util.plain(@labels),
  }.reject { |_k, v| v.nil? }
end