Class SecretVolume.Builder

  • All Implemented Interfaces:
    SecretVolumeOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    SecretVolume

    public static final class SecretVolume.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<SecretVolume.Builder>
    implements SecretVolumeOrBuilder
     Configuration for a secret volume. It has the information necessary to fetch
     the secret value from Secret Manager and make it available as files mounted
     at the requested paths within the application container. Secret value is not
     a part of the configuration. Every file system read operation performs a
     lookup in Secret Manager to retrieve the secret value.
     
    Protobuf type google.cloud.functions.v1.SecretVolume
    • Method Detail

      • getDescriptor

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

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

        public SecretVolume.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.GeneratedMessageV3.Builder<SecretVolume.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.GeneratedMessageV3.Builder<SecretVolume.Builder>
      • getDefaultInstanceForType

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

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

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

        public SecretVolume.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<SecretVolume.Builder>
      • setField

        public SecretVolume.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                             Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<SecretVolume.Builder>
      • clearField

        public SecretVolume.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<SecretVolume.Builder>
      • clearOneof

        public SecretVolume.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<SecretVolume.Builder>
      • setRepeatedField

        public SecretVolume.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                     int index,
                                                     Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<SecretVolume.Builder>
      • addRepeatedField

        public SecretVolume.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                     Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<SecretVolume.Builder>
      • mergeFrom

        public SecretVolume.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<SecretVolume.Builder>
      • isInitialized

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

        public SecretVolume.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<SecretVolume.Builder>
        Throws:
        IOException
      • getMountPath

        public String getMountPath()
         The path within the container to mount the secret volume. For example,
         setting the mount_path as `/etc/secrets` mounts the secret value files
         under the `/etc/secrets` directory. This directory is also completely
         shadowed and unavailable to mount any other secrets.
        
         Recommended mount paths: /etc/secrets
         Restricted mount paths: /cloudsql, /dev/log, /pod, /proc, /var/log
         
        string mount_path = 1;
        Specified by:
        getMountPath in interface SecretVolumeOrBuilder
        Returns:
        The mountPath.
      • getMountPathBytes

        public com.google.protobuf.ByteString getMountPathBytes()
         The path within the container to mount the secret volume. For example,
         setting the mount_path as `/etc/secrets` mounts the secret value files
         under the `/etc/secrets` directory. This directory is also completely
         shadowed and unavailable to mount any other secrets.
        
         Recommended mount paths: /etc/secrets
         Restricted mount paths: /cloudsql, /dev/log, /pod, /proc, /var/log
         
        string mount_path = 1;
        Specified by:
        getMountPathBytes in interface SecretVolumeOrBuilder
        Returns:
        The bytes for mountPath.
      • setMountPath

        public SecretVolume.Builder setMountPath​(String value)
         The path within the container to mount the secret volume. For example,
         setting the mount_path as `/etc/secrets` mounts the secret value files
         under the `/etc/secrets` directory. This directory is also completely
         shadowed and unavailable to mount any other secrets.
        
         Recommended mount paths: /etc/secrets
         Restricted mount paths: /cloudsql, /dev/log, /pod, /proc, /var/log
         
        string mount_path = 1;
        Parameters:
        value - The mountPath to set.
        Returns:
        This builder for chaining.
      • clearMountPath

        public SecretVolume.Builder clearMountPath()
         The path within the container to mount the secret volume. For example,
         setting the mount_path as `/etc/secrets` mounts the secret value files
         under the `/etc/secrets` directory. This directory is also completely
         shadowed and unavailable to mount any other secrets.
        
         Recommended mount paths: /etc/secrets
         Restricted mount paths: /cloudsql, /dev/log, /pod, /proc, /var/log
         
        string mount_path = 1;
        Returns:
        This builder for chaining.
      • setMountPathBytes

        public SecretVolume.Builder setMountPathBytes​(com.google.protobuf.ByteString value)
         The path within the container to mount the secret volume. For example,
         setting the mount_path as `/etc/secrets` mounts the secret value files
         under the `/etc/secrets` directory. This directory is also completely
         shadowed and unavailable to mount any other secrets.
        
         Recommended mount paths: /etc/secrets
         Restricted mount paths: /cloudsql, /dev/log, /pod, /proc, /var/log
         
        string mount_path = 1;
        Parameters:
        value - The bytes for mountPath to set.
        Returns:
        This builder for chaining.
      • getProjectId

        public String getProjectId()
         Project identifier (preferrably project number but can also be the project
         ID) of the project that contains the secret. If not set, it is
         populated with the function's project, assuming that the secret exists in
         the same project as the function.
         
        string project_id = 2;
        Specified by:
        getProjectId in interface SecretVolumeOrBuilder
        Returns:
        The projectId.
      • getProjectIdBytes

        public com.google.protobuf.ByteString getProjectIdBytes()
         Project identifier (preferrably project number but can also be the project
         ID) of the project that contains the secret. If not set, it is
         populated with the function's project, assuming that the secret exists in
         the same project as the function.
         
        string project_id = 2;
        Specified by:
        getProjectIdBytes in interface SecretVolumeOrBuilder
        Returns:
        The bytes for projectId.
      • setProjectId

        public SecretVolume.Builder setProjectId​(String value)
         Project identifier (preferrably project number but can also be the project
         ID) of the project that contains the secret. If not set, it is
         populated with the function's project, assuming that the secret exists in
         the same project as the function.
         
        string project_id = 2;
        Parameters:
        value - The projectId to set.
        Returns:
        This builder for chaining.
      • clearProjectId

        public SecretVolume.Builder clearProjectId()
         Project identifier (preferrably project number but can also be the project
         ID) of the project that contains the secret. If not set, it is
         populated with the function's project, assuming that the secret exists in
         the same project as the function.
         
        string project_id = 2;
        Returns:
        This builder for chaining.
      • setProjectIdBytes

        public SecretVolume.Builder setProjectIdBytes​(com.google.protobuf.ByteString value)
         Project identifier (preferrably project number but can also be the project
         ID) of the project that contains the secret. If not set, it is
         populated with the function's project, assuming that the secret exists in
         the same project as the function.
         
        string project_id = 2;
        Parameters:
        value - The bytes for projectId to set.
        Returns:
        This builder for chaining.
      • getSecret

        public String getSecret()
         Name of the secret in Secret Manager (not the full resource name).
         
        string secret = 3;
        Specified by:
        getSecret in interface SecretVolumeOrBuilder
        Returns:
        The secret.
      • getSecretBytes

        public com.google.protobuf.ByteString getSecretBytes()
         Name of the secret in Secret Manager (not the full resource name).
         
        string secret = 3;
        Specified by:
        getSecretBytes in interface SecretVolumeOrBuilder
        Returns:
        The bytes for secret.
      • setSecret

        public SecretVolume.Builder setSecret​(String value)
         Name of the secret in Secret Manager (not the full resource name).
         
        string secret = 3;
        Parameters:
        value - The secret to set.
        Returns:
        This builder for chaining.
      • clearSecret

        public SecretVolume.Builder clearSecret()
         Name of the secret in Secret Manager (not the full resource name).
         
        string secret = 3;
        Returns:
        This builder for chaining.
      • setSecretBytes

        public SecretVolume.Builder setSecretBytes​(com.google.protobuf.ByteString value)
         Name of the secret in Secret Manager (not the full resource name).
         
        string secret = 3;
        Parameters:
        value - The bytes for secret to set.
        Returns:
        This builder for chaining.
      • getVersionsList

        public List<SecretVolume.SecretVersion> getVersionsList()
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
        Specified by:
        getVersionsList in interface SecretVolumeOrBuilder
      • getVersionsCount

        public int getVersionsCount()
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
        Specified by:
        getVersionsCount in interface SecretVolumeOrBuilder
      • getVersions

        public SecretVolume.SecretVersion getVersions​(int index)
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
        Specified by:
        getVersions in interface SecretVolumeOrBuilder
      • setVersions

        public SecretVolume.Builder setVersions​(int index,
                                                SecretVolume.SecretVersion value)
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
      • setVersions

        public SecretVolume.Builder setVersions​(int index,
                                                SecretVolume.SecretVersion.Builder builderForValue)
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
      • addVersions

        public SecretVolume.Builder addVersions​(SecretVolume.SecretVersion value)
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
      • addVersions

        public SecretVolume.Builder addVersions​(int index,
                                                SecretVolume.SecretVersion value)
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
      • addVersions

        public SecretVolume.Builder addVersions​(SecretVolume.SecretVersion.Builder builderForValue)
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
      • addVersions

        public SecretVolume.Builder addVersions​(int index,
                                                SecretVolume.SecretVersion.Builder builderForValue)
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
      • addAllVersions

        public SecretVolume.Builder addAllVersions​(Iterable<? extends SecretVolume.SecretVersion> values)
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
      • clearVersions

        public SecretVolume.Builder clearVersions()
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
      • removeVersions

        public SecretVolume.Builder removeVersions​(int index)
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
      • getVersionsBuilder

        public SecretVolume.SecretVersion.Builder getVersionsBuilder​(int index)
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
      • getVersionsOrBuilder

        public SecretVolume.SecretVersionOrBuilder getVersionsOrBuilder​(int index)
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
        Specified by:
        getVersionsOrBuilder in interface SecretVolumeOrBuilder
      • getVersionsOrBuilderList

        public List<? extends SecretVolume.SecretVersionOrBuilder> getVersionsOrBuilderList()
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
        Specified by:
        getVersionsOrBuilderList in interface SecretVolumeOrBuilder
      • addVersionsBuilder

        public SecretVolume.SecretVersion.Builder addVersionsBuilder()
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
      • addVersionsBuilder

        public SecretVolume.SecretVersion.Builder addVersionsBuilder​(int index)
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
      • getVersionsBuilderList

        public List<SecretVolume.SecretVersion.Builder> getVersionsBuilderList()
         List of secret versions to mount for this secret. If empty, the `latest`
         version of the secret is made available in a file named after the
         secret under the mount point.
         
        repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;
      • setUnknownFields

        public final SecretVolume.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<SecretVolume.Builder>
      • mergeUnknownFields

        public final SecretVolume.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<SecretVolume.Builder>