Class CloudFunctionsServiceClient (2.23.0-rc)

A service that application uses to manipulate triggers and functions.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

CloudFunctionsServiceClient(CloudFunctionsServiceClient const &)

Copy and move support

Parameter
NameDescription
CloudFunctionsServiceClient const &

CloudFunctionsServiceClient(CloudFunctionsServiceClient &&)

Copy and move support

Parameter
NameDescription
CloudFunctionsServiceClient &&

CloudFunctionsServiceClient(std::shared_ptr< CloudFunctionsServiceConnection >, Options)

Parameters
NameDescription
connection std::shared_ptr< CloudFunctionsServiceConnection >
opts Options

Operators

operator=(CloudFunctionsServiceClient const &)

Copy and move support

Parameter
NameDescription
CloudFunctionsServiceClient const &
Returns
TypeDescription
CloudFunctionsServiceClient &

operator=(CloudFunctionsServiceClient &&)

Copy and move support

Parameter
NameDescription
CloudFunctionsServiceClient &&
Returns
TypeDescription
CloudFunctionsServiceClient &

Functions

ListFunctions(google::cloud::functions::v1::ListFunctionsRequest, Options)

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

Parameters
NameDescription
request google::cloud::functions::v1::ListFunctionsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.functions.v1.ListFunctionsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StreamRange< google::cloud::functions::v1::CloudFunction >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.functions.v1.CloudFunction, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

GetFunction(std::string const &, Options)

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

Parameters
NameDescription
name std::string const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::functions::v1::CloudFunction >

the result of the RPC. The response message type (google.cloud.functions.v1.CloudFunction) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetFunction(google::cloud::functions::v1::GetFunctionRequest const &, Options)

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

Parameters
NameDescription
request google::cloud::functions::v1::GetFunctionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.functions.v1.GetFunctionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::functions::v1::CloudFunction >

the result of the RPC. The response message type (google.cloud.functions.v1.CloudFunction) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateFunction(std::string const &, google::cloud::functions::v1::CloudFunction const &, 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
location std::string const &

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

function google::cloud::functions::v1::CloudFunction const &

Required. Function to be created.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::functions::v1::CloudFunction > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.functions.v1.CloudFunction proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateFunction(google::cloud::functions::v1::CreateFunctionRequest const &, 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
request google::cloud::functions::v1::CreateFunctionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.functions.v1.CreateFunctionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::functions::v1::CloudFunction > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.functions.v1.CloudFunction proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateFunction(google::cloud::functions::v1::CloudFunction const &, Options)

Updates existing function.

Parameters
NameDescription
function google::cloud::functions::v1::CloudFunction const &

Required. New version of the function.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::functions::v1::CloudFunction > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.functions.v1.CloudFunction proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateFunction(google::cloud::functions::v1::UpdateFunctionRequest const &, Options)

Updates existing function.

Parameters
NameDescription
request google::cloud::functions::v1::UpdateFunctionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.functions.v1.UpdateFunctionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::functions::v1::CloudFunction > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.functions.v1.CloudFunction proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteFunction(std::string const &, 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
name std::string const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::functions::v1::OperationMetadataV1 > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.functions.v1.OperationMetadataV1 proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteFunction(google::cloud::functions::v1::DeleteFunctionRequest const &, 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
request google::cloud::functions::v1::DeleteFunctionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.functions.v1.DeleteFunctionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::functions::v1::OperationMetadataV1 > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.functions.v1.OperationMetadataV1 proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CallFunction(std::string const &, std::string const &, Options)

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
name std::string const &

Required. The name of the function to be called.

data std::string const &

Required. Input to be passed to the function.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::functions::v1::CallFunctionResponse >

the result of the RPC. The response message type (google.cloud.functions.v1.CallFunctionResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CallFunction(google::cloud::functions::v1::CallFunctionRequest const &, Options)

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
request google::cloud::functions::v1::CallFunctionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.functions.v1.CallFunctionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::functions::v1::CallFunctionResponse >

the result of the RPC. The response message type (google.cloud.functions.v1.CallFunctionResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GenerateUploadUrl(google::cloud::functions::v1::GenerateUploadUrlRequest const &, 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.
  • 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
request google::cloud::functions::v1::GenerateUploadUrlRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.functions.v1.GenerateUploadUrlRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::functions::v1::GenerateUploadUrlResponse >

the result of the RPC. The response message type (google.cloud.functions.v1.GenerateUploadUrlResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GenerateDownloadUrl(google::cloud::functions::v1::GenerateDownloadUrlRequest const &, 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 minutes after generation. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls

Parameters
NameDescription
request google::cloud::functions::v1::GenerateDownloadUrlRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.functions.v1.GenerateDownloadUrlRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::functions::v1::GenerateDownloadUrlResponse >

the result of the RPC. The response message type (google.cloud.functions.v1.GenerateDownloadUrlResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &, Options)

Sets the IAM access control policy on the specified function.

Replaces any existing policy.

Parameters
NameDescription
request google::iam::v1::SetIamPolicyRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.SetIamPolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::iam::v1::Policy >

the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &, Options)

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
request google::iam::v1::GetIamPolicyRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.GetIamPolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::iam::v1::Policy >

the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &, Options)

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
request google::iam::v1::TestIamPermissionsRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.TestIamPermissionsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::iam::v1::TestIamPermissionsResponse >

the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.