@BetaApi @Generated(value="by gapic-generator-java") public class FunctionServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
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().
The surface of this class includes several types of Java methods for each of the API's 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.
| Modifier and Type | Class and Description |
|---|---|
static class |
FunctionServiceClient.ListFunctionsFixedSizeCollection |
static class |
FunctionServiceClient.ListFunctionsPage |
static class |
FunctionServiceClient.ListFunctionsPagedResponse |
static class |
FunctionServiceClient.ListLocationsFixedSizeCollection |
static class |
FunctionServiceClient.ListLocationsPage |
static class |
FunctionServiceClient.ListLocationsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
FunctionServiceClient(FunctionServiceSettings settings)
Constructs an instance of FunctionServiceClient, using the given settings.
|
protected |
FunctionServiceClient(FunctionServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static FunctionServiceClient |
create()
Constructs an instance of FunctionServiceClient with default settings.
|
static FunctionServiceClient |
create(FunctionServiceSettings settings)
Constructs an instance of FunctionServiceClient, using the given settings.
|
static FunctionServiceClient |
create(FunctionServiceStub stub)
Constructs an instance of FunctionServiceClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Function,OperationMetadata> |
createFunctionAsync(CreateFunctionRequest request)
Creates a new function.
|
com.google.api.gax.longrunning.OperationFuture<Function,OperationMetadata> |
createFunctionAsync(LocationName parent,
Function function,
String functionId)
Creates a new function.
|
com.google.api.gax.longrunning.OperationFuture<Function,OperationMetadata> |
createFunctionAsync(String parent,
Function function,
String functionId)
Creates a new function.
|
com.google.api.gax.rpc.UnaryCallable<CreateFunctionRequest,com.google.longrunning.Operation> |
createFunctionCallable()
Creates a new function.
|
com.google.api.gax.rpc.OperationCallable<CreateFunctionRequest,Function,OperationMetadata> |
createFunctionOperationCallable()
Creates a new function.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteFunctionAsync(DeleteFunctionRequest request)
Deletes a function with the given name from the specified project.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteFunctionAsync(FunctionName name)
Deletes a function with the given name from the specified project.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteFunctionAsync(String name)
Deletes a function with the given name from the specified project.
|
com.google.api.gax.rpc.UnaryCallable<DeleteFunctionRequest,com.google.longrunning.Operation> |
deleteFunctionCallable()
Deletes a function with the given name from the specified project.
|
com.google.api.gax.rpc.OperationCallable<DeleteFunctionRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteFunctionOperationCallable()
Deletes a function with the given name from the specified project.
|
GenerateDownloadUrlResponse |
generateDownloadUrl(GenerateDownloadUrlRequest request)
Returns a signed URL for downloading deployed function source code.
|
com.google.api.gax.rpc.UnaryCallable<GenerateDownloadUrlRequest,GenerateDownloadUrlResponse> |
generateDownloadUrlCallable()
Returns a signed URL for downloading deployed function source code.
|
GenerateUploadUrlResponse |
generateUploadUrl(GenerateUploadUrlRequest request)
Returns a signed URL for uploading a function source code.
|
com.google.api.gax.rpc.UnaryCallable<GenerateUploadUrlRequest,GenerateUploadUrlResponse> |
generateUploadUrlCallable()
Returns a signed URL for uploading a function source code.
|
Function |
getFunction(FunctionName name)
Returns a function with the given name from the requested project.
|
Function |
getFunction(GetFunctionRequest request)
Returns a function with the given name from the requested project.
|
Function |
getFunction(String name)
Returns a function with the given name from the requested project.
|
com.google.api.gax.rpc.UnaryCallable<GetFunctionRequest,Function> |
getFunctionCallable()
Returns a function with the given name from the requested project.
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
com.google.iam.v1.Policy |
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getIamPolicyCallable()
Gets the access control policy for a resource.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
FunctionServiceSettings |
getSettings() |
FunctionServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
FunctionServiceClient.ListFunctionsPagedResponse |
listFunctions(ListFunctionsRequest request)
Returns a list of functions that belong to the requested project.
|
FunctionServiceClient.ListFunctionsPagedResponse |
listFunctions(LocationName parent)
Returns a list of functions that belong to the requested project.
|
FunctionServiceClient.ListFunctionsPagedResponse |
listFunctions(String parent)
Returns a list of functions that belong to the requested project.
|
com.google.api.gax.rpc.UnaryCallable<ListFunctionsRequest,ListFunctionsResponse> |
listFunctionsCallable()
Returns a list of functions that belong to the requested project.
|
com.google.api.gax.rpc.UnaryCallable<ListFunctionsRequest,FunctionServiceClient.ListFunctionsPagedResponse> |
listFunctionsPagedCallable()
Returns a list of functions that belong to the requested project.
|
FunctionServiceClient.ListLocationsPagedResponse |
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsCallable()
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,FunctionServiceClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
ListRuntimesResponse |
listRuntimes(ListRuntimesRequest request)
Returns a list of runtimes that are supported for the requested project.
|
ListRuntimesResponse |
listRuntimes(LocationName parent)
Returns a list of runtimes that are supported for the requested project.
|
ListRuntimesResponse |
listRuntimes(String parent)
Returns a list of runtimes that are supported for the requested project.
|
com.google.api.gax.rpc.UnaryCallable<ListRuntimesRequest,ListRuntimesResponse> |
listRuntimesCallable()
Returns a list of runtimes that are supported for the requested project.
|
com.google.iam.v1.Policy |
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
setIamPolicyCallable()
Sets the access control policy on the specified resource.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.longrunning.OperationFuture<Function,OperationMetadata> |
updateFunctionAsync(Function function,
com.google.protobuf.FieldMask updateMask)
Updates existing function.
|
com.google.api.gax.longrunning.OperationFuture<Function,OperationMetadata> |
updateFunctionAsync(UpdateFunctionRequest request)
Updates existing function.
|
com.google.api.gax.rpc.UnaryCallable<UpdateFunctionRequest,com.google.longrunning.Operation> |
updateFunctionCallable()
Updates existing function.
|
com.google.api.gax.rpc.OperationCallable<UpdateFunctionRequest,Function,OperationMetadata> |
updateFunctionOperationCallable()
Updates existing function.
|
protected FunctionServiceClient(FunctionServiceSettings settings) throws IOException
IOExceptionprotected FunctionServiceClient(FunctionServiceStub stub)
public static final FunctionServiceClient create() throws IOException
IOExceptionpublic static final FunctionServiceClient create(FunctionServiceSettings settings) throws IOException
IOExceptionpublic static final FunctionServiceClient create(FunctionServiceStub stub)
public final FunctionServiceSettings getSettings()
public FunctionServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final Function getFunction(FunctionName name)
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);
}
name - Required. The name of the function which details should be obtained.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Function getFunction(String name)
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);
}
name - Required. The name of the function which details should be obtained.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Function getFunction(GetFunctionRequest request)
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())
.build();
Function response = functionServiceClient.getFunction(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetFunctionRequest,Function> getFunctionCallable()
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())
.build();
ApiFuture<Function> future = functionServiceClient.getFunctionCallable().futureCall(request);
// Do something.
Function response = future.get();
}
public final FunctionServiceClient.ListFunctionsPagedResponse listFunctions(LocationName parent)
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);
}
}
parent - 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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FunctionServiceClient.ListFunctionsPagedResponse listFunctions(String parent)
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);
}
}
parent - 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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FunctionServiceClient.ListFunctionsPagedResponse listFunctions(ListFunctionsRequest request)
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListFunctionsRequest,FunctionServiceClient.ListFunctionsPagedResponse> listFunctionsPagedCallable()
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListFunctionsRequest,ListFunctionsResponse> listFunctionsCallable()
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;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Function,OperationMetadata> createFunctionAsync(LocationName parent, Function function, String functionId)
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();
}
parent - Required. The project and location in which the function should be created,
specified in the format `projects/*/locations/*`function - Required. Function to be created.functionId - 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][0-9]-/.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Function,OperationMetadata> createFunctionAsync(String parent, Function function, String functionId)
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();
}
parent - Required. The project and location in which the function should be created,
specified in the format `projects/*/locations/*`function - Required. Function to be created.functionId - 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][0-9]-/.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Function,OperationMetadata> createFunctionAsync(CreateFunctionRequest request)
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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateFunctionRequest,Function,OperationMetadata> createFunctionOperationCallable()
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();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateFunctionRequest,com.google.longrunning.Operation> createFunctionCallable()
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();
}
public final com.google.api.gax.longrunning.OperationFuture<Function,OperationMetadata> updateFunctionAsync(Function function, com.google.protobuf.FieldMask updateMask)
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();
}
function - Required. New version of the function.updateMask - The list of fields to be updated. If no field mask is provided, all provided
fields in the request will be updated.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Function,OperationMetadata> updateFunctionAsync(UpdateFunctionRequest request)
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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateFunctionRequest,Function,OperationMetadata> updateFunctionOperationCallable()
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();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateFunctionRequest,com.google.longrunning.Operation> updateFunctionCallable()
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();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteFunctionAsync(FunctionName name)
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();
}
name - Required. The name of the function which should be deleted.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteFunctionAsync(String name)
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();
}
name - Required. The name of the function which should be deleted.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteFunctionAsync(DeleteFunctionRequest request)
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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteFunctionRequest,com.google.protobuf.Empty,OperationMetadata> deleteFunctionOperationCallable()
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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteFunctionRequest,com.google.longrunning.Operation> deleteFunctionCallable()
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();
}
public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlRequest request)
When uploading source code to the generated signed URL, please follow these restrictions:
When making a HTTP PUT request, these two headers need to be specified:
And this header SHOULD NOT be specified:
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())
.build();
GenerateUploadUrlResponse response = functionServiceClient.generateUploadUrl(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GenerateUploadUrlRequest,GenerateUploadUrlResponse> generateUploadUrlCallable()
When uploading source code to the generated signed URL, please follow these restrictions:
When making a HTTP PUT request, these two headers need to be specified:
And this header SHOULD NOT be specified:
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())
.build();
ApiFuture<GenerateUploadUrlResponse> future =
functionServiceClient.generateUploadUrlCallable().futureCall(request);
// Do something.
GenerateUploadUrlResponse response = future.get();
}
public final GenerateDownloadUrlResponse generateDownloadUrl(GenerateDownloadUrlRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GenerateDownloadUrlRequest,GenerateDownloadUrlResponse> generateDownloadUrlCallable()
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();
}
public final ListRuntimesResponse listRuntimes(LocationName parent)
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);
}
parent - Required. The project and location from which the runtimes should be listed,
specified in the format `projects/*/locations/*`com.google.api.gax.rpc.ApiException - if the remote call failspublic final ListRuntimesResponse listRuntimes(String parent)
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);
}
parent - Required. The project and location from which the runtimes should be listed,
specified in the format `projects/*/locations/*`com.google.api.gax.rpc.ApiException - if the remote call failspublic final ListRuntimesResponse listRuntimes(ListRuntimesRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListRuntimesRequest,ListRuntimesResponse> listRuntimesCallable()
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();
}
public final FunctionServiceClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,FunctionServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
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;
}
}
}
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
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();
}
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
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();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
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();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2023 Google LLC. All rights reserved.