Class CloudFunctionsServiceClient (1.3.0)

public abstract class CloudFunctionsServiceClient

CloudFunctionsService client wrapper, for convenient use.

Inheritance

Object > CloudFunctionsServiceClient

Namespace

Google.Cloud.Functions.V1

Assembly

Google.Cloud.Functions.V1.dll

Remarks

A service that application uses to manipulate triggers and functions.

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 CloudFunctionsService 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 CloudFunctionsService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default CloudFunctionsService scopes are:

DeleteFunctionOperationsClient

public virtual OperationsClient DeleteFunctionOperationsClient { get; }

The long-running operations client for DeleteFunction.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual CloudFunctionsService.CloudFunctionsServiceClient GrpcClient { get; }

The underlying gRPC CloudFunctionsService client

Property Value
TypeDescription
CloudFunctionsService.CloudFunctionsServiceClient

UpdateFunctionOperationsClient

public virtual OperationsClient UpdateFunctionOperationsClient { get; }

The long-running operations client for UpdateFunction.

Property Value
TypeDescription
OperationsClient

Methods

CallFunction(CallFunctionRequest, CallSettings)

public virtual CallFunctionResponse CallFunction(CallFunctionRequest request, CallSettings callSettings = null)

Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very limited traffic is allowed. For more information on the actual limits, refer to Rate Limits.

Parameters
NameDescription
requestCallFunctionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
CallFunctionResponse

The RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
CallFunctionRequest request = new CallFunctionRequest
{
    CloudFunctionName = CloudFunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
    Data = "",
};
// Make the request
CallFunctionResponse response = cloudFunctionsServiceClient.CallFunction(request);

CallFunction(CloudFunctionName, String, CallSettings)

public virtual CallFunctionResponse CallFunction(CloudFunctionName name, string data, CallSettings callSettings = null)

Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very limited traffic is allowed. For more information on the actual limits, refer to Rate Limits.

Parameters
NameDescription
nameCloudFunctionName

Required. The name of the function to be called.

dataString

Required. Input to be passed to the function.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
CallFunctionResponse

The RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
CloudFunctionName name = CloudFunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]");
string data = "";
// Make the request
CallFunctionResponse response = cloudFunctionsServiceClient.CallFunction(name, data);

CallFunction(String, String, CallSettings)

public virtual CallFunctionResponse CallFunction(string name, string data, CallSettings callSettings = null)

Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very limited traffic is allowed. For more information on the actual limits, refer to Rate Limits.

Parameters
NameDescription
nameString

Required. The name of the function to be called.

dataString

Required. Input to be passed to the function.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
CallFunctionResponse

The RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/functions/[FUNCTION]";
string data = "";
// Make the request
CallFunctionResponse response = cloudFunctionsServiceClient.CallFunction(name, data);

CallFunctionAsync(CallFunctionRequest, CallSettings)

public virtual Task<CallFunctionResponse> CallFunctionAsync(CallFunctionRequest request, CallSettings callSettings = null)

Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very limited traffic is allowed. For more information on the actual limits, refer to Rate Limits.

Parameters
NameDescription
requestCallFunctionRequest

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<CallFunctionResponse>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
CallFunctionRequest request = new CallFunctionRequest
{
    CloudFunctionName = CloudFunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
    Data = "",
};
// Make the request
CallFunctionResponse response = await cloudFunctionsServiceClient.CallFunctionAsync(request);

CallFunctionAsync(CallFunctionRequest, CancellationToken)

public virtual Task<CallFunctionResponse> CallFunctionAsync(CallFunctionRequest request, CancellationToken cancellationToken)

Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very limited traffic is allowed. For more information on the actual limits, refer to Rate Limits.

Parameters
NameDescription
requestCallFunctionRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<CallFunctionResponse>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
CallFunctionRequest request = new CallFunctionRequest
{
    CloudFunctionName = CloudFunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
    Data = "",
};
// Make the request
CallFunctionResponse response = await cloudFunctionsServiceClient.CallFunctionAsync(request);

CallFunctionAsync(CloudFunctionName, String, CallSettings)

public virtual Task<CallFunctionResponse> CallFunctionAsync(CloudFunctionName name, string data, CallSettings callSettings = null)

Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very limited traffic is allowed. For more information on the actual limits, refer to Rate Limits.

