# Interface FunctionOrBuilder (0.16.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [0.16.0 (latest)](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.FunctionOrBuilder)
- [0.15.0](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.functions.v2.FunctionOrBuilder)
- [0.14.1](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.functions.v2.FunctionOrBuilder)

    public interface FunctionOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### containsLabels(String key)

    public abstract boolean containsLabels(String key)

Labels associated with this Cloud Function.

`map<string, string> labels = 8;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getBuildConfig()

    public abstract BuildConfig getBuildConfig()

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

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.BuildConfig` | The buildConfig. |

### getBuildConfigOrBuilder()

    public abstract BuildConfigOrBuilder getBuildConfigOrBuilder()

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

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.BuildConfigOrBuilder` |   |

### getDescription()

    public abstract String getDescription()

User-provided description of a function.

`string description = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The description. |

### getDescriptionBytes()

    public abstract ByteString getDescriptionBytes()

User-provided description of a function.

`string description = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for description. |

### getEnvironment()

    public abstract Environment getEnvironment()

Describe whether the function is gen1 or gen2.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.Environment` | The environment. |

### getEnvironmentValue()

    public abstract int getEnvironmentValue()

Describe whether the function is gen1 or gen2.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for environment. |

### getEventTrigger()

    public abstract EventTrigger getEventTrigger()

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

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.EventTrigger` | The eventTrigger. |

### getEventTriggerOrBuilder()

    public abstract EventTriggerOrBuilder getEventTriggerOrBuilder()

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

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.EventTriggerOrBuilder` |   |

### getLabels()

    public abstract Map<String,String> getLabels()

Use [#getLabelsMap()](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.FunctionOrBuilder#com_google_events_cloud_functions_v2_FunctionOrBuilder_getLabelsMap__) instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getLabelsCount()

    public abstract int getLabelsCount()

Labels associated with this Cloud Function.

`map<string, string> labels = 8;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getLabelsMap()

    public abstract Map<String,String> getLabelsMap()

Labels associated with this Cloud Function.

`map<string, string> labels = 8;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getLabelsOrDefault(String key, String defaultValue)

    public abstract String getLabelsOrDefault(String key, String defaultValue)

Labels associated with this Cloud Function.

`map<string, string> labels = 8;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `defaultValue` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getLabelsOrThrow(String key)

    public abstract String getLabelsOrThrow(String key)

Labels associated with this Cloud Function.

`map<string, string> labels = 8;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getName()

    public abstract String getName()

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** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The name. |

### getNameBytes()

    public abstract ByteString getNameBytes()

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** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for name. |

### getServiceConfig()

    public abstract ServiceConfig getServiceConfig()

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

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.ServiceConfig` | The serviceConfig. |

### getServiceConfigOrBuilder()

    public abstract ServiceConfigOrBuilder getServiceConfigOrBuilder()

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

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.ServiceConfigOrBuilder` |   |

### getState()

    public abstract Function.State getState()

Output only. State of the function.

`.google.events.cloud.functions.v2.Function.State state = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.Function.State` | The state. |

### getStateMessages(int index)

    public abstract StateMessage getStateMessages(int index)

Output only. State Messages for this Cloud Function.

`repeated .google.events.cloud.functions.v2.StateMessage state_messages = 9;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.StateMessage` |   |

### getStateMessagesCount()

    public abstract int getStateMessagesCount()

Output only. State Messages for this Cloud Function.

`repeated .google.events.cloud.functions.v2.StateMessage state_messages = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getStateMessagesList()

    public abstract List<StateMessage> getStateMessagesList()

Output only. State Messages for this Cloud Function.

`repeated .google.events.cloud.functions.v2.StateMessage state_messages = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.StateMessage>` |   |

### getStateMessagesOrBuilder(int index)

    public abstract StateMessageOrBuilder getStateMessagesOrBuilder(int index)

Output only. State Messages for this Cloud Function.

`repeated .google.events.cloud.functions.v2.StateMessage state_messages = 9;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.functions.v2.StateMessageOrBuilder` |   |

### getStateMessagesOrBuilderList()

    public abstract List<? extends StateMessageOrBuilder> getStateMessagesOrBuilderList()

Output only. State Messages for this Cloud Function.

`repeated .google.events.cloud.functions.v2.StateMessage state_messages = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.events.cloud.functions.v2.StateMessageOrBuilder>` |   |

### getStateValue()

    public abstract int getStateValue()

Output only. State of the function.

`.google.events.cloud.functions.v2.Function.State state = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for state. |

### getUpdateTime()

    public abstract Timestamp getUpdateTime()

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

`.google.protobuf.Timestamp update_time = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` | The updateTime. |

### getUpdateTimeOrBuilder()

    public abstract TimestampOrBuilder getUpdateTimeOrBuilder()

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

`.google.protobuf.Timestamp update_time = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TimestampOrBuilder.html` |   |

### hasBuildConfig()

    public abstract boolean hasBuildConfig()

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

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the buildConfig field is set. |

### hasEventTrigger()

    public abstract boolean hasEventTrigger()

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

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the eventTrigger field is set. |

### hasServiceConfig()

    public abstract boolean hasServiceConfig()

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

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the serviceConfig field is set. |

### hasUpdateTime()

    public abstract boolean hasUpdateTime()

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

`.google.protobuf.Timestamp update_time = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the updateTime field is set. |