Class: Cadenya::Types::CreateAccountResourceMetadata

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

Returns a new instance of CreateAccountResourceMetadata.



1503
1504
1505
1506
1507
# File 'lib/cadenya/types.rb', line 1503

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.



1501
1502
1503
# File 'lib/cadenya/types.rb', line 1501

def external_id
  @external_id
end

#labelsObject (readonly)

Returns the value of attribute labels.



1501
1502
1503
# File 'lib/cadenya/types.rb', line 1501

def labels
  @labels
end

#nameObject (readonly)

Returns the value of attribute name.



1501
1502
1503
# File 'lib/cadenya/types.rb', line 1501

def name
  @name
end

Class Method Details

.from_json(data) ⇒ Object



1509
1510
1511
1512
1513
1514
1515
# File 'lib/cadenya/types.rb', line 1509

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

Instance Method Details

#to_hObject



1517
1518
1519
1520
1521
1522
1523
# File 'lib/cadenya/types.rb', line 1517

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