Class ProtectedResource.Builder (0.18.0)

public static final class ProtectedResource.Builder extends GeneratedMessageV3.Builder<ProtectedResource.Builder> implements ProtectedResourceOrBuilder

Metadata about a resource protected by a Cloud KMS key.

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

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllCryptoKeyVersions(Iterable<String> values)

public ProtectedResource.Builder addAllCryptoKeyVersions(Iterable<String> values)

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
NameDescription
valuesIterable<String>

The cryptoKeyVersions to add.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

addCryptoKeyVersions(String value)

public ProtectedResource.Builder addCryptoKeyVersions(String value)

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
NameDescription
valueString

The cryptoKeyVersions to add.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

addCryptoKeyVersionsBytes(ByteString value)

public ProtectedResource.Builder addCryptoKeyVersionsBytes(ByteString value)

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
NameDescription
valueByteString

The bytes of the cryptoKeyVersions to add.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ProtectedResource.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ProtectedResource.Builder
Overrides

build()

public ProtectedResource build()
Returns
TypeDescription
ProtectedResource

buildPartial()

public ProtectedResource buildPartial()
Returns
TypeDescription
ProtectedResource

clear()

public ProtectedResource.Builder clear()
Returns
TypeDescription
ProtectedResource.Builder
Overrides

clearCloudProduct()

public ProtectedResource.Builder clearCloudProduct()

The Cloud product that owns the resource. Example: compute

string cloud_product = 8;

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

clearCreateTime()

public ProtectedResource.Builder clearCreateTime()

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
TypeDescription
ProtectedResource.Builder

clearCryptoKeyVersion()

public ProtectedResource.Builder clearCryptoKeyVersion()

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
TypeDescription
ProtectedResource.Builder

This builder for chaining.

clearCryptoKeyVersions()

public ProtectedResource.Builder clearCryptoKeyVersions()

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
TypeDescription
ProtectedResource.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public ProtectedResource.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
ProtectedResource.Builder
Overrides

clearLabels()

public ProtectedResource.Builder clearLabels()
Returns
TypeDescription
ProtectedResource.Builder

clearLocation()

public ProtectedResource.Builder clearLocation()

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

string location = 4;

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

clearName()

public ProtectedResource.Builder clearName()

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

string name = 1;

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public ProtectedResource.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
ProtectedResource.Builder
Overrides

clearProject()

public ProtectedResource.Builder clearProject()

Format: projects/{PROJECT_NUMBER}.

string project = 2;

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

clearProjectId()

public ProtectedResource.Builder clearProjectId()

The ID of the project that owns the resource.

string project_id = 9;

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

clearResourceType()

public ProtectedResource.Builder clearResourceType()

Example: compute.googleapis.com/Disk

string resource_type = 3;

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

clone()

public ProtectedResource.Builder clone()
Returns
TypeDescription
ProtectedResource.Builder
Overrides

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
NameDescription
keyString
Returns
TypeDescription
boolean

getCloudProduct()

public String getCloudProduct()

The Cloud product that owns the resource. Example: compute

string cloud_product = 8;

Returns
TypeDescription
String

The cloudProduct.

getCloudProductBytes()

public ByteString getCloudProductBytes()

The Cloud product that owns the resource. Example: compute

string cloud_product = 8;

Returns
TypeDescription
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
TypeDescription
Timestamp

The createTime.

getCreateTimeBuilder()

public Timestamp.Builder getCreateTimeBuilder()

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
TypeDescription
Builder

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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ProtocolStringList

A list containing the cryptoKeyVersions.

getDefaultInstanceForType()

public ProtectedResource getDefaultInstanceForType()
Returns
TypeDescription
ProtectedResource

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getLabels()

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
keyString
defaultValueString
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
String

getLocation()

public String getLocation()

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

string location = 4;

Returns
TypeDescription
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
TypeDescription
ByteString

The bytes for location.

getMutableLabels()

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

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
TypeDescription
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
TypeDescription
ByteString

The bytes for name.

getProject()

public String getProject()

Format: projects/{PROJECT_NUMBER}.

string project = 2;

Returns
TypeDescription
String

The project.

getProjectBytes()

public ByteString getProjectBytes()

Format: projects/{PROJECT_NUMBER}.

string project = 2;

Returns
TypeDescription
ByteString

The bytes for project.

getProjectId()

public String getProjectId()

The ID of the project that owns the resource.

string project_id = 9;

Returns
TypeDescription
String

The projectId.

getProjectIdBytes()

public ByteString getProjectIdBytes()

The ID of the project that owns the resource.

string project_id = 9;

Returns
TypeDescription
ByteString

The bytes for projectId.

getResourceType()

public String getResourceType()

Example: compute.googleapis.com/Disk

string resource_type = 3;

Returns
TypeDescription
String

The resourceType.

getResourceTypeBytes()

public ByteString getResourceTypeBytes()

