Class ProtectedResource (0.16.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
TypeDescription
int

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

CRYPTO_KEY_VERSIONS_FIELD_NUMBER

public static final int CRYPTO_KEY_VERSIONS_FIELD_NUMBER
Field Value
TypeDescription
int

CRYPTO_KEY_VERSION_FIELD_NUMBER

public static final int CRYPTO_KEY_VERSION_FIELD_NUMBER
Field Value
TypeDescription
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
TypeDescription
int

LOCATION_FIELD_NUMBER

public static final int LOCATION_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

PROJECT_FIELD_NUMBER

public static final int PROJECT_FIELD_NUMBER
Field Value
TypeDescription
int

PROJECT_ID_FIELD_NUMBER

public static final int PROJECT_ID_FIELD_NUMBER
Field Value
TypeDescription
int

RESOURCE_TYPE_FIELD_NUMBER

public static final int RESOURCE_TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static ProtectedResource getDefaultInstance()
Returns
TypeDescription
ProtectedResource

getDescriptor()

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

newBuilder()

public static ProtectedResource.Builder newBuilder()
Returns
TypeDescription
ProtectedResource.Builder

newBuilder(ProtectedResource prototype)

public static ProtectedResource.Builder newBuilder(ProtectedResource prototype)
Parameter
NameDescription
prototypeProtectedResource
Returns
TypeDescription
ProtectedResource.Builder

parseDelimitedFrom(InputStream input)

public static ProtectedResource parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
ProtectedResource
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ProtectedResource parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProtectedResource
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static ProtectedResource parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
ProtectedResource
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ProtectedResource parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProtectedResource
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ProtectedResource parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
ProtectedResource
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ProtectedResource parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProtectedResource
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ProtectedResource parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
ProtectedResource
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ProtectedResource parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProtectedResource
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static ProtectedResource parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
ProtectedResource
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ProtectedResource parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProtectedResource
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static ProtectedResource parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
ProtectedResource
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ProtectedResource parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProtectedResource
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<ProtectedResource> parser()
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

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.

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

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.

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.

getParserForType()

public Parser<ProtectedResource> getParserForType()
Returns
TypeDescription
Parser<ProtectedResource>
Overrides

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.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
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
TypeDescription
boolean

Whether the createTime field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

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

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected ProtectedResource.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
ProtectedResource.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

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

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException