Reference documentation and code samples for the Google Cloud Asset V1 Client class 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).
Generated from protobuf message google.cloud.asset.v1.RelatedAsset
Namespace
Google \ Cloud \ Asset \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ asset
string
The full name of the asset. Example: //compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1 See Resource names for more information.
↳ asset_type
string
The type of the asset. Example: compute.googleapis.com/Disk See Supported asset types for more information.
↳ ancestors
array
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. Example: ["projects/123456789", "folders/5432", "organizations/1234"]
↳ relationship_type
string
The unique identifier of the relationship type. Example: INSTANCE_TO_INSTANCEGROUP
getAsset
The full name of the asset. Example:
//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1
See Resource
names
for more information.
Returns
Type
Description
string
setAsset
The full name of the asset. Example:
//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1
See Resource
names
for more information.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getAssetType
The type of the asset. Example: compute.googleapis.com/Disk
See Supported asset
types
for more information.
Returns
Type
Description
string
setAssetType
The type of the asset. Example: compute.googleapis.com/Disk
See Supported asset
types
for more information.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getAncestors
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.
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-04 UTC."],[],[],null,["# Google Cloud Asset V1 Client - Class RelatedAsset (2.2.3)\n\nVersion latestkeyboard_arrow_down\n\n- [2.2.3 (latest)](/php/docs/reference/cloud-asset/latest/V1.RelatedAsset)\n- [2.2.2](/php/docs/reference/cloud-asset/2.2.2/V1.RelatedAsset)\n- [2.1.3](/php/docs/reference/cloud-asset/2.1.3/V1.RelatedAsset)\n- [2.0.1](/php/docs/reference/cloud-asset/2.0.1/V1.RelatedAsset)\n- [1.16.4](/php/docs/reference/cloud-asset/1.16.4/V1.RelatedAsset)\n- [1.14.1](/php/docs/reference/cloud-asset/1.14.1/V1.RelatedAsset)\n- [1.13.2](/php/docs/reference/cloud-asset/1.13.2/V1.RelatedAsset)\n- [1.12.2](/php/docs/reference/cloud-asset/1.12.2/V1.RelatedAsset)\n- [1.11.3](/php/docs/reference/cloud-asset/1.11.3/V1.RelatedAsset)\n- [1.10.2](/php/docs/reference/cloud-asset/1.10.2/V1.RelatedAsset)\n- [1.9.2](/php/docs/reference/cloud-asset/1.9.2/V1.RelatedAsset) \nReference documentation and code samples for the Google Cloud Asset V1 Client class 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).\n\nSee [Supported asset\ntypes](https://cloud.google.com/asset-inventory/docs/supported-asset-types)\nfor more information.\n\nGenerated from protobuf message `google.cloud.asset.v1.RelatedAsset`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Asset \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getAsset\n\nThe full name of the asset. Example:\n`//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`\nSee [Resource\nnames](https://cloud.google.com/apis/design/resource_names#full_resource_name)\nfor more information.\n\n### setAsset\n\nThe full name of the asset. Example:\n`//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`\nSee [Resource\nnames](https://cloud.google.com/apis/design/resource_names#full_resource_name)\nfor more information.\n\n### getAssetType\n\nThe type of the asset. Example: `compute.googleapis.com/Disk`\nSee [Supported asset\ntypes](https://cloud.google.com/asset-inventory/docs/supported-asset-types)\nfor more information.\n\n### setAssetType\n\nThe type of the asset. Example: `compute.googleapis.com/Disk`\nSee [Supported asset\ntypes](https://cloud.google.com/asset-inventory/docs/supported-asset-types)\nfor more information.\n\n### getAncestors\n\nThe ancestors of an asset in Google Cloud [resource\nhierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),\nrepresented as a list of relative resource names. An ancestry path starts\nwith the closest ancestor in the hierarchy and ends at root.\n\nExample: `[\"projects/123456789\", \"folders/5432\", \"organizations/1234\"]`\n\n### setAncestors\n\nThe ancestors of an asset in Google Cloud [resource\nhierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),\nrepresented as a list of relative resource names. An ancestry path starts\nwith the closest ancestor in the hierarchy and ends at root.\n\nExample: `[\"projects/123456789\", \"folders/5432\", \"organizations/1234\"]`\n\n### getRelationshipType\n\nThe unique identifier of the relationship type. Example:\n`INSTANCE_TO_INSTANCEGROUP`\n\n### setRelationshipType\n\nThe unique identifier of the relationship type. Example:\n`INSTANCE_TO_INSTANCEGROUP`"]]