Class Secret.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Secret.Builder>
com.google.cloud.secretmanager.v1beta1.Secret.Builder
All Implemented Interfaces:
SecretOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Secret

public static final class Secret.Builder extends com.google.protobuf.GeneratedMessage.Builder<Secret.Builder> implements SecretOrBuilder
 A [Secret][google.cloud.secrets.v1beta1.Secret] is a logical secret whose
 value and versions can be accessed.

 A [Secret][google.cloud.secrets.v1beta1.Secret] is made up of zero or more
 [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion] that represent
 the secret data.
 
Protobuf type google.cloud.secrets.v1beta1.Secret
  • Method Details

    • getDescriptor

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

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<Secret.Builder>
    • internalGetMutableMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
      Overrides:
      internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<Secret.Builder>
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<Secret.Builder>
    • clear

      public Secret.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<Secret.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<Secret.Builder>
    • getDefaultInstanceForType

      public Secret getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public Secret build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public Secret buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public Secret.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Secret.Builder>
    • mergeFrom

      public Secret.Builder mergeFrom(Secret other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<Secret.Builder>
    • mergeFrom

      public Secret.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Secret.Builder>
      Throws:
      IOException
    • getName

      public String getName()
       Output only. The resource name of the
       [Secret][google.cloud.secrets.v1beta1.Secret] in the format
       `projects/*/secrets/*`.
       
      string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getName in interface SecretOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Output only. The resource name of the
       [Secret][google.cloud.secrets.v1beta1.Secret] in the format
       `projects/*/secrets/*`.
       
      string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getNameBytes in interface SecretOrBuilder
      Returns:
      The bytes for name.
    • setName

      public Secret.Builder setName(String value)
       Output only. The resource name of the
       [Secret][google.cloud.secrets.v1beta1.Secret] in the format
       `projects/*/secrets/*`.
       
      string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public Secret.Builder clearName()
       Output only. The resource name of the
       [Secret][google.cloud.secrets.v1beta1.Secret] in the format
       `projects/*/secrets/*`.
       
      string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Returns:
      This builder for chaining.
    • setNameBytes

      public Secret.Builder setNameBytes(com.google.protobuf.ByteString value)
       Output only. The resource name of the
       [Secret][google.cloud.secrets.v1beta1.Secret] in the format
       `projects/*/secrets/*`.
       
      string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • hasReplication

      public boolean hasReplication()
       Required. Immutable. The replication policy of the secret data attached to
       the [Secret][google.cloud.secrets.v1beta1.Secret].
      
       The replication policy cannot be changed after the Secret has been created.
       
      .google.cloud.secrets.v1beta1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];
      Specified by:
      hasReplication in interface SecretOrBuilder
      Returns:
      Whether the replication field is set.
    • getReplication

      public Replication getReplication()
       Required. Immutable. The replication policy of the secret data attached to
       the [Secret][google.cloud.secrets.v1beta1.Secret].
      
       The replication policy cannot be changed after the Secret has been created.
       
      .google.cloud.secrets.v1beta1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];
      Specified by:
      getReplication in interface SecretOrBuilder
      Returns:
      The replication.
    • setReplication

      public Secret.Builder setReplication(Replication value)
       Required. Immutable. The replication policy of the secret data attached to
       the [Secret][google.cloud.secrets.v1beta1.Secret].
      
       The replication policy cannot be changed after the Secret has been created.
       
      .google.cloud.secrets.v1beta1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];
    • setReplication

      public Secret.Builder setReplication(Replication.Builder builderForValue)
       Required. Immutable. The replication policy of the secret data attached to
       the [Secret][google.cloud.secrets.v1beta1.Secret].
      
       The replication policy cannot be changed after the Secret has been created.
       
      .google.cloud.secrets.v1beta1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];
    • mergeReplication

      public Secret.Builder mergeReplication(Replication value)
       Required. Immutable. The replication policy of the secret data attached to
       the [Secret][google.cloud.secrets.v1beta1.Secret].
      
       The replication policy cannot be changed after the Secret has been created.
       
      .google.cloud.secrets.v1beta1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];
    • clearReplication

      public Secret.Builder clearReplication()
       Required. Immutable. The replication policy of the secret data attached to
       the [Secret][google.cloud.secrets.v1beta1.Secret].
      
       The replication policy cannot be changed after the Secret has been created.
       
      .google.cloud.secrets.v1beta1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];
    • getReplicationBuilder

      public Replication.Builder getReplicationBuilder()
       Required. Immutable. The replication policy of the secret data attached to
       the [Secret][google.cloud.secrets.v1beta1.Secret].
      
       The replication policy cannot be changed after the Secret has been created.
       
      .google.cloud.secrets.v1beta1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];
    • getReplicationOrBuilder

      public ReplicationOrBuilder getReplicationOrBuilder()
       Required. Immutable. The replication policy of the secret data attached to
       the [Secret][google.cloud.secrets.v1beta1.Secret].
      
       The replication policy cannot be changed after the Secret has been created.
       
      .google.cloud.secrets.v1beta1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];
      Specified by:
      getReplicationOrBuilder in interface SecretOrBuilder
    • hasCreateTime

      public boolean hasCreateTime()
       Output only. The time at which the
       [Secret][google.cloud.secrets.v1beta1.Secret] was created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasCreateTime in interface SecretOrBuilder
      Returns:
      Whether the createTime field is set.
    • getCreateTime

      public com.google.protobuf.Timestamp getCreateTime()
       Output only. The time at which the
       [Secret][google.cloud.secrets.v1beta1.Secret] was created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTime in interface SecretOrBuilder
      Returns:
      The createTime.
    • setCreateTime

      public Secret.Builder setCreateTime(com.google.protobuf.Timestamp value)
       Output only. The time at which the
       [Secret][google.cloud.secrets.v1beta1.Secret] was created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • setCreateTime

      public Secret.Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue)
       Output only. The time at which the
       [Secret][google.cloud.secrets.v1beta1.Secret] was created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • mergeCreateTime

      public Secret.Builder mergeCreateTime(com.google.protobuf.Timestamp value)
       Output only. The time at which the
       [Secret][google.cloud.secrets.v1beta1.Secret] was created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • clearCreateTime

      public Secret.Builder clearCreateTime()
       Output only. The time at which the
       [Secret][google.cloud.secrets.v1beta1.Secret] was created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getCreateTimeBuilder

      public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder()
       Output only. The time at which the
       [Secret][google.cloud.secrets.v1beta1.Secret] was created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getCreateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder()
       Output only. The time at which the
       [Secret][google.cloud.secrets.v1beta1.Secret] was created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTimeOrBuilder in interface SecretOrBuilder
    • getLabelsCount

      public int getLabelsCount()
      Description copied from interface: SecretOrBuilder
       The labels assigned to this Secret.
      
       Label keys must be between 1 and 63 characters long, have a UTF-8 encoding
       of maximum 128 bytes, and must conform to the following PCRE regular
       expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`
      
       Label values must be between 0 and 63 characters long, have a UTF-8
       encoding of maximum 128 bytes, and must conform to the following PCRE
       regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`
      
       No more than 64 labels can be assigned to a given resource.
       
      map<string, string> labels = 4;
      Specified by:
      getLabelsCount in interface SecretOrBuilder
    • containsLabels

      public boolean containsLabels(String key)
       The labels assigned to this Secret.
      
       Label keys must be between 1 and 63 characters long, have a UTF-8 encoding
       of maximum 128 bytes, and must conform to the following PCRE regular
       expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`
      
       Label values must be between 0 and 63 characters long, have a UTF-8
       encoding of maximum 128 bytes, and must conform to the following PCRE
       regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`
      
       No more than 64 labels can be assigned to a given resource.
       
      map<string, string> labels = 4;
      Specified by:
      containsLabels in interface SecretOrBuilder
    • getLabels

      @Deprecated public Map<String,String> getLabels()
      Deprecated.
      Use getLabelsMap() instead.
      Specified by:
      getLabels in interface SecretOrBuilder
    • getLabelsMap

      public Map<String,String> getLabelsMap()
       The labels assigned to this Secret.
      
       Label keys must be between 1 and 63 characters long, have a UTF-8 encoding
       of maximum 128 bytes, and must conform to the following PCRE regular
       expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`
      
       Label values must be between 0 and 63 characters long, have a UTF-8
       encoding of maximum 128 bytes, and must conform to the following PCRE
       regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`
      
       No more than 64 labels can be assigned to a given resource.
       
      map<string, string> labels = 4;
      Specified by:
      getLabelsMap in interface SecretOrBuilder
    • getLabelsOrDefault

      public String getLabelsOrDefault(String key, String defaultValue)
       The labels assigned to this Secret.
      
       Label keys must be between 1 and 63 characters long, have a UTF-8 encoding
       of maximum 128 bytes, and must conform to the following PCRE regular
       expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`
      
       Label values must be between 0 and 63 characters long, have a UTF-8
       encoding of maximum 128 bytes, and must conform to the following PCRE
       regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`
      
       No more than 64 labels can be assigned to a given resource.
       
      map<string, string> labels = 4;
      Specified by:
      getLabelsOrDefault in interface SecretOrBuilder
    • getLabelsOrThrow

      public String getLabelsOrThrow(String key)
       The labels assigned to this Secret.
      
       Label keys must be between 1 and 63 characters long, have a UTF-8 encoding
       of maximum 128 bytes, and must conform to the following PCRE regular
       expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`
      
       Label values must be between 0 and 63 characters long, have a UTF-8
       encoding of maximum 128 bytes, and must conform to the following PCRE
       regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`
      
       No more than 64 labels can be assigned to a given resource.
       
      map<string, string> labels = 4;
      Specified by:
      getLabelsOrThrow in interface SecretOrBuilder
    • clearLabels

      public Secret.Builder clearLabels()
    • removeLabels

      public Secret.Builder removeLabels(String key)
       The labels assigned to this Secret.
      
       Label keys must be between 1 and 63 characters long, have a UTF-8 encoding
       of maximum 128 bytes, and must conform to the following PCRE regular
       expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`
      
       Label values must be between 0 and 63 characters long, have a UTF-8
       encoding of maximum 128 bytes, and must conform to the following PCRE
       regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`
      
       No more than 64 labels can be assigned to a given resource.
       
      map<string, string> labels = 4;
    • getMutableLabels

      @Deprecated public Map<String,String> getMutableLabels()
      Deprecated.
      Use alternate mutation accessors instead.
    • putLabels

      public Secret.Builder putLabels(String key, String value)
       The labels assigned to this Secret.
      
       Label keys must be between 1 and 63 characters long, have a UTF-8 encoding
       of maximum 128 bytes, and must conform to the following PCRE regular
       expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`
      
       Label values must be between 0 and 63 characters long, have a UTF-8
       encoding of maximum 128 bytes, and must conform to the following PCRE
       regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`
      
       No more than 64 labels can be assigned to a given resource.
       
      map<string, string> labels = 4;
    • putAllLabels

      public Secret.Builder putAllLabels(Map<String,String> values)
       The labels assigned to this Secret.
      
       Label keys must be between 1 and 63 characters long, have a UTF-8 encoding
       of maximum 128 bytes, and must conform to the following PCRE regular
       expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`
      
       Label values must be between 0 and 63 characters long, have a UTF-8
       encoding of maximum 128 bytes, and must conform to the following PCRE
       regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`
      
       No more than 64 labels can be assigned to a given resource.
       
      map<string, string> labels = 4;