Class BuildConfig.Builder (2.13.0)

publicstaticfinalclass BuildConfig.BuilderextendsGeneratedMessageV3.Builder<BuildConfig.Builder>implementsBuildConfigOrBuilder

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

Protobuf type google.cloud.functions.v2alpha.BuildConfig

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicBuildConfig.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
value Object
Returns
Type Description
Overrides

build()

publicBuildConfigbuild()
Returns
Type Description

buildPartial()

publicBuildConfigbuildPartial()
Returns
Type Description

clear()

publicBuildConfig.Builderclear()
Returns
Type Description
Overrides

clearBuild()

publicBuildConfig.BuilderclearBuild()

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.

clearDockerRepository()

publicBuildConfig.BuilderclearDockerRepository()

Optional. User managed repository created in Artifact Registry optionally with a customer managed encryption key. This is the repository to which the function docker image will be pushed after it is built by Cloud Build. If unspecified, 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.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Returns
Type Description
BuildConfig.Builder

This builder for chaining.

clearEntryPoint()

publicBuildConfig.BuilderclearEntryPoint()

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()

publicBuildConfig.BuilderclearEnvironmentVariables()
Returns
Type Description

clearField(Descriptors.FieldDescriptor field)

publicBuildConfig.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
Returns
Type Description
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

publicBuildConfig.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
Returns
Type Description
Overrides

clearRuntime()

publicBuildConfig.BuilderclearRuntime()

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.

clearSource()

publicBuildConfig.BuilderclearSource()

The location of the function source code.

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

Returns
Type Description

clearSourceProvenance()

publicBuildConfig.BuilderclearSourceProvenance()

Output only. A permanent fixed identifier for source.

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

Returns
Type Description

clearWorkerPool()

publicBuildConfig.BuilderclearWorkerPool()

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()

publicBuildConfig.Builderclone()
Returns
Type Description
Overrides

containsEnvironmentVariables(String key)

publicbooleancontainsEnvironmentVariables(Stringkey)

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Parameter
Name Description
key String
Returns
Type Description

getBuild()

publicStringgetBuild()

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()

publicByteStringgetBuildBytes()

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()

publicBuildConfiggetDefaultInstanceForType()
Returns
Type Description

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Overrides

getDockerRepository()

publicStringgetDockerRepository()

Optional. User managed repository created in Artifact Registry optionally with a customer managed encryption key. This is the repository to which the function docker image will be pushed after it is built by Cloud Build. If unspecified, 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.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The dockerRepository.

getDockerRepositoryBytes()

publicByteStringgetDockerRepositoryBytes()

Optional. User managed repository created in Artifact Registry optionally with a customer managed encryption key. This is the repository to which the function docker image will be pushed after it is built by Cloud Build. If unspecified, 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.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for dockerRepository.

getEntryPoint()

publicStringgetEntryPoint()

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()

publicByteStringgetEntryPointBytes()

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()

publicMap<String,String>getEnvironmentVariables()
Returns
Type Description

getEnvironmentVariablesCount()

publicintgetEnvironmentVariablesCount()

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Returns
Type Description
int

getEnvironmentVariablesMap()

publicMap<String,String>getEnvironmentVariablesMap()

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Returns
Type Description

getEnvironmentVariablesOrDefault(String key, String defaultValue)

publicStringgetEnvironmentVariablesOrDefault(Stringkey,StringdefaultValue)

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

getEnvironmentVariablesOrThrow(String key)

publicStringgetEnvironmentVariablesOrThrow(Stringkey)

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Parameter
Name Description
key String
Returns
Type Description

getMutableEnvironmentVariables()

publicMap<String,String>getMutableEnvironmentVariables()

Use alternate mutation accessors instead.

Returns
Type Description

getRuntime()

publicStringgetRuntime()

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()

publicByteStringgetRuntimeBytes()

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.

getSource()

publicSourcegetSource()

The location of the function source code.

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

Returns
Type Description
Source

The source.

getSourceBuilder()

publicSource.BuildergetSourceBuilder()

The location of the function source code.

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

Returns
Type Description

getSourceOrBuilder()

publicSourceOrBuildergetSourceOrBuilder()

The location of the function source code.

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

Returns
Type Description

getSourceProvenance()

publicSourceProvenancegetSourceProvenance()

Output only. A permanent fixed identifier for source.

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

Returns
Type Description
SourceProvenance

The sourceProvenance.

getSourceProvenanceBuilder()

publicSourceProvenance.BuildergetSourceProvenanceBuilder()

Output only. A permanent fixed identifier for source.

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

Returns
Type Description

getSourceProvenanceOrBuilder()

publicSourceProvenanceOrBuildergetSourceProvenanceOrBuilder()

