Class: Cadenya::Types::ResourceMetadata

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(id: nil, account_id: nil, workspace_id: nil, name: nil, external_id: nil, labels: nil, profile_id: nil, created_at: nil, updated_at: nil) ⇒ ResourceMetadata

Returns a new instance of ResourceMetadata.



4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
# File 'lib/cadenya/types.rb', line 4730

def initialize(id: nil, account_id: nil, workspace_id: nil, name: nil, external_id: nil, labels: nil, profile_id: nil, created_at: nil, updated_at: nil)
  @id = id
  @account_id = 
  @workspace_id = workspace_id
  @name = name
  @external_id = external_id
  @labels = labels
  @profile_id = profile_id
  @created_at = created_at
  @updated_at = updated_at
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



4728
4729
4730
# File 'lib/cadenya/types.rb', line 4728

def 
  @account_id
end

#created_atObject (readonly)

Returns the value of attribute created_at.



4728
4729
4730
# File 'lib/cadenya/types.rb', line 4728

def created_at
  @created_at
end

#external_idObject (readonly)

Returns the value of attribute external_id.



4728
4729
4730
# File 'lib/cadenya/types.rb', line 4728

def external_id
  @external_id
end

#idObject (readonly)

Returns the value of attribute id.



4728
4729
4730
# File 'lib/cadenya/types.rb', line 4728

def id
  @id
end

#labelsObject (readonly)

Returns the value of attribute labels.



4728
4729
4730
# File 'lib/cadenya/types.rb', line 4728

def labels
  @labels
end

#nameObject (readonly)

Returns the value of attribute name.



4728
4729
4730
# File 'lib/cadenya/types.rb', line 4728

def name
  @name
end

#profile_idObject (readonly)

Returns the value of attribute profile_id.



4728
4729
4730
# File 'lib/cadenya/types.rb', line 4728

def profile_id
  @profile_id
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



4728
4729
4730
# File 'lib/cadenya/types.rb', line 4728

def updated_at
  @updated_at
end

#workspace_idObject (readonly)

Returns the value of attribute workspace_id.



4728
4729
4730
# File 'lib/cadenya/types.rb', line 4728

def workspace_id
  @workspace_id
end

Class Method Details

.from_json(data) ⇒ Object



4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
# File 'lib/cadenya/types.rb', line 4742

def self.from_json(data)
  new(
    id: data["id"],
    account_id: data["accountId"],
    workspace_id: data["workspaceId"],
    name: data["name"],
    external_id: data["externalId"],
    labels: data["labels"],
    profile_id: data["profileId"],
    created_at: data["createdAt"].nil? ? nil : Time.iso8601(data["createdAt"]),
    updated_at: data["updatedAt"].nil? ? nil : Time.iso8601(data["updatedAt"]),
  )
end

Instance Method Details

#to_hObject



4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
# File 'lib/cadenya/types.rb', line 4756

def to_h
  {
    id: Util.plain(@id),
    account_id: Util.plain(@account_id),
    workspace_id: Util.plain(@workspace_id),
    name: Util.plain(@name),
    external_id: Util.plain(@external_id),
    labels: Util.plain(@labels),
    profile_id: Util.plain(@profile_id),
    created_at: Util.plain(@created_at),
    updated_at: Util.plain(@updated_at),
  }.reject { |_k, v| v.nil? }
end