Class BuildConfig (2.34.0)

public final class BuildConfig extends GeneratedMessageV3 implements BuildConfigOrBuilder

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

Protobuf type google.cloud.functions.v2alpha.BuildConfig

Static Fields

BUILD_FIELD_NUMBER

public static final int BUILD_FIELD_NUMBER
Field Value
TypeDescription
int

DOCKER_REGISTRY_FIELD_NUMBER

public static final int DOCKER_REGISTRY_FIELD_NUMBER
Field Value
TypeDescription
int

DOCKER_REPOSITORY_FIELD_NUMBER

public static final int DOCKER_REPOSITORY_FIELD_NUMBER
Field Value
TypeDescription
int

ENTRY_POINT_FIELD_NUMBER

public static final int ENTRY_POINT_FIELD_NUMBER
Field Value
TypeDescription
int

ENVIRONMENT_VARIABLES_FIELD_NUMBER

public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER
Field Value
TypeDescription
int

RUNTIME_FIELD_NUMBER

public static final int RUNTIME_FIELD_NUMBER
Field Value
TypeDescription
int

SOURCE_FIELD_NUMBER

public static final int SOURCE_FIELD_NUMBER
Field Value
TypeDescription
int

SOURCE_PROVENANCE_FIELD_NUMBER

public static final int SOURCE_PROVENANCE_FIELD_NUMBER
Field Value
TypeDescription
int

WORKER_POOL_FIELD_NUMBER

public static final int WORKER_POOL_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static BuildConfig getDefaultInstance()
Returns
TypeDescription
BuildConfig

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static BuildConfig.Builder newBuilder()
Returns
TypeDescription
BuildConfig.Builder

newBuilder(BuildConfig prototype)

public static BuildConfig.Builder newBuilder(BuildConfig prototype)
Parameter
NameDescription
prototypeBuildConfig
Returns
TypeDescription
BuildConfig.Builder

parseDelimitedFrom(InputStream input)

public static BuildConfig parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
BuildConfig
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static BuildConfig parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BuildConfig
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static BuildConfig parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
BuildConfig
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static BuildConfig parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BuildConfig
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static BuildConfig parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
BuildConfig
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static BuildConfig parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BuildConfig
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static BuildConfig parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
BuildConfig
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static BuildConfig parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BuildConfig
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static BuildConfig parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
BuildConfig
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static BuildConfig parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BuildConfig
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static BuildConfig parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
BuildConfig
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static BuildConfig parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BuildConfig
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<BuildConfig> parser()
Returns
TypeDescription
Parser<BuildConfig>

Methods

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

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

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

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 docker_repository field is specified, this field will be automatically set as ARTIFACT_REGISTRY. If unspecified, it currently defaults to CONTAINER_REGISTRY. This field may be overridden by the backend for eligible deployments.

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

Returns
TypeDescription
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 docker_repository field is specified, this field will be automatically set as ARTIFACT_REGISTRY. If unspecified, it currently defaults to CONTAINER_REGISTRY. This field may be overridden by the backend for eligible deployments.

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

Returns
TypeDescription
int

The enum numeric value on the wire for dockerRegistry.

getDockerRepository()

public String getDockerRepository()

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.resource_reference) = { ... }

Returns
TypeDescription
String

The dockerRepository.

getDockerRepositoryBytes()

public ByteString getDockerRepositoryBytes()

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

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

getParserForType()

public Parser<BuildConfig> getParserForType()
Returns
TypeDescription
Parser<BuildConfig>
Overrides

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.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getSource()

public Source getSource()

The location of the function source code.

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

Returns
TypeDescription
Source

The source.

getSourceOrBuilder()

public SourceOrBuilder getSourceOrBuilder()

The location of the function source code.

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

Returns
TypeDescription
SourceOrBuilder

getSourceProvenance()

public SourceProvenance getSourceProvenance()

Output only. A permanent fixed identifier for source.

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

Returns
TypeDescription
SourceProvenance

The sourceProvenance.

getSourceProvenanceOrBuilder()

public SourceProvenanceOrBuilder getSourceProvenanceOrBuilder()

Output only. A permanent fixed identifier for source.

.google.cloud.functions.v2alpha.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.v2alpha.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.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

Whether the sourceProvenance field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

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

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected BuildConfig.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
BuildConfig.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

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

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException