# Class FunctionServiceClient (2.95.0)

2.95.0 (latest) 2.93.0 2.90.0 2.89.0 2.87.0 2.85.0 2.84.0 2.83.0 2.82.0 2.80.0 2.78.0 2.77.0 2.76.0 2.75.0 2.74.0 2.72.0 2.70.0 2.69.0 2.66.0 2.65.0 2.64.0 2.62.0 2.61.0 2.60.0 2.59.0 2.58.0 2.57.0 2.56.0 2.55.0 2.54.0 2.53.0 2.51.0 2.50.0 2.49.0 2.48.0 2.47.0 2.46.0 2.45.0 2.44.0 2.43.0 2.42.0 2.41.0 2.39.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.26.0 2.25.0 2.24.0 2.23.0 2.22.0 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.4 2.4.3 2.3.6

|---|---|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/FunctionServiceClient.java) | [Product Reference](https://cloud.google.com/functions) | [REST Documentation](https://cloud.google.com/functions/docs/reference/rest) | [RPC Documentation](https://cloud.google.com/functions/docs/reference/rpc) |

Service Description: Google Cloud Functions is used to deploy functions that are executed by
Google in response to various events. Data connected with that event is passed to a function as
the input data.

A \*\*function\*\* is a resource which describes a function that should be
executed and how it is triggered.

This class provides the ability to make remote calls to the backing service through method
calls that map to API methods. Sample code to get started:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
       Function response = functionServiceClient.getFunction(name);
     }
     
Note: close() needs to be called on the FunctionServiceClient object to clean up resources
such as threads. In the example above, try-with-resources is used, which automatically calls
close().

