Class ResourceContext (0.55.0)
public final class ResourceContext extends GeneratedMessageV3 implements ResourceContextOrBuilder
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.
Protobuf type google.cloud.policysimulator.v1.ResourceContext
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
ANCESTORS_FIELD_NUMBER
public static final int ANCESTORS_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
ASSET_TYPE_FIELD_NUMBER
public static final int ASSET_TYPE_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
RESOURCE_FIELD_NUMBER
public static final int RESOURCE_FIELD_NUMBER
Field Value |
Type |
Description |
int |
|
Static Methods
getDefaultInstance()
public static ResourceContext getDefaultInstance()
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static ResourceContext.Builder newBuilder()
newBuilder(ResourceContext prototype)
public static ResourceContext.Builder newBuilder(ResourceContext prototype)
parseDelimitedFrom(InputStream input)
public static ResourceContext parseDelimitedFrom(InputStream input)
parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static ResourceContext parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(byte[] data)
public static ResourceContext parseFrom(byte[] data)
Parameter |
Name |
Description |
data |
byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static ResourceContext parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteString data)
public static ResourceContext parseFrom(ByteString data)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static ResourceContext parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
parseFrom(CodedInputStream input)
public static ResourceContext parseFrom(CodedInputStream input)
parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static ResourceContext parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(InputStream input)
public static ResourceContext parseFrom(InputStream input)
parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static ResourceContext parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteBuffer data)
public static ResourceContext parseFrom(ByteBuffer data)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static ResourceContext parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
parser()
public static Parser<ResourceContext> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter |
Name |
Description |
obj |
Object
|
Overrides
getAncestors(int index)
public String getAncestors(int index)
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.
Example: ["projects/123456789", "folders/5432", "organizations/1234"]
repeated string ancestors = 3;
Parameter |
Name |
Description |
index |
int
The index of the element to return.
|
Returns |
Type |
Description |
String |
The ancestors at the given index.
|
getAncestorsBytes(int index)
public ByteString getAncestorsBytes(int index)
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.
Example: ["projects/123456789", "folders/5432", "organizations/1234"]
repeated string ancestors = 3;
Parameter |
Name |
Description |
index |
int
The index of the value to return.
|
Returns |
Type |
Description |
ByteString |
The bytes of the ancestors at the given index.
|
getAncestorsCount()
public int getAncestorsCount()
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.
Example: ["projects/123456789", "folders/5432", "organizations/1234"]
repeated string ancestors = 3;
Returns |
Type |
Description |
int |
The count of ancestors.
|
getAncestorsList()
public ProtocolStringList getAncestorsList()
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.
Example: ["projects/123456789", "folders/5432", "organizations/1234"]
repeated string ancestors = 3;
getAssetType()
public String getAssetType()
The asset type of the resource as defined by CAIS.
Example: compute.googleapis.com/Firewall
See Supported asset
types
for more information.
string asset_type = 2;
Returns |
Type |
Description |
String |
The assetType.
|
getAssetTypeBytes()
public ByteString getAssetTypeBytes()
The asset type of the resource as defined by CAIS.
Example: compute.googleapis.com/Firewall
See Supported asset
types
for more information.
string asset_type = 2;
Returns |
Type |
Description |
ByteString |
The bytes for assetType.
|
getDefaultInstanceForType()
public ResourceContext getDefaultInstanceForType()
getParserForType()
public Parser<ResourceContext> getParserForType()
Overrides
getResource()
public String getResource()
The full name of the resource. Example:
//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1
See Resource
names
for more information.
string resource = 1;
Returns |
Type |
Description |
String |
The resource.
|
getResourceBytes()
public ByteString getResourceBytes()
The full name of the resource. Example:
//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1
See Resource
names
for more information.
string resource = 1;
Returns |
Type |
Description |
ByteString |
The bytes for resource.
|
getSerializedSize()
public int getSerializedSize()
Returns |
Type |
Description |
int |
|
Overrides
hashCode()
Returns |
Type |
Description |
int |
|
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public ResourceContext.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected ResourceContext.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Returns |
Type |
Description |
Object |
|
Overrides
toBuilder()
public ResourceContext.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-11 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-11 UTC."],[],[]]