Cloud Functions v2 API - Class FunctionService.FunctionServiceClient (1.5.0)

public class FunctionService.FunctionServiceClient : ClientBase<FunctionService.FunctionServiceClient>

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

Client for FunctionService

Inheritance

object > ClientBase > ClientBaseFunctionServiceFunctionServiceClient > FunctionService.FunctionServiceClient

Namespace

Google.Cloud.Functions.V2

Assembly

Google.Cloud.Functions.V2.dll

Constructors

FunctionServiceClient()

protected FunctionServiceClient()

Protected parameterless constructor to allow creation of test doubles.

FunctionServiceClient(CallInvoker)

public FunctionServiceClient(CallInvoker callInvoker)

Creates a new client for FunctionService that uses a custom CallInvoker.

Parameter
Name Description
callInvoker CallInvoker

The callInvoker to use to make remote calls.

FunctionServiceClient(ChannelBase)

public FunctionServiceClient(ChannelBase channel)

Creates a new client for FunctionService

Parameter
Name Description
channel ChannelBase

The channel to use to make remote calls.

FunctionServiceClient(ClientBaseConfiguration)

protected FunctionServiceClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration

The client configuration.

Methods

CreateFunction(CreateFunctionRequest, CallOptions)

public virtual Operation CreateFunction(CreateFunctionRequest request, CallOptions options)

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
Name Description
request CreateFunctionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Operation

The response received from the server.