| Method | Description | Method Variants |
|---|---|---|
| GetFunction | Returns a function with the given name from the requested project. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getFunction(GetFunctionRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getFunction(FunctionName name) - getFunction(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getFunctionCallable() |
| ListFunctions | Returns a list of functions that belong to the requested project. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listFunctions(ListFunctionsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listFunctions(LocationName parent) - listFunctions(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listFunctionsPagedCallable() - listFunctionsCallable() |
| CreateFunction | Creates a new function. If a function with the given name already exists in the specified project, the long running operation will return `ALREADY_EXISTS` error. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createFunctionAsync(CreateFunctionRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - createFunctionAsync(LocationName parent, Function function, String functionId) - createFunctionAsync(String parent, Function function, String functionId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createFunctionOperationCallable() - createFunctionCallable() |
| UpdateFunction | Updates existing function. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateFunctionAsync(UpdateFunctionRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - updateFunctionAsync(Function function, FieldMask updateMask) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateFunctionOperationCallable() - updateFunctionCallable() |
| DeleteFunction | Deletes a function with the given name from the specified project. If the given function is used by some trigger, the trigger will be updated to remove this function. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteFunctionAsync(DeleteFunctionRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - deleteFunctionAsync(FunctionName name) - deleteFunctionAsync(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteFunctionOperationCallable() - deleteFunctionCallable() |
| GenerateUploadUrl | Returns a signed URL for uploading a function source code. For more information about the signed URL usage see: <https://cloud.google.com/storage/docs/access-control/signed-urls>. Once the function source code upload is complete, the used signed URL should be provided in CreateFunction or UpdateFunction request as a reference to the function source code. When uploading source code to the generated signed URL, please follow these restrictions: - Source file type should be a zip file. - No credentials should be attached - the signed URLs provide access to the target bucket using internal service identity; if credentials were attached, the identity from the credentials would be used, but that identity does not have permissions to upload files to the URL. When making a HTTP PUT request, specify this header: - `content-type: application/zip` Do not specify this header: - `Authorization: Bearer YOUR_TOKEN` | Request object method variants only take one parameter, a request object, which must be constructed before the call. - generateUploadUrl(GenerateUploadUrlRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - generateUploadUrlCallable() |
| GenerateDownloadUrl | Returns a signed URL for downloading deployed function source code. The URL is only valid for a limited period and should be used within 30 minutes of generation. For more information about the signed URL usage see: <https://cloud.google.com/storage/docs/access-control/signed-urls> | Request object method variants only take one parameter, a request object, which must be constructed before the call. - generateDownloadUrl(GenerateDownloadUrlRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - generateDownloadUrlCallable() |
| ListRuntimes | Returns a list of runtimes that are supported for the requested project. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listRuntimes(ListRuntimesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listRuntimes(LocationName parent) - listRuntimes(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listRuntimesCallable() |
| ListLocations | Lists information about the supported locations for this service. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listLocations(ListLocationsRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listLocationsPagedCallable() - listLocationsCallable() |
| SetIamPolicy | Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - setIamPolicy(SetIamPolicyRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - setIamPolicyCallable() |
| GetIamPolicy | Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getIamPolicy(GetIamPolicyRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getIamPolicyCallable() |
| TestIamPermissions | Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - testIamPermissions(TestIamPermissionsRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - testIamPermissionsCallable() |
[Methods]

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with
these names, this class includes a format method for each type of name, and additionally a parse
method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of FunctionServiceSettings to
create(). For example:

To customize credentials:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     FunctionServiceSettings functionServiceSettings =
         FunctionServiceSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     FunctionServiceClient functionServiceClient =
         FunctionServiceClient.create(functionServiceSettings);
     
To customize the endpoint:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     FunctionServiceSettings functionServiceSettings =
         FunctionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
     FunctionServiceClient functionServiceClient =
         FunctionServiceClient.create(functionServiceSettings);
     
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
the wire:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     FunctionServiceSettings functionServiceSettings =
         FunctionServiceSettings.newHttpJsonBuilder().build();
     FunctionServiceClient functionServiceClient =
         FunctionServiceClient.create(functionServiceSettings);
     
Please refer to the GitHub repository's samples for more quickstart code snippets.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> FunctionServiceClient

## Static Methods

### create()

    public static final FunctionServiceClient create()

Constructs an instance of FunctionServiceClient with default settings.

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

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(FunctionServiceSettings settings)

    public static final FunctionServiceClient create(FunctionServiceSettings settings)

Constructs an instance of FunctionServiceClient, using the given settings. The channels are
created based on the settings passed in, or defaults for any settings that are not set.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.FunctionServiceSettings` |

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

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(FunctionServiceStub stub)

    public static final FunctionServiceClient create(FunctionServiceStub stub)

Constructs an instance of FunctionServiceClient, using the given stub for making calls. This is
for advanced usage - prefer using create(FunctionServiceSettings).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.stub.FunctionServiceStub` |

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

## Constructors

### FunctionServiceClient(FunctionServiceSettings settings)

    protected FunctionServiceClient(FunctionServiceSettings settings)

Constructs an instance of FunctionServiceClient, using the given settings. This is protected so
that it is easy to make a subclass, but otherwise, the static factory methods should be
preferred.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.FunctionServiceSettings` |

### FunctionServiceClient(FunctionServiceStub stub)

    protected FunctionServiceClient(FunctionServiceStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.stub.FunctionServiceStub` |

## Methods

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

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

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

### close()

    public final void close()

### createFunctionAsync(CreateFunctionRequest request)

    public final OperationFuture<Function,OperationMetadata> createFunctionAsync(CreateFunctionRequest request)

Creates a new function. If a function with the given name already exists in the specified
project, the long running operation will return `ALREADY_EXISTS` error.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       CreateFunctionRequest request =
           CreateFunctionRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setFunction(Function.newBuilder().build())
               .setFunctionId("functionId-62789869")
               .build();
       Function response = functionServiceClient.createFunctionAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.CreateFunctionRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.Function,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.OperationMetadata>` |   |

### createFunctionAsync(LocationName parent, Function function, String functionId)

    public final OperationFuture<Function,OperationMetadata> createFunctionAsync(LocationName parent, Function function, String functionId)

Creates a new function. If a function with the given name already exists in the specified
project, the long running operation will return `ALREADY_EXISTS` error.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       Function function = Function.newBuilder().build();
       String functionId = "functionId-62789869";
       Function response =
           functionServiceClient.createFunctionAsync(parent, function, functionId).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.LocationName` Required. The project and location in which the function should be created, specified in the format `projects/*/locations/*` |
| `function` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.Function` Required. Function to be created. |
| `functionId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The ID to use for the function, which will become the final component of the function's resource name. This value should be 4-63 characters, and valid characters are /a-z-/. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.Function,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.OperationMetadata>` |   |

### createFunctionAsync(String parent, Function function, String functionId)

    public final OperationFuture<Function,OperationMetadata> createFunctionAsync(String parent, Function function, String functionId)

Creates a new function. If a function with the given name already exists in the specified
project, the long running operation will return `ALREADY_EXISTS` error.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       Function function = Function.newBuilder().build();
       String functionId = "functionId-62789869";
       Function response =
           functionServiceClient.createFunctionAsync(parent, function, functionId).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The project and location in which the function should be created, specified in the format `projects/*/locations/*` |
| `function` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.Function` Required. Function to be created. |
| `functionId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The ID to use for the function, which will become the final component of the function's resource name. This value should be 4-63 characters, and valid characters are /a-z-/. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.Function,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.OperationMetadata>` |   |

### createFunctionCallable()

    public final UnaryCallable<CreateFunctionRequest,Operation> createFunctionCallable()

Creates a new function. If a function with the given name already exists in the specified
project, the long running operation will return `ALREADY_EXISTS` error.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       CreateFunctionRequest request =
           CreateFunctionRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setFunction(Function.newBuilder().build())
               .setFunctionId("functionId-62789869")
               .build();
       ApiFuture<Operation> future =
           functionServiceClient.createFunctionCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.CreateFunctionRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### createFunctionOperationCallable()

    public final OperationCallable<CreateFunctionRequest,Function,OperationMetadata> createFunctionOperationCallable()

Creates a new function. If a function with the given name already exists in the specified
project, the long running operation will return `ALREADY_EXISTS` error.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       CreateFunctionRequest request =
           CreateFunctionRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setFunction(Function.newBuilder().build())
               .setFunctionId("functionId-62789869")
               .build();
       OperationFuture<Function, OperationMetadata> future =
           functionServiceClient.createFunctionOperationCallable().futureCall(request);
       // Do something.
       Function response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.CreateFunctionRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.Function,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.OperationMetadata>` |   |

### deleteFunctionAsync(DeleteFunctionRequest request)

    public final OperationFuture<Empty,OperationMetadata> deleteFunctionAsync(DeleteFunctionRequest request)

Deletes a function with the given name from the specified project. If the given function is
used by some trigger, the trigger will be updated to remove this function.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       DeleteFunctionRequest request =
           DeleteFunctionRequest.newBuilder()
               .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
               .build();
       functionServiceClient.deleteFunctionAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.DeleteFunctionRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.OperationMetadata>` |   |

### deleteFunctionAsync(FunctionName name)

    public final OperationFuture<Empty,OperationMetadata> deleteFunctionAsync(FunctionName name)

Deletes a function with the given name from the specified project. If the given function is
used by some trigger, the trigger will be updated to remove this function.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
       functionServiceClient.deleteFunctionAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.FunctionName` Required. The name of the function which should be deleted. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.OperationMetadata>` |   |

### deleteFunctionAsync(String name)

    public final OperationFuture<Empty,OperationMetadata> deleteFunctionAsync(String name)

Deletes a function with the given name from the specified project. If the given function is
used by some trigger, the trigger will be updated to remove this function.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       String name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString();
       functionServiceClient.deleteFunctionAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the function which should be deleted. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.OperationMetadata>` |   |

### deleteFunctionCallable()

    public final UnaryCallable<DeleteFunctionRequest,Operation> deleteFunctionCallable()

Deletes a function with the given name from the specified project. If the given function is
used by some trigger, the trigger will be updated to remove this function.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       DeleteFunctionRequest request =
           DeleteFunctionRequest.newBuilder()
               .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
               .build();
       ApiFuture<Operation> future =
           functionServiceClient.deleteFunctionCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.DeleteFunctionRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### deleteFunctionOperationCallable()

    public final OperationCallable<DeleteFunctionRequest,Empty,OperationMetadata> deleteFunctionOperationCallable()

Deletes a function with the given name from the specified project. If the given function is
used by some trigger, the trigger will be updated to remove this function.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       DeleteFunctionRequest request =
           DeleteFunctionRequest.newBuilder()
               .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
               .build();
       OperationFuture<Empty, OperationMetadata> future =
           functionServiceClient.deleteFunctionOperationCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.DeleteFunctionRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.OperationMetadata>` |   |

### generateDownloadUrl(GenerateDownloadUrlRequest request)

    public final GenerateDownloadUrlResponse generateDownloadUrl(GenerateDownloadUrlRequest request)

Returns a signed URL for downloading deployed function source code. The URL is only valid for a
limited period and should be used within 30 minutes of generation. For more information about
the signed URL usage see: <https://cloud.google.com/storage/docs/access-control/signed-urls>

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       GenerateDownloadUrlRequest request =
           GenerateDownloadUrlRequest.newBuilder()
               .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
               .build();
       GenerateDownloadUrlResponse response = functionServiceClient.generateDownloadUrl(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.GenerateDownloadUrlRequest` The request object containing all of the parameters for the API call. |

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

### generateDownloadUrlCallable()

    public final UnaryCallable<GenerateDownloadUrlRequest,GenerateDownloadUrlResponse> generateDownloadUrlCallable()

Returns a signed URL for downloading deployed function source code. The URL is only valid for a
limited period and should be used within 30 minutes of generation. For more information about
the signed URL usage see: <https://cloud.google.com/storage/docs/access-control/signed-urls>

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       GenerateDownloadUrlRequest request =
           GenerateDownloadUrlRequest.newBuilder()
               .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
               .build();
       ApiFuture<GenerateDownloadUrlResponse> future =
           functionServiceClient.generateDownloadUrlCallable().futureCall(request);
       // Do something.
       GenerateDownloadUrlResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.GenerateDownloadUrlRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.GenerateDownloadUrlResponse>` |   |

### generateUploadUrl(GenerateUploadUrlRequest request)

    public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlRequest request)

Returns a signed URL for uploading a function source code. For more information about the
signed URL usage see: <https://cloud.google.com/storage/docs/access-control/signed-urls>. Once
the function source code upload is complete, the used signed URL should be provided in
CreateFunction or UpdateFunction request as a reference to the function source code.

When uploading source code to the generated signed URL, please follow these restrictions:

- Source file type should be a zip file.
- No credentials should be attached - the signed URLs provide access to the target bucket using internal service identity; if credentials were attached, the identity from the credentials would be used, but that identity does not have permissions to upload files to the URL.

When making a HTTP PUT request, specify this header:

- `content-type: application/zip`

Do not specify this header:

- `Authorization: Bearer YOUR_TOKEN`

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       GenerateUploadUrlRequest request =
           GenerateUploadUrlRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setKmsKeyName(
                   CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
                       .toString())
               .setEnvironment(Environment.forNumber(0))
               .build();
       GenerateUploadUrlResponse response = functionServiceClient.generateUploadUrl(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.GenerateUploadUrlRequest` The request object containing all of the parameters for the API call. |

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

### generateUploadUrlCallable()

    public final UnaryCallable<GenerateUploadUrlRequest,GenerateUploadUrlResponse> generateUploadUrlCallable()

Returns a signed URL for uploading a function source code. For more information about the
signed URL usage see: <https://cloud.google.com/storage/docs/access-control/signed-urls>. Once
the function source code upload is complete, the used signed URL should be provided in
CreateFunction or UpdateFunction request as a reference to the function source code.

When uploading source code to the generated signed URL, please follow these restrictions:

- Source file type should be a zip file.
- No credentials should be attached - the signed URLs provide access to the target bucket using internal service identity; if credentials were attached, the identity from the credentials would be used, but that identity does not have permissions to upload files to the URL.

When making a HTTP PUT request, specify this header:

- `content-type: application/zip`

Do not specify this header:

- `Authorization: Bearer YOUR_TOKEN`

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       GenerateUploadUrlRequest request =
           GenerateUploadUrlRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setKmsKeyName(
                   CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
                       .toString())
               .setEnvironment(Environment.forNumber(0))
               .build();
       ApiFuture<GenerateUploadUrlResponse> future =
           functionServiceClient.generateUploadUrlCallable().futureCall(request);
       // Do something.
       GenerateUploadUrlResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.GenerateUploadUrlRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.GenerateUploadUrlResponse>` |   |

### getFunction(FunctionName name)

    public final Function getFunction(FunctionName name)

Returns a function with the given name from the requested project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
       Function response = functionServiceClient.getFunction(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.FunctionName` Required. The name of the function which details should be obtained. |

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

### getFunction(GetFunctionRequest request)

    public final Function getFunction(GetFunctionRequest request)

Returns a function with the given name from the requested project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       GetFunctionRequest request =
           GetFunctionRequest.newBuilder()
               .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
               .setRevision("revision-260786213")
               .build();
       Function response = functionServiceClient.getFunction(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.GetFunctionRequest` The request object containing all of the parameters for the API call. |

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

### getFunction(String name)

    public final Function getFunction(String name)

Returns a function with the given name from the requested project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       String name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString();
       Function response = functionServiceClient.getFunction(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the function which details should be obtained. |

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

### getFunctionCallable()

    public final UnaryCallable<GetFunctionRequest,Function> getFunctionCallable()

Returns a function with the given name from the requested project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       GetFunctionRequest request =
           GetFunctionRequest.newBuilder()
               .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
               .setRevision("revision-260786213")
               .build();
       ApiFuture<Function> future = functionServiceClient.getFunctionCallable().futureCall(request);
       // Do something.
       Function response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.GetFunctionRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.Function>` |   |

### getHttpJsonOperationsClient()

    public final OperationsClient getHttpJsonOperationsClient()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.httpjson.longrunning.OperationsClient.html` |   |

### getIamPolicy(GetIamPolicyRequest request)

    public final Policy getIamPolicy(GetIamPolicyRequest request)

Gets the access control policy for a resource. Returns an empty policyif the resource exists
and does not have a policy set.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       GetIamPolicyRequest request =
           GetIamPolicyRequest.newBuilder()
               .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
               .setOptions(GetPolicyOptions.newBuilder().build())
               .build();
       Policy response = functionServiceClient.getIamPolicy(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.GetIamPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicyCallable()

    public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Gets the access control policy for a resource. Returns an empty policyif the resource exists
and does not have a policy set.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       GetIamPolicyRequest request =
           GetIamPolicyRequest.newBuilder()
               .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
               .setOptions(GetPolicyOptions.newBuilder().build())
               .build();
       ApiFuture<Policy> future = functionServiceClient.getIamPolicyCallable().futureCall(request);
       // Do something.
       Policy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>` |   |

### getOperationsClient()

    public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.OperationsClient.html` |   |

### getSettings()

    public final FunctionServiceSettings getSettings()

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

### getStub()

    public FunctionServiceStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.stub.FunctionServiceStub` |   |

### isShutdown()

    public boolean isShutdown()

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

### isTerminated()

    public boolean isTerminated()

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

### listFunctions(ListFunctionsRequest request)

    public final FunctionServiceClient.ListFunctionsPagedResponse listFunctions(ListFunctionsRequest request)

Returns a list of functions that belong to the requested project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       ListFunctionsRequest request =
           ListFunctionsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setOrderBy("orderBy-1207110587")
               .build();
       for (Function element : functionServiceClient.listFunctions(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.ListFunctionsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.FunctionServiceClient.ListFunctionsPagedResponse` |   |

### listFunctions(LocationName parent)

    public final FunctionServiceClient.ListFunctionsPagedResponse listFunctions(LocationName parent)

Returns a list of functions that belong to the requested project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       for (Function element : functionServiceClient.listFunctions(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.LocationName` Required. The project and location from which the function should be listed, specified in the format `projects/*/locations/*` If you want to list functions in all locations, use "-" in place of a location. When listing functions in all locations, if one or more location(s) are unreachable, the response will contain functions from all reachable locations along with the names of any unreachable locations. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.FunctionServiceClient.ListFunctionsPagedResponse` |   |

### listFunctions(String parent)

    public final FunctionServiceClient.ListFunctionsPagedResponse listFunctions(String parent)

Returns a list of functions that belong to the requested project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       for (Function element : functionServiceClient.listFunctions(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The project and location from which the function should be listed, specified in the format `projects/*/locations/*` If you want to list functions in all locations, use "-" in place of a location. When listing functions in all locations, if one or more location(s) are unreachable, the response will contain functions from all reachable locations along with the names of any unreachable locations. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.FunctionServiceClient.ListFunctionsPagedResponse` |   |

### listFunctionsCallable()

    public final UnaryCallable<ListFunctionsRequest,ListFunctionsResponse> listFunctionsCallable()

Returns a list of functions that belong to the requested project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       ListFunctionsRequest request =
           ListFunctionsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setOrderBy("orderBy-1207110587")
               .build();
       while (true) {
         ListFunctionsResponse response =
             functionServiceClient.listFunctionsCallable().call(request);
         for (Function element : response.getFunctionsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.ListFunctionsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.ListFunctionsResponse>` |   |

### listFunctionsPagedCallable()

    public final UnaryCallable<ListFunctionsRequest,FunctionServiceClient.ListFunctionsPagedResponse> listFunctionsPagedCallable()

Returns a list of functions that belong to the requested project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       ListFunctionsRequest request =
           ListFunctionsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setOrderBy("orderBy-1207110587")
               .build();
       ApiFuture<Function> future =
           functionServiceClient.listFunctionsPagedCallable().futureCall(request);
       // Do something.
       for (Function element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.ListFunctionsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.FunctionServiceClient.ListFunctionsPagedResponse>` |   |

### listLocations(ListLocationsRequest request)

    public final FunctionServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       ListLocationsRequest request =
           ListLocationsRequest.newBuilder()
               .setName("name3373707")
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (Location element : functionServiceClient.listLocations(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.cloud.location.ListLocationsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.FunctionServiceClient.ListLocationsPagedResponse` |   |

### listLocationsCallable()

    public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       ListLocationsRequest request =
           ListLocationsRequest.newBuilder()
               .setName("name3373707")
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListLocationsResponse response =
             functionServiceClient.listLocationsCallable().call(request);
         for (Location element : response.getLocationsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>` |   |

### listLocationsPagedCallable()

    public final UnaryCallable<ListLocationsRequest,FunctionServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Lists information about the supported locations for this service.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       ListLocationsRequest request =
           ListLocationsRequest.newBuilder()
               .setName("name3373707")
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<Location> future =
           functionServiceClient.listLocationsPagedCallable().futureCall(request);
       // Do something.
       for (Location element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.cloud.location.ListLocationsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.FunctionServiceClient.ListLocationsPagedResponse>` |   |

### listRuntimes(ListRuntimesRequest request)

    public final ListRuntimesResponse listRuntimes(ListRuntimesRequest request)

Returns a list of runtimes that are supported for the requested project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       ListRuntimesRequest request =
           ListRuntimesRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setFilter("filter-1274492040")
               .build();
       ListRuntimesResponse response = functionServiceClient.listRuntimes(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.ListRuntimesRequest` The request object containing all of the parameters for the API call. |

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

### listRuntimes(LocationName parent)

    public final ListRuntimesResponse listRuntimes(LocationName parent)

Returns a list of runtimes that are supported for the requested project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       ListRuntimesResponse response = functionServiceClient.listRuntimes(parent);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.LocationName` Required. The project and location from which the runtimes should be listed, specified in the format `projects/*/locations/*` |

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

### listRuntimes(String parent)

    public final ListRuntimesResponse listRuntimes(String parent)

Returns a list of runtimes that are supported for the requested project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       ListRuntimesResponse response = functionServiceClient.listRuntimes(parent);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The project and location from which the runtimes should be listed, specified in the format `projects/*/locations/*` |

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

### listRuntimesCallable()

    public final UnaryCallable<ListRuntimesRequest,ListRuntimesResponse> listRuntimesCallable()

Returns a list of runtimes that are supported for the requested project.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       ListRuntimesRequest request =
           ListRuntimesRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setFilter("filter-1274492040")
               .build();
       ApiFuture<ListRuntimesResponse> future =
           functionServiceClient.listRuntimesCallable().futureCall(request);
       // Do something.
       ListRuntimesResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.ListRuntimesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.ListRuntimesResponse>` |   |

### setIamPolicy(SetIamPolicyRequest request)

    public final Policy setIamPolicy(SetIamPolicyRequest request)

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       SetIamPolicyRequest request =
           SetIamPolicyRequest.newBuilder()
               .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
               .setPolicy(Policy.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Policy response = functionServiceClient.setIamPolicy(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.SetIamPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicyCallable()

    public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       SetIamPolicyRequest request =
           SetIamPolicyRequest.newBuilder()
               .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
               .setPolicy(Policy.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Policy> future = functionServiceClient.setIamPolicyCallable().futureCall(request);
       // Do something.
       Policy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### testIamPermissions(TestIamPermissionsRequest request)

    public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

Returns permissions that a caller has on the specified resource. If theresource does not exist,
this will return an empty set ofpermissions, not a `NOT_FOUND` error.

Note: This operation is designed to be used for buildingpermission-aware UIs and
command-line tools, not for authorizationchecking. This operation may "fail open" without
warning.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       TestIamPermissionsRequest request =
           TestIamPermissionsRequest.newBuilder()
               .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
               .addAllPermissions(new ArrayList<String>())
               .build();
       TestIamPermissionsResponse response = functionServiceClient.testIamPermissions(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.TestIamPermissionsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.TestIamPermissionsResponse` |   |

### testIamPermissionsCallable()

    public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

Returns permissions that a caller has on the specified resource. If theresource does not exist,
this will return an empty set ofpermissions, not a `NOT_FOUND` error.

Note: This operation is designed to be used for buildingpermission-aware UIs and
command-line tools, not for authorizationchecking. This operation may "fail open" without
warning.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       TestIamPermissionsRequest request =
           TestIamPermissionsRequest.newBuilder()
               .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
               .addAllPermissions(new ArrayList<String>())
               .build();
       ApiFuture<TestIamPermissionsResponse> future =
           functionServiceClient.testIamPermissionsCallable().futureCall(request);
       // Do something.
       TestIamPermissionsResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>` |   |

### updateFunctionAsync(Function function, FieldMask updateMask)

    public final OperationFuture<Function,OperationMetadata> updateFunctionAsync(Function function, FieldMask updateMask)

Updates existing function.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       Function function = Function.newBuilder().build();
       FieldMask updateMask = FieldMask.newBuilder().build();
       Function response = functionServiceClient.updateFunctionAsync(function, updateMask).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `function` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.Function` Required. New version of the function. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` The list of fields to be updated. If no field mask is provided, all fields will be updated. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.Function,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.OperationMetadata>` |   |

### updateFunctionAsync(UpdateFunctionRequest request)

    public final OperationFuture<Function,OperationMetadata> updateFunctionAsync(UpdateFunctionRequest request)

Updates existing function.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       UpdateFunctionRequest request =
           UpdateFunctionRequest.newBuilder()
               .setFunction(Function.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Function response = functionServiceClient.updateFunctionAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.UpdateFunctionRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.Function,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.OperationMetadata>` |   |

### updateFunctionCallable()

    public final UnaryCallable<UpdateFunctionRequest,Operation> updateFunctionCallable()

Updates existing function.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       UpdateFunctionRequest request =
           UpdateFunctionRequest.newBuilder()
               .setFunction(Function.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Operation> future =
           functionServiceClient.updateFunctionCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.UpdateFunctionRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### updateFunctionOperationCallable()

    public final OperationCallable<UpdateFunctionRequest,Function,OperationMetadata> updateFunctionOperationCallable()

Updates existing function.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
       UpdateFunctionRequest request =
           UpdateFunctionRequest.newBuilder()
               .setFunction(Function.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       OperationFuture<Function, OperationMetadata> future =
           functionServiceClient.updateFunctionOperationCallable().futureCall(request);
       // Do something.
       Function response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.UpdateFunctionRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.Function,https://docs.cloud.google.com/java/docs/reference/google-cloud-functions/latest/com.google.cloud.functions.v2.OperationMetadata>` |   |