Class Function (2.13.0)

publicfinalclass FunctionextendsGeneratedMessageV3implementsFunctionOrBuilder

Describes a Cloud Function that contains user computation executed in response to an event. It encapsulates function and trigger configurations.

Protobuf type google.cloud.functions.v2.Function

Implements

FunctionOrBuilder

Inherited Members

Static Fields

BUILD_CONFIG_FIELD_NUMBER

publicstaticfinalintBUILD_CONFIG_FIELD_NUMBER
Field Value
Type Description
int

DESCRIPTION_FIELD_NUMBER

publicstaticfinalintDESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

ENVIRONMENT_FIELD_NUMBER

publicstaticfinalintENVIRONMENT_FIELD_NUMBER
Field Value
Type Description
int

EVENT_TRIGGER_FIELD_NUMBER

publicstaticfinalintEVENT_TRIGGER_FIELD_NUMBER
Field Value
Type Description
int

LABELS_FIELD_NUMBER

publicstaticfinalintLABELS_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

publicstaticfinalintNAME_FIELD_NUMBER
Field Value
Type Description
int

SERVICE_CONFIG_FIELD_NUMBER

publicstaticfinalintSERVICE_CONFIG_FIELD_NUMBER
Field Value
Type Description
int

STATE_FIELD_NUMBER

publicstaticfinalintSTATE_FIELD_NUMBER
Field Value
Type Description
int

STATE_MESSAGES_FIELD_NUMBER

publicstaticfinalintSTATE_MESSAGES_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_TIME_FIELD_NUMBER

publicstaticfinalintUPDATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticFunctiongetDefaultInstance()
Returns
Type Description

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description

newBuilder()

publicstaticFunction.BuildernewBuilder()
Returns
Type Description

newBuilder(Function prototype)

publicstaticFunction.BuildernewBuilder(Functionprototype)
Parameter
Name Description
prototype Function
Returns
Type Description

parseDelimitedFrom(InputStream input)

publicstaticFunctionparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Exceptions
Type Description

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticFunctionparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(byte[] data)

publicstaticFunctionparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
Exceptions
Type Description

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticFunctionparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteString data)

publicstaticFunctionparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticFunctionparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(CodedInputStream input)

publicstaticFunctionparseFrom(CodedInputStreaminput)
Parameter
Name Description
Returns
Type Description
Exceptions
Type Description

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticFunctionparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(InputStream input)

publicstaticFunctionparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Exceptions
Type Description

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticFunctionparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteBuffer data)

publicstaticFunctionparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticFunctionparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parser()

publicstaticParser<Function>parser()
Returns
Type Description

Methods

containsLabels(String key)

publicbooleancontainsLabels(Stringkey)

Labels associated with this Cloud Function.

map<string, string> labels = 8;

Parameter
Name Description
key String
Returns
Type Description

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
Overrides

getBuildConfig()

publicBuildConfiggetBuildConfig()

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

.google.cloud.functions.v2.BuildConfig build_config = 3;

Returns
Type Description
BuildConfig

The buildConfig.

getBuildConfigOrBuilder()

publicBuildConfigOrBuildergetBuildConfigOrBuilder()

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

.google.cloud.functions.v2.BuildConfig build_config = 3;

Returns
Type Description

getDefaultInstanceForType()

publicFunctiongetDefaultInstanceForType()
Returns
Type Description

getDescription()

publicStringgetDescription()

User-provided description of a function.

string description = 2;

Returns
Type Description
String

The description.

getDescriptionBytes()

publicByteStringgetDescriptionBytes()

User-provided description of a function.

string description = 2;

Returns
Type Description
ByteString

The bytes for description.

getEnvironment()

publicEnvironmentgetEnvironment()

Describe whether the function is gen1 or gen2.

.google.cloud.functions.v2.Environment environment = 10;

Returns
Type Description
Environment

The environment.

getEnvironmentValue()

publicintgetEnvironmentValue()

Describe whether the function is gen1 or gen2.

.google.cloud.functions.v2.Environment environment = 10;

Returns
Type Description
int

The enum numeric value on the wire for environment.

getEventTrigger()

publicEventTriggergetEventTrigger()

An Eventarc trigger managed by Google Cloud Functions that fires events in response to a condition in another service.

.google.cloud.functions.v2.EventTrigger event_trigger = 5;

Returns
Type Description
EventTrigger

The eventTrigger.

getEventTriggerOrBuilder()

publicEventTriggerOrBuildergetEventTriggerOrBuilder()

An Eventarc trigger managed by Google Cloud Functions that fires events in response to a condition in another service.