Parameters
NameDescription
nameCloudFunctionName

Required. The name of the function to be called.

dataString

Required. Input to be passed to the function.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<CallFunctionResponse>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
CloudFunctionName name = CloudFunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]");
string data = "";
// Make the request
CallFunctionResponse response = await cloudFunctionsServiceClient.CallFunctionAsync(name, data);

CallFunctionAsync(CloudFunctionName, String, CancellationToken)

public virtual Task<CallFunctionResponse> CallFunctionAsync(CloudFunctionName name, string data, CancellationToken cancellationToken)

Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very limited traffic is allowed. For more information on the actual limits, refer to Rate Limits.

Parameters
NameDescription
nameCloudFunctionName

Required. The name of the function to be called.

dataString

Required. Input to be passed to the function.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<CallFunctionResponse>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
CloudFunctionName name = CloudFunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]");
string data = "";
// Make the request
CallFunctionResponse response = await cloudFunctionsServiceClient.CallFunctionAsync(name, data);

CallFunctionAsync(String, String, CallSettings)

public virtual Task<CallFunctionResponse> CallFunctionAsync(string name, string data, CallSettings callSettings = null)

Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very limited traffic is allowed. For more information on the actual limits, refer to Rate Limits.

Parameters
NameDescription
nameString

Required. The name of the function to be called.

dataString

Required. Input to be passed to the function.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<CallFunctionResponse>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/functions/[FUNCTION]";
string data = "";
// Make the request
CallFunctionResponse response = await cloudFunctionsServiceClient.CallFunctionAsync(name, data);

CallFunctionAsync(String, String, CancellationToken)

public virtual Task<CallFunctionResponse> CallFunctionAsync(string name, string data, CancellationToken cancellationToken)

Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very limited traffic is allowed. For more information on the actual limits, refer to Rate Limits.

Parameters
NameDescription
nameString

Required. The name of the function to be called.

dataString

Required. Input to be passed to the function.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<CallFunctionResponse>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/functions/[FUNCTION]";
string data = "";
// Make the request
CallFunctionResponse response = await cloudFunctionsServiceClient.CallFunctionAsync(name, data);

Create()

public static CloudFunctionsServiceClient Create()

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

Returns
TypeDescription
CloudFunctionsServiceClient

The created CloudFunctionsServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<CloudFunctionsServiceClient>

The task representing the created CloudFunctionsServiceClient.

CreateFunction(LocationName, CloudFunction, CallSettings)

public virtual Operation<CloudFunction, OperationMetadataV1> CreateFunction(LocationName location, CloudFunction function, 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
locationLocationName

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

functionCloudFunction

Required. Function to be created.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<CloudFunction, OperationMetadataV1>

The RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
LocationName location = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
CloudFunction function = new CloudFunction();
// Make the request
Operation<CloudFunction, OperationMetadataV1> response = cloudFunctionsServiceClient.CreateFunction(location, function);

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = cloudFunctionsServiceClient.PollOnceCreateFunction(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

CreateFunction(CreateFunctionRequest, CallSettings)

public virtual Operation<CloudFunction, OperationMetadataV1> 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<CloudFunction, OperationMetadataV1>

The RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
CreateFunctionRequest request = new CreateFunctionRequest
{
    LocationAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Function = new CloudFunction(),
};
// Make the request
Operation<CloudFunction, OperationMetadataV1> response = cloudFunctionsServiceClient.CreateFunction(request);

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = cloudFunctionsServiceClient.PollOnceCreateFunction(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

CreateFunction(String, CloudFunction, CallSettings)

public virtual Operation<CloudFunction, OperationMetadataV1> CreateFunction(string location, CloudFunction function, 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
locationString

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

functionCloudFunction

Required. Function to be created.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<CloudFunction, OperationMetadataV1>

The RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
string location = "projects/[PROJECT]/locations/[LOCATION]";
CloudFunction function = new CloudFunction();
// Make the request
Operation<CloudFunction, OperationMetadataV1> response = cloudFunctionsServiceClient.CreateFunction(location, function);

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = cloudFunctionsServiceClient.PollOnceCreateFunction(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

CreateFunctionAsync(LocationName, CloudFunction, CallSettings)

public virtual Task<Operation<CloudFunction, OperationMetadataV1>> CreateFunctionAsync(LocationName location, CloudFunction function, 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
locationLocationName

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

functionCloudFunction

Required. Function to be created.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<CloudFunction, OperationMetadataV1>>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName location = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
CloudFunction function = new CloudFunction();
// Make the request
Operation<CloudFunction, OperationMetadataV1> response = await cloudFunctionsServiceClient.CreateFunctionAsync(location, function);

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.PollOnceCreateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

CreateFunctionAsync(LocationName, CloudFunction, CancellationToken)

public virtual Task<Operation<CloudFunction, OperationMetadataV1>> CreateFunctionAsync(LocationName location, CloudFunction function, 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
locationLocationName

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

functionCloudFunction

Required. Function to be created.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<CloudFunction, OperationMetadataV1>>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName location = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
CloudFunction function = new CloudFunction();
// Make the request
Operation<CloudFunction, OperationMetadataV1> response = await cloudFunctionsServiceClient.CreateFunctionAsync(location, function);

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.PollOnceCreateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

CreateFunctionAsync(CreateFunctionRequest, CallSettings)

public virtual Task<Operation<CloudFunction, OperationMetadataV1>> 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<CloudFunction, OperationMetadataV1>>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
CreateFunctionRequest request = new CreateFunctionRequest
{
    LocationAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Function = new CloudFunction(),
};
// Make the request
Operation<CloudFunction, OperationMetadataV1> response = await cloudFunctionsServiceClient.CreateFunctionAsync(request);

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.PollOnceCreateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

CreateFunctionAsync(CreateFunctionRequest, CancellationToken)

public virtual Task<Operation<CloudFunction, OperationMetadataV1>> 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<CloudFunction, OperationMetadataV1>>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
CreateFunctionRequest request = new CreateFunctionRequest
{
    LocationAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Function = new CloudFunction(),
};
// Make the request
Operation<CloudFunction, OperationMetadataV1> response = await cloudFunctionsServiceClient.CreateFunctionAsync(request);

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.PollOnceCreateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

CreateFunctionAsync(String, CloudFunction, CallSettings)

public virtual Task<Operation<CloudFunction, OperationMetadataV1>> CreateFunctionAsync(string location, CloudFunction function, 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
locationString

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

functionCloudFunction

Required. Function to be created.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<CloudFunction, OperationMetadataV1>>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
string location = "projects/[PROJECT]/locations/[LOCATION]";
CloudFunction function = new CloudFunction();
// Make the request
Operation<CloudFunction, OperationMetadataV1> response = await cloudFunctionsServiceClient.CreateFunctionAsync(location, function);

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.PollOnceCreateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

CreateFunctionAsync(String, CloudFunction, CancellationToken)

public virtual Task<Operation<CloudFunction, OperationMetadataV1>> CreateFunctionAsync(string location, CloudFunction function, 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
locationString

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

functionCloudFunction

Required. Function to be created.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<CloudFunction, OperationMetadataV1>>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
string location = "projects/[PROJECT]/locations/[LOCATION]";
CloudFunction function = new CloudFunction();
// Make the request
Operation<CloudFunction, OperationMetadataV1> response = await cloudFunctionsServiceClient.CreateFunctionAsync(location, function);

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.PollOnceCreateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

DeleteFunction(CloudFunctionName, CallSettings)

public virtual Operation<Empty, OperationMetadataV1> DeleteFunction(CloudFunctionName 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
nameCloudFunctionName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, OperationMetadataV1>

The RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
CloudFunctionName name = CloudFunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]");
// Make the request
Operation<Empty, OperationMetadataV1> response = cloudFunctionsServiceClient.DeleteFunction(name);

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadataV1> 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, OperationMetadataV1> retrievedResponse = cloudFunctionsServiceClient.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(DeleteFunctionRequest, CallSettings)

public virtual Operation<Empty, OperationMetadataV1> 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, OperationMetadataV1>

The RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadataV1> 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, OperationMetadataV1> retrievedResponse = cloudFunctionsServiceClient.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, OperationMetadataV1> 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, OperationMetadataV1>

The RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadataV1> 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, OperationMetadataV1> retrievedResponse = cloudFunctionsServiceClient.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(CloudFunctionName, CallSettings)

public virtual Task<Operation<Empty, OperationMetadataV1>> DeleteFunctionAsync(CloudFunctionName 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
nameCloudFunctionName

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, OperationMetadataV1>>

A Task containing the RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadataV1> 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, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.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(CloudFunctionName, CancellationToken)

public virtual Task<Operation<Empty, OperationMetadataV1>> DeleteFunctionAsync(CloudFunctionName 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
nameCloudFunctionName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, OperationMetadataV1>>

A Task containing the RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadataV1> 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, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.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, CallSettings)

public virtual Task<Operation<Empty, OperationMetadataV1>> 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, OperationMetadataV1>>

A Task containing the RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadataV1> 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, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.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, OperationMetadataV1>> 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, OperationMetadataV1>>

A Task containing the RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadataV1> 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, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.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, OperationMetadataV1>> 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, OperationMetadataV1>>

A Task containing the RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadataV1> 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, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.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, OperationMetadataV1>> 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, OperationMetadataV1>>

A Task containing the RPC response.

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

// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadataV1> 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, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.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 minutes after 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
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
GenerateDownloadUrlRequest request = new GenerateDownloadUrlRequest
{
    Name = "",
    VersionId = 0UL,
};
// Make the request
GenerateDownloadUrlResponse response = cloudFunctionsServiceClient.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 minutes after 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
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
GenerateDownloadUrlRequest request = new GenerateDownloadUrlRequest
{
    Name = "",
    VersionId = 0UL,
};
// Make the request
GenerateDownloadUrlResponse response = await cloudFunctionsServiceClient.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 minutes after 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
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
GenerateDownloadUrlRequest request = new GenerateDownloadUrlRequest
{
    Name = "",
    VersionId = 0UL,
};
// Make the request
GenerateDownloadUrlResponse response = await cloudFunctionsServiceClient.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.
  • Source file size should not exceed 100MB limit.
  • 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
  • x-goog-content-length-range: 0,104857600

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
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
GenerateUploadUrlRequest request = new GenerateUploadUrlRequest { Parent = "", };
// Make the request
GenerateUploadUrlResponse response = cloudFunctionsServiceClient.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.
  • Source file size should not exceed 100MB limit.
  • 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
  • x-goog-content-length-range: 0,104857600

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
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
GenerateUploadUrlRequest request = new GenerateUploadUrlRequest { Parent = "", };
// Make the request
GenerateUploadUrlResponse response = await cloudFunctionsServiceClient.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.
  • Source file size should not exceed 100MB limit.
  • 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
  • x-goog-content-length-range: 0,104857600

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
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
GenerateUploadUrlRequest request = new GenerateUploadUrlRequest { Parent = "", };
// Make the request
GenerateUploadUrlResponse response = await cloudFunctionsServiceClient.GenerateUploadUrlAsync(request);

GetFunction(CloudFunctionName, CallSettings)

public virtual CloudFunction GetFunction(CloudFunctionName name, CallSettings callSettings = null)

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

Parameters
NameDescription
nameCloudFunctionName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
CloudFunction

The RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
CloudFunctionName name = CloudFunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]");
// Make the request
CloudFunction response = cloudFunctionsServiceClient.GetFunction(name);

GetFunction(GetFunctionRequest, CallSettings)

public virtual CloudFunction 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
CloudFunction

The RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
GetFunctionRequest request = new GetFunctionRequest
{
    CloudFunctionName = CloudFunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
};
// Make the request
CloudFunction response = cloudFunctionsServiceClient.GetFunction(request);

GetFunction(String, CallSettings)

public virtual CloudFunction 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
CloudFunction

The RPC response.

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

GetFunctionAsync(CloudFunctionName, CallSettings)

public virtual Task<CloudFunction> GetFunctionAsync(CloudFunctionName name, CallSettings callSettings = null)

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

Parameters
NameDescription
nameCloudFunctionName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<CloudFunction>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
CloudFunctionName name = CloudFunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]");
// Make the request
CloudFunction response = await cloudFunctionsServiceClient.GetFunctionAsync(name);

GetFunctionAsync(CloudFunctionName, CancellationToken)

public virtual Task<CloudFunction> GetFunctionAsync(CloudFunctionName name, CancellationToken cancellationToken)

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

Parameters
NameDescription
nameCloudFunctionName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<CloudFunction>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
CloudFunctionName name = CloudFunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]");
// Make the request
CloudFunction response = await cloudFunctionsServiceClient.GetFunctionAsync(name);

GetFunctionAsync(GetFunctionRequest, CallSettings)

public virtual Task<CloudFunction> 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<CloudFunction>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
GetFunctionRequest request = new GetFunctionRequest
{
    CloudFunctionName = CloudFunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
};
// Make the request
CloudFunction response = await cloudFunctionsServiceClient.GetFunctionAsync(request);

GetFunctionAsync(GetFunctionRequest, CancellationToken)

public virtual Task<CloudFunction> 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<CloudFunction>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
GetFunctionRequest request = new GetFunctionRequest
{
    CloudFunctionName = CloudFunctionName.FromProjectLocationFunction("[PROJECT]", "[LOCATION]", "[FUNCTION]"),
};
// Make the request
CloudFunction response = await cloudFunctionsServiceClient.GetFunctionAsync(request);

GetFunctionAsync(String, CallSettings)

public virtual Task<CloudFunction> 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<CloudFunction>

A Task containing the RPC response.

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

GetFunctionAsync(String, CancellationToken)

public virtual Task<CloudFunction> 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<CloudFunction>

A Task containing the RPC response.

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

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the IAM access control policy for a function. Returns an empty policy if the function exists and does not have a policy set.

Parameters
NameDescription
requestGetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = cloudFunctionsServiceClient.GetIamPolicy(request);

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the IAM access control policy for a function. Returns an empty policy if the function exists and does not have a policy set.

Parameters
NameDescription
requestGetIamPolicyRequest

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<Policy>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await cloudFunctionsServiceClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)

Gets the IAM access control policy for a function. Returns an empty policy if the function exists and does not have a policy set.

Parameters
NameDescription
requestGetIamPolicyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await cloudFunctionsServiceClient.GetIamPolicyAsync(request);

ListFunctions(ListFunctionsRequest, CallSettings)

public virtual PagedEnumerable<ListFunctionsResponse, CloudFunction> 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, CloudFunction>

A pageable sequence of CloudFunction resources.

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

// Iterate over all response items, lazily performing RPCs as required
foreach (CloudFunction 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 (CloudFunction 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<CloudFunction> 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 (CloudFunction 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, CloudFunction> 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, CloudFunction>

A pageable asynchronous sequence of CloudFunction resources.

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

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((CloudFunction 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 (CloudFunction 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<CloudFunction> 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 (CloudFunction 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;

PollOnceCreateFunction(String, CallSettings)

public virtual Operation<CloudFunction, OperationMetadataV1> 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<CloudFunction, OperationMetadataV1>

The result of polling the operation.

PollOnceCreateFunctionAsync(String, CallSettings)

public virtual Task<Operation<CloudFunction, OperationMetadataV1>> 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<CloudFunction, OperationMetadataV1>>

A task representing the result of polling the operation.

PollOnceDeleteFunction(String, CallSettings)

public virtual Operation<Empty, OperationMetadataV1> 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, OperationMetadataV1>

The result of polling the operation.

PollOnceDeleteFunctionAsync(String, CallSettings)

public virtual Task<Operation<Empty, OperationMetadataV1>> 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, OperationMetadataV1>>

A task representing the result of polling the operation.

PollOnceUpdateFunction(String, CallSettings)

public virtual Operation<CloudFunction, OperationMetadataV1> 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<CloudFunction, OperationMetadataV1>

The result of polling the operation.

PollOnceUpdateFunctionAsync(String, CallSettings)

public virtual Task<Operation<CloudFunction, OperationMetadataV1>> 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<CloudFunction, OperationMetadataV1>>

A task representing the result of polling the operation.

SetIamPolicy(SetIamPolicyRequest, CallSettings)

public virtual Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the IAM access control policy on the specified function. Replaces any existing policy.

Parameters
NameDescription
requestSetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
};
// Make the request
Policy response = cloudFunctionsServiceClient.SetIamPolicy(request);

SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the IAM access control policy on the specified function. Replaces any existing policy.

Parameters
NameDescription
requestSetIamPolicyRequest

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<Policy>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
};
// Make the request
Policy response = await cloudFunctionsServiceClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(SetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CancellationToken cancellationToken)

Sets the IAM access control policy on the specified function. Replaces any existing policy.

Parameters
NameDescription
requestSetIamPolicyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Policy>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
};
// Make the request
Policy response = await cloudFunctionsServiceClient.SetIamPolicyAsync(request);

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.

TestIamPermissions(TestIamPermissionsRequest, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)

Tests the specified permissions against the IAM access control policy for a function. If the function does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Parameters
NameDescription
requestTestIamPermissionsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = cloudFunctionsServiceClient.TestIamPermissions(request);

TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)

Tests the specified permissions against the IAM access control policy for a function. If the function does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Parameters
NameDescription
requestTestIamPermissionsRequest

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<TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await cloudFunctionsServiceClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(TestIamPermissionsRequest, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CancellationToken cancellationToken)

Tests the specified permissions against the IAM access control policy for a function. If the function does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Parameters
NameDescription
requestTestIamPermissionsRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await cloudFunctionsServiceClient.TestIamPermissionsAsync(request);

UpdateFunction(CloudFunction, CallSettings)

public virtual Operation<CloudFunction, OperationMetadataV1> UpdateFunction(CloudFunction function, CallSettings callSettings = null)

Updates existing function.

Parameters
NameDescription
functionCloudFunction

Required. New version of the function.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<CloudFunction, OperationMetadataV1>

The RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.Create();
// Initialize request argument(s)
CloudFunction function = new CloudFunction();
// Make the request
Operation<CloudFunction, OperationMetadataV1> response = cloudFunctionsServiceClient.UpdateFunction(function);

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = cloudFunctionsServiceClient.PollOnceUpdateFunction(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

UpdateFunction(UpdateFunctionRequest, CallSettings)

public virtual Operation<CloudFunction, OperationMetadataV1> 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<CloudFunction, OperationMetadataV1>

The RPC response.

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

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = cloudFunctionsServiceClient.PollOnceUpdateFunction(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

UpdateFunctionAsync(CloudFunction, CallSettings)

public virtual Task<Operation<CloudFunction, OperationMetadataV1>> UpdateFunctionAsync(CloudFunction function, CallSettings callSettings = null)

Updates existing function.

Parameters
NameDescription
functionCloudFunction

Required. New version of the function.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<CloudFunction, OperationMetadataV1>>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
CloudFunction function = new CloudFunction();
// Make the request
Operation<CloudFunction, OperationMetadataV1> response = await cloudFunctionsServiceClient.UpdateFunctionAsync(function);

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.PollOnceUpdateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

UpdateFunctionAsync(CloudFunction, CancellationToken)

public virtual Task<Operation<CloudFunction, OperationMetadataV1>> UpdateFunctionAsync(CloudFunction function, CancellationToken cancellationToken)

Updates existing function.

Parameters
NameDescription
functionCloudFunction

Required. New version of the function.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<CloudFunction, OperationMetadataV1>>

A Task containing the RPC response.

Example
// Create client
CloudFunctionsServiceClient cloudFunctionsServiceClient = await CloudFunctionsServiceClient.CreateAsync();
// Initialize request argument(s)
CloudFunction function = new CloudFunction();
// Make the request
Operation<CloudFunction, OperationMetadataV1> response = await cloudFunctionsServiceClient.UpdateFunctionAsync(function);

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.PollOnceUpdateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

UpdateFunctionAsync(UpdateFunctionRequest, CallSettings)

public virtual Task<Operation<CloudFunction, OperationMetadataV1>> 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<CloudFunction, OperationMetadataV1>>

A Task containing the RPC response.

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

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.PollOnceUpdateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}

UpdateFunctionAsync(UpdateFunctionRequest, CancellationToken)

public virtual Task<Operation<CloudFunction, OperationMetadataV1>> 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<CloudFunction, OperationMetadataV1>>

A Task containing the RPC response.

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

// Poll until the returned long-running operation is complete
Operation<CloudFunction, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
CloudFunction 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<CloudFunction, OperationMetadataV1> retrievedResponse = await cloudFunctionsServiceClient.PollOnceUpdateFunctionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    CloudFunction retrievedResult = retrievedResponse.Result;
}