Class: Cadenya::Types::UpdateResourceMetadata

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) ⇒ UpdateResourceMetadata

Returns a new instance of UpdateResourceMetadata.



6829
6830
6831
6832
6833
# File 'lib/cadenya/types.rb', line 6829

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.



6827
6828
6829
# File 'lib/cadenya/types.rb', line 6827

def external_id
  @external_id
end

#labelsObject (readonly)

Returns the value of attribute labels.



6827
6828
6829
# File 'lib/cadenya/types.rb', line 6827

def labels
  @labels
end

#nameObject (readonly)

Returns the value of attribute name.



6827
6828
6829
# File 'lib/cadenya/types.rb', line 6827

def name
  @name
end

Class Method Details

.from_json(data) ⇒ Object



6835
6836
6837
6838
6839
6840
6841
# File 'lib/cadenya/types.rb', line 6835

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

Instance Method Details

#to_hObject



6843
6844
6845
6846
6847
6848
6849
# File 'lib/cadenya/types.rb', line 6843

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