Reference documentation and code samples for the Policy Simulator V1 API class Google::Cloud::PolicySimulator::V1::ResourceContext.
ResourceContext provides the context we know about a resource.
It is similar in concept to google.cloud.asset.v1.Resource, but focuses
on the information specifically used by Simulator.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#ancestors
defancestors()->::Array<::String>
Returns
(::Array<::String>) — The ancestry path of the resource 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. If the
resource is a project, folder, or organization, the ancestry path starts
from the resource itself.
value (::Array<::String>) — The ancestry path of the resource 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. If the
resource is a project, folder, or organization, the ancestry path starts
from the resource itself.
(::Array<::String>) — The ancestry path of the resource 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. If the
resource is a project, folder, or organization, the ancestry path starts
from the resource itself.
[[["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-03 UTC."],[],[],null,["# Policy Simulator V1 API - Class Google::Cloud::PolicySimulator::V1::ResourceContext (v1.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.0 (latest)](/ruby/docs/reference/google-cloud-policy_simulator-v1/latest/Google-Cloud-PolicySimulator-V1-ResourceContext)\n- [1.3.0](/ruby/docs/reference/google-cloud-policy_simulator-v1/1.3.0/Google-Cloud-PolicySimulator-V1-ResourceContext)\n- [1.2.1](/ruby/docs/reference/google-cloud-policy_simulator-v1/1.2.1/Google-Cloud-PolicySimulator-V1-ResourceContext)\n- [1.1.0](/ruby/docs/reference/google-cloud-policy_simulator-v1/1.1.0/Google-Cloud-PolicySimulator-V1-ResourceContext)\n- [1.0.1](/ruby/docs/reference/google-cloud-policy_simulator-v1/1.0.1/Google-Cloud-PolicySimulator-V1-ResourceContext)\n- [0.4.0](/ruby/docs/reference/google-cloud-policy_simulator-v1/0.4.0/Google-Cloud-PolicySimulator-V1-ResourceContext)\n- [0.3.2](/ruby/docs/reference/google-cloud-policy_simulator-v1/0.3.2/Google-Cloud-PolicySimulator-V1-ResourceContext)\n- [0.2.0](/ruby/docs/reference/google-cloud-policy_simulator-v1/0.2.0/Google-Cloud-PolicySimulator-V1-ResourceContext)\n- [0.1.1](/ruby/docs/reference/google-cloud-policy_simulator-v1/0.1.1/Google-Cloud-PolicySimulator-V1-ResourceContext) \nReference documentation and code samples for the Policy Simulator V1 API class Google::Cloud::PolicySimulator::V1::ResourceContext.\n\nResourceContext provides the context we know about a resource.\nIt is similar in concept to google.cloud.asset.v1.Resource, but focuses\non the information specifically used by Simulator. \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 ancestry path of the resource 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. If the resource is a project, folder, or organization, the ancestry path starts from the resource itself.\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 ancestry path of the resource 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. If the resource is a project, folder, or organization, the ancestry path starts from the resource itself.\n\n\nExample: `[\"projects/123456789\", \"folders/5432\", \"organizations/1234\"]` \n**Returns**\n\n- (::Array\\\u003c::String\\\u003e) --- The ancestry path of the resource 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. If the resource is a project, folder, or organization, the ancestry path starts from the resource itself.\n\n\n Example: `[\"projects/123456789\", \"folders/5432\", \"organizations/1234\"]`\n\n### #asset_type\n\n def asset_type() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The asset type of the resource as defined by CAIS.\n\n Example: `compute.googleapis.com/Firewall`\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 asset type of the resource as defined by CAIS.\n\n\n Example: `compute.googleapis.com/Firewall`\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 asset type of the resource as defined by CAIS.\n\n Example: `compute.googleapis.com/Firewall`\n\n See [Supported asset\n types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)\n for more information.\n\n### #resource\n\n def resource() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The full name of the resource. 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### #resource=\n\n def resource=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The full name of the resource. 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 resource. 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."]]