Class BuildConfig.Builder (2.56.0)

public static final class BuildConfig.Builder extends GeneratedMessageV3.Builder<BuildConfig.Builder> implements BuildConfigOrBuilder

Describes the Build step of the function that builds a container from the given source.

Protobuf type google.cloud.functions.v2.BuildConfig

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public BuildConfig.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
BuildConfig.Builder
Overrides

build()

public BuildConfig build()
Returns
Type Description
BuildConfig

buildPartial()

public BuildConfig buildPartial()
Returns
Type Description
BuildConfig

clear()

public BuildConfig.Builder clear()
Returns
Type Description
BuildConfig.Builder
Overrides

clearAutomaticUpdatePolicy()

public BuildConfig.Builder clearAutomaticUpdatePolicy()

.google.cloud.functions.v2.AutomaticUpdatePolicy automatic_update_policy = 40;

Returns
Type Description
BuildConfig.Builder

clearBuild()

public BuildConfig.Builder clearBuild()

Output only. The Cloud Build name of the latest successful deployment of the function.

string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

clearDockerRegistry()

public BuildConfig.Builder clearDockerRegistry()

Docker Registry to use for this deployment. This configuration is only applicable to 1st Gen functions, 2nd Gen functions can only use Artifact Registry.

If unspecified, it defaults to ARTIFACT_REGISTRY. If docker_repository field is specified, this field should either be left unspecified or set to ARTIFACT_REGISTRY.

.google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10;

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

clearDockerRepository()

public BuildConfig.Builder clearDockerRepository()

Repository in Artifact Registry to which the function docker image will be pushed after it is built by Cloud Build. If specified by user, it is created and managed by user with a customer managed encryption key. Otherwise, GCF will create and use a repository named 'gcf-artifacts' for every deployed region.

It must match the pattern projects/{project}/locations/{location}/repositories/{repository}.

Cross-project repositories are not supported. Cross-location repositories are not supported. Repository format must be 'DOCKER'.

