Class: Cadenya::Types::ResourceMetadata
- Inherits:
-
Object
- Object
- Cadenya::Types::ResourceMetadata
- Defined in:
- lib/cadenya/types.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#external_id ⇒ Object
readonly
Returns the value of attribute external_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#profile_id ⇒ Object
readonly
Returns the value of attribute profile_id.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#workspace_id ⇒ Object
readonly
Returns the value of attribute workspace_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#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
constructor
A new instance of ResourceMetadata.
- #to_h ⇒ Object
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 = 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_id ⇒ Object (readonly)
Returns the value of attribute account_id.
4728 4729 4730 |
# File 'lib/cadenya/types.rb', line 4728 def account_id @account_id end |
#created_at ⇒ Object (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_id ⇒ Object (readonly)
Returns the value of attribute external_id.
4728 4729 4730 |
# File 'lib/cadenya/types.rb', line 4728 def external_id @external_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4728 4729 4730 |
# File 'lib/cadenya/types.rb', line 4728 def id @id end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
4728 4729 4730 |
# File 'lib/cadenya/types.rb', line 4728 def labels @labels end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4728 4729 4730 |
# File 'lib/cadenya/types.rb', line 4728 def name @name end |
#profile_id ⇒ Object (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_at ⇒ Object (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_id ⇒ Object (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_h ⇒ Object
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 |