Reference documentation and code samples for the Cloud Asset V1 API class Google::Cloud::Asset::V1::RelatedAsset.
An asset identifier in Google Cloud which contains its name, type and
ancestors. An asset can be any resource in the Google Cloud resource
hierarchy,
a resource outside the Google Cloud resource hierarchy (such as Google
Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy).
See Supported asset
types
for more information.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#ancestors
defancestors()->::Array<::String>
Returns
(::Array<::String>) — The ancestors of an asset in Google Cloud resource
hierarchy,
represented as a list of relative resource names. An ancestry path starts
with the closest ancestor in the hierarchy and ends at root.
value (::Array<::String>) — The ancestors of an asset in Google Cloud resource
hierarchy,
represented as a list of relative resource names. An ancestry path starts
with the closest ancestor in the hierarchy and ends at root.
(::Array<::String>) — The ancestors of an asset in Google Cloud resource
hierarchy,
represented as a list of relative resource names. An ancestry path starts
with the closest ancestor in the hierarchy and ends at root.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Cloud Asset V1 API - Class Google::Cloud::Asset::V1::RelatedAsset (v1.4.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.1 (latest)](/ruby/docs/reference/google-cloud-asset-v1/latest/Google-Cloud-Asset-V1-RelatedAsset)\n- [1.4.0](/ruby/docs/reference/google-cloud-asset-v1/1.4.0/Google-Cloud-Asset-V1-RelatedAsset)\n- [1.3.1](/ruby/docs/reference/google-cloud-asset-v1/1.3.1/Google-Cloud-Asset-V1-RelatedAsset)\n- [1.2.0](/ruby/docs/reference/google-cloud-asset-v1/1.2.0/Google-Cloud-Asset-V1-RelatedAsset)\n- [1.1.0](/ruby/docs/reference/google-cloud-asset-v1/1.1.0/Google-Cloud-Asset-V1-RelatedAsset)\n- [1.0.2](/ruby/docs/reference/google-cloud-asset-v1/1.0.2/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.32.0](/ruby/docs/reference/google-cloud-asset-v1/0.32.0/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.31.0](/ruby/docs/reference/google-cloud-asset-v1/0.31.0/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.30.0](/ruby/docs/reference/google-cloud-asset-v1/0.30.0/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.29.3](/ruby/docs/reference/google-cloud-asset-v1/0.29.3/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.28.1](/ruby/docs/reference/google-cloud-asset-v1/0.28.1/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.27.0](/ruby/docs/reference/google-cloud-asset-v1/0.27.0/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.26.1](/ruby/docs/reference/google-cloud-asset-v1/0.26.1/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.25.0](/ruby/docs/reference/google-cloud-asset-v1/0.25.0/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.24.0](/ruby/docs/reference/google-cloud-asset-v1/0.24.0/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.23.0](/ruby/docs/reference/google-cloud-asset-v1/0.23.0/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.22.0](/ruby/docs/reference/google-cloud-asset-v1/0.22.0/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.21.1](/ruby/docs/reference/google-cloud-asset-v1/0.21.1/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.20.1](/ruby/docs/reference/google-cloud-asset-v1/0.20.1/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.19.0](/ruby/docs/reference/google-cloud-asset-v1/0.19.0/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.18.0](/ruby/docs/reference/google-cloud-asset-v1/0.18.0/Google-Cloud-Asset-V1-RelatedAsset)\n- [0.17.3](/ruby/docs/reference/google-cloud-asset-v1/0.17.3/Google-Cloud-Asset-V1-RelatedAsset) \nReference documentation and code samples for the Cloud Asset V1 API class Google::Cloud::Asset::V1::RelatedAsset.\n\nAn asset identifier in Google Cloud which contains its name, type and\nancestors. An asset can be any resource in the Google Cloud [resource\nhierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),\na resource outside the Google Cloud resource hierarchy (such as Google\nKubernetes Engine clusters and objects), or a policy (e.g. IAM policy).\nSee [Supported asset\ntypes](https://cloud.google.com/asset-inventory/docs/supported-asset-types)\nfor more information. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #ancestors\n\n def ancestors() -\u003e ::Array\u003c::String\u003e\n\n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- The ancestors of an asset in Google Cloud [resource\n hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names. An ancestry path starts with the closest ancestor in the hierarchy and ends at root.\n\n\n Example: `[\"projects/123456789\", \"folders/5432\", \"organizations/1234\"]`\n\n### #ancestors=\n\n def ancestors=(value) -\u003e ::Array\u003c::String\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c::String\\\u003e) --- The ancestors of an asset in Google Cloud [resource\n hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names. An ancestry path starts with the closest ancestor in the hierarchy and ends at root.\n\n\nExample: `[\"projects/123456789\", \"folders/5432\", \"organizations/1234\"]` \n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- The ancestors of an asset in Google Cloud [resource\n hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative resource names. An ancestry path starts with the closest ancestor in the hierarchy and ends at root.\n\n\n Example: `[\"projects/123456789\", \"folders/5432\", \"organizations/1234\"]`\n\n### #asset\n\n def asset() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The full name of the asset. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`\n\n\n See [Resource\n names](https://cloud.google.com/apis/design/resource_names#full_resource_name)\n for more information.\n\n### #asset=\n\n def asset=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The full name of the asset. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`\n\n\n See [Resource\n names](https://cloud.google.com/apis/design/resource_names#full_resource_name)\nfor more information. \n**Returns**\n\n- (::String) --- The full name of the asset. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`\n\n\n See [Resource\n names](https://cloud.google.com/apis/design/resource_names#full_resource_name)\n for more information.\n\n### #asset_type\n\n def asset_type() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The type of the asset. Example: `compute.googleapis.com/Disk`\n\n\n See [Supported asset\n types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)\n for more information.\n\n### #asset_type=\n\n def asset_type=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The type of the asset. Example: `compute.googleapis.com/Disk`\n\n\n See [Supported asset\n types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)\nfor more information. \n**Returns**\n\n- (::String) --- The type of the asset. Example: `compute.googleapis.com/Disk`\n\n\n See [Supported asset\n types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)\n for more information.\n\n### #relationship_type\n\n def relationship_type() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The unique identifier of the relationship type. Example: `INSTANCE_TO_INSTANCEGROUP`\n\n### #relationship_type=\n\n def relationship_type=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The unique identifier of the relationship type. Example: `INSTANCE_TO_INSTANCEGROUP` \n**Returns**\n\n- (::String) --- The unique identifier of the relationship type. Example: `INSTANCE_TO_INSTANCEGROUP`"]]