string docker_repository = 7 [(.google.api.resource_reference) = { ... }

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

clearEntryPoint()

public BuildConfig.Builder clearEntryPoint()

The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified. For backward compatibility, if function with given name is not found, then the system will try to use function named "function". For Node.js this is name of a function exported by the module specified in source_location.

string entry_point = 3;

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

clearEnvironmentVariables()

public BuildConfig.Builder clearEnvironmentVariables()
Returns
Type Description
BuildConfig.Builder

clearField(Descriptors.FieldDescriptor field)

public BuildConfig.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
BuildConfig.Builder
Overrides

clearOnDeployUpdatePolicy()

public BuildConfig.Builder clearOnDeployUpdatePolicy()

.google.cloud.functions.v2.OnDeployUpdatePolicy on_deploy_update_policy = 41;

Returns
Type Description
BuildConfig.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public BuildConfig.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
BuildConfig.Builder
Overrides

clearRuntime()

public BuildConfig.Builder clearRuntime()

The runtime in which to run the function. Required when deploying a new function, optional when updating an existing function. For a complete list of possible choices, see the gcloud command reference.

string runtime = 2;

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

clearRuntimeUpdatePolicy()

public BuildConfig.Builder clearRuntimeUpdatePolicy()
Returns
Type Description
BuildConfig.Builder

clearServiceAccount()

public BuildConfig.Builder clearServiceAccount()

Service account to be used for building the container. The format of this field is projects/{projectId}/serviceAccounts/{serviceAccountEmail}.

string service_account = 27;

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

clearSource()

public BuildConfig.Builder clearSource()

The location of the function source code.

.google.cloud.functions.v2.Source source = 4;

Returns
Type Description
BuildConfig.Builder

clearSourceProvenance()

public BuildConfig.Builder clearSourceProvenance()

Output only. A permanent fixed identifier for source.

.google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
BuildConfig.Builder

clearWorkerPool()

public BuildConfig.Builder clearWorkerPool()

Name of the Cloud Build Custom Worker Pool that should be used to build the function. The format of this field is projects/{project}/locations/{region}/workerPools/{workerPool} where {project} and {region} are the project id and region respectively where the worker pool is defined and {workerPool} is the short name of the worker pool.

If the project id is not the same as the function, then the Cloud Functions Service Agent (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be granted the role Cloud Build Custom Workers Builder (roles/cloudbuild.customworkers.builder) in the project.

string worker_pool = 5 [(.google.api.resource_reference) = { ... }

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

clone()

public BuildConfig.Builder clone()
Returns
Type Description
BuildConfig.Builder
Overrides

containsEnvironmentVariables(String key)

public boolean containsEnvironmentVariables(String key)

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Parameter
Name Description
key String
Returns
Type Description
boolean

getAutomaticUpdatePolicy()

public AutomaticUpdatePolicy getAutomaticUpdatePolicy()

.google.cloud.functions.v2.AutomaticUpdatePolicy automatic_update_policy = 40;

Returns
Type Description
AutomaticUpdatePolicy

The automaticUpdatePolicy.

getAutomaticUpdatePolicyBuilder()

public AutomaticUpdatePolicy.Builder getAutomaticUpdatePolicyBuilder()

.google.cloud.functions.v2.AutomaticUpdatePolicy automatic_update_policy = 40;

Returns
Type Description
AutomaticUpdatePolicy.Builder

getAutomaticUpdatePolicyOrBuilder()

public AutomaticUpdatePolicyOrBuilder getAutomaticUpdatePolicyOrBuilder()

.google.cloud.functions.v2.AutomaticUpdatePolicy automatic_update_policy = 40;

Returns
Type Description
AutomaticUpdatePolicyOrBuilder

getBuild()

public String getBuild()

Output only. The Cloud Build name of the latest successful deployment of the function.

string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The build.

getBuildBytes()

public ByteString getBuildBytes()

Output only. The Cloud Build name of the latest successful deployment of the function.

string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for build.

getDefaultInstanceForType()

public BuildConfig getDefaultInstanceForType()
Returns
Type Description
BuildConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDockerRegistry()

public BuildConfig.DockerRegistry getDockerRegistry()

Docker Registry to use for this deployment. This configuration is only applicable to 1st Gen functions, 2nd Gen functions can only use Artifact Registry.

If unspecified, it defaults to ARTIFACT_REGISTRY. If docker_repository field is specified, this field should either be left unspecified or set to ARTIFACT_REGISTRY.

.google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10;

Returns
Type Description
BuildConfig.DockerRegistry

The dockerRegistry.

getDockerRegistryValue()

public int getDockerRegistryValue()

Docker Registry to use for this deployment. This configuration is only applicable to 1st Gen functions, 2nd Gen functions can only use Artifact Registry.

If unspecified, it defaults to ARTIFACT_REGISTRY. If docker_repository field is specified, this field should either be left unspecified or set to ARTIFACT_REGISTRY.

.google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10;

Returns
Type Description
int

The enum numeric value on the wire for dockerRegistry.

getDockerRepository()

public String getDockerRepository()

Repository in Artifact Registry to which the function docker image will be pushed after it is built by Cloud Build. If specified by user, it is created and managed by user with a customer managed encryption key. Otherwise, GCF will create and use a repository named 'gcf-artifacts' for every deployed region.

It must match the pattern projects/{project}/locations/{location}/repositories/{repository}.

Cross-project repositories are not supported. Cross-location repositories are not supported. Repository format must be 'DOCKER'.

string docker_repository = 7 [(.google.api.resource_reference) = { ... }

Returns
Type Description
String

The dockerRepository.

getDockerRepositoryBytes()

public ByteString getDockerRepositoryBytes()

Repository in Artifact Registry to which the function docker image will be pushed after it is built by Cloud Build. If specified by user, it is created and managed by user with a customer managed encryption key. Otherwise, GCF will create and use a repository named 'gcf-artifacts' for every deployed region.

It must match the pattern projects/{project}/locations/{location}/repositories/{repository}.

Cross-project repositories are not supported. Cross-location repositories are not supported. Repository format must be 'DOCKER'.

string docker_repository = 7 [(.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for dockerRepository.

getEntryPoint()

public String getEntryPoint()

The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified. For backward compatibility, if function with given name is not found, then the system will try to use function named "function". For Node.js this is name of a function exported by the module specified in source_location.

string entry_point = 3;

Returns
Type Description
String

The entryPoint.

getEntryPointBytes()

public ByteString getEntryPointBytes()

The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified. For backward compatibility, if function with given name is not found, then the system will try to use function named "function". For Node.js this is name of a function exported by the module specified in source_location.

string entry_point = 3;

Returns
Type Description
ByteString

The bytes for entryPoint.

getEnvironmentVariables() (deprecated)

public Map<String,String> getEnvironmentVariables()
Returns
Type Description
Map<String,String>

getEnvironmentVariablesCount()

public int getEnvironmentVariablesCount()

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Returns
Type Description
int

getEnvironmentVariablesMap()

public Map<String,String> getEnvironmentVariablesMap()

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Returns
Type Description
Map<String,String>

getEnvironmentVariablesOrDefault(String key, String defaultValue)

public String getEnvironmentVariablesOrDefault(String key, String defaultValue)

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getEnvironmentVariablesOrThrow(String key)

public String getEnvironmentVariablesOrThrow(String key)

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Parameter
Name Description
key String
Returns
Type Description
String

getMutableEnvironmentVariables() (deprecated)

public Map<String,String> getMutableEnvironmentVariables()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getOnDeployUpdatePolicy()

public OnDeployUpdatePolicy getOnDeployUpdatePolicy()

.google.cloud.functions.v2.OnDeployUpdatePolicy on_deploy_update_policy = 41;

Returns
Type Description
OnDeployUpdatePolicy

The onDeployUpdatePolicy.

getOnDeployUpdatePolicyBuilder()

public OnDeployUpdatePolicy.Builder getOnDeployUpdatePolicyBuilder()

.google.cloud.functions.v2.OnDeployUpdatePolicy on_deploy_update_policy = 41;

Returns
Type Description
OnDeployUpdatePolicy.Builder

getOnDeployUpdatePolicyOrBuilder()

public OnDeployUpdatePolicyOrBuilder getOnDeployUpdatePolicyOrBuilder()

.google.cloud.functions.v2.OnDeployUpdatePolicy on_deploy_update_policy = 41;

Returns
Type Description
OnDeployUpdatePolicyOrBuilder

getRuntime()

public String getRuntime()

The runtime in which to run the function. Required when deploying a new function, optional when updating an existing function. For a complete list of possible choices, see the gcloud command reference.

string runtime = 2;

Returns
Type Description
String

The runtime.

getRuntimeBytes()

public ByteString getRuntimeBytes()

The runtime in which to run the function. Required when deploying a new function, optional when updating an existing function. For a complete list of possible choices, see the gcloud command reference.

string runtime = 2;

Returns
Type Description
ByteString

The bytes for runtime.

getRuntimeUpdatePolicyCase()

public BuildConfig.RuntimeUpdatePolicyCase getRuntimeUpdatePolicyCase()
Returns
Type Description
BuildConfig.RuntimeUpdatePolicyCase

getServiceAccount()

public String getServiceAccount()

Service account to be used for building the container. The format of this field is projects/{projectId}/serviceAccounts/{serviceAccountEmail}.

string service_account = 27;

Returns
Type Description
String

The serviceAccount.

getServiceAccountBytes()

public ByteString getServiceAccountBytes()

Service account to be used for building the container. The format of this field is projects/{projectId}/serviceAccounts/{serviceAccountEmail}.

string service_account = 27;

Returns
Type Description
ByteString

The bytes for serviceAccount.

getSource()

public Source getSource()

The location of the function source code.

.google.cloud.functions.v2.Source source = 4;

Returns
Type Description
Source

The source.

getSourceBuilder()

public Source.Builder getSourceBuilder()

The location of the function source code.

.google.cloud.functions.v2.Source source = 4;

Returns
Type Description
Source.Builder

getSourceOrBuilder()

public SourceOrBuilder getSourceOrBuilder()

The location of the function source code.

.google.cloud.functions.v2.Source source = 4;

Returns
Type Description
SourceOrBuilder

getSourceProvenance()

public SourceProvenance getSourceProvenance()

Output only. A permanent fixed identifier for source.

.google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
SourceProvenance

The sourceProvenance.

getSourceProvenanceBuilder()

public SourceProvenance.Builder getSourceProvenanceBuilder()

Output only. A permanent fixed identifier for source.

.google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
SourceProvenance.Builder

getSourceProvenanceOrBuilder()

public SourceProvenanceOrBuilder getSourceProvenanceOrBuilder()

Output only. A permanent fixed identifier for source.

.google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
SourceProvenanceOrBuilder

getWorkerPool()

public String getWorkerPool()

Name of the Cloud Build Custom Worker Pool that should be used to build the function. The format of this field is projects/{project}/locations/{region}/workerPools/{workerPool} where {project} and {region} are the project id and region respectively where the worker pool is defined and {workerPool} is the short name of the worker pool.

If the project id is not the same as the function, then the Cloud Functions Service Agent (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be granted the role Cloud Build Custom Workers Builder (roles/cloudbuild.customworkers.builder) in the project.

string worker_pool = 5 [(.google.api.resource_reference) = { ... }

Returns
Type Description
String

The workerPool.

getWorkerPoolBytes()

public ByteString getWorkerPoolBytes()

Name of the Cloud Build Custom Worker Pool that should be used to build the function. The format of this field is projects/{project}/locations/{region}/workerPools/{workerPool} where {project} and {region} are the project id and region respectively where the worker pool is defined and {workerPool} is the short name of the worker pool.

If the project id is not the same as the function, then the Cloud Functions Service Agent (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be granted the role Cloud Build Custom Workers Builder (roles/cloudbuild.customworkers.builder) in the project.

string worker_pool = 5 [(.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for workerPool.

hasAutomaticUpdatePolicy()

public boolean hasAutomaticUpdatePolicy()

.google.cloud.functions.v2.AutomaticUpdatePolicy automatic_update_policy = 40;

Returns
Type Description
boolean

Whether the automaticUpdatePolicy field is set.

hasOnDeployUpdatePolicy()

public boolean hasOnDeployUpdatePolicy()

.google.cloud.functions.v2.OnDeployUpdatePolicy on_deploy_update_policy = 41;

Returns
Type Description
boolean

Whether the onDeployUpdatePolicy field is set.

hasSource()

public boolean hasSource()

The location of the function source code.

.google.cloud.functions.v2.Source source = 4;

Returns
Type Description
boolean

Whether the source field is set.

hasSourceProvenance()

public boolean hasSourceProvenance()

Output only. A permanent fixed identifier for source.

.google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the sourceProvenance field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeAutomaticUpdatePolicy(AutomaticUpdatePolicy value)

public BuildConfig.Builder mergeAutomaticUpdatePolicy(AutomaticUpdatePolicy value)

.google.cloud.functions.v2.AutomaticUpdatePolicy automatic_update_policy = 40;

Parameter
Name Description
value AutomaticUpdatePolicy
Returns
Type Description
BuildConfig.Builder

mergeFrom(BuildConfig other)

public BuildConfig.Builder mergeFrom(BuildConfig other)
Parameter
Name Description
other BuildConfig
Returns
Type Description
BuildConfig.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public BuildConfig.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
BuildConfig.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public BuildConfig.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
BuildConfig.Builder
Overrides

mergeOnDeployUpdatePolicy(OnDeployUpdatePolicy value)

public BuildConfig.Builder mergeOnDeployUpdatePolicy(OnDeployUpdatePolicy value)

.google.cloud.functions.v2.OnDeployUpdatePolicy on_deploy_update_policy = 41;

Parameter
Name Description
value OnDeployUpdatePolicy
Returns
Type Description
BuildConfig.Builder

mergeSource(Source value)

public BuildConfig.Builder mergeSource(Source value)

The location of the function source code.

.google.cloud.functions.v2.Source source = 4;

Parameter
Name Description
value Source
Returns
Type Description
BuildConfig.Builder

mergeSourceProvenance(SourceProvenance value)

public BuildConfig.Builder mergeSourceProvenance(SourceProvenance value)

Output only. A permanent fixed identifier for source.

.google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value SourceProvenance
Returns
Type Description
BuildConfig.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final BuildConfig.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
BuildConfig.Builder
Overrides

putAllEnvironmentVariables(Map<String,String> values)

public BuildConfig.Builder putAllEnvironmentVariables(Map<String,String> values)

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Parameter
Name Description
values Map<String,String>
Returns
Type Description
BuildConfig.Builder

putEnvironmentVariables(String key, String value)

public BuildConfig.Builder putEnvironmentVariables(String key, String value)

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Parameters
Name Description
key String
value String
Returns
Type Description
BuildConfig.Builder

removeEnvironmentVariables(String key)

public BuildConfig.Builder removeEnvironmentVariables(String key)

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Parameter
Name Description
key String
Returns
Type Description
BuildConfig.Builder

setAutomaticUpdatePolicy(AutomaticUpdatePolicy value)

public BuildConfig.Builder setAutomaticUpdatePolicy(AutomaticUpdatePolicy value)

.google.cloud.functions.v2.AutomaticUpdatePolicy automatic_update_policy = 40;

Parameter
Name Description
value AutomaticUpdatePolicy
Returns
Type Description
BuildConfig.Builder

setAutomaticUpdatePolicy(AutomaticUpdatePolicy.Builder builderForValue)

public BuildConfig.Builder setAutomaticUpdatePolicy(AutomaticUpdatePolicy.Builder builderForValue)

.google.cloud.functions.v2.AutomaticUpdatePolicy automatic_update_policy = 40;

Parameter
Name Description
builderForValue AutomaticUpdatePolicy.Builder
Returns
Type Description
BuildConfig.Builder

setBuild(String value)

public BuildConfig.Builder setBuild(String value)

Output only. The Cloud Build name of the latest successful deployment of the function.

string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The build to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

setBuildBytes(ByteString value)

public BuildConfig.Builder setBuildBytes(ByteString value)

Output only. The Cloud Build name of the latest successful deployment of the function.

string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for build to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

setDockerRegistry(BuildConfig.DockerRegistry value)

public BuildConfig.Builder setDockerRegistry(BuildConfig.DockerRegistry value)

Docker Registry to use for this deployment. This configuration is only applicable to 1st Gen functions, 2nd Gen functions can only use Artifact Registry.

If unspecified, it defaults to ARTIFACT_REGISTRY. If docker_repository field is specified, this field should either be left unspecified or set to ARTIFACT_REGISTRY.

.google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10;

Parameter
Name Description
value BuildConfig.DockerRegistry

The dockerRegistry to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

setDockerRegistryValue(int value)

public BuildConfig.Builder setDockerRegistryValue(int value)

Docker Registry to use for this deployment. This configuration is only applicable to 1st Gen functions, 2nd Gen functions can only use Artifact Registry.

If unspecified, it defaults to ARTIFACT_REGISTRY. If docker_repository field is specified, this field should either be left unspecified or set to ARTIFACT_REGISTRY.

.google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10;

Parameter
Name Description
value int

The enum numeric value on the wire for dockerRegistry to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

setDockerRepository(String value)

public BuildConfig.Builder setDockerRepository(String value)

Repository in Artifact Registry to which the function docker image will be pushed after it is built by Cloud Build. If specified by user, it is created and managed by user with a customer managed encryption key. Otherwise, GCF will create and use a repository named 'gcf-artifacts' for every deployed region.

It must match the pattern projects/{project}/locations/{location}/repositories/{repository}.

Cross-project repositories are not supported. Cross-location repositories are not supported. Repository format must be 'DOCKER'.

string docker_repository = 7 [(.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The dockerRepository to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

setDockerRepositoryBytes(ByteString value)

public BuildConfig.Builder setDockerRepositoryBytes(ByteString value)

Repository in Artifact Registry to which the function docker image will be pushed after it is built by Cloud Build. If specified by user, it is created and managed by user with a customer managed encryption key. Otherwise, GCF will create and use a repository named 'gcf-artifacts' for every deployed region.

It must match the pattern projects/{project}/locations/{location}/repositories/{repository}.

Cross-project repositories are not supported. Cross-location repositories are not supported. Repository format must be 'DOCKER'.

string docker_repository = 7 [(.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for dockerRepository to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

setEntryPoint(String value)

public BuildConfig.Builder setEntryPoint(String value)

The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified. For backward compatibility, if function with given name is not found, then the system will try to use function named "function". For Node.js this is name of a function exported by the module specified in source_location.

string entry_point = 3;

Parameter
Name Description
value String

The entryPoint to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

setEntryPointBytes(ByteString value)

public BuildConfig.Builder setEntryPointBytes(ByteString value)

The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified. For backward compatibility, if function with given name is not found, then the system will try to use function named "function". For Node.js this is name of a function exported by the module specified in source_location.

string entry_point = 3;

Parameter
Name Description
value ByteString

The bytes for entryPoint to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public BuildConfig.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
BuildConfig.Builder
Overrides

setOnDeployUpdatePolicy(OnDeployUpdatePolicy value)

public BuildConfig.Builder setOnDeployUpdatePolicy(OnDeployUpdatePolicy value)

.google.cloud.functions.v2.OnDeployUpdatePolicy on_deploy_update_policy = 41;

Parameter
Name Description
value OnDeployUpdatePolicy
Returns
Type Description
BuildConfig.Builder

setOnDeployUpdatePolicy(OnDeployUpdatePolicy.Builder builderForValue)

public BuildConfig.Builder setOnDeployUpdatePolicy(OnDeployUpdatePolicy.Builder builderForValue)

.google.cloud.functions.v2.OnDeployUpdatePolicy on_deploy_update_policy = 41;

Parameter
Name Description
builderForValue OnDeployUpdatePolicy.Builder
Returns
Type Description
BuildConfig.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public BuildConfig.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
BuildConfig.Builder
Overrides

setRuntime(String value)

public BuildConfig.Builder setRuntime(String value)

The runtime in which to run the function. Required when deploying a new function, optional when updating an existing function. For a complete list of possible choices, see the gcloud command reference.

string runtime = 2;

Parameter
Name Description
value String

The runtime to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

setRuntimeBytes(ByteString value)

public BuildConfig.Builder setRuntimeBytes(ByteString value)

The runtime in which to run the function. Required when deploying a new function, optional when updating an existing function. For a complete list of possible choices, see the gcloud command reference.

string runtime = 2;

Parameter
Name Description
value ByteString

The bytes for runtime to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

setServiceAccount(String value)

public BuildConfig.Builder setServiceAccount(String value)

Service account to be used for building the container. The format of this field is projects/{projectId}/serviceAccounts/{serviceAccountEmail}.

string service_account = 27;

Parameter
Name Description
value String

The serviceAccount to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

setServiceAccountBytes(ByteString value)

public BuildConfig.Builder setServiceAccountBytes(ByteString value)

Service account to be used for building the container. The format of this field is projects/{projectId}/serviceAccounts/{serviceAccountEmail}.

string service_account = 27;

Parameter
Name Description
value ByteString

The bytes for serviceAccount to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

setSource(Source value)

public BuildConfig.Builder setSource(Source value)

The location of the function source code.

.google.cloud.functions.v2.Source source = 4;

Parameter
Name Description
value Source
Returns
Type Description
BuildConfig.Builder

setSource(Source.Builder builderForValue)

public BuildConfig.Builder setSource(Source.Builder builderForValue)

The location of the function source code.

.google.cloud.functions.v2.Source source = 4;

Parameter
Name Description
builderForValue Source.Builder
Returns
Type Description
BuildConfig.Builder

setSourceProvenance(SourceProvenance value)

public BuildConfig.Builder setSourceProvenance(SourceProvenance value)

Output only. A permanent fixed identifier for source.

.google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value SourceProvenance
Returns
Type Description
BuildConfig.Builder

setSourceProvenance(SourceProvenance.Builder builderForValue)

public BuildConfig.Builder setSourceProvenance(SourceProvenance.Builder builderForValue)

Output only. A permanent fixed identifier for source.

.google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue SourceProvenance.Builder
Returns
Type Description
BuildConfig.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final BuildConfig.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
BuildConfig.Builder
Overrides

setWorkerPool(String value)

public BuildConfig.Builder setWorkerPool(String value)

Name of the Cloud Build Custom Worker Pool that should be used to build the function. The format of this field is projects/{project}/locations/{region}/workerPools/{workerPool} where {project} and {region} are the project id and region respectively where the worker pool is defined and {workerPool} is the short name of the worker pool.

If the project id is not the same as the function, then the Cloud Functions Service Agent (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be granted the role Cloud Build Custom Workers Builder (roles/cloudbuild.customworkers.builder) in the project.

string worker_pool = 5 [(.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The workerPool to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

setWorkerPoolBytes(ByteString value)

public BuildConfig.Builder setWorkerPoolBytes(ByteString value)

Name of the Cloud Build Custom Worker Pool that should be used to build the function. The format of this field is projects/{project}/locations/{region}/workerPools/{workerPool} where {project} and {region} are the project id and region respectively where the worker pool is defined and {workerPool} is the short name of the worker pool.

If the project id is not the same as the function, then the Cloud Functions Service Agent (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be granted the role Cloud Build Custom Workers Builder (roles/cloudbuild.customworkers.builder) in the project.

string worker_pool = 5 [(.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for workerPool to set.

Returns
Type Description
BuildConfig.Builder

This builder for chaining.