Class ProtectedResource

  • All Implemented Interfaces:
    ProtectedResourceOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class ProtectedResource
    extends com.google.protobuf.GeneratedMessageV3
    implements ProtectedResourceOrBuilder
     Metadata about a resource protected by a Cloud KMS key.
     
    Protobuf type google.cloud.kms.inventory.v1.ProtectedResource
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ProtectedResource.Builder
      Metadata about a resource protected by a Cloud KMS key.
      • Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3

        com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,​BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,​BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
      • Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

        com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetMapField

        protected com.google.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class com.google.protobuf.GeneratedMessageV3
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • 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;
        Specified by:
        getName in interface ProtectedResourceOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         The full resource name of the resource.
         Example:
         `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
         
        string name = 1;
        Specified by:
        getNameBytes in interface ProtectedResourceOrBuilder
        Returns:
        The bytes for name.
      • getProjectBytes

        public com.google.protobuf.ByteString getProjectBytes()
         Format: `projects/{PROJECT_NUMBER}`.
         
        string project = 2;
        Specified by:
        getProjectBytes in interface ProtectedResourceOrBuilder
        Returns:
        The bytes for project.
      • getProjectIdBytes

        public com.google.protobuf.ByteString getProjectIdBytes()
         The ID of the project that owns the resource.
         
        string project_id = 9;
        Specified by:
        getProjectIdBytes in interface ProtectedResourceOrBuilder
        Returns:
        The bytes for projectId.
      • getCloudProduct

        public String getCloudProduct()
         The Cloud product that owns the resource.
         Example: `compute`
         
        string cloud_product = 8;
        Specified by:
        getCloudProduct in interface ProtectedResourceOrBuilder
        Returns:
        The cloudProduct.
      • getCloudProductBytes

        public com.google.protobuf.ByteString getCloudProductBytes()
         The Cloud product that owns the resource.
         Example: `compute`
         
        string cloud_product = 8;
        Specified by:
        getCloudProductBytes in interface ProtectedResourceOrBuilder
        Returns:
        The bytes for cloudProduct.
      • getResourceTypeBytes

        public com.google.protobuf.ByteString getResourceTypeBytes()
         Example: `compute.googleapis.com/Disk`
         
        string resource_type = 3;
        Specified by:
        getResourceTypeBytes in interface ProtectedResourceOrBuilder
        Returns:
        The bytes for resourceType.
      • getLocation

        public String getLocation()
         Location can be `global`, regional like `us-east1`, or zonal like
         `us-west1-b`.
         
        string location = 4;
        Specified by:
        getLocation in interface ProtectedResourceOrBuilder
        Returns:
        The location.
      • getLocationBytes

        public com.google.protobuf.ByteString getLocationBytes()
         Location can be `global`, regional like `us-east1`, or zonal like
         `us-west1-b`.
         
        string location = 4;
        Specified by:
        getLocationBytes in interface ProtectedResourceOrBuilder
        Returns:
        The bytes for location.
      • containsLabels

        public boolean containsLabels​(String key)
         A key-value pair of the resource's labels (v1) to their values.
         
        map<string, string> labels = 5;
        Specified by:
        containsLabels in interface ProtectedResourceOrBuilder
      • getCryptoKeyVersion

        public String getCryptoKeyVersion()
         The name of the Cloud KMS
         [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en)
         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) = { ... }
        Specified by:
        getCryptoKeyVersion in interface ProtectedResourceOrBuilder
        Returns:
        The cryptoKeyVersion.
      • getCryptoKeyVersionBytes

        public com.google.protobuf.ByteString getCryptoKeyVersionBytes()
         The name of the Cloud KMS
         [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en)
         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) = { ... }
        Specified by:
        getCryptoKeyVersionBytes in interface ProtectedResourceOrBuilder
        Returns:
        The bytes for cryptoKeyVersion.
      • getCryptoKeyVersionsList

        public com.google.protobuf.ProtocolStringList getCryptoKeyVersionsList()
         The names of the Cloud KMS
         [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en)
         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) = { ... }
        Specified by:
        getCryptoKeyVersionsList in interface ProtectedResourceOrBuilder
        Returns:
        A list containing the cryptoKeyVersions.
      • getCryptoKeyVersionsCount

        public int getCryptoKeyVersionsCount()
         The names of the Cloud KMS
         [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en)
         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) = { ... }
        Specified by:
        getCryptoKeyVersionsCount in interface ProtectedResourceOrBuilder
        Returns:
        The count of cryptoKeyVersions.
      • getCryptoKeyVersions

        public String getCryptoKeyVersions​(int index)
         The names of the Cloud KMS
         [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en)
         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) = { ... }
        Specified by:
        getCryptoKeyVersions in interface ProtectedResourceOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The cryptoKeyVersions at the given index.
      • getCryptoKeyVersionsBytes

        public com.google.protobuf.ByteString getCryptoKeyVersionsBytes​(int index)
         The names of the Cloud KMS
         [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en)
         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) = { ... }
        Specified by:
        getCryptoKeyVersionsBytes in interface ProtectedResourceOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the cryptoKeyVersions at the given index.
      • 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];
        Specified by:
        hasCreateTime in interface ProtectedResourceOrBuilder
        Returns:
        Whether the createTime field is set.
      • getCreateTime

        public com.google.protobuf.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];
        Specified by:
        getCreateTime in interface ProtectedResourceOrBuilder
        Returns:
        The createTime.
      • getCreateTimeOrBuilder

        public com.google.protobuf.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];
        Specified by:
        getCreateTimeOrBuilder in interface ProtectedResourceOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static ProtectedResource parseFrom​(ByteBuffer data)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ProtectedResource parseFrom​(ByteBuffer data,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ProtectedResource parseFrom​(com.google.protobuf.ByteString data)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ProtectedResource parseFrom​(com.google.protobuf.ByteString data,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ProtectedResource parseFrom​(byte[] data)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ProtectedResource parseFrom​(byte[] data,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ProtectedResource parseFrom​(com.google.protobuf.CodedInputStream input,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws IOException
        Throws:
        IOException
      • newBuilderForType

        public ProtectedResource.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public ProtectedResource.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected ProtectedResource.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<ProtectedResource> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public ProtectedResource getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder