Class BuildConfig.Builder (2.13.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public BuildConfig.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
BuildConfig.Builder
Overrides

build()

public BuildConfig build()
Returns
TypeDescription
BuildConfig

buildPartial()

public BuildConfig buildPartial()
Returns
TypeDescription
BuildConfig

clear()

public BuildConfig.Builder clear()
Returns
TypeDescription
BuildConfig.Builder
Overrides

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
TypeDescription
BuildConfig.Builder

This builder for chaining.

clearDockerRepository()

public BuildConfig.Builder clearDockerRepository()

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
TypeDescription
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
TypeDescription
BuildConfig.Builder

This builder for chaining.

clearEnvironmentVariables()

public BuildConfig.Builder clearEnvironmentVariables()
Returns
TypeDescription
BuildConfig.Builder

clearField(Descriptors.FieldDescriptor field)

public BuildConfig.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
BuildConfig.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public BuildConfig.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
BuildConfig.Builder

This builder for chaining.

clone()

public BuildConfig.Builder clone()
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
boolean

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
TypeDescription
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
TypeDescription
ByteString

The bytes for build.

getDefaultInstanceForType()

public BuildConfig getDefaultInstanceForType()
Returns
TypeDescription
BuildConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDockerRepository()

public String getDockerRepository()

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
TypeDescription
String

The dockerRepository.

getDockerRepositoryBytes()

public ByteString getDockerRepositoryBytes()

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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for entryPoint.

getEnvironmentVariables()

public Map<String,String> getEnvironmentVariables()
Returns
TypeDescription
Map<String,String>

getEnvironmentVariablesCount()

public int getEnvironmentVariablesCount()

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Returns
TypeDescription
int

getEnvironmentVariablesMap()

public Map<String,String> getEnvironmentVariablesMap()

User-provided build-time environment variables for the function

map<string, string> environment_variables = 6;

Returns
TypeDescription
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
NameDescription
keyString
defaultValueString
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
String

getMutableEnvironmentVariables()

public Map<String,String> getMutableEnvironmentVariables()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

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
TypeDescription
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
TypeDescription
ByteString

The bytes for runtime.

getSource()

public Source getSource()

The location of the function source code.

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

Returns
TypeDescription
Source

The source.

getSourceBuilder()

public Source.Builder getSourceBuilder()

The location of the function source code.

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

Returns
TypeDescription
Source.Builder

getSourceOrBuilder()

public SourceOrBuilder getSourceOrBuilder()

The location of the function source code.

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for workerPool.

hasSource()

public boolean hasSource()

The location of the function source code.

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

Returns
TypeDescription
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
TypeDescription
boolean

Whether the sourceProvenance field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(BuildConfig other)

public BuildConfig.Builder mergeFrom(BuildConfig other)
Parameter
NameDescription
otherBuildConfig
Returns
TypeDescription
BuildConfig.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public BuildConfig.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BuildConfig.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public BuildConfig.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
BuildConfig.Builder
Overrides

mergeSource(Source value)

public BuildConfig.Builder mergeSource(Source value)

The location of the function source code.

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

Parameter
NameDescription
valueSource
Returns
TypeDescription
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
NameDescription
valueSourceProvenance
Returns
TypeDescription
BuildConfig.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final BuildConfig.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valuesMap<String,String>
Returns
TypeDescription
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
NameDescription
keyString
valueString
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
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
NameDescription
valueString

The build to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for build to set.

Returns
TypeDescription
BuildConfig.Builder

This builder for chaining.

setDockerRepository(String value)

public BuildConfig.Builder setDockerRepository(String value)

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
NameDescription
valueString

The dockerRepository to set.

Returns
TypeDescription
BuildConfig.Builder

This builder for chaining.

setDockerRepositoryBytes(ByteString value)

public BuildConfig.Builder setDockerRepositoryBytes(ByteString value)

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
NameDescription
valueByteString

The bytes for dockerRepository to set.

Returns
TypeDescription
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
NameDescription
valueString

The entryPoint to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for entryPoint to set.

Returns
TypeDescription
BuildConfig.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public BuildConfig.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
BuildConfig.Builder
Overrides

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

public BuildConfig.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The runtime to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for runtime to set.

Returns
TypeDescription
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
NameDescription
valueSource
Returns
TypeDescription
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
NameDescription
builderForValueSource.Builder
Returns
TypeDescription
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
NameDescription
valueSourceProvenance
Returns
TypeDescription
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
NameDescription
builderForValueSourceProvenance.Builder
Returns
TypeDescription
BuildConfig.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final BuildConfig.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueString

The workerPool to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for workerPool to set.

Returns
TypeDescription
BuildConfig.Builder

This builder for chaining.