Example: compute.googleapis.com/Disk

string resource_type = 3;

Returns
TypeDescription
ByteString

The bytes for resourceType.

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
TypeDescription
boolean

Whether the createTime field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeCreateTime(Timestamp value)

public ProtectedResource.Builder mergeCreateTime(Timestamp value)

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];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
ProtectedResource.Builder

mergeFrom(ProtectedResource other)

public ProtectedResource.Builder mergeFrom(ProtectedResource other)
Parameter
NameDescription
otherProtectedResource
Returns
TypeDescription
ProtectedResource.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ProtectedResource.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProtectedResource.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public ProtectedResource.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
ProtectedResource.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ProtectedResource.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ProtectedResource.Builder
Overrides

putAllLabels(Map<String,String> values)

public ProtectedResource.Builder putAllLabels(Map<String,String> values)

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

map<string, string> labels = 5;

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
ProtectedResource.Builder

putLabels(String key, String value)

public ProtectedResource.Builder putLabels(String key, String value)

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

map<string, string> labels = 5;

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
ProtectedResource.Builder

removeLabels(String key)

public ProtectedResource.Builder removeLabels(String key)

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

map<string, string> labels = 5;

Parameter
NameDescription
keyString
Returns
TypeDescription
ProtectedResource.Builder

setCloudProduct(String value)

public ProtectedResource.Builder setCloudProduct(String value)

The Cloud product that owns the resource. Example: compute

string cloud_product = 8;

Parameter
NameDescription
valueString

The cloudProduct to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setCloudProductBytes(ByteString value)

public ProtectedResource.Builder setCloudProductBytes(ByteString value)

The Cloud product that owns the resource. Example: compute

string cloud_product = 8;

Parameter
NameDescription
valueByteString

The bytes for cloudProduct to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setCreateTime(Timestamp value)

public ProtectedResource.Builder setCreateTime(Timestamp value)

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];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
ProtectedResource.Builder

setCreateTime(Timestamp.Builder builderForValue)

public ProtectedResource.Builder setCreateTime(Timestamp.Builder builderForValue)

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];

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
ProtectedResource.Builder

setCryptoKeyVersion(String value)

public ProtectedResource.Builder setCryptoKeyVersion(String value)

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) = { ... }

Parameter
NameDescription
valueString

The cryptoKeyVersion to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setCryptoKeyVersionBytes(ByteString value)

public ProtectedResource.Builder setCryptoKeyVersionBytes(ByteString value)

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) = { ... }

Parameter
NameDescription
valueByteString

The bytes for cryptoKeyVersion to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setCryptoKeyVersions(int index, String value)

public ProtectedResource.Builder setCryptoKeyVersions(int index, String value)

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) = { ... }

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The cryptoKeyVersions to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public ProtectedResource.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ProtectedResource.Builder
Overrides

setLocation(String value)

public ProtectedResource.Builder setLocation(String value)

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

string location = 4;

Parameter
NameDescription
valueString

The location to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setLocationBytes(ByteString value)

public ProtectedResource.Builder setLocationBytes(ByteString value)

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

string location = 4;

Parameter
NameDescription
valueByteString

The bytes for location to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setName(String value)

public ProtectedResource.Builder setName(String value)

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

string name = 1;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setNameBytes(ByteString value)

public ProtectedResource.Builder setNameBytes(ByteString value)

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

string name = 1;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setProject(String value)

public ProtectedResource.Builder setProject(String value)

Format: projects/{PROJECT_NUMBER}.

string project = 2;

Parameter
NameDescription
valueString

The project to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setProjectBytes(ByteString value)

public ProtectedResource.Builder setProjectBytes(ByteString value)

Format: projects/{PROJECT_NUMBER}.

string project = 2;

Parameter
NameDescription
valueByteString

The bytes for project to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setProjectId(String value)

public ProtectedResource.Builder setProjectId(String value)

The ID of the project that owns the resource.

string project_id = 9;

Parameter
NameDescription
valueString

The projectId to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setProjectIdBytes(ByteString value)

public ProtectedResource.Builder setProjectIdBytes(ByteString value)

The ID of the project that owns the resource.

string project_id = 9;

Parameter
NameDescription
valueByteString

The bytes for projectId to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public ProtectedResource.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
ProtectedResource.Builder
Overrides

setResourceType(String value)

public ProtectedResource.Builder setResourceType(String value)

Example: compute.googleapis.com/Disk

string resource_type = 3;

Parameter
NameDescription
valueString

The resourceType to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setResourceTypeBytes(ByteString value)

public ProtectedResource.Builder setResourceTypeBytes(ByteString value)

Example: compute.googleapis.com/Disk

string resource_type = 3;

Parameter
NameDescription
valueByteString

The bytes for resourceType to set.

Returns
TypeDescription
ProtectedResource.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final ProtectedResource.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ProtectedResource.Builder
Overrides