Cloud Functions v2 API - Class FunctionService.FunctionServiceClient (1.4.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
NameDescription
callInvokerCallInvoker

The callInvoker to use to make remote calls.

FunctionServiceClient(ChannelBase)

public FunctionServiceClient(ChannelBase channel)

Creates a new client for FunctionService

Parameter
NameDescription
channelChannelBase

The channel to use to make remote calls.

FunctionServiceClient(ClientBaseConfiguration)

protected FunctionServiceClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
NameDescription
configurationClientBaseClientBaseConfiguration

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
NameDescription
requestCreateFunctionRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestCreateFunctionRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestCreateFunctionRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestCreateFunctionRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
requestDeleteFunctionRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestDeleteFunctionRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestDeleteFunctionRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestDeleteFunctionRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestGenerateDownloadUrlRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestGenerateDownloadUrlRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestGenerateDownloadUrlRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestGenerateDownloadUrlRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestGenerateUploadUrlRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestGenerateUploadUrlRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestGenerateUploadUrlRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestGenerateUploadUrlRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestGetFunctionRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestGetFunctionRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestGetFunctionRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestGetFunctionRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestListFunctionsRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestListFunctionsRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestListFunctionsRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestListFunctionsRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestListRuntimesRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestListRuntimesRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
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
NameDescription
requestListRuntimesRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestListRuntimesRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallListRuntimesResponse

The call object.

NewInstance(ClientBaseConfiguration)

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

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
NameDescription
configurationClientBaseClientBaseConfiguration
Returns
TypeDescription
FunctionServiceFunctionServiceClient
Overrides

UpdateFunction(UpdateFunctionRequest, CallOptions)

public virtual Operation UpdateFunction(UpdateFunctionRequest request, CallOptions options)

Updates existing function.

Parameters
NameDescription
requestUpdateFunctionRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestUpdateFunctionRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Operation

The response received from the server.

UpdateFunctionAsync(UpdateFunctionRequest, CallOptions)

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

Updates existing function.

Parameters
NameDescription
requestUpdateFunctionRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
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
NameDescription
requestUpdateFunctionRequest

The request to send to the server.

headersMetadata

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

deadlineDateTime

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

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.