CreateFunction(CreateFunctionRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation CreateFunction(CreateFunctionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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
Name Description
request CreateFunctionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Operation

The response received from the server.

CreateFunctionAsync(CreateFunctionRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> CreateFunctionAsync(CreateFunctionRequest request, CallOptions options)

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
Name Description
request CreateFunctionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.

CreateFunctionAsync(CreateFunctionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> CreateFunctionAsync(CreateFunctionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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
Name Description
request CreateFunctionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.

CreateIAMPolicyClient()

public virtual IAMPolicy.IAMPolicyClient CreateIAMPolicyClient()

Creates a new instance of IAMPolicy.IAMPolicyClient using the same call invoker as this client.

Returns
Type Description
IAMPolicyIAMPolicyClient

A new IAMPolicy.IAMPolicyClient for the same target as this client.

CreateLocationsClient()

public virtual Locations.LocationsClient CreateLocationsClient()

Creates a new instance of Locations.LocationsClient using the same call invoker as this client.

Returns
Type Description
LocationsLocationsClient

A new Locations.LocationsClient for the same target as this client.

CreateOperationsClient()

public virtual Operations.OperationsClient CreateOperationsClient()

Creates a new instance of Operations.OperationsClient using the same call invoker as this client.

Returns
Type Description
OperationsOperationsClient

A new Operations client for the same target as this client.

DeleteFunction(DeleteFunctionRequest, CallOptions)

public virtual Operation DeleteFunction(DeleteFunctionRequest request, CallOptions options)

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
Name Description
request DeleteFunctionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Operation

The response received from the server.

DeleteFunction(DeleteFunctionRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation DeleteFunction(DeleteFunctionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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
Name Description
request DeleteFunctionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Operation

The response received from the server.

DeleteFunctionAsync(DeleteFunctionRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> DeleteFunctionAsync(DeleteFunctionRequest request, CallOptions options)

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
Name Description
request DeleteFunctionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.

DeleteFunctionAsync(DeleteFunctionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> DeleteFunctionAsync(DeleteFunctionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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
Name Description
request DeleteFunctionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.

GenerateDownloadUrl(GenerateDownloadUrlRequest, CallOptions)

public virtual GenerateDownloadUrlResponse GenerateDownloadUrl(GenerateDownloadUrlRequest request, CallOptions options)

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
Name Description
request GenerateDownloadUrlRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
GenerateDownloadUrlResponse

The response received from the server.

GenerateDownloadUrl(GenerateDownloadUrlRequest, Metadata, DateTime?, CancellationToken)

public virtual GenerateDownloadUrlResponse GenerateDownloadUrl(GenerateDownloadUrlRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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
Name Description
request GenerateDownloadUrlRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
GenerateDownloadUrlResponse

The response received from the server.

GenerateDownloadUrlAsync(GenerateDownloadUrlRequest, CallOptions)

public virtual AsyncUnaryCall<GenerateDownloadUrlResponse> GenerateDownloadUrlAsync(GenerateDownloadUrlRequest request, CallOptions options)

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
Name Description
request GenerateDownloadUrlRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallGenerateDownloadUrlResponse

The call object.

GenerateDownloadUrlAsync(GenerateDownloadUrlRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<GenerateDownloadUrlResponse> GenerateDownloadUrlAsync(GenerateDownloadUrlRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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
Name Description
request GenerateDownloadUrlRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallGenerateDownloadUrlResponse

The call object.

GenerateUploadUrl(GenerateUploadUrlRequest, CallOptions)

public virtual GenerateUploadUrlResponse GenerateUploadUrl(GenerateUploadUrlRequest request, CallOptions options)

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
Name Description
request GenerateUploadUrlRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
GenerateUploadUrlResponse

The response received from the server.

GenerateUploadUrl(GenerateUploadUrlRequest, Metadata, DateTime?, CancellationToken)

public virtual GenerateUploadUrlResponse GenerateUploadUrl(GenerateUploadUrlRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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
Name Description
request GenerateUploadUrlRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
GenerateUploadUrlResponse

The response received from the server.

GenerateUploadUrlAsync(GenerateUploadUrlRequest, CallOptions)

public virtual AsyncUnaryCall<GenerateUploadUrlResponse> GenerateUploadUrlAsync(GenerateUploadUrlRequest request, CallOptions options)

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
Name Description
request GenerateUploadUrlRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallGenerateUploadUrlResponse

The call object.

GenerateUploadUrlAsync(GenerateUploadUrlRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<GenerateUploadUrlResponse> GenerateUploadUrlAsync(GenerateUploadUrlRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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
Name Description
request GenerateUploadUrlRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallGenerateUploadUrlResponse

The call object.

GetFunction(GetFunctionRequest, CallOptions)

public virtual Function GetFunction(GetFunctionRequest request, CallOptions options)

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

Parameters
Name Description
request GetFunctionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Function

The response received from the server.

GetFunction(GetFunctionRequest, Metadata, DateTime?, CancellationToken)

public virtual Function GetFunction(GetFunctionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request GetFunctionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Function

The response received from the server.

GetFunctionAsync(GetFunctionRequest, CallOptions)

public virtual AsyncUnaryCall<Function> GetFunctionAsync(GetFunctionRequest request, CallOptions options)

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

Parameters
Name Description
request GetFunctionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallFunction

The call object.

GetFunctionAsync(GetFunctionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Function> GetFunctionAsync(GetFunctionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request GetFunctionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallFunction

The call object.

ListFunctions(ListFunctionsRequest, CallOptions)

public virtual ListFunctionsResponse ListFunctions(ListFunctionsRequest request, CallOptions options)

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

Parameters
Name Description
request ListFunctionsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListFunctionsResponse

The response received from the server.

ListFunctions(ListFunctionsRequest, Metadata, DateTime?, CancellationToken)

public virtual ListFunctionsResponse ListFunctions(ListFunctionsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request ListFunctionsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListFunctionsResponse

The response received from the server.

ListFunctionsAsync(ListFunctionsRequest, CallOptions)

public virtual AsyncUnaryCall<ListFunctionsResponse> ListFunctionsAsync(ListFunctionsRequest request, CallOptions options)

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

Parameters
Name Description
request ListFunctionsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListFunctionsResponse

The call object.

ListFunctionsAsync(ListFunctionsRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListFunctionsResponse> ListFunctionsAsync(ListFunctionsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request ListFunctionsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListFunctionsResponse

The call object.

ListRuntimes(ListRuntimesRequest, CallOptions)

public virtual ListRuntimesResponse ListRuntimes(ListRuntimesRequest request, CallOptions options)

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

Parameters
Name Description
request ListRuntimesRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListRuntimesResponse

The response received from the server.

ListRuntimes(ListRuntimesRequest, Metadata, DateTime?, CancellationToken)

public virtual ListRuntimesResponse ListRuntimes(ListRuntimesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request ListRuntimesRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListRuntimesResponse

The response received from the server.

ListRuntimesAsync(ListRuntimesRequest, CallOptions)

public virtual AsyncUnaryCall<ListRuntimesResponse> ListRuntimesAsync(ListRuntimesRequest request, CallOptions options)

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

Parameters
Name Description
request ListRuntimesRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListRuntimesResponse

The call object.

ListRuntimesAsync(ListRuntimesRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListRuntimesResponse> ListRuntimesAsync(ListRuntimesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request ListRuntimesRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListRuntimesResponse

The call object.

NewInstance(ClientBaseConfiguration)

protected override FunctionService.FunctionServiceClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration
Returns
Type Description
FunctionServiceFunctionServiceClient
Overrides

UpdateFunction(UpdateFunctionRequest, CallOptions)

public virtual Operation UpdateFunction(UpdateFunctionRequest request, CallOptions options)

Updates existing function.

Parameters
Name Description
request UpdateFunctionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Operation

The response received from the server.

UpdateFunction(UpdateFunctionRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation UpdateFunction(UpdateFunctionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Updates existing function.

Parameters
Name Description
request UpdateFunctionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Operation

The response received from the server.

UpdateFunctionAsync(UpdateFunctionRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> UpdateFunctionAsync(UpdateFunctionRequest request, CallOptions options)

Updates existing function.

Parameters
Name Description
request UpdateFunctionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.

UpdateFunctionAsync(UpdateFunctionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> UpdateFunctionAsync(UpdateFunctionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Updates existing function.

Parameters
Name Description
request UpdateFunctionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.