.google.cloud.functions.v2.EventTrigger event_trigger = 5;

Returns
Type Description

getLabels()

publicMap<String,String>getLabels()

Use #getLabelsMap() instead.

Returns
Type Description

getLabelsCount()

publicintgetLabelsCount()

Labels associated with this Cloud Function.

map<string, string> labels = 8;

Returns
Type Description
int

getLabelsMap()

publicMap<String,String>getLabelsMap()

Labels associated with this Cloud Function.

map<string, string> labels = 8;

Returns
Type Description

getLabelsOrDefault(String key, String defaultValue)

publicStringgetLabelsOrDefault(Stringkey,StringdefaultValue)

Labels associated with this Cloud Function.

map<string, string> labels = 8;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description

getLabelsOrThrow(String key)

publicStringgetLabelsOrThrow(Stringkey)

Labels associated with this Cloud Function.

map<string, string> labels = 8;

Parameter
Name Description
key String
Returns
Type Description

getName()

publicStringgetName()

A user-defined name of the function. Function names must be unique globally and match pattern projects/*/locations/*/functions/*

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

publicByteStringgetNameBytes()

A user-defined name of the function. Function names must be unique globally and match pattern projects/*/locations/*/functions/*

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

publicParser<Function>getParserForType()
Returns
Type Description
Overrides

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getServiceConfig()

publicServiceConfiggetServiceConfig()

Describes the Service being deployed. Currently deploys services to Cloud Run (fully managed).

.google.cloud.functions.v2.ServiceConfig service_config = 4;

Returns
Type Description
ServiceConfig

The serviceConfig.

getServiceConfigOrBuilder()

publicServiceConfigOrBuildergetServiceConfigOrBuilder()

Describes the Service being deployed. Currently deploys services to Cloud Run (fully managed).

.google.cloud.functions.v2.ServiceConfig service_config = 4;

Returns
Type Description

getState()

publicFunction.StategetState()

Output only. State of the function.

.google.cloud.functions.v2.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Function.State

The state.

getStateMessages(int index)

publicStateMessagegetStateMessages(intindex)

Output only. State Messages for this Cloud Function.

repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description

getStateMessagesCount()

publicintgetStateMessagesCount()

Output only. State Messages for this Cloud Function.

repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getStateMessagesList()

publicList<StateMessage>getStateMessagesList()

Output only. State Messages for this Cloud Function.

repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description

getStateMessagesOrBuilder(int index)

publicStateMessageOrBuildergetStateMessagesOrBuilder(intindex)

Output only. State Messages for this Cloud Function.

repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description

getStateMessagesOrBuilderList()

publicList<?extendsStateMessageOrBuilder>getStateMessagesOrBuilderList()

Output only. State Messages for this Cloud Function.

repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.cloud.functions.v2.StateMessageOrBuilder>

getStateValue()

publicintgetStateValue()

Output only. State of the function.

.google.cloud.functions.v2.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for state.

getUnknownFields()

publicfinalUnknownFieldSetgetUnknownFields()
Returns
Type Description
Overrides

getUpdateTime()

publicTimestampgetUpdateTime()

Output only. The last update timestamp of a Cloud Function.

.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The updateTime.

getUpdateTimeOrBuilder()

publicTimestampOrBuildergetUpdateTimeOrBuilder()

Output only. The last update timestamp of a Cloud Function.

.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description

hasBuildConfig()

publicbooleanhasBuildConfig()

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

.google.cloud.functions.v2.BuildConfig build_config = 3;

Returns
Type Description
boolean

Whether the buildConfig field is set.

hasEventTrigger()

publicbooleanhasEventTrigger()

An Eventarc trigger managed by Google Cloud Functions that fires events in response to a condition in another service.

.google.cloud.functions.v2.EventTrigger event_trigger = 5;

Returns
Type Description
boolean

Whether the eventTrigger field is set.

hasServiceConfig()

publicbooleanhasServiceConfig()

Describes the Service being deployed. Currently deploys services to Cloud Run (fully managed).

.google.cloud.functions.v2.ServiceConfig service_config = 4;

Returns
Type Description
boolean

Whether the serviceConfig field is set.

hasUpdateTime()

publicbooleanhasUpdateTime()

Output only. The last update timestamp of a Cloud Function.

.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the updateTime field is set.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
Overrides

internalGetMapField(int number)

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

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
Overrides

newBuilderForType()

publicFunction.BuildernewBuilderForType()
Returns
Type Description

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedFunction.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
Returns
Type Description
Overrides

toBuilder()

publicFunction.BuildertoBuilder()
Returns
Type Description

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
Overrides Exceptions
Type Description

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.