Class Key

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

    public final class Key
    extends com.google.protobuf.GeneratedMessageV3
    implements KeyOrBuilder
     The representation of a key managed by the API Keys API.
     
    Protobuf type google.api.apikeys.v2.Key
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Key.Builder
      The representation of a key managed by the API Keys API.
      • 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()
         Output only. The resource name of the key.
         The `name` has the form:
         `projects/<PROJECT_NUMBER>/locations/global/keys/<KEY_ID>`.
         For example:
         `projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2`
        
         NOTE: Key is a global resource; hence the only supported value for
         location is `global`.
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getName in interface KeyOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         Output only. The resource name of the key.
         The `name` has the form:
         `projects/<PROJECT_NUMBER>/locations/global/keys/<KEY_ID>`.
         For example:
         `projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2`
        
         NOTE: Key is a global resource; hence the only supported value for
         location is `global`.
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getNameBytes in interface KeyOrBuilder
        Returns:
        The bytes for name.
      • getUid

        public String getUid()
         Output only. Unique id in UUID4 format.
         
        string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getUid in interface KeyOrBuilder
        Returns:
        The uid.
      • getUidBytes

        public com.google.protobuf.ByteString getUidBytes()
         Output only. Unique id in UUID4 format.
         
        string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getUidBytes in interface KeyOrBuilder
        Returns:
        The bytes for uid.
      • getDisplayName

        public String getDisplayName()
         Human-readable display name of this key that you can modify.
         The maximum length is 63 characters.
         
        string display_name = 2;
        Specified by:
        getDisplayName in interface KeyOrBuilder
        Returns:
        The displayName.
      • getDisplayNameBytes

        public com.google.protobuf.ByteString getDisplayNameBytes()
         Human-readable display name of this key that you can modify.
         The maximum length is 63 characters.
         
        string display_name = 2;
        Specified by:
        getDisplayNameBytes in interface KeyOrBuilder
        Returns:
        The bytes for displayName.
      • getKeyString

        public String getKeyString()
         Output only. An encrypted and signed value held by this key.
         This field can be accessed only through the `GetKeyString` method.
         
        string key_string = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getKeyString in interface KeyOrBuilder
        Returns:
        The keyString.
      • getKeyStringBytes

        public com.google.protobuf.ByteString getKeyStringBytes()
         Output only. An encrypted and signed value held by this key.
         This field can be accessed only through the `GetKeyString` method.
         
        string key_string = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getKeyStringBytes in interface KeyOrBuilder
        Returns:
        The bytes for keyString.
      • hasCreateTime

        public boolean hasCreateTime()
         Output only. A timestamp identifying the time this key was originally
         created.
         
        .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        hasCreateTime in interface KeyOrBuilder
        Returns:
        Whether the createTime field is set.
      • getCreateTime

        public com.google.protobuf.Timestamp getCreateTime()
         Output only. A timestamp identifying the time this key was originally
         created.
         
        .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getCreateTime in interface KeyOrBuilder
        Returns:
        The createTime.
      • getCreateTimeOrBuilder

        public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder()
         Output only. A timestamp identifying the time this key was originally
         created.
         
        .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getCreateTimeOrBuilder in interface KeyOrBuilder
      • hasUpdateTime

        public boolean hasUpdateTime()
         Output only. A timestamp identifying the time this key was last
         updated.
         
        .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        hasUpdateTime in interface KeyOrBuilder
        Returns:
        Whether the updateTime field is set.
      • getUpdateTime

        public com.google.protobuf.Timestamp getUpdateTime()
         Output only. A timestamp identifying the time this key was last
         updated.
         
        .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getUpdateTime in interface KeyOrBuilder
        Returns:
        The updateTime.
      • getUpdateTimeOrBuilder

        public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder()
         Output only. A timestamp identifying the time this key was last
         updated.
         
        .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getUpdateTimeOrBuilder in interface KeyOrBuilder
      • hasDeleteTime

        public boolean hasDeleteTime()
         Output only. A timestamp when this key was deleted. If the resource is not deleted,
         this must be empty.
         
        .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        hasDeleteTime in interface KeyOrBuilder
        Returns:
        Whether the deleteTime field is set.
      • getDeleteTime

        public com.google.protobuf.Timestamp getDeleteTime()
         Output only. A timestamp when this key was deleted. If the resource is not deleted,
         this must be empty.
         
        .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getDeleteTime in interface KeyOrBuilder
        Returns:
        The deleteTime.
      • getDeleteTimeOrBuilder

        public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder()
         Output only. A timestamp when this key was deleted. If the resource is not deleted,
         this must be empty.
         
        .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getDeleteTimeOrBuilder in interface KeyOrBuilder
      • getAnnotationsCount

        public int getAnnotationsCount()
        Description copied from interface: KeyOrBuilder
         Annotations is an unstructured key-value map stored with a policy that
         may be set by external tools to store and retrieve arbitrary metadata.
         They are not queryable and should be preserved when modifying objects.
         
        map<string, string> annotations = 8;
        Specified by:
        getAnnotationsCount in interface KeyOrBuilder
      • containsAnnotations

        public boolean containsAnnotations​(String key)
         Annotations is an unstructured key-value map stored with a policy that
         may be set by external tools to store and retrieve arbitrary metadata.
         They are not queryable and should be preserved when modifying objects.
         
        map<string, string> annotations = 8;
        Specified by:
        containsAnnotations in interface KeyOrBuilder
      • getAnnotationsMap

        public Map<String,​String> getAnnotationsMap()
         Annotations is an unstructured key-value map stored with a policy that
         may be set by external tools to store and retrieve arbitrary metadata.
         They are not queryable and should be preserved when modifying objects.
         
        map<string, string> annotations = 8;
        Specified by:
        getAnnotationsMap in interface KeyOrBuilder
      • getAnnotationsOrDefault

        public String getAnnotationsOrDefault​(String key,
                                              String defaultValue)
         Annotations is an unstructured key-value map stored with a policy that
         may be set by external tools to store and retrieve arbitrary metadata.
         They are not queryable and should be preserved when modifying objects.
         
        map<string, string> annotations = 8;
        Specified by:
        getAnnotationsOrDefault in interface KeyOrBuilder
      • getAnnotationsOrThrow

        public String getAnnotationsOrThrow​(String key)
         Annotations is an unstructured key-value map stored with a policy that
         may be set by external tools to store and retrieve arbitrary metadata.
         They are not queryable and should be preserved when modifying objects.
         
        map<string, string> annotations = 8;
        Specified by:
        getAnnotationsOrThrow in interface KeyOrBuilder
      • hasRestrictions

        public boolean hasRestrictions()
         Key restrictions.
         
        .google.api.apikeys.v2.Restrictions restrictions = 9;
        Specified by:
        hasRestrictions in interface KeyOrBuilder
        Returns:
        Whether the restrictions field is set.
      • getRestrictions

        public Restrictions getRestrictions()
         Key restrictions.
         
        .google.api.apikeys.v2.Restrictions restrictions = 9;
        Specified by:
        getRestrictions in interface KeyOrBuilder
        Returns:
        The restrictions.
      • getEtag

        public String getEtag()
         Output only. A checksum computed by the server based on the current value of the Key
         resource. This may be sent on update and delete requests to ensure the
         client has an up-to-date value before proceeding.
         See https://google.aip.dev/154.
         
        string etag = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getEtag in interface KeyOrBuilder
        Returns:
        The etag.
      • getEtagBytes

        public com.google.protobuf.ByteString getEtagBytes()
         Output only. A checksum computed by the server based on the current value of the Key
         resource. This may be sent on update and delete requests to ensure the
         client has an up-to-date value before proceeding.
         See https://google.aip.dev/154.
         
        string etag = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getEtagBytes in interface KeyOrBuilder
        Returns:
        The bytes for etag.
      • 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 Key parseFrom​(ByteBuffer data)
                             throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

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

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

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

        public static Key parseDelimitedFrom​(InputStream input,
                                             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                      throws IOException
        Throws:
        IOException
      • parseFrom

        public static Key parseFrom​(com.google.protobuf.CodedInputStream input)
                             throws IOException
        Throws:
        IOException
      • parseFrom

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

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

        public static Key.Builder newBuilder​(Key prototype)
      • toBuilder

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

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

        public static Key getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<Key> parser()
      • getParserForType

        public com.google.protobuf.Parser<Key> 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 Key getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder