Cloud Functions v2 API - Class FunctionServiceClient (1.1.0)

public abstract class FunctionServiceClient

Reference documentation and code samples for the Cloud Functions v2 API class FunctionServiceClient.

FunctionService client wrapper, for convenient use.

Inheritance

Object > FunctionServiceClient

Namespace

Google.Cloud.Functions.V2

Assembly

Google.Cloud.Functions.V2.dll

Remarks

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.

Properties

CreateFunctionOperationsClient

public virtual OperationsClient CreateFunctionOperationsClient { get; }

The long-running operations client for CreateFunction.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the FunctionService service, which is a host of "cloudfunctions.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default FunctionService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default FunctionService scopes are:

DeleteFunctionOperationsClient

public virtual OperationsClient DeleteFunctionOperationsClient { get; }

The long-running operations client for DeleteFunction.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual FunctionService.FunctionServiceClient GrpcClient { get; }

The underlying gRPC FunctionService client

Property Value
TypeDescription
FunctionService.FunctionServiceClient

IAMPolicyClient

public virtual IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
TypeDescription
IAMPolicyClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
TypeDescription
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

UpdateFunctionOperationsClient

public virtual OperationsClient UpdateFunctionOperationsClient { get; }

The long-running operations client for UpdateFunction.

Property Value
TypeDescription
OperationsClient

Methods

Create()

public static FunctionServiceClient Create()

Synchronously creates a FunctionServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use FunctionServiceClientBuilder.

Returns
TypeDescription
FunctionServiceClient

The created FunctionServiceClient.

CreateAsync(CancellationToken)

public static Task<FunctionServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a FunctionServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use FunctionServiceClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<FunctionServiceClient>

The task representing the created FunctionServiceClient.

CreateFunction(LocationName, Function, String, CallSettings)

public virtual Operation<Function, OperationMetadata> CreateFunction(LocationName parent, Function function, string functionId, CallSettings callSettings = null)

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.

Parameters
NameDescription
parentLocationName

Required. The project and location in which the function should be created, specified in the format projects/*/locations/*

functionFunction

Required. Function to be created.

functionIdString

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]-/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Function, OperationMetadata>

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Function function = new Function();
string functionId = "";
// Make the request
Operation<Function, OperationMetadata> response = functionServiceClient.CreateFunction(parent, function, functionId);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = functionServiceClient.PollOnceCreateFunction(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

CreateFunction(CreateFunctionRequest, CallSettings)

public virtual Operation<Function, OperationMetadata> CreateFunction(CreateFunctionRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestCreateFunctionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Function, OperationMetadata>

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
CreateFunctionRequest request = new CreateFunctionRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Function = new Function(),
    FunctionId = "",
};
// Make the request
Operation<Function, OperationMetadata> response = functionServiceClient.CreateFunction(request);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = functionServiceClient.PollOnceCreateFunction(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

CreateFunction(String, Function, String, CallSettings)

public virtual Operation<Function, OperationMetadata> CreateFunction(string parent, Function function, string functionId, CallSettings callSettings = null)

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.

Parameters
NameDescription
parentString

Required. The project and location in which the function should be created, specified in the format projects/*/locations/*

functionFunction

Required. Function to be created.

functionIdString

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]-/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Function, OperationMetadata>

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Function function = new Function();
string functionId = "";
// Make the request
Operation<Function, OperationMetadata> response = functionServiceClient.CreateFunction(parent, function, functionId);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = functionServiceClient.PollOnceCreateFunction(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

CreateFunctionAsync(LocationName, Function, String, CallSettings)

public virtual Task<Operation<Function, OperationMetadata>> CreateFunctionAsync(LocationName parent, Function function, string functionId, CallSettings callSettings = null)

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.

Parameters
NameDescription
parentLocationName

Required. The project and location in which the function should be created, specified in the format projects/*/locations/*

functionFunction

Required. Function to be created.

functionIdString

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]-/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Function, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Function function = new Function();
string functionId = "";
// Make the request
Operation<Function, OperationMetadata> response = await functionServiceClient.CreateFunctionAsync(parent, function, functionId);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceCreateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

CreateFunctionAsync(LocationName, Function, String, CancellationToken)

public virtual Task<Operation<Function, OperationMetadata>> CreateFunctionAsync(LocationName parent, Function function, string functionId, CancellationToken cancellationToken)

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.

Parameters
NameDescription
parentLocationName

Required. The project and location in which the function should be created, specified in the format projects/*/locations/*

functionFunction

Required. Function to be created.

functionIdString

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]-/.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Function, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Function function = new Function();
string functionId = "";
// Make the request
Operation<Function, OperationMetadata> response = await functionServiceClient.CreateFunctionAsync(parent, function, functionId);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceCreateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

CreateFunctionAsync(CreateFunctionRequest, CallSettings)

public virtual Task<Operation<Function, OperationMetadata>> CreateFunctionAsync(CreateFunctionRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestCreateFunctionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Function, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
CreateFunctionRequest request = new CreateFunctionRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Function = new Function(),
    FunctionId = "",
};
// Make the request
Operation<Function, OperationMetadata> response = await functionServiceClient.CreateFunctionAsync(request);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceCreateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

CreateFunctionAsync(CreateFunctionRequest, CancellationToken)

public virtual Task<Operation<Function, OperationMetadata>> CreateFunctionAsync(CreateFunctionRequest request, CancellationToken cancellationToken)

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.

Parameters
NameDescription
requestCreateFunctionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Function, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
CreateFunctionRequest request = new CreateFunctionRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Function = new Function(),
    FunctionId = "",
};
// Make the request
Operation<Function, OperationMetadata> response = await functionServiceClient.CreateFunctionAsync(request);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceCreateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

CreateFunctionAsync(String, Function, String, CallSettings)

public virtual Task<Operation<Function, OperationMetadata>> CreateFunctionAsync(string parent, Function function, string functionId, CallSettings callSettings = null)

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.

Parameters
NameDescription
parentString

Required. The project and location in which the function should be created, specified in the format projects/*/locations/*

functionFunction

Required. Function to be created.

functionIdString

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]-/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Function, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Function function = new Function();
string functionId = "";
// Make the request
Operation<Function, OperationMetadata> response = await functionServiceClient.CreateFunctionAsync(parent, function, functionId);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceCreateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

CreateFunctionAsync(String, Function, String, CancellationToken)

public virtual Task<Operation<Function, OperationMetadata>> CreateFunctionAsync(string parent, Function function, string functionId, CancellationToken cancellationToken)

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.

Parameters
NameDescription
parentString

Required. The project and location in which the function should be created, specified in the format projects/*/locations/*

functionFunction

Required. Function to be created.

functionIdString

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]-/.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Function, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Function function = new Function();
string functionId = "";
// Make the request
Operation<Function, OperationMetadata> response = await functionServiceClient.CreateFunctionAsync(parent, function, functionId);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceCreateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

DeleteFunction(DeleteFunctionRequest, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteFunction(DeleteFunctionRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestDeleteFunctionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, OperationMetadata>

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
DeleteFunctionRequest request = new DeleteFunctionRequest
{
    FunctionName = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
};
// Make the request
Operation<Empty, OperationMetadata> response = functionServiceClient.DeleteFunction(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = functionServiceClient.PollOnceDeleteFunction(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteFunction(FunctionName, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteFunction(FunctionName name, CallSettings callSettings = null)

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.

Parameters
NameDescription
nameFunctionName

Required. The name of the function which should be deleted.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, OperationMetadata>

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
FunctionName name = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]");
// Make the request
Operation<Empty, OperationMetadata> response = functionServiceClient.DeleteFunction(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = functionServiceClient.PollOnceDeleteFunction(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteFunction(String, CallSettings)

public virtual Operation<Empty, OperationMetadata> DeleteFunction(string name, CallSettings callSettings = null)

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.

Parameters
NameDescription
nameString

Required. The name of the function which should be deleted.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, OperationMetadata>

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/functions/[FUNCTION]";
// Make the request
Operation<Empty, OperationMetadata> response = functionServiceClient.DeleteFunction(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = functionServiceClient.PollOnceDeleteFunction(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteFunctionAsync(DeleteFunctionRequest, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteFunctionAsync(DeleteFunctionRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestDeleteFunctionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteFunctionRequest request = new DeleteFunctionRequest
{
    FunctionName = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
};
// Make the request
Operation<Empty, OperationMetadata> response = await functionServiceClient.DeleteFunctionAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceDeleteFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteFunctionAsync(DeleteFunctionRequest, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteFunctionAsync(DeleteFunctionRequest request, CancellationToken cancellationToken)

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.

Parameters
NameDescription
requestDeleteFunctionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteFunctionRequest request = new DeleteFunctionRequest
{
    FunctionName = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
};
// Make the request
Operation<Empty, OperationMetadata> response = await functionServiceClient.DeleteFunctionAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceDeleteFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteFunctionAsync(FunctionName, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteFunctionAsync(FunctionName name, CallSettings callSettings = null)

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.

Parameters
NameDescription
nameFunctionName

Required. The name of the function which should be deleted.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
FunctionName name = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]");
// Make the request
Operation<Empty, OperationMetadata> response = await functionServiceClient.DeleteFunctionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceDeleteFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteFunctionAsync(FunctionName, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteFunctionAsync(FunctionName name, CancellationToken cancellationToken)

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.

Parameters
NameDescription
nameFunctionName

Required. The name of the function which should be deleted.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
FunctionName name = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]");
// Make the request
Operation<Empty, OperationMetadata> response = await functionServiceClient.DeleteFunctionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceDeleteFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteFunctionAsync(String, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteFunctionAsync(string name, CallSettings callSettings = null)

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.

Parameters
NameDescription
nameString

Required. The name of the function which should be deleted.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/functions/[FUNCTION]";
// Make the request
Operation<Empty, OperationMetadata> response = await functionServiceClient.DeleteFunctionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceDeleteFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteFunctionAsync(String, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadata>> DeleteFunctionAsync(string name, CancellationToken cancellationToken)

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.

Parameters
NameDescription
nameString

Required. The name of the function which should be deleted.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/functions/[FUNCTION]";
// Make the request
Operation<Empty, OperationMetadata> response = await functionServiceClient.DeleteFunctionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceDeleteFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

GenerateDownloadUrl(GenerateDownloadUrlRequest, CallSettings)

public virtual GenerateDownloadUrlResponse GenerateDownloadUrl(GenerateDownloadUrlRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGenerateDownloadUrlRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
GenerateDownloadUrlResponse

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
GenerateDownloadUrlRequest request = new GenerateDownloadUrlRequest
{
    FunctionName = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
};
// Make the request
GenerateDownloadUrlResponse response = functionServiceClient.GenerateDownloadUrl(request);

GenerateDownloadUrlAsync(GenerateDownloadUrlRequest, CallSettings)

public virtual Task<GenerateDownloadUrlResponse> GenerateDownloadUrlAsync(GenerateDownloadUrlRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGenerateDownloadUrlRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<GenerateDownloadUrlResponse>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
GenerateDownloadUrlRequest request = new GenerateDownloadUrlRequest
{
    FunctionName = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
};
// Make the request
GenerateDownloadUrlResponse response = await functionServiceClient.GenerateDownloadUrlAsync(request);

GenerateDownloadUrlAsync(GenerateDownloadUrlRequest, CancellationToken)

public virtual Task<GenerateDownloadUrlResponse> GenerateDownloadUrlAsync(GenerateDownloadUrlRequest request, CancellationToken cancellationToken)

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

Parameters
NameDescription
requestGenerateDownloadUrlRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<GenerateDownloadUrlResponse>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
GenerateDownloadUrlRequest request = new GenerateDownloadUrlRequest
{
    FunctionName = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
};
// Make the request
GenerateDownloadUrlResponse response = await functionServiceClient.GenerateDownloadUrlAsync(request);

GenerateUploadUrl(GenerateUploadUrlRequest, CallSettings)

public virtual GenerateUploadUrlResponse GenerateUploadUrl(GenerateUploadUrlRequest request, CallSettings callSettings = null)

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, these two headers need to be specified:

  • content-type: application/zip

And this header SHOULD NOT be specified:

  • Authorization: Bearer YOUR_TOKEN
Parameters
NameDescription
requestGenerateUploadUrlRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
GenerateUploadUrlResponse

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
GenerateUploadUrlRequest request = new GenerateUploadUrlRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
GenerateUploadUrlResponse response = functionServiceClient.GenerateUploadUrl(request);

GenerateUploadUrlAsync(GenerateUploadUrlRequest, CallSettings)

public virtual Task<GenerateUploadUrlResponse> GenerateUploadUrlAsync(GenerateUploadUrlRequest request, CallSettings callSettings = null)

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, these two headers need to be specified:

  • content-type: application/zip

And this header SHOULD NOT be specified:

  • Authorization: Bearer YOUR_TOKEN
Parameters
NameDescription
requestGenerateUploadUrlRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<GenerateUploadUrlResponse>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
GenerateUploadUrlRequest request = new GenerateUploadUrlRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
GenerateUploadUrlResponse response = await functionServiceClient.GenerateUploadUrlAsync(request);

GenerateUploadUrlAsync(GenerateUploadUrlRequest, CancellationToken)

public virtual Task<GenerateUploadUrlResponse> GenerateUploadUrlAsync(GenerateUploadUrlRequest request, CancellationToken cancellationToken)

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, these two headers need to be specified:

  • content-type: application/zip

And this header SHOULD NOT be specified:

  • Authorization: Bearer YOUR_TOKEN
Parameters
NameDescription
requestGenerateUploadUrlRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<GenerateUploadUrlResponse>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
GenerateUploadUrlRequest request = new GenerateUploadUrlRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
GenerateUploadUrlResponse response = await functionServiceClient.GenerateUploadUrlAsync(request);

GetFunction(FunctionName, CallSettings)

public virtual Function GetFunction(FunctionName name, CallSettings callSettings = null)

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

Parameters
NameDescription
nameFunctionName

Required. The name of the function which details should be obtained.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Function

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
FunctionName name = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]");
// Make the request
Function response = functionServiceClient.GetFunction(name);

GetFunction(GetFunctionRequest, CallSettings)

public virtual Function GetFunction(GetFunctionRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetFunctionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Function

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
GetFunctionRequest request = new GetFunctionRequest
{
    FunctionName = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
};
// Make the request
Function response = functionServiceClient.GetFunction(request);

GetFunction(String, CallSettings)

public virtual Function GetFunction(string name, CallSettings callSettings = null)

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

Parameters
NameDescription
nameString

Required. The name of the function which details should be obtained.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Function

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/functions/[FUNCTION]";
// Make the request
Function response = functionServiceClient.GetFunction(name);

GetFunctionAsync(FunctionName, CallSettings)

public virtual Task<Function> GetFunctionAsync(FunctionName name, CallSettings callSettings = null)

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

Parameters
NameDescription
nameFunctionName

Required. The name of the function which details should be obtained.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Function>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
FunctionName name = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]");
// Make the request
Function response = await functionServiceClient.GetFunctionAsync(name);

GetFunctionAsync(FunctionName, CancellationToken)

public virtual Task<Function> GetFunctionAsync(FunctionName name, CancellationToken cancellationToken)

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

Parameters
NameDescription
nameFunctionName

Required. The name of the function which details should be obtained.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Function>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
FunctionName name = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]");
// Make the request
Function response = await functionServiceClient.GetFunctionAsync(name);

GetFunctionAsync(GetFunctionRequest, CallSettings)

public virtual Task<Function> GetFunctionAsync(GetFunctionRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetFunctionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Function>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
GetFunctionRequest request = new GetFunctionRequest
{
    FunctionName = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
};
// Make the request
Function response = await functionServiceClient.GetFunctionAsync(request);

GetFunctionAsync(GetFunctionRequest, CancellationToken)

public virtual Task<Function> GetFunctionAsync(GetFunctionRequest request, CancellationToken cancellationToken)

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

Parameters
NameDescription
requestGetFunctionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Function>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
GetFunctionRequest request = new GetFunctionRequest
{
    FunctionName = FunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
};
// Make the request
Function response = await functionServiceClient.GetFunctionAsync(request);

GetFunctionAsync(String, CallSettings)

public virtual Task<Function> GetFunctionAsync(string name, CallSettings callSettings = null)

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

Parameters
NameDescription
nameString

Required. The name of the function which details should be obtained.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Function>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/functions/[FUNCTION]";
// Make the request
Function response = await functionServiceClient.GetFunctionAsync(name);

GetFunctionAsync(String, CancellationToken)

public virtual Task<Function> GetFunctionAsync(string name, CancellationToken cancellationToken)

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

Parameters
NameDescription
nameString

Required. The name of the function which details should be obtained.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Function>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/functions/[FUNCTION]";
// Make the request
Function response = await functionServiceClient.GetFunctionAsync(name);

ListFunctions(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListFunctionsResponse, Function> ListFunctions(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

Parameters
NameDescription
parentLocationName

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.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListFunctionsResponse, Function>

A pageable sequence of Function resources.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListFunctionsResponse, Function> response = functionServiceClient.ListFunctions(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Function item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListFunctionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Function item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Function> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Function item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListFunctions(ListFunctionsRequest, CallSettings)

public virtual PagedEnumerable<ListFunctionsResponse, Function> ListFunctions(ListFunctionsRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestListFunctionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListFunctionsResponse, Function>

A pageable sequence of Function resources.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
ListFunctionsRequest request = new ListFunctionsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedEnumerable<ListFunctionsResponse, Function> response = functionServiceClient.ListFunctions(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Function item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListFunctionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Function item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Function> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Function item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListFunctions(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListFunctionsResponse, Function> ListFunctions(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

Parameters
NameDescription
parentString

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.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListFunctionsResponse, Function>

A pageable sequence of Function resources.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListFunctionsResponse, Function> response = functionServiceClient.ListFunctions(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Function item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListFunctionsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Function item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Function> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Function item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListFunctionsAsync(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListFunctionsResponse, Function> ListFunctionsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

Parameters
NameDescription
parentLocationName

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.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListFunctionsResponse, Function>

A pageable asynchronous sequence of Function resources.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListFunctionsResponse, Function> response = functionServiceClient.ListFunctionsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Function item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListFunctionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Function item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Function> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Function item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListFunctionsAsync(ListFunctionsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListFunctionsResponse, Function> ListFunctionsAsync(ListFunctionsRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestListFunctionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListFunctionsResponse, Function>

A pageable asynchronous sequence of Function resources.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
ListFunctionsRequest request = new ListFunctionsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<ListFunctionsResponse, Function> response = functionServiceClient.ListFunctionsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Function item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListFunctionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Function item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Function> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Function item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListFunctionsAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListFunctionsResponse, Function> ListFunctionsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

Parameters
NameDescription
parentString

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.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListFunctionsResponse, Function>

A pageable asynchronous sequence of Function resources.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListFunctionsResponse, Function> response = functionServiceClient.ListFunctionsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Function item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListFunctionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Function item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Function> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Function item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListRuntimes(LocationName, CallSettings)

public virtual ListRuntimesResponse ListRuntimes(LocationName parent, CallSettings callSettings = null)

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

Parameters
NameDescription
parentLocationName

Required. The project and location from which the runtimes should be listed, specified in the format projects/*/locations/*

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ListRuntimesResponse

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
ListRuntimesResponse response = functionServiceClient.ListRuntimes(parent);

ListRuntimes(ListRuntimesRequest, CallSettings)

public virtual ListRuntimesResponse ListRuntimes(ListRuntimesRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestListRuntimesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ListRuntimesResponse

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
ListRuntimesRequest request = new ListRuntimesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
};
// Make the request
ListRuntimesResponse response = functionServiceClient.ListRuntimes(request);

ListRuntimes(String, CallSettings)

public virtual ListRuntimesResponse ListRuntimes(string parent, CallSettings callSettings = null)

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

Parameters
NameDescription
parentString

Required. The project and location from which the runtimes should be listed, specified in the format projects/*/locations/*

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ListRuntimesResponse

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
ListRuntimesResponse response = functionServiceClient.ListRuntimes(parent);

ListRuntimesAsync(LocationName, CallSettings)

public virtual Task<ListRuntimesResponse> ListRuntimesAsync(LocationName parent, CallSettings callSettings = null)

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

Parameters
NameDescription
parentLocationName

Required. The project and location from which the runtimes should be listed, specified in the format projects/*/locations/*

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ListRuntimesResponse>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
ListRuntimesResponse response = await functionServiceClient.ListRuntimesAsync(parent);

ListRuntimesAsync(LocationName, CancellationToken)

public virtual Task<ListRuntimesResponse> ListRuntimesAsync(LocationName parent, CancellationToken cancellationToken)

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

Parameters
NameDescription
parentLocationName

Required. The project and location from which the runtimes should be listed, specified in the format projects/*/locations/*

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ListRuntimesResponse>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
ListRuntimesResponse response = await functionServiceClient.ListRuntimesAsync(parent);

ListRuntimesAsync(ListRuntimesRequest, CallSettings)

public virtual Task<ListRuntimesResponse> ListRuntimesAsync(ListRuntimesRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestListRuntimesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ListRuntimesResponse>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
ListRuntimesRequest request = new ListRuntimesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
};
// Make the request
ListRuntimesResponse response = await functionServiceClient.ListRuntimesAsync(request);

ListRuntimesAsync(ListRuntimesRequest, CancellationToken)

public virtual Task<ListRuntimesResponse> ListRuntimesAsync(ListRuntimesRequest request, CancellationToken cancellationToken)

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

Parameters
NameDescription
requestListRuntimesRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ListRuntimesResponse>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
ListRuntimesRequest request = new ListRuntimesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
};
// Make the request
ListRuntimesResponse response = await functionServiceClient.ListRuntimesAsync(request);

ListRuntimesAsync(String, CallSettings)

public virtual Task<ListRuntimesResponse> ListRuntimesAsync(string parent, CallSettings callSettings = null)

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

Parameters
NameDescription
parentString

Required. The project and location from which the runtimes should be listed, specified in the format projects/*/locations/*

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ListRuntimesResponse>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
ListRuntimesResponse response = await functionServiceClient.ListRuntimesAsync(parent);

ListRuntimesAsync(String, CancellationToken)

public virtual Task<ListRuntimesResponse> ListRuntimesAsync(string parent, CancellationToken cancellationToken)

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

Parameters
NameDescription
parentString

Required. The project and location from which the runtimes should be listed, specified in the format projects/*/locations/*

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ListRuntimesResponse>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
ListRuntimesResponse response = await functionServiceClient.ListRuntimesAsync(parent);

PollOnceCreateFunction(String, CallSettings)

public virtual Operation<Function, OperationMetadata> PollOnceCreateFunction(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of CreateFunction.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Function, OperationMetadata>

The result of polling the operation.

PollOnceCreateFunctionAsync(String, CallSettings)

public virtual Task<Operation<Function, OperationMetadata>> PollOnceCreateFunctionAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of CreateFunction.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Function, OperationMetadata>>

A task representing the result of polling the operation.

PollOnceDeleteFunction(String, CallSettings)

public virtual Operation<Empty, OperationMetadata> PollOnceDeleteFunction(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of DeleteFunction.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, OperationMetadata>

The result of polling the operation.

PollOnceDeleteFunctionAsync(String, CallSettings)

public virtual Task<Operation<Empty, OperationMetadata>> PollOnceDeleteFunctionAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of DeleteFunction.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, OperationMetadata>>

A task representing the result of polling the operation.

PollOnceUpdateFunction(String, CallSettings)

public virtual Operation<Function, OperationMetadata> PollOnceUpdateFunction(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of UpdateFunction.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Function, OperationMetadata>

The result of polling the operation.

PollOnceUpdateFunctionAsync(String, CallSettings)

public virtual Task<Operation<Function, OperationMetadata>> PollOnceUpdateFunctionAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of UpdateFunction.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Function, OperationMetadata>>

A task representing the result of polling the operation.

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateFunction(Function, FieldMask, CallSettings)

public virtual Operation<Function, OperationMetadata> UpdateFunction(Function function, FieldMask updateMask, CallSettings callSettings = null)

Updates existing function.

Parameters
NameDescription
functionFunction

Required. New version of the function.

updateMaskFieldMask

The list of fields to be updated. If no field mask is provided, all provided fields in the request will be updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Function, OperationMetadata>

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
Function function = new Function();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Function, OperationMetadata> response = functionServiceClient.UpdateFunction(function, updateMask);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = functionServiceClient.PollOnceUpdateFunction(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

UpdateFunction(UpdateFunctionRequest, CallSettings)

public virtual Operation<Function, OperationMetadata> UpdateFunction(UpdateFunctionRequest request, CallSettings callSettings = null)

Updates existing function.

Parameters
NameDescription
requestUpdateFunctionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Function, OperationMetadata>

The RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = FunctionServiceClient.Create();
// Initialize request argument(s)
UpdateFunctionRequest request = new UpdateFunctionRequest
{
    Function = new Function(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Function, OperationMetadata> response = functionServiceClient.UpdateFunction(request);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = functionServiceClient.PollOnceUpdateFunction(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

UpdateFunctionAsync(Function, FieldMask, CallSettings)

public virtual Task<Operation<Function, OperationMetadata>> UpdateFunctionAsync(Function function, FieldMask updateMask, CallSettings callSettings = null)

Updates existing function.

Parameters
NameDescription
functionFunction

Required. New version of the function.

updateMaskFieldMask

The list of fields to be updated. If no field mask is provided, all provided fields in the request will be updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Function, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
Function function = new Function();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Function, OperationMetadata> response = await functionServiceClient.UpdateFunctionAsync(function, updateMask);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceUpdateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

UpdateFunctionAsync(Function, FieldMask, CancellationToken)

public virtual Task<Operation<Function, OperationMetadata>> UpdateFunctionAsync(Function function, FieldMask updateMask, CancellationToken cancellationToken)

Updates existing function.

Parameters
NameDescription
functionFunction

Required. New version of the function.

updateMaskFieldMask

The list of fields to be updated. If no field mask is provided, all provided fields in the request will be updated.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Function, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
Function function = new Function();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Function, OperationMetadata> response = await functionServiceClient.UpdateFunctionAsync(function, updateMask);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceUpdateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

UpdateFunctionAsync(UpdateFunctionRequest, CallSettings)

public virtual Task<Operation<Function, OperationMetadata>> UpdateFunctionAsync(UpdateFunctionRequest request, CallSettings callSettings = null)

Updates existing function.

Parameters
NameDescription
requestUpdateFunctionRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Function, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateFunctionRequest request = new UpdateFunctionRequest
{
    Function = new Function(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Function, OperationMetadata> response = await functionServiceClient.UpdateFunctionAsync(request);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceUpdateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}

UpdateFunctionAsync(UpdateFunctionRequest, CancellationToken)

public virtual Task<Operation<Function, OperationMetadata>> UpdateFunctionAsync(UpdateFunctionRequest request, CancellationToken cancellationToken)

Updates existing function.

Parameters
NameDescription
requestUpdateFunctionRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Function, OperationMetadata>>

A Task containing the RPC response.

Example
// Create client
FunctionServiceClient functionServiceClient = await FunctionServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateFunctionRequest request = new UpdateFunctionRequest
{
    Function = new Function(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Function, OperationMetadata> response = await functionServiceClient.UpdateFunctionAsync(request);

// Poll until the returned long-running operation is complete
Operation<Function, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Function result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Function, OperationMetadata> retrievedResponse = await functionServiceClient.PollOnceUpdateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Function retrievedResult = retrievedResponse.Result;
}