Output only. A permanent fixed identifier for source.

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

Returns
Type Description

getWorkerPool()

publicStringgetWorkerPool()

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()

publicByteStringgetWorkerPoolBytes()

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.

hasSource()

publicbooleanhasSource()

The location of the function source code.

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

Returns
Type Description
boolean

Whether the source field is set.

hasSourceProvenance()

publicbooleanhasSourceProvenance()

Output only. A permanent fixed identifier for source.

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

Returns
Type Description
boolean

Whether the sourceProvenance field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
Overrides

internalGetMapField(int number)

protectedMapFieldinternalGetMapField(intnumber)
Parameter
Name Description
number int
Returns
Type Description
Overrides

internalGetMutableMapField(int number)

protectedMapFieldinternalGetMutableMapField(intnumber)
Parameter
Name Description
number int
Returns
Type Description
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
Overrides

mergeFrom(BuildConfig other)

publicBuildConfig.BuildermergeFrom(BuildConfigother)
Parameter
Name Description
other BuildConfig
Returns
Type Description

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicBuildConfig.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Overrides Exceptions
Type Description

mergeFrom(Message other)

publicBuildConfig.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
Overrides

mergeSource(Source value)

publicBuildConfig.BuildermergeSource(Sourcevalue)

The location of the function source code.

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

Parameter
Name Description
value Source
Returns
Type Description

mergeSourceProvenance(SourceProvenance value)

publicBuildConfig.BuildermergeSourceProvenance(SourceProvenancevalue)

Output only. A permanent fixed identifier for source.

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

Parameter
Name Description
Returns
Type Description

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalBuildConfig.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Overrides

putAllEnvironmentVariables(Map<String,String> values)

publicBuildConfig.BuilderputAllEnvironmentVariables(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

putEnvironmentVariables(String key, String value)

publicBuildConfig.BuilderputEnvironmentVariables(Stringkey,Stringvalue)

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

removeEnvironmentVariables(String key)

publicBuildConfig.BuilderremoveEnvironmentVariables(Stringkey)

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Parameter
Name Description
key String
Returns
Type Description

setBuild(String value)

publicBuildConfig.BuildersetBuild(Stringvalue)

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)

publicBuildConfig.BuildersetBuildBytes(ByteStringvalue)

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.

setDockerRepository(String value)

publicBuildConfig.BuildersetDockerRepository(Stringvalue)

Optional. User managed repository created in Artifact Registry optionally with a customer managed encryption key. This is the repository to which the function docker image will be pushed after it is built by Cloud Build. If unspecified, 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.field_behavior) = OPTIONAL, (.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)

publicBuildConfig.BuildersetDockerRepositoryBytes(ByteStringvalue)

Optional. User managed repository created in Artifact Registry optionally with a customer managed encryption key. This is the repository to which the function docker image will be pushed after it is built by Cloud Build. If unspecified, 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.field_behavior) = OPTIONAL, (.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)

publicBuildConfig.BuildersetEntryPoint(Stringvalue)

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)

publicBuildConfig.BuildersetEntryPointBytes(ByteStringvalue)

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)

publicBuildConfig.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
value Object
Returns
Type Description
Overrides

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

publicBuildConfig.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
index int
value Object
Returns
Type Description
Overrides

setRuntime(String value)

publicBuildConfig.BuildersetRuntime(Stringvalue)

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)

publicBuildConfig.BuildersetRuntimeBytes(ByteStringvalue)

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.

setSource(Source value)

publicBuildConfig.BuildersetSource(Sourcevalue)

The location of the function source code.

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

Parameter
Name Description
value Source
Returns
Type Description

setSource(Source.Builder builderForValue)

publicBuildConfig.BuildersetSource(Source.BuilderbuilderForValue)

The location of the function source code.

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

Parameter
Name Description
builderForValue Source.Builder
Returns
Type Description

setSourceProvenance(SourceProvenance value)

publicBuildConfig.BuildersetSourceProvenance(SourceProvenancevalue)

Output only. A permanent fixed identifier for source.

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

Parameter
Name Description
Returns
Type Description

setSourceProvenance(SourceProvenance.Builder builderForValue)

publicBuildConfig.BuildersetSourceProvenance(SourceProvenance.BuilderbuilderForValue)

Output only. A permanent fixed identifier for source.

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

Parameter
Name Description
builderForValue SourceProvenance.Builder
Returns
Type Description

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalBuildConfig.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Overrides

setWorkerPool(String value)

publicBuildConfig.BuildersetWorkerPool(Stringvalue)

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)

publicBuildConfig.BuildersetWorkerPoolBytes(ByteStringvalue)

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.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.