Class ResourceContext (0.49.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

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()
Returns
Type Description
ResourceContext

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static ResourceContext.Builder newBuilder()
Returns
Type Description
ResourceContext.Builder

newBuilder(ResourceContext prototype)

public static ResourceContext.Builder newBuilder(ResourceContext prototype)
Parameter
Name Description
prototype ResourceContext
Returns
Type Description
ResourceContext.Builder

parseDelimitedFrom(InputStream input)

public static ResourceContext parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ResourceContext
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ResourceContext parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceContext
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static ResourceContext parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
ResourceContext
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ResourceContext parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceContext
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ResourceContext parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
ResourceContext
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ResourceContext parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceContext
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ResourceContext parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
ResourceContext
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ResourceContext parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceContext
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static ResourceContext parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ResourceContext
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ResourceContext parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceContext
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static ResourceContext parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
ResourceContext
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ResourceContext parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ResourceContext
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<ResourceContext> parser()
Returns
Type Description
Parser<ResourceContext>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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;

Returns
Type Description
ProtocolStringList

A list containing the ancestors.

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()
Returns
Type Description
ResourceContext

getParserForType()

public Parser<ResourceContext> getParserForType()
Returns
Type Description
Parser<ResourceContext>
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()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public ResourceContext.Builder newBuilderForType()
Returns
Type Description
ResourceContext.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected ResourceContext.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
ResourceContext.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public ResourceContext.Builder toBuilder()
Returns
Type Description
ResourceContext.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException