Class ProtectedResource (0.31.0)

public final class ProtectedResource extends GeneratedMessageV3 implements ProtectedResourceOrBuilder

Metadata about a resource protected by a Cloud KMS key.

Protobuf type google.cloud.kms.inventory.v1.ProtectedResource

Static Fields

CLOUD_PRODUCT_FIELD_NUMBER

public static final int CLOUD_PRODUCT_FIELD_NUMBER
Field Value
Type Description
int

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

CRYPTO_KEY_VERSIONS_FIELD_NUMBER

public static final int CRYPTO_KEY_VERSIONS_FIELD_NUMBER
Field Value
Type Description
int

CRYPTO_KEY_VERSION_FIELD_NUMBER

public static final int CRYPTO_KEY_VERSION_FIELD_NUMBER
Field Value
Type Description
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
Type Description
int

LOCATION_FIELD_NUMBER

public static final int LOCATION_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

PROJECT_FIELD_NUMBER

public static final int PROJECT_FIELD_NUMBER
Field Value
Type Description
int

PROJECT_ID_FIELD_NUMBER

public static final int PROJECT_ID_FIELD_NUMBER
Field Value
Type Description
int

RESOURCE_TYPE_FIELD_NUMBER

public static final int RESOURCE_TYPE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static ProtectedResource getDefaultInstance()
Returns
Type Description
ProtectedResource

getDescriptor()

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

newBuilder()

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

newBuilder(ProtectedResource prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

containsLabels(String key)

public boolean containsLabels(String key)

A key-value pair of the resource's labels (v1) to their values.

map<string, string> labels = 5;

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCloudProduct()

public String getCloudProduct()

The Cloud product that owns the resource. Example: compute

string cloud_product = 8;

Returns
Type Description
String

The cloudProduct.

getCloudProductBytes()

public ByteString getCloudProductBytes()

The Cloud product that owns the resource. Example: compute

string cloud_product = 8;

Returns
Type Description
ByteString

The bytes for cloudProduct.

getCreateTime()

public Timestamp getCreateTime()

Output only. The time at which this resource was created. The granularity is in seconds. Timestamp.nanos will always be 0.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The createTime.

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. The time at which this resource was created. The granularity is in seconds. Timestamp.nanos will always be 0.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getCryptoKeyVersion()

public String getCryptoKeyVersion()

The name of the Cloud KMS CryptoKeyVersion used to protect this resource via CMEK. This field is empty if the Google Cloud product owning the resource does not provide key version data to Asset Inventory. If there are multiple key versions protecting the resource, then this is same value as the first element of crypto_key_versions.

string crypto_key_version = 6 [(.google.api.resource_reference) = { ... }

Returns
Type Description
String

The cryptoKeyVersion.

getCryptoKeyVersionBytes()

public ByteString getCryptoKeyVersionBytes()

The name of the Cloud KMS CryptoKeyVersion used to protect this resource via CMEK. This field is empty if the Google Cloud product owning the resource does not provide key version data to Asset Inventory. If there are multiple key versions protecting the resource, then this is same value as the first element of crypto_key_versions.

string crypto_key_version = 6 [(.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for cryptoKeyVersion.

getCryptoKeyVersions(int index)

public String getCryptoKeyVersions(int index)

The names of the Cloud KMS CryptoKeyVersion used to protect this resource via CMEK. This field is empty if the Google Cloud product owning the resource does not provide key versions data to Asset Inventory. The first element of this field is stored in crypto_key_version.

repeated string crypto_key_versions = 10 [(.google.api.resource_reference) = { ... }

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The cryptoKeyVersions at the given index.

getCryptoKeyVersionsBytes(int index)

public ByteString getCryptoKeyVersionsBytes(int index)

The names of the Cloud KMS CryptoKeyVersion used to protect this resource via CMEK. This field is empty if the Google Cloud product owning the resource does not provide key versions data to Asset Inventory. The first element of this field is stored in crypto_key_version.

repeated string crypto_key_versions = 10 [(.google.api.resource_reference) = { ... }

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the cryptoKeyVersions at the given index.

getCryptoKeyVersionsCount()

public int getCryptoKeyVersionsCount()

The names of the Cloud KMS CryptoKeyVersion used to protect this resource via CMEK. This field is empty if the Google Cloud product owning the resource does not provide key versions data to Asset Inventory. The first element of this field is stored in crypto_key_version.

repeated string crypto_key_versions = 10 [(.google.api.resource_reference) = { ... }

Returns
Type Description
int

The count of cryptoKeyVersions.

getCryptoKeyVersionsList()

public ProtocolStringList getCryptoKeyVersionsList()

The names of the Cloud KMS CryptoKeyVersion used to protect this resource via CMEK. This field is empty if the Google Cloud product owning the resource does not provide key versions data to Asset Inventory. The first element of this field is stored in crypto_key_version.

repeated string crypto_key_versions = 10 [(.google.api.resource_reference) = { ... }

Returns
Type Description
ProtocolStringList

A list containing the cryptoKeyVersions.

getDefaultInstanceForType()

public ProtectedResource getDefaultInstanceForType()
Returns
Type Description
ProtectedResource

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

getLabelsCount()

public int getLabelsCount()

A key-value pair of the resource's labels (v1) to their values.

map<string, string> labels = 5;

Returns
Type Description
int

getLabelsMap()

public Map<String,String> getLabelsMap()

A key-value pair of the resource's labels (v1) to their values.

map<string, string> labels = 5;

Returns
Type Description
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

A key-value pair of the resource's labels (v1) to their values.

map<string, string> labels = 5;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

A key-value pair of the resource's labels (v1) to their values.

map<string, string> labels = 5;

Parameter
Name Description
key String
Returns
Type Description
String

getLocation()

public String getLocation()

Location can be global, regional like us-east1, or zonal like us-west1-b.

string location = 4;

Returns
Type Description
String

The location.

getLocationBytes()

public ByteString getLocationBytes()

Location can be global, regional like us-east1, or zonal like us-west1-b.

string location = 4;

Returns
Type Description
ByteString

The bytes for location.

getName()

public String getName()

The full resource name of the resource. Example: //compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

The full resource name of the resource. Example: //compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<ProtectedResource> getParserForType()
Returns
Type Description
Parser<ProtectedResource>
Overrides

getProject()

public String getProject()

Format: projects/{PROJECT_NUMBER}.

string project = 2;

Returns
Type Description
String

The project.

getProjectBytes()

public ByteString getProjectBytes()

Format: projects/{PROJECT_NUMBER}.

string project = 2;

Returns
Type Description
ByteString

The bytes for project.

getProjectId()

public String getProjectId()

The ID of the project that owns the resource.

string project_id = 9;

Returns
Type Description
String

The projectId.

getProjectIdBytes()

public ByteString getProjectIdBytes()

The ID of the project that owns the resource.

string project_id = 9;

Returns
Type Description
ByteString

The bytes for projectId.

getResourceType()

public String getResourceType()

Example: compute.googleapis.com/Disk

string resource_type = 3;

Returns
Type Description
String

The resourceType.

getResourceTypeBytes()

public ByteString getResourceTypeBytes()

Example: compute.googleapis.com/Disk

string resource_type = 3;

Returns
Type Description
ByteString

The bytes for resourceType.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hasCreateTime()

public boolean hasCreateTime()

Output only. The time at which this resource was created. The granularity is in seconds. Timestamp.nanos will always be 0.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the createTime field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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