diff --git a/packages/google-cloud-functions/README.md b/packages/google-cloud-functions/README.md
index 5a56f0391b9..e2be01d5c9d 100644
--- a/packages/google-cloud-functions/README.md
+++ b/packages/google-cloud-functions/README.md
@@ -2,7 +2,7 @@
[//]: # "To regenerate it, use `python -m synthtool`."
-# [Google Cloud Functions: Node.js Client](https://github.com/googleapis/google-cloud-node)
+# [Google Cloud Functions: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-functions)
[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/functions.svg)](https://www.npmjs.org/package/@google-cloud/functions)
@@ -83,47 +83,46 @@ listFunctions();
## Samples
-Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.
+Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-functions/samples) directory. Each sample's `README.md` has instructions for running its sample.
| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
-| Cloud_functions_service.call_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.call_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.call_function.js,samples/README.md) |
-| Cloud_functions_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js,samples/README.md) |
-| Cloud_functions_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.delete_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.delete_function.js,samples/README.md) |
-| Cloud_functions_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.generate_download_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.generate_download_url.js,samples/README.md) |
-| Cloud_functions_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.generate_upload_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.generate_upload_url.js,samples/README.md) |
-| Cloud_functions_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.get_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.get_function.js,samples/README.md) |
-| Cloud_functions_service.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.get_iam_policy.js,samples/README.md) |
-| Cloud_functions_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.list_functions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.list_functions.js,samples/README.md) |
-| Cloud_functions_service.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.set_iam_policy.js,samples/README.md) |
-| Cloud_functions_service.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.test_iam_permissions.js,samples/README.md) |
-| Cloud_functions_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.update_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.update_function.js,samples/README.md) |
-| Function_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.create_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.create_function.js,samples/README.md) |
-| Function_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.delete_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.delete_function.js,samples/README.md) |
-| Function_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.generate_download_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.generate_download_url.js,samples/README.md) |
-| Function_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js,samples/README.md) |
-| Function_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.get_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.get_function.js,samples/README.md) |
-| Function_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.list_functions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.list_functions.js,samples/README.md) |
-| Function_service.list_runtimes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.list_runtimes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.list_runtimes.js,samples/README.md) |
-| Function_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.update_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.update_function.js,samples/README.md) |
-| Function_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js,samples/README.md) |
-| Function_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.delete_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.delete_function.js,samples/README.md) |
-| Function_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js,samples/README.md) |
-| Function_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js,samples/README.md) |
-| Function_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.get_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.get_function.js,samples/README.md) |
-| Function_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js,samples/README.md) |
-| Function_service.list_runtimes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js,samples/README.md) |
-| Function_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.update_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.update_function.js,samples/README.md) |
-| Function_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js,samples/README.md) |
-| Function_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.delete_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.delete_function.js,samples/README.md) |
-| Function_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js,samples/README.md) |
-| Function_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js,samples/README.md) |
-| Function_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.get_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.get_function.js,samples/README.md) |
-| Function_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js,samples/README.md) |
-| Function_service.list_runtimes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js,samples/README.md) |
-| Function_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.update_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.update_function.js,samples/README.md) |
-| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/quickstart.js,samples/README.md) |
-| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/test/quickstart.test.js,samples/README.md) |
+| Cloud_functions_service.call_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.call_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.call_function.js,packages/google-cloud-functions/samples/README.md) |
+| Cloud_functions_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js,packages/google-cloud-functions/samples/README.md) |
+| Cloud_functions_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.delete_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.delete_function.js,packages/google-cloud-functions/samples/README.md) |
+| Cloud_functions_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.generate_download_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.generate_download_url.js,packages/google-cloud-functions/samples/README.md) |
+| Cloud_functions_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.generate_upload_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.generate_upload_url.js,packages/google-cloud-functions/samples/README.md) |
+| Cloud_functions_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.get_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.get_function.js,packages/google-cloud-functions/samples/README.md) |
+| Cloud_functions_service.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.get_iam_policy.js,packages/google-cloud-functions/samples/README.md) |
+| Cloud_functions_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.list_functions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.list_functions.js,packages/google-cloud-functions/samples/README.md) |
+| Cloud_functions_service.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.set_iam_policy.js,packages/google-cloud-functions/samples/README.md) |
+| Cloud_functions_service.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.test_iam_permissions.js,packages/google-cloud-functions/samples/README.md) |
+| Cloud_functions_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.update_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.update_function.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.create_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.create_function.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.delete_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.delete_function.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.generate_download_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.generate_download_url.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.get_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.get_function.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.list_functions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.list_functions.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.list_runtimes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.list_runtimes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.list_runtimes.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2/function_service.update_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2/function_service.update_function.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.delete_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.delete_function.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.get_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.get_function.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.list_runtimes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2alpha/function_service.update_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2alpha/function_service.update_function.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.create_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.delete_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.delete_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.delete_function.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.generate_download_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.generate_upload_url | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.get_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.get_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.get_function.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.list_functions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.list_runtimes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js,packages/google-cloud-functions/samples/README.md) |
+| Function_service.update_function | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/generated/v2beta/function_service.update_function.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/generated/v2beta/function_service.update_function.js,packages/google-cloud-functions/samples/README.md) |
+| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/quickstart.js,packages/google-cloud-functions/samples/README.md) |
diff --git a/packages/google-cloud-functions/protos/google/cloud/functions/v1/functions.proto b/packages/google-cloud-functions/protos/google/cloud/functions/v1/functions.proto
index 4b01c5b4f6b..340338e5b23 100644
--- a/packages/google-cloud-functions/protos/google/cloud/functions/v1/functions.proto
+++ b/packages/google-cloud-functions/protos/google/cloud/functions/v1/functions.proto
@@ -1,4 +1,4 @@
-// Copyright 2022 Google LLC
+// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,10 +20,12 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
+import "google/cloud/functions/v1/operations.proto";
import "google/iam/v1/iam_policy.proto";
import "google/iam/v1/policy.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/duration.proto";
+import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
@@ -44,7 +46,8 @@ option (google.api.resource_definition) = {
// A service that application uses to manipulate triggers and functions.
service CloudFunctionsService {
option (google.api.default_host) = "cloudfunctions.googleapis.com";
- option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
+ option (google.api.oauth_scopes) =
+ "https://www.googleapis.com/auth/cloud-platform";
// Returns a list of functions that belong to the requested project.
rpc ListFunctions(ListFunctionsRequest) returns (ListFunctionsResponse) {
@@ -62,9 +65,10 @@ service CloudFunctionsService {
}
// Creates a new function. If a function with the given name already exists in
- // the specified project, the long running operation will return
+ // the specified project, the long running operation returns an
// `ALREADY_EXISTS` error.
- rpc CreateFunction(CreateFunctionRequest) returns (google.longrunning.Operation) {
+ rpc CreateFunction(CreateFunctionRequest)
+ returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{location=projects/*/locations/*}/functions"
body: "function"
@@ -77,7 +81,8 @@ service CloudFunctionsService {
}
// Updates existing function.
- rpc UpdateFunction(UpdateFunctionRequest) returns (google.longrunning.Operation) {
+ rpc UpdateFunction(UpdateFunctionRequest)
+ returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{function.name=projects/*/locations/*/functions/*}"
body: "function"
@@ -90,9 +95,10 @@ service CloudFunctionsService {
}
// 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
+ // given function is used by some trigger, the trigger is updated to
// remove this function.
- rpc DeleteFunction(DeleteFunctionRequest) returns (google.longrunning.Operation) {
+ rpc DeleteFunction(DeleteFunctionRequest)
+ returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/functions/*}"
};
@@ -132,15 +138,16 @@ service CloudFunctionsService {
// 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:
+ // When making an HTTP PUT request, these two headers must be specified:
//
// * `content-type: application/zip`
// * `x-goog-content-length-range: 0,104857600`
//
- // And this header SHOULD NOT be specified:
+ // And this header must NOT be specified:
//
// * `Authorization: Bearer YOUR_TOKEN`
- rpc GenerateUploadUrl(GenerateUploadUrlRequest) returns (GenerateUploadUrlResponse) {
+ rpc GenerateUploadUrl(GenerateUploadUrlRequest)
+ returns (GenerateUploadUrlResponse) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/functions:generateUploadUrl"
body: "*"
@@ -148,11 +155,12 @@ service CloudFunctionsService {
}
// Returns a signed URL for downloading deployed function source code.
- // The URL is only valid for a limited period and should be used within
+ // The URL is only valid for a limited period and must be used within
// minutes after generation.
- // For more information about the signed URL usage see:
+ // For more information about the signed URL usage, see:
// https://cloud.google.com/storage/docs/access-control/signed-urls
- rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) returns (GenerateDownloadUrlResponse) {
+ rpc GenerateDownloadUrl(GenerateDownloadUrlRequest)
+ returns (GenerateDownloadUrlResponse) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/functions/*}:generateDownloadUrl"
body: "*"
@@ -161,7 +169,8 @@ service CloudFunctionsService {
// Sets the IAM access control policy on the specified function.
// Replaces any existing policy.
- rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
+ rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest)
+ returns (google.iam.v1.Policy) {
option (google.api.http) = {
post: "/v1/{resource=projects/*/locations/*/functions/*}:setIamPolicy"
body: "*"
@@ -171,7 +180,8 @@ service CloudFunctionsService {
// Gets the IAM access control policy for a function.
// Returns an empty policy if the function exists and does not have a policy
// set.
- rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
+ rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest)
+ returns (google.iam.v1.Policy) {
option (google.api.http) = {
get: "/v1/{resource=projects/*/locations/*/functions/*}:getIamPolicy"
};
@@ -179,9 +189,10 @@ service CloudFunctionsService {
// 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
+ // If the function does not exist, this returns an empty set of
// permissions, not a NOT_FOUND error.
- rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
+ rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest)
+ returns (google.iam.v1.TestIamPermissionsResponse) {
option (google.api.http) = {
post: "/v1/{resource=projects/*/locations/*/functions/*}:testIamPermissions"
body: "*"
@@ -190,7 +201,7 @@ service CloudFunctionsService {
}
// Describes a Cloud Function that contains user computation executed in
-// response to an event. It encapsulate function and triggers configurations.
+// response to an event. It encapsulates function and triggers configurations.
message CloudFunction {
option (google.api.resource) = {
type: "cloudfunctions.googleapis.com/CloudFunction"
@@ -199,17 +210,18 @@ message CloudFunction {
// Available egress settings.
//
- // This controls what traffic is diverted through the VPC Access Connector
- // resource. By default PRIVATE_RANGES_ONLY will be used.
+ // This controls what traffic is diverted through the Serverless VPC Access
+ // connector resource. By default, PRIVATE_RANGES_ONLY is used.
enum VpcConnectorEgressSettings {
// Unspecified.
VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0;
- // Use the VPC Access Connector only for private IP space from RFC1918.
+ // Use the Serverless VPC Access connector only for private IP space from
+ // RFC1918.
PRIVATE_RANGES_ONLY = 1;
- // Force the use of VPC Access Connector for all egress traffic from the
- // function.
+ // Force the use of Serverless VPC Access connector for all egress traffic
+ // from the function.
ALL_TRAFFIC = 2;
}
@@ -217,7 +229,7 @@ message CloudFunction {
//
// This controls what traffic can reach the function.
//
- // If unspecified, ALLOW_ALL will be used.
+ // If unspecified, ALLOW_ALL is used.
enum IngressSettings {
// Unspecified.
INGRESS_SETTINGS_UNSPECIFIED = 0;
@@ -237,15 +249,15 @@ message CloudFunction {
// Unspecified.
DOCKER_REGISTRY_UNSPECIFIED = 0;
- // Docker images will be stored in multi-regional Container Registry
+ // Docker images are stored in multi-regional Container Registry
// repositories named `gcf`.
CONTAINER_REGISTRY = 1;
- // Docker images will be stored in regional Artifact Registry repositories.
- // By default, GCF will create and use repositories named `gcf-artifacts`
- // in every region in which a function is deployed. But the repository to
- // use can also be specified by the user using the `docker_repository`
- // field.
+ // Docker images are stored in regional Artifact Registry repositories.
+ // By default, Cloud Functions creates and uses repositories named
+ // `gcf-artifacts` in every region in which a function is deployed. But the
+ // repository to use can also be specified by the user by using the
+ // `docker_repository` field.
ARTIFACT_REGISTRY = 2;
}
@@ -267,7 +279,7 @@ message CloudFunction {
// The source repository where a function is hosted.
SourceRepository source_repository = 4;
- // The Google Cloud Storage signed URL used for source uploading, generated
+ // The Google Cloud Storage-signed URL used for source uploading, generated
// by calling [google.cloud.functions.v1.GenerateUploadUrl].
//
// The signature is validated on write methods (Create, Update)
@@ -288,12 +300,12 @@ message CloudFunction {
// Output only. Status of the function deployment.
CloudFunctionStatus status = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
- // The name of the function (as defined in source code) that will be
- // executed. Defaults to the resource name suffix, if not specified. For
- // backward compatibility, if function with given name is not found, then the
- // system will try to use function named "function".
- // For Node.js this is name of a function exported by the module specified
- // in `source_location`.
+ // The name of the function (as defined in source code) that is executed.
+ // Defaults to the resource name suffix, if not specified. For
+ // backward compatibility, if function with given name is not found, the
+ // system tries to use the function named "function".
+ // For Node.js, this is the name of a function exported by the module
+ // as specified in `source_location`.
string entry_point = 8;
// The runtime in which to run the function. Required when deploying a new
@@ -317,10 +329,11 @@ message CloudFunction {
string service_account_email = 11;
// Output only. The last update timestamp of a Cloud Function.
- google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
+ google.protobuf.Timestamp update_time = 12
+ [(google.api.field_behavior) = OUTPUT_ONLY];
- // Output only. The version identifier of the Cloud Function. Each deployment attempt
- // results in a new version of a function being created.
+ // Output only. The version identifier of the Cloud Function. Each deployment
+ // attempt results in a new version of a function being created.
int64 version_id = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
// Labels associated with this Cloud Function.
@@ -332,11 +345,11 @@ message CloudFunction {
// Build environment variables that shall be available during build time.
map build_environment_variables = 28;
- // The VPC Network that this cloud function can connect to. It can be
- // either the fully-qualified URI, or the short name of the network resource.
- // If the short network name is used, the network must belong to the same
- // project. Otherwise, it must belong to a project within the same
- // organization. The format of this field is either
+ // The Serverless VPC Access connector that this cloud function can connect
+ // to. It can be either the fully qualified URI, or the short name of the
+ // connector resource. If the connector name is used, the connector must
+ // belong to the same project as the function. Otherwise, it must belong to a
+ // project within the same organization. The format of this field is either
// `projects/{project}/global/networks/{network}` or `{network}`, where
// `{project}` is a project id where the network is defined, and `{network}`
// is the short name of the network.
@@ -348,13 +361,13 @@ message CloudFunction {
// more information on connecting Cloud projects.
string network = 18;
- // The limit on the maximum number of function instances that may coexist at a
+ // The limit on the maximum number of function instances that can coexist at a
// given time.
//
- // In some cases, such as rapid traffic surges, Cloud Functions may, for a
- // short period of time, create more instances than the specified max
+ // In some cases, such as rapid traffic surges, Cloud Functions can for a
+ // short period of time create more instances than the specified max
// instances limit. If your function cannot tolerate this temporary behavior,
- // you may want to factor in a safety margin and set a lower max instances
+ // you might want to factor in a safety margin and set a lower max instances
// value than your function can tolerate.
//
// See the [Max
@@ -362,12 +375,12 @@ message CloudFunction {
// more details.
int32 max_instances = 20;
- // A lower bound for the number function instances that may coexist at a
+ // A lower bound for the number function instances that can coexist at a
// given time.
int32 min_instances = 32;
// The VPC Network Connector that this cloud function can connect to. It can
- // be either the fully-qualified URI, or the short name of the network
+ // be either the fully qualified URI, or the short name of the network
// connector resource. The format of this field is
// `projects/*/locations/*/connectors/*`
//
@@ -416,8 +429,8 @@ message CloudFunction {
// function resources in internal projects that are not accessible by the
// end user.
string kms_key_name = 25 [(google.api.resource_reference) = {
- type: "cloudkms.googleapis.com/CryptoKey"
- }];
+ type: "cloudkms.googleapis.com/CryptoKey"
+ }];
// Name of the Cloud Build Custom Worker Pool that should be used to build the
// function. The format of this field is
@@ -447,8 +460,8 @@ message CloudFunction {
// Secret volumes configuration.
repeated SecretVolume secret_volumes = 30;
- // Input only. An identifier for Firebase function sources. Disclaimer: This field is only
- // supported for Firebase function deployments.
+ // Input only. An identifier for Firebase function sources. Disclaimer: This
+ // field is only supported for Firebase function deployments.
string source_token = 31 [(google.api.field_behavior) = INPUT_ONLY];
// User managed repository created in Artifact Registry optionally with a
@@ -456,7 +469,7 @@ message CloudFunction {
// Artifact Registry. If unspecified and the deployment is eligible to use
// Artifact Registry, GCF will create and use a repository named
// 'gcf-artifacts' for every deployed region. This is the repository to which
- // the function docker image will be pushed after it is built by Cloud Build.
+ // the function docker image is pushed after it is built by Cloud Build.
//
// It must match the pattern
// `projects/{project}/locations/{location}/repositories/{repository}`.
@@ -465,12 +478,12 @@ message CloudFunction {
// Cross-location repositories are not supported.
// Repository format must be 'DOCKER'.
string docker_repository = 34 [(google.api.resource_reference) = {
- type: "artifactregistry.googleapis.com/Repository"
- }];
+ type: "artifactregistry.googleapis.com/Repository"
+ }];
// Docker Registry to use for this deployment.
//
- // If `docker_repository` field is specified, this field will be automatically
+ // If `docker_repository` field is specified, this field is automatically
// set as `ARTIFACT_REGISTRY`.
// If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
// This field may be overridden by the backend for eligible deployments.
@@ -492,7 +505,7 @@ message SourceRepository {
// To refer to a specific fixed alias (tag):
// `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*`
//
- // You may omit `paths/*` if you want to use the main directory.
+ // You can omit `paths/*` if you want to use the main directory.
string url = 1;
// Output only. The URL pointing to the hosted repository where the function
@@ -503,11 +516,11 @@ message SourceRepository {
// Describes HttpsTrigger, could be used to connect web hooks to function.
message HttpsTrigger {
- // Available security level settings.
+ // Available security-level settings.
//
// This controls the methods to enforce security (HTTPS) on a URL.
//
- // If unspecified, SECURE_OPTIONAL will be used.
+ // If unspecified, SECURE_OPTIONAL is used.
enum SecurityLevel {
// Unspecified.
SECURITY_LEVEL_UNSPECIFIED = 0;
@@ -523,14 +536,14 @@ message HttpsTrigger {
SECURE_OPTIONAL = 2;
}
- // Output only. The deployed url for the function.
+ // Output only. The deployed URL for the function.
string url = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// The security level for the function.
SecurityLevel security_level = 2;
}
-// Describes EventTrigger, used to request events be sent from another
+// Describes EventTrigger, used to request that events be sent from another
// service.
message EventTrigger {
// Required. The type of event to observe. For example:
@@ -546,7 +559,7 @@ message EventTrigger {
// example, the Google Cloud Storage API includes the type `object`.
// 3. action: The action that generates the event. For example, action for
// a Google Cloud Storage Object is 'change'.
- // These parts are lower case.
+ // These parts are lowercase.
string event_type = 1;
// Required. The resource(s) from which to observe events, for example,
@@ -564,7 +577,7 @@ message EventTrigger {
// that matches Google Cloud Pub/Sub topics.
//
// Additionally, some services may support short names when creating an
- // `EventTrigger`. These will always be returned in the normalized "long"
+ // `EventTrigger`. These are always returned in the normalized "long"
// format.
//
// See each *service's* documentation for supported formats.
@@ -582,20 +595,18 @@ message EventTrigger {
}
// Describes the policy in case of function's execution failure.
-// If empty, then defaults to ignoring failures (i.e. not retrying them).
+// If empty, then defaults to ignoring failures (i.e., not retrying them).
message FailurePolicy {
// Describes the retry policy in case of function's execution failure.
- // A function execution will be retried on any failure.
- // A failed execution will be retried up to 7 days with an exponential backoff
+ // A function execution is retried on any failure.
+ // A failed execution is retried up to 7 days with an exponential backoff
// (capped at 10 seconds).
// Retried execution is charged as any other execution.
- message Retry {
-
- }
+ message Retry {}
// Defines the action taken in case of a function execution failure.
oneof action {
- // If specified, then the function will be retried in case of a failure.
+ // If specified, the function is retried in case of a failure.
Retry retry = 1;
}
}
@@ -623,19 +634,19 @@ enum CloudFunctionStatus {
}
// Configuration for a secret environment variable. It has the information
-// necessary to fetch the secret value from secret manager and expose it as an
+// necessary to fetch the secret value from Secret Manager and expose it as an
// environment variable.
message SecretEnvVar {
// Name of the environment variable.
string key = 1;
// Project identifier (preferrably project number but can also be the project
- // ID) of the project that contains the secret. If not set, it will be
- // populated with the function's project assuming that the secret exists in
- // the same project as of the function.
+ // ID) of the project that contains the secret. If not set, it is
+ // populated with the function's project, assuming that the secret exists in
+ // the same project as the function.
string project_id = 2;
- // Name of the secret in secret manager (not the full resource name).
+ // Name of the secret in Secret Manager (not the full resource name).
string secret = 3;
// Version of the secret (version number or the string 'latest'). It is
@@ -645,28 +656,28 @@ message SecretEnvVar {
}
// Configuration for a secret volume. It has the information necessary to fetch
-// the secret value from secret manager and make it available as files mounted
+// the secret value from Secret Manager and make it available as files mounted
// at the requested paths within the application container. Secret value is not
-// a part of the configuration. Every filesystem read operation performs a
-// lookup in secret manager to retrieve the secret value.
+// a part of the configuration. Every file system read operation performs a
+// lookup in Secret Manager to retrieve the secret value.
message SecretVolume {
// Configuration for a single version.
message SecretVersion {
// Version of the secret (version number or the string 'latest'). It is
- // preferrable to use `latest` version with secret volumes as secret value
+ // preferable to use `latest` version with secret volumes as secret value
// changes are reflected immediately.
string version = 1;
// Relative path of the file under the mount path where the secret value for
- // this version will be fetched and made available. For example, setting the
- // mount_path as '/etc/secrets' and path as `/secret_foo` would mount the
+ // this version is fetched and made available. For example, setting the
+ // mount_path as '/etc/secrets' and path as `/secret_foo` mounts the
// secret value file at `/etc/secrets/secret_foo`.
string path = 2;
}
// The path within the container to mount the secret volume. For example,
- // setting the mount_path as `/etc/secrets` would mount the secret value files
- // under the `/etc/secrets` directory. This directory will also be completely
+ // setting the mount_path as `/etc/secrets` mounts the secret value files
+ // under the `/etc/secrets` directory. This directory is also completely
// shadowed and unavailable to mount any other secrets.
//
// Recommended mount paths: /etc/secrets
@@ -674,24 +685,24 @@ message SecretVolume {
string mount_path = 1;
// Project identifier (preferrably project number but can also be the project
- // ID) of the project that contains the secret. If not set, it will be
- // populated with the function's project assuming that the secret exists in
- // the same project as of the function.
+ // ID) of the project that contains the secret. If not set, it is
+ // populated with the function's project, assuming that the secret exists in
+ // the same project as the function.
string project_id = 2;
- // Name of the secret in secret manager (not the full resource name).
+ // Name of the secret in Secret Manager (not the full resource name).
string secret = 3;
// List of secret versions to mount for this secret. If empty, the `latest`
- // version of the secret will be made available in a file named after the
+ // version of the secret is made available in a file named after the
// secret under the mount point.
repeated SecretVersion versions = 4;
}
// Request for the `CreateFunction` method.
message CreateFunctionRequest {
- // Required. The project and location in which the function should be created, specified
- // in the format `projects/*/locations/*`
+ // Required. The project and location in which the function should be created,
+ // specified in the format `projects/*/locations/*`
string location = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
@@ -732,8 +743,8 @@ message ListFunctionsRequest {
// location(s) are unreachable, the response will contain functions from all
// reachable locations along with the names of any unreachable locations.
string parent = 1 [(google.api.resource_reference) = {
- type: "locations.googleapis.com/Location"
- }];
+ type: "locations.googleapis.com/Location"
+ }];
// Maximum number of functions to return per call.
int32 page_size = 2;
@@ -824,8 +835,8 @@ message GenerateUploadUrlRequest {
// delegate access to the Google Storage service account in the internal
// project.
string kms_key_name = 2 [(google.api.resource_reference) = {
- type: "cloudkms.googleapis.com/CryptoKey"
- }];
+ type: "cloudkms.googleapis.com/CryptoKey"
+ }];
}
// Response of `GenerateSourceUploadUrl` method.
diff --git a/packages/google-cloud-functions/protos/google/cloud/functions/v1/operations.proto b/packages/google-cloud-functions/protos/google/cloud/functions/v1/operations.proto
index 880774c96c0..1a9ba18890b 100644
--- a/packages/google-cloud-functions/protos/google/cloud/functions/v1/operations.proto
+++ b/packages/google-cloud-functions/protos/google/cloud/functions/v1/operations.proto
@@ -1,4 +1,4 @@
-// Copyright 2022 Google LLC
+// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/packages/google-cloud-functions/protos/google/cloud/functions/v2/functions.proto b/packages/google-cloud-functions/protos/google/cloud/functions/v2/functions.proto
index 8b29cd4976b..ae0cdc1ef22 100644
--- a/packages/google-cloud-functions/protos/google/cloud/functions/v2/functions.proto
+++ b/packages/google-cloud-functions/protos/google/cloud/functions/v2/functions.proto
@@ -1,4 +1,4 @@
-// Copyright 2022 Google LLC
+// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -241,9 +241,6 @@ message Function {
// globally and match pattern `projects/*/locations/*/functions/*`
string name = 1;
- // Describe whether the function is 1st Gen or 2nd Gen.
- Environment environment = 10;
-
// User-provided description of a function.
string description = 2;
@@ -273,7 +270,13 @@ message Function {
repeated StateMessage state_messages = 9
[(google.api.field_behavior) = OUTPUT_ONLY];
- // Resource name of a KMS crypto key (managed by the user) used to
+ // Describe whether the function is 1st Gen or 2nd Gen.
+ Environment environment = 10;
+
+ // Output only. The deployed url for the function.
+ string url = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // [Preview] Resource name of a KMS crypto key (managed by the user) used to
// encrypt/decrypt function resources.
//
// It must match the pattern
@@ -281,9 +284,6 @@ message Function {
string kms_key_name = 25 [(google.api.resource_reference) = {
type: "cloudkms.googleapis.com/CryptoKey"
}];
-
- // Output only. The deployed url for the function.
- string url = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// Informational messages about the state of the Cloud Function or Operation.
@@ -467,18 +467,18 @@ message BuildConfig {
// User-provided build-time environment variables for the function
map environment_variables = 6;
- // Optional. Docker Registry to use for this deployment. This configuration is
- // only applicable to 1st Gen functions, 2nd Gen functions can only use
- // Artifact Registry.
+ // Docker Registry to use for this deployment. This configuration is only
+ // applicable to 1st Gen functions, 2nd Gen functions can only use Artifact
+ // Registry.
//
// If `docker_repository` field is specified, this field will be automatically
// set as `ARTIFACT_REGISTRY`.
// If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
// This field may be overridden by the backend for eligible deployments.
- DockerRegistry docker_registry = 10 [(google.api.field_behavior) = OPTIONAL];
+ DockerRegistry docker_registry = 10;
- // User managed repository created in Artifact Registry optionally with a
- // customer managed encryption key. This is the repository to which the
+ // User managed repository created in Artifact Registry optionally
+ // with a customer managed encryption key. This is the repository to which the
// function docker image will be pushed after it is built by Cloud Build.
// If unspecified, GCF will create and use a repository named 'gcf-artifacts'
// for every deployed region.
@@ -496,7 +496,6 @@ message BuildConfig {
// Describes the Service being deployed.
// Currently Supported : Cloud Run (fully managed).
-// Next tag: 23
message ServiceConfig {
// Available egress settings.
//
@@ -537,7 +536,7 @@ message ServiceConfig {
//
// This enforces security protocol on function URL.
//
- // Security level is only ocnfigurable for 1st Gen functions, If unspecified,
+ // Security level is only configurable for 1st Gen functions, If unspecified,
// SECURE_OPTIONAL will be used. 2nd Gen functions are SECURE_ALWAYS ONLY.
enum SecurityLevel {
// Unspecified.
@@ -575,7 +574,7 @@ message ServiceConfig {
// a full description.
string available_memory = 13;
- // The number of CPUs used in a single container instance.
+ // [Preview] The number of CPUs used in a single container instance.
// Default value is calculated from available memory.
// Supports the same values as Cloud Run, see
// https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements
@@ -647,8 +646,8 @@ message ServiceConfig {
// Output only. The name of service revision.
string revision = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
- // Sets the maximum number of concurrent requests that each instance can
- // receive. Defaults to 1.
+ // [Preview] Sets the maximum number of concurrent requests that each instance
+ // can receive. Defaults to 1.
int32 max_instance_request_concurrency = 20;
// Security level configure whether the function only accepts https.
@@ -925,7 +924,7 @@ message GenerateUploadUrlRequest {
}
];
- // Resource name of a KMS crypto key (managed by the user) used to
+ // [Preview] Resource name of a KMS crypto key (managed by the user) used to
// encrypt/decrypt function source code objects in intermediate Cloud Storage
// buckets. When you generate an upload url and upload your source code, it
// gets copied to an intermediate Cloud Storage bucket. The source code is
@@ -1081,6 +1080,12 @@ message OperationMetadata {
repeated Stage stages = 9;
}
+// Extra GCF specific location information.
+message LocationMetadata {
+ // The Cloud Function environments this location supports.
+ repeated Environment environments = 1;
+}
+
// Each Stage of the deployment process
message Stage {
// Possible names for a Stage
diff --git a/packages/google-cloud-functions/protos/google/cloud/functions/v2alpha/functions.proto b/packages/google-cloud-functions/protos/google/cloud/functions/v2alpha/functions.proto
index 0861c4b668f..3c96518d728 100644
--- a/packages/google-cloud-functions/protos/google/cloud/functions/v2alpha/functions.proto
+++ b/packages/google-cloud-functions/protos/google/cloud/functions/v2alpha/functions.proto
@@ -1,4 +1,4 @@
-// Copyright 2022 Google LLC
+// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/any.proto";
+import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
@@ -62,6 +63,10 @@ option (google.api.resource_definition) = {
type: "pubsub.googleapis.com/Topic"
pattern: "projects/{project}/topics/{topic}"
};
+option (google.api.resource_definition) = {
+ type: "cloudkms.googleapis.com/CryptoKey"
+ pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
+};
// Google Cloud Functions is used to deploy functions that are executed by
// Google in response to various events. Data connected with that event is
@@ -71,7 +76,8 @@ option (google.api.resource_definition) = {
// executed and how it is triggered.
service FunctionService {
option (google.api.default_host) = "cloudfunctions.googleapis.com";
- option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
+ option (google.api.oauth_scopes) =
+ "https://www.googleapis.com/auth/cloud-platform";
// Returns a function with the given name from the requested project.
rpc GetFunction(GetFunctionRequest) returns (Function) {
@@ -92,7 +98,8 @@ service FunctionService {
// 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.
- rpc CreateFunction(CreateFunctionRequest) returns (google.longrunning.Operation) {
+ rpc CreateFunction(CreateFunctionRequest)
+ returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2alpha/{parent=projects/*/locations/*}/functions"
body: "function"
@@ -105,7 +112,8 @@ service FunctionService {
}
// Updates existing function.
- rpc UpdateFunction(UpdateFunctionRequest) returns (google.longrunning.Operation) {
+ rpc UpdateFunction(UpdateFunctionRequest)
+ returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v2alpha/{function.name=projects/*/locations/*/functions/*}"
body: "function"
@@ -120,7 +128,8 @@ service FunctionService {
// 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.
- rpc DeleteFunction(DeleteFunctionRequest) returns (google.longrunning.Operation) {
+ rpc DeleteFunction(DeleteFunctionRequest)
+ returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v2alpha/{name=projects/*/locations/*/functions/*}"
};
@@ -154,7 +163,8 @@ service FunctionService {
// And this header SHOULD NOT be specified:
//
// * `Authorization: Bearer YOUR_TOKEN`
- rpc GenerateUploadUrl(GenerateUploadUrlRequest) returns (GenerateUploadUrlResponse) {
+ rpc GenerateUploadUrl(GenerateUploadUrlRequest)
+ returns (GenerateUploadUrlResponse) {
option (google.api.http) = {
post: "/v2alpha/{parent=projects/*/locations/*}/functions:generateUploadUrl"
body: "*"
@@ -166,7 +176,8 @@ service FunctionService {
// 30 minutes of generation.
// For more information about the signed URL usage see:
// https://cloud.google.com/storage/docs/access-control/signed-urls
- rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) returns (GenerateDownloadUrlResponse) {
+ rpc GenerateDownloadUrl(GenerateDownloadUrlRequest)
+ returns (GenerateDownloadUrlResponse) {
option (google.api.http) = {
post: "/v2alpha/{name=projects/*/locations/*/functions/*}:generateDownloadUrl"
body: "*"
@@ -230,9 +241,6 @@ message Function {
// globally and match pattern `projects/*/locations/*/functions/*`
string name = 1;
- // Describe whether the function is gen1 or gen2.
- Environment environment = 10;
-
// User-provided description of a function.
string description = 2;
@@ -252,13 +260,30 @@ message Function {
State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The last update timestamp of a Cloud Function.
- google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
+ google.protobuf.Timestamp update_time = 7
+ [(google.api.field_behavior) = OUTPUT_ONLY];
// Labels associated with this Cloud Function.
map labels = 8;
// Output only. State Messages for this Cloud Function.
- repeated StateMessage state_messages = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
+ repeated StateMessage state_messages = 9
+ [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Describe whether the function is 1st Gen or 2nd Gen.
+ Environment environment = 10;
+
+ // Output only. The deployed url for the function.
+ string url = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // [Preview] Resource name of a KMS crypto key (managed by the user) used to
+ // encrypt/decrypt function resources.
+ //
+ // It must match the pattern
+ // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+ string kms_key_name = 25 [(google.api.resource_reference) = {
+ type: "cloudkms.googleapis.com/CryptoKey"
+ }];
}
// Informational messages about the state of the Cloud Function or Operation.
@@ -375,8 +400,25 @@ message SourceProvenance {
// Describes the Build step of the function that builds a container from the
// given source.
message BuildConfig {
- // Output only. The Cloud Build name of the latest successful deployment of the
- // function.
+ // Docker Registry to use for storing function Docker images.
+ enum DockerRegistry {
+ // Unspecified.
+ DOCKER_REGISTRY_UNSPECIFIED = 0;
+
+ // Docker images will be stored in multi-regional Container Registry
+ // repositories named `gcf`.
+ CONTAINER_REGISTRY = 1;
+
+ // Docker images will be stored in regional Artifact Registry repositories.
+ // By default, GCF will create and use repositories named `gcf-artifacts`
+ // in every region in which a function is deployed. But the repository to
+ // use can also be specified by the user using the `docker_repository`
+ // field.
+ ARTIFACT_REGISTRY = 2;
+ }
+
+ // Output only. The Cloud Build name of the latest successful deployment of
+ // the function.
string build = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = {
@@ -403,7 +445,8 @@ message BuildConfig {
Source source = 4;
// Output only. A permanent fixed identifier for source.
- SourceProvenance source_provenance = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
+ SourceProvenance source_provenance = 8
+ [(google.api.field_behavior) = OUTPUT_ONLY];
// Name of the Cloud Build Custom Worker Pool that should be used to build the
// function. The format of this field is
@@ -418,14 +461,24 @@ message BuildConfig {
// granted the role Cloud Build Custom Workers Builder
// (roles/cloudbuild.customworkers.builder) in the project.
string worker_pool = 5 [(google.api.resource_reference) = {
- type: "cloudbuild.googleapis.com/WorkerPool"
- }];
+ type: "cloudbuild.googleapis.com/WorkerPool"
+ }];
// User-provided build-time environment variables for the function
map environment_variables = 6;
- // Optional. User managed repository created in Artifact Registry optionally with a
- // customer managed encryption key. This is the repository to which the
+ // Docker Registry to use for this deployment. This configuration is only
+ // applicable to 1st Gen functions, 2nd Gen functions can only use Artifact
+ // Registry.
+ //
+ // If `docker_repository` field is specified, this field will be automatically
+ // set as `ARTIFACT_REGISTRY`.
+ // If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
+ // This field may be overridden by the backend for eligible deployments.
+ DockerRegistry docker_registry = 10;
+
+ // User managed repository created in Artifact Registry optionally
+ // with a customer managed encryption key. This is the repository to which the
// function docker image will be pushed after it is built by Cloud Build.
// If unspecified, GCF will create and use a repository named 'gcf-artifacts'
// for every deployed region.
@@ -436,12 +489,9 @@ message BuildConfig {
// Cross-project repositories are not supported.
// Cross-location repositories are not supported.
// Repository format must be 'DOCKER'.
- string docker_repository = 7 [
- (google.api.field_behavior) = OPTIONAL,
- (google.api.resource_reference) = {
- type: "artifactregistry.googleapis.com/Repository"
- }
- ];
+ string docker_repository = 7 [(google.api.resource_reference) = {
+ type: "artifactregistry.googleapis.com/Repository"
+ }];
}
// Describes the Service being deployed.
@@ -482,14 +532,33 @@ message ServiceConfig {
ALLOW_INTERNAL_AND_GCLB = 3;
}
+ // Available security level settings.
+ //
+ // This enforces security protocol on function URL.
+ //
+ // Security level is only configurable for 1st Gen functions, If unspecified,
+ // SECURE_OPTIONAL will be used. 2nd Gen functions are SECURE_ALWAYS ONLY.
+ enum SecurityLevel {
+ // Unspecified.
+ SECURITY_LEVEL_UNSPECIFIED = 0;
+
+ // Requests for a URL that match this handler that do not use HTTPS are
+ // automatically redirected to the HTTPS URL with the same path. Query
+ // parameters are reserved for the redirect.
+ SECURE_ALWAYS = 1;
+
+ // Both HTTP and HTTPS requests with URLs that match the handler succeed
+ // without redirects. The application can examine the request to determine
+ // which protocol was used and respond accordingly.
+ SECURE_OPTIONAL = 2;
+ }
+
// Output only. Name of the service associated with a Function.
// The format of this field is
// `projects/{project}/locations/{region}/services/{service}`
string service = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
- (google.api.resource_reference) = {
- type: "run.googleapis.com/Service"
- }
+ (google.api.resource_reference) = { type: "run.googleapis.com/Service" }
];
// The function execution timeout. Execution is considered failed and
@@ -505,6 +574,13 @@ message ServiceConfig {
// a full description.
string available_memory = 13;
+ // [Preview] The number of CPUs used in a single container instance.
+ // Default value is calculated from available memory.
+ // Supports the same values as Cloud Run, see
+ // https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements
+ // Example: "1" indicates 1 vCPU
+ string available_cpu = 22;
+
// Environment variables that shall be available during function execution.
map environment_variables = 4;
@@ -536,8 +612,8 @@ message ServiceConfig {
// The Serverless VPC Access connector that this cloud function can connect
// to. The format of this field is `projects/*/locations/*/connectors/*`.
string vpc_connector = 6 [(google.api.resource_reference) = {
- type: "vpcaccess.googleapis.com/Connector"
- }];
+ type: "vpcaccess.googleapis.com/Connector"
+ }];
// The egress settings for the connector, controlling what traffic is diverted
// through it.
@@ -569,6 +645,16 @@ message ServiceConfig {
// Output only. The name of service revision.
string revision = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // [Preview] Sets the maximum number of concurrent requests that each instance
+ // can receive. Defaults to 1.
+ int32 max_instance_request_concurrency = 20;
+
+ // Security level configure whether the function only accepts https.
+ // This configuration is only applicable to 1st Gen functions with Http
+ // trigger. By default https is optional for 1st Gen functions; 2nd Gen
+ // functions are https ONLY.
+ SecurityLevel security_level = 21;
}
// Configuration for a secret environment variable. It has the information
@@ -649,8 +735,8 @@ message EventTrigger {
RETRY_POLICY_RETRY = 2;
}
- // Output only. The resource name of the Eventarc trigger. The format of this field is
- // `projects/{project}/locations/{region}/triggers/{trigger}`.
+ // Output only. The resource name of the Eventarc trigger. The format of this
+ // field is `projects/{project}/locations/{region}/triggers/{trigger}`.
string trigger = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = {
@@ -681,19 +767,18 @@ message EventTrigger {
// will not be deleted at function deletion.
string pubsub_topic = 5 [
(google.api.field_behavior) = OPTIONAL,
- (google.api.resource_reference) = {
- type: "pubsub.googleapis.com/Topic"
- }
+ (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
];
- // Optional. The email of the trigger's service account. The service account must have
- // permission to invoke Cloud Run services, the permission is
+ // Optional. The email of the trigger's service account. The service account
+ // must have permission to invoke Cloud Run services, the permission is
// `run.routes.invoke`.
// If empty, defaults to the Compute Engine default service account:
// `{project_number}-compute@developer.gserviceaccount.com`.
string service_account_email = 6 [(google.api.field_behavior) = OPTIONAL];
- // Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+ // Optional. If unset, then defaults to ignoring failures (i.e. not retrying
+ // them).
RetryPolicy retry_policy = 7 [(google.api.field_behavior) = OPTIONAL];
// Optional. The name of the channel associated with the trigger in
@@ -735,12 +820,12 @@ message GetFunctionRequest {
// Request for the `ListFunctions` method.
message ListFunctionsRequest {
- // Required. The project and location from which the function should be listed,
- // specified in the format `projects/*/locations/*`
- // If you want to list functions in all locations, use "-" in place of a
- // location. When listing functions in all locations, if one or more
- // location(s) are unreachable, the response will contain functions from all
- // reachable locations along with the names of any unreachable locations.
+ // Required. The project and location from which the function should be
+ // listed, specified in the format `projects/*/locations/*` If you want to
+ // list functions in all locations, use "-" in place of a location. When
+ // listing functions in all locations, if one or more location(s) are
+ // unreachable, the response will contain functions from all reachable
+ // locations along with the names of any unreachable locations.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
@@ -748,7 +833,10 @@ message ListFunctionsRequest {
}
];
- // Maximum number of functions to return per call.
+ // Maximum number of functions to return per call. The largest allowed
+ // page_size is 1,000, if the page_size is omitted or specified as greater
+ // than 1,000 then it will be replaced as 1,000. The size of the list
+ // response can be less than specified when used with filters.
int32 page_size = 2;
// The value returned by the last
@@ -783,8 +871,8 @@ message ListFunctionsResponse {
// Request for the `CreateFunction` method.
message CreateFunctionRequest {
- // Required. The project and location in which the function should be created, specified
- // in the format `projects/*/locations/*`
+ // Required. The project and location in which the function should be created,
+ // specified in the format `projects/*/locations/*`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
@@ -827,14 +915,33 @@ message DeleteFunctionRequest {
// Request of `GenerateSourceUploadUrl` method.
message GenerateUploadUrlRequest {
- // Required. The project and location in which the Google Cloud Storage signed URL
- // should be generated, specified in the format `projects/*/locations/*`.
+ // Required. The project and location in which the Google Cloud Storage signed
+ // URL should be generated, specified in the format `projects/*/locations/*`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
+
+ // [Preview] Resource name of a KMS crypto key (managed by the user) used to
+ // encrypt/decrypt function source code objects in intermediate Cloud Storage
+ // buckets. When you generate an upload url and upload your source code, it
+ // gets copied to an intermediate Cloud Storage bucket. The source code is
+ // then copied to a versioned directory in the sources bucket in the consumer
+ // project during the function deployment.
+ //
+ // It must match the pattern
+ // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+ //
+ // The Google Cloud Functions service account
+ // (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+ // granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+ // (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+ // Key/KeyRing/Project/Organization (least access preferred).
+ string kms_key_name = 2 [(google.api.resource_reference) = {
+ type: "cloudkms.googleapis.com/CryptoKey"
+ }];
}
// Response of `GenerateSourceUploadUrl` method.
@@ -857,8 +964,8 @@ message GenerateUploadUrlResponse {
// Request of `GenerateDownloadUrl` method.
message GenerateDownloadUrlRequest {
- // Required. The name of function for which source code Google Cloud Storage signed
- // URL should be generated.
+ // Required. The name of function for which source code Google Cloud Storage
+ // signed URL should be generated.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
@@ -876,8 +983,8 @@ message GenerateDownloadUrlResponse {
// Request for the `ListRuntimes` method.
message ListRuntimesRequest {
- // Required. The project and location from which the runtimes should be listed,
- // specified in the format `projects/*/locations/*`
+ // Required. The project and location from which the runtimes should be
+ // listed, specified in the format `projects/*/locations/*`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
@@ -958,8 +1065,9 @@ message OperationMetadata {
// Identifies whether the user has requested cancellation
// of the operation. Operations that have successfully been cancelled
- // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
- // corresponding to `Code.CANCELLED`.
+ // have [Operation.error][] value with a
+ // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+ // `Code.CANCELLED`.
bool cancel_requested = 6;
// API version used to start the operation.
@@ -972,6 +1080,12 @@ message OperationMetadata {
repeated Stage stages = 9;
}
+// Extra GCF specific location information.
+message LocationMetadata {
+ // The Cloud Function environments this location supports.
+ repeated Environment environments = 1;
+}
+
// Each Stage of the deployment process
message Stage {
// Possible names for a Stage
diff --git a/packages/google-cloud-functions/protos/google/cloud/functions/v2beta/functions.proto b/packages/google-cloud-functions/protos/google/cloud/functions/v2beta/functions.proto
index 4d2284f31de..a8f89d5a4f4 100644
--- a/packages/google-cloud-functions/protos/google/cloud/functions/v2beta/functions.proto
+++ b/packages/google-cloud-functions/protos/google/cloud/functions/v2beta/functions.proto
@@ -1,4 +1,4 @@
-// Copyright 2022 Google LLC
+// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/any.proto";
+import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
@@ -62,6 +63,10 @@ option (google.api.resource_definition) = {
type: "pubsub.googleapis.com/Topic"
pattern: "projects/{project}/topics/{topic}"
};
+option (google.api.resource_definition) = {
+ type: "cloudkms.googleapis.com/CryptoKey"
+ pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
+};
// Google Cloud Functions is used to deploy functions that are executed by
// Google in response to various events. Data connected with that event is
@@ -71,7 +76,8 @@ option (google.api.resource_definition) = {
// executed and how it is triggered.
service FunctionService {
option (google.api.default_host) = "cloudfunctions.googleapis.com";
- option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
+ option (google.api.oauth_scopes) =
+ "https://www.googleapis.com/auth/cloud-platform";
// Returns a function with the given name from the requested project.
rpc GetFunction(GetFunctionRequest) returns (Function) {
@@ -92,7 +98,8 @@ service FunctionService {
// 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.
- rpc CreateFunction(CreateFunctionRequest) returns (google.longrunning.Operation) {
+ rpc CreateFunction(CreateFunctionRequest)
+ returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2beta/{parent=projects/*/locations/*}/functions"
body: "function"
@@ -105,7 +112,8 @@ service FunctionService {
}
// Updates existing function.
- rpc UpdateFunction(UpdateFunctionRequest) returns (google.longrunning.Operation) {
+ rpc UpdateFunction(UpdateFunctionRequest)
+ returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v2beta/{function.name=projects/*/locations/*/functions/*}"
body: "function"
@@ -120,7 +128,8 @@ service FunctionService {
// 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.
- rpc DeleteFunction(DeleteFunctionRequest) returns (google.longrunning.Operation) {
+ rpc DeleteFunction(DeleteFunctionRequest)
+ returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v2beta/{name=projects/*/locations/*/functions/*}"
};
@@ -154,7 +163,8 @@ service FunctionService {
// And this header SHOULD NOT be specified:
//
// * `Authorization: Bearer YOUR_TOKEN`
- rpc GenerateUploadUrl(GenerateUploadUrlRequest) returns (GenerateUploadUrlResponse) {
+ rpc GenerateUploadUrl(GenerateUploadUrlRequest)
+ returns (GenerateUploadUrlResponse) {
option (google.api.http) = {
post: "/v2beta/{parent=projects/*/locations/*}/functions:generateUploadUrl"
body: "*"
@@ -166,7 +176,8 @@ service FunctionService {
// 30 minutes of generation.
// For more information about the signed URL usage see:
// https://cloud.google.com/storage/docs/access-control/signed-urls
- rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) returns (GenerateDownloadUrlResponse) {
+ rpc GenerateDownloadUrl(GenerateDownloadUrlRequest)
+ returns (GenerateDownloadUrlResponse) {
option (google.api.http) = {
post: "/v2beta/{name=projects/*/locations/*/functions/*}:generateDownloadUrl"
body: "*"
@@ -230,9 +241,6 @@ message Function {
// globally and match pattern `projects/*/locations/*/functions/*`
string name = 1;
- // Describe whether the function is gen1 or gen2.
- Environment environment = 10;
-
// User-provided description of a function.
string description = 2;
@@ -252,13 +260,30 @@ message Function {
State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The last update timestamp of a Cloud Function.
- google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
+ google.protobuf.Timestamp update_time = 7
+ [(google.api.field_behavior) = OUTPUT_ONLY];
// Labels associated with this Cloud Function.
map labels = 8;
// Output only. State Messages for this Cloud Function.
- repeated StateMessage state_messages = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
+ repeated StateMessage state_messages = 9
+ [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Describe whether the function is 1st Gen or 2nd Gen.
+ Environment environment = 10;
+
+ // Output only. The deployed url for the function.
+ string url = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // [Preview] Resource name of a KMS crypto key (managed by the user) used to
+ // encrypt/decrypt function resources.
+ //
+ // It must match the pattern
+ // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+ string kms_key_name = 25 [(google.api.resource_reference) = {
+ type: "cloudkms.googleapis.com/CryptoKey"
+ }];
}
// Informational messages about the state of the Cloud Function or Operation.
@@ -375,8 +400,25 @@ message SourceProvenance {
// Describes the Build step of the function that builds a container from the
// given source.
message BuildConfig {
- // Output only. The Cloud Build name of the latest successful deployment of the
- // function.
+ // Docker Registry to use for storing function Docker images.
+ enum DockerRegistry {
+ // Unspecified.
+ DOCKER_REGISTRY_UNSPECIFIED = 0;
+
+ // Docker images will be stored in multi-regional Container Registry
+ // repositories named `gcf`.
+ CONTAINER_REGISTRY = 1;
+
+ // Docker images will be stored in regional Artifact Registry repositories.
+ // By default, GCF will create and use repositories named `gcf-artifacts`
+ // in every region in which a function is deployed. But the repository to
+ // use can also be specified by the user using the `docker_repository`
+ // field.
+ ARTIFACT_REGISTRY = 2;
+ }
+
+ // Output only. The Cloud Build name of the latest successful deployment of
+ // the function.
string build = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = {
@@ -403,7 +445,8 @@ message BuildConfig {
Source source = 4;
// Output only. A permanent fixed identifier for source.
- SourceProvenance source_provenance = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
+ SourceProvenance source_provenance = 8
+ [(google.api.field_behavior) = OUTPUT_ONLY];
// Name of the Cloud Build Custom Worker Pool that should be used to build the
// function. The format of this field is
@@ -418,14 +461,24 @@ message BuildConfig {
// granted the role Cloud Build Custom Workers Builder
// (roles/cloudbuild.customworkers.builder) in the project.
string worker_pool = 5 [(google.api.resource_reference) = {
- type: "cloudbuild.googleapis.com/WorkerPool"
- }];
+ type: "cloudbuild.googleapis.com/WorkerPool"
+ }];
// User-provided build-time environment variables for the function
map environment_variables = 6;
- // Optional. User managed repository created in Artifact Registry optionally with a
- // customer managed encryption key. This is the repository to which the
+ // Docker Registry to use for this deployment. This configuration is only
+ // applicable to 1st Gen functions, 2nd Gen functions can only use Artifact
+ // Registry.
+ //
+ // If `docker_repository` field is specified, this field will be automatically
+ // set as `ARTIFACT_REGISTRY`.
+ // If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
+ // This field may be overridden by the backend for eligible deployments.
+ DockerRegistry docker_registry = 10;
+
+ // User managed repository created in Artifact Registry optionally
+ // with a customer managed encryption key. This is the repository to which the
// function docker image will be pushed after it is built by Cloud Build.
// If unspecified, GCF will create and use a repository named 'gcf-artifacts'
// for every deployed region.
@@ -436,12 +489,9 @@ message BuildConfig {
// Cross-project repositories are not supported.
// Cross-location repositories are not supported.
// Repository format must be 'DOCKER'.
- string docker_repository = 7 [
- (google.api.field_behavior) = OPTIONAL,
- (google.api.resource_reference) = {
- type: "artifactregistry.googleapis.com/Repository"
- }
- ];
+ string docker_repository = 7 [(google.api.resource_reference) = {
+ type: "artifactregistry.googleapis.com/Repository"
+ }];
}
// Describes the Service being deployed.
@@ -482,14 +532,33 @@ message ServiceConfig {
ALLOW_INTERNAL_AND_GCLB = 3;
}
+ // Available security level settings.
+ //
+ // This enforces security protocol on function URL.
+ //
+ // Security level is only configurable for 1st Gen functions, If unspecified,
+ // SECURE_OPTIONAL will be used. 2nd Gen functions are SECURE_ALWAYS ONLY.
+ enum SecurityLevel {
+ // Unspecified.
+ SECURITY_LEVEL_UNSPECIFIED = 0;
+
+ // Requests for a URL that match this handler that do not use HTTPS are
+ // automatically redirected to the HTTPS URL with the same path. Query
+ // parameters are reserved for the redirect.
+ SECURE_ALWAYS = 1;
+
+ // Both HTTP and HTTPS requests with URLs that match the handler succeed
+ // without redirects. The application can examine the request to determine
+ // which protocol was used and respond accordingly.
+ SECURE_OPTIONAL = 2;
+ }
+
// Output only. Name of the service associated with a Function.
// The format of this field is
// `projects/{project}/locations/{region}/services/{service}`
string service = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
- (google.api.resource_reference) = {
- type: "run.googleapis.com/Service"
- }
+ (google.api.resource_reference) = { type: "run.googleapis.com/Service" }
];
// The function execution timeout. Execution is considered failed and
@@ -505,6 +574,13 @@ message ServiceConfig {
// a full description.
string available_memory = 13;
+ // [Preview] The number of CPUs used in a single container instance.
+ // Default value is calculated from available memory.
+ // Supports the same values as Cloud Run, see
+ // https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements
+ // Example: "1" indicates 1 vCPU
+ string available_cpu = 22;
+
// Environment variables that shall be available during function execution.
map environment_variables = 4;
@@ -536,8 +612,8 @@ message ServiceConfig {
// The Serverless VPC Access connector that this cloud function can connect
// to. The format of this field is `projects/*/locations/*/connectors/*`.
string vpc_connector = 6 [(google.api.resource_reference) = {
- type: "vpcaccess.googleapis.com/Connector"
- }];
+ type: "vpcaccess.googleapis.com/Connector"
+ }];
// The egress settings for the connector, controlling what traffic is diverted
// through it.
@@ -569,6 +645,16 @@ message ServiceConfig {
// Output only. The name of service revision.
string revision = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // [Preview] Sets the maximum number of concurrent requests that each instance
+ // can receive. Defaults to 1.
+ int32 max_instance_request_concurrency = 20;
+
+ // Security level configure whether the function only accepts https.
+ // This configuration is only applicable to 1st Gen functions with Http
+ // trigger. By default https is optional for 1st Gen functions; 2nd Gen
+ // functions are https ONLY.
+ SecurityLevel security_level = 21;
}
// Configuration for a secret environment variable. It has the information
@@ -649,8 +735,8 @@ message EventTrigger {
RETRY_POLICY_RETRY = 2;
}
- // Output only. The resource name of the Eventarc trigger. The format of this field is
- // `projects/{project}/locations/{region}/triggers/{trigger}`.
+ // Output only. The resource name of the Eventarc trigger. The format of this
+ // field is `projects/{project}/locations/{region}/triggers/{trigger}`.
string trigger = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = {
@@ -681,19 +767,18 @@ message EventTrigger {
// will not be deleted at function deletion.
string pubsub_topic = 5 [
(google.api.field_behavior) = OPTIONAL,
- (google.api.resource_reference) = {
- type: "pubsub.googleapis.com/Topic"
- }
+ (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
];
- // Optional. The email of the trigger's service account. The service account must have
- // permission to invoke Cloud Run services, the permission is
+ // Optional. The email of the trigger's service account. The service account
+ // must have permission to invoke Cloud Run services, the permission is
// `run.routes.invoke`.
// If empty, defaults to the Compute Engine default service account:
// `{project_number}-compute@developer.gserviceaccount.com`.
string service_account_email = 6 [(google.api.field_behavior) = OPTIONAL];
- // Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+ // Optional. If unset, then defaults to ignoring failures (i.e. not retrying
+ // them).
RetryPolicy retry_policy = 7 [(google.api.field_behavior) = OPTIONAL];
// Optional. The name of the channel associated with the trigger in
@@ -735,12 +820,12 @@ message GetFunctionRequest {
// Request for the `ListFunctions` method.
message ListFunctionsRequest {
- // Required. The project and location from which the function should be listed,
- // specified in the format `projects/*/locations/*`
- // If you want to list functions in all locations, use "-" in place of a
- // location. When listing functions in all locations, if one or more
- // location(s) are unreachable, the response will contain functions from all
- // reachable locations along with the names of any unreachable locations.
+ // Required. The project and location from which the function should be
+ // listed, specified in the format `projects/*/locations/*` If you want to
+ // list functions in all locations, use "-" in place of a location. When
+ // listing functions in all locations, if one or more location(s) are
+ // unreachable, the response will contain functions from all reachable
+ // locations along with the names of any unreachable locations.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
@@ -748,7 +833,10 @@ message ListFunctionsRequest {
}
];
- // Maximum number of functions to return per call.
+ // Maximum number of functions to return per call. The largest allowed
+ // page_size is 1,000, if the page_size is omitted or specified as greater
+ // than 1,000 then it will be replaced as 1,000. The size of the list
+ // response can be less than specified when used with filters.
int32 page_size = 2;
// The value returned by the last
@@ -783,8 +871,8 @@ message ListFunctionsResponse {
// Request for the `CreateFunction` method.
message CreateFunctionRequest {
- // Required. The project and location in which the function should be created, specified
- // in the format `projects/*/locations/*`
+ // Required. The project and location in which the function should be created,
+ // specified in the format `projects/*/locations/*`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
@@ -827,14 +915,33 @@ message DeleteFunctionRequest {
// Request of `GenerateSourceUploadUrl` method.
message GenerateUploadUrlRequest {
- // Required. The project and location in which the Google Cloud Storage signed URL
- // should be generated, specified in the format `projects/*/locations/*`.
+ // Required. The project and location in which the Google Cloud Storage signed
+ // URL should be generated, specified in the format `projects/*/locations/*`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
+
+ // [Preview] Resource name of a KMS crypto key (managed by the user) used to
+ // encrypt/decrypt function source code objects in intermediate Cloud Storage
+ // buckets. When you generate an upload url and upload your source code, it
+ // gets copied to an intermediate Cloud Storage bucket. The source code is
+ // then copied to a versioned directory in the sources bucket in the consumer
+ // project during the function deployment.
+ //
+ // It must match the pattern
+ // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+ //
+ // The Google Cloud Functions service account
+ // (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+ // granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+ // (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+ // Key/KeyRing/Project/Organization (least access preferred).
+ string kms_key_name = 2 [(google.api.resource_reference) = {
+ type: "cloudkms.googleapis.com/CryptoKey"
+ }];
}
// Response of `GenerateSourceUploadUrl` method.
@@ -857,8 +964,8 @@ message GenerateUploadUrlResponse {
// Request of `GenerateDownloadUrl` method.
message GenerateDownloadUrlRequest {
- // Required. The name of function for which source code Google Cloud Storage signed
- // URL should be generated.
+ // Required. The name of function for which source code Google Cloud Storage
+ // signed URL should be generated.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
@@ -876,8 +983,8 @@ message GenerateDownloadUrlResponse {
// Request for the `ListRuntimes` method.
message ListRuntimesRequest {
- // Required. The project and location from which the runtimes should be listed,
- // specified in the format `projects/*/locations/*`
+ // Required. The project and location from which the runtimes should be
+ // listed, specified in the format `projects/*/locations/*`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
@@ -958,8 +1065,9 @@ message OperationMetadata {
// Identifies whether the user has requested cancellation
// of the operation. Operations that have successfully been cancelled
- // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
- // corresponding to `Code.CANCELLED`.
+ // have [Operation.error][] value with a
+ // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+ // `Code.CANCELLED`.
bool cancel_requested = 6;
// API version used to start the operation.
@@ -972,6 +1080,12 @@ message OperationMetadata {
repeated Stage stages = 9;
}
+// Extra GCF specific location information.
+message LocationMetadata {
+ // The Cloud Function environments this location supports.
+ repeated Environment environments = 1;
+}
+
// Each Stage of the deployment process
message Stage {
// Possible names for a Stage
diff --git a/packages/google-cloud-functions/protos/protos.d.ts b/packages/google-cloud-functions/protos/protos.d.ts
index dc6a0c168ca..c871c7b9450 100644
--- a/packages/google-cloud-functions/protos/protos.d.ts
+++ b/packages/google-cloud-functions/protos/protos.d.ts
@@ -3058,9 +3058,6 @@ export namespace google {
/** Function name */
name?: (string|null);
- /** Function environment */
- environment?: (google.cloud.functions.v2.Environment|keyof typeof google.cloud.functions.v2.Environment|null);
-
/** Function description */
description?: (string|null);
@@ -3085,11 +3082,14 @@ export namespace google {
/** Function stateMessages */
stateMessages?: (google.cloud.functions.v2.IStateMessage[]|null);
- /** Function kmsKeyName */
- kmsKeyName?: (string|null);
+ /** Function environment */
+ environment?: (google.cloud.functions.v2.Environment|keyof typeof google.cloud.functions.v2.Environment|null);
/** Function url */
url?: (string|null);
+
+ /** Function kmsKeyName */
+ kmsKeyName?: (string|null);
}
/** Represents a Function. */
@@ -3104,9 +3104,6 @@ export namespace google {
/** Function name. */
public name: string;
- /** Function environment. */
- public environment: (google.cloud.functions.v2.Environment|keyof typeof google.cloud.functions.v2.Environment);
-
/** Function description. */
public description: string;
@@ -3131,12 +3128,15 @@ export namespace google {
/** Function stateMessages. */
public stateMessages: google.cloud.functions.v2.IStateMessage[];
- /** Function kmsKeyName. */
- public kmsKeyName: string;
+ /** Function environment. */
+ public environment: (google.cloud.functions.v2.Environment|keyof typeof google.cloud.functions.v2.Environment);
/** Function url. */
public url: string;
+ /** Function kmsKeyName. */
+ public kmsKeyName: string;
+
/**
* Creates a new Function instance using the specified properties.
* @param [properties] Properties to set
@@ -6291,6 +6291,103 @@ export namespace google {
public static getTypeUrl(typeUrlPrefix?: string): string;
}
+ /** Properties of a LocationMetadata. */
+ interface ILocationMetadata {
+
+ /** LocationMetadata environments */
+ environments?: (google.cloud.functions.v2.Environment[]|null);
+ }
+
+ /** Represents a LocationMetadata. */
+ class LocationMetadata implements ILocationMetadata {
+
+ /**
+ * Constructs a new LocationMetadata.
+ * @param [properties] Properties to set
+ */
+ constructor(properties?: google.cloud.functions.v2.ILocationMetadata);
+
+ /** LocationMetadata environments. */
+ public environments: google.cloud.functions.v2.Environment[];
+
+ /**
+ * Creates a new LocationMetadata instance using the specified properties.
+ * @param [properties] Properties to set
+ * @returns LocationMetadata instance
+ */
+ public static create(properties?: google.cloud.functions.v2.ILocationMetadata): google.cloud.functions.v2.LocationMetadata;
+
+ /**
+ * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.functions.v2.LocationMetadata.verify|verify} messages.
+ * @param message LocationMetadata message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encode(message: google.cloud.functions.v2.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.functions.v2.LocationMetadata.verify|verify} messages.
+ * @param message LocationMetadata message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encodeDelimited(message: google.cloud.functions.v2.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Decodes a LocationMetadata message from the specified reader or buffer.
+ * @param reader Reader or buffer to decode from
+ * @param [length] Message length if known beforehand
+ * @returns LocationMetadata
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.functions.v2.LocationMetadata;
+
+ /**
+ * Decodes a LocationMetadata message from the specified reader or buffer, length delimited.
+ * @param reader Reader or buffer to decode from
+ * @returns LocationMetadata
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.functions.v2.LocationMetadata;
+
+ /**
+ * Verifies a LocationMetadata message.
+ * @param message Plain object to verify
+ * @returns `null` if valid, otherwise the reason why it is not
+ */
+ public static verify(message: { [k: string]: any }): (string|null);
+
+ /**
+ * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types.
+ * @param object Plain object
+ * @returns LocationMetadata
+ */
+ public static fromObject(object: { [k: string]: any }): google.cloud.functions.v2.LocationMetadata;
+
+ /**
+ * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified.
+ * @param message LocationMetadata
+ * @param [options] Conversion options
+ * @returns Plain object
+ */
+ public static toObject(message: google.cloud.functions.v2.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
+
+ /**
+ * Converts this LocationMetadata to JSON.
+ * @returns JSON object
+ */
+ public toJSON(): { [k: string]: any };
+
+ /**
+ * Gets the default type url for LocationMetadata
+ * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
+ * @returns The default type url
+ */
+ public static getTypeUrl(typeUrlPrefix?: string): string;
+ }
+
/** Properties of a Stage. */
interface IStage {
@@ -6649,9 +6746,6 @@ export namespace google {
/** Function name */
name?: (string|null);
- /** Function environment */
- environment?: (google.cloud.functions.v2alpha.Environment|keyof typeof google.cloud.functions.v2alpha.Environment|null);
-
/** Function description */
description?: (string|null);
@@ -6675,6 +6769,15 @@ export namespace google {
/** Function stateMessages */
stateMessages?: (google.cloud.functions.v2alpha.IStateMessage[]|null);
+
+ /** Function environment */
+ environment?: (google.cloud.functions.v2alpha.Environment|keyof typeof google.cloud.functions.v2alpha.Environment|null);
+
+ /** Function url */
+ url?: (string|null);
+
+ /** Function kmsKeyName */
+ kmsKeyName?: (string|null);
}
/** Represents a Function. */
@@ -6689,9 +6792,6 @@ export namespace google {
/** Function name. */
public name: string;
- /** Function environment. */
- public environment: (google.cloud.functions.v2alpha.Environment|keyof typeof google.cloud.functions.v2alpha.Environment);
-
/** Function description. */
public description: string;
@@ -6716,6 +6816,15 @@ export namespace google {
/** Function stateMessages. */
public stateMessages: google.cloud.functions.v2alpha.IStateMessage[];
+ /** Function environment. */
+ public environment: (google.cloud.functions.v2alpha.Environment|keyof typeof google.cloud.functions.v2alpha.Environment);
+
+ /** Function url. */
+ public url: string;
+
+ /** Function kmsKeyName. */
+ public kmsKeyName: string;
+
/**
* Creates a new Function instance using the specified properties.
* @param [properties] Properties to set
@@ -7405,6 +7514,9 @@ export namespace google {
/** BuildConfig environmentVariables */
environmentVariables?: ({ [k: string]: string }|null);
+ /** BuildConfig dockerRegistry */
+ dockerRegistry?: (google.cloud.functions.v2alpha.BuildConfig.DockerRegistry|keyof typeof google.cloud.functions.v2alpha.BuildConfig.DockerRegistry|null);
+
/** BuildConfig dockerRepository */
dockerRepository?: (string|null);
}
@@ -7439,6 +7551,9 @@ export namespace google {
/** BuildConfig environmentVariables. */
public environmentVariables: { [k: string]: string };
+ /** BuildConfig dockerRegistry. */
+ public dockerRegistry: (google.cloud.functions.v2alpha.BuildConfig.DockerRegistry|keyof typeof google.cloud.functions.v2alpha.BuildConfig.DockerRegistry);
+
/** BuildConfig dockerRepository. */
public dockerRepository: string;
@@ -7520,6 +7635,16 @@ export namespace google {
public static getTypeUrl(typeUrlPrefix?: string): string;
}
+ namespace BuildConfig {
+
+ /** DockerRegistry enum. */
+ enum DockerRegistry {
+ DOCKER_REGISTRY_UNSPECIFIED = 0,
+ CONTAINER_REGISTRY = 1,
+ ARTIFACT_REGISTRY = 2
+ }
+ }
+
/** Properties of a ServiceConfig. */
interface IServiceConfig {
@@ -7532,6 +7657,9 @@ export namespace google {
/** ServiceConfig availableMemory */
availableMemory?: (string|null);
+ /** ServiceConfig availableCpu */
+ availableCpu?: (string|null);
+
/** ServiceConfig environmentVariables */
environmentVariables?: ({ [k: string]: string }|null);
@@ -7567,6 +7695,12 @@ export namespace google {
/** ServiceConfig revision */
revision?: (string|null);
+
+ /** ServiceConfig maxInstanceRequestConcurrency */
+ maxInstanceRequestConcurrency?: (number|null);
+
+ /** ServiceConfig securityLevel */
+ securityLevel?: (google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel|keyof typeof google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel|null);
}
/** Represents a ServiceConfig. */
@@ -7587,6 +7721,9 @@ export namespace google {
/** ServiceConfig availableMemory. */
public availableMemory: string;
+ /** ServiceConfig availableCpu. */
+ public availableCpu: string;
+
/** ServiceConfig environmentVariables. */
public environmentVariables: { [k: string]: string };
@@ -7623,6 +7760,12 @@ export namespace google {
/** ServiceConfig revision. */
public revision: string;
+ /** ServiceConfig maxInstanceRequestConcurrency. */
+ public maxInstanceRequestConcurrency: number;
+
+ /** ServiceConfig securityLevel. */
+ public securityLevel: (google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel|keyof typeof google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel);
+
/**
* Creates a new ServiceConfig instance using the specified properties.
* @param [properties] Properties to set
@@ -7717,6 +7860,13 @@ export namespace google {
ALLOW_INTERNAL_ONLY = 2,
ALLOW_INTERNAL_AND_GCLB = 3
}
+
+ /** SecurityLevel enum. */
+ enum SecurityLevel {
+ SECURITY_LEVEL_UNSPECIFIED = 0,
+ SECURE_ALWAYS = 1,
+ SECURE_OPTIONAL = 2
+ }
}
/** Properties of a SecretEnvVar. */
@@ -8954,6 +9104,9 @@ export namespace google {
/** GenerateUploadUrlRequest parent */
parent?: (string|null);
+
+ /** GenerateUploadUrlRequest kmsKeyName */
+ kmsKeyName?: (string|null);
}
/** Represents a GenerateUploadUrlRequest. */
@@ -8968,6 +9121,9 @@ export namespace google {
/** GenerateUploadUrlRequest parent. */
public parent: string;
+ /** GenerateUploadUrlRequest kmsKeyName. */
+ public kmsKeyName: string;
+
/**
* Creates a new GenerateUploadUrlRequest instance using the specified properties.
* @param [properties] Properties to set
@@ -9823,6 +9979,103 @@ export namespace google {
public static getTypeUrl(typeUrlPrefix?: string): string;
}
+ /** Properties of a LocationMetadata. */
+ interface ILocationMetadata {
+
+ /** LocationMetadata environments */
+ environments?: (google.cloud.functions.v2alpha.Environment[]|null);
+ }
+
+ /** Represents a LocationMetadata. */
+ class LocationMetadata implements ILocationMetadata {
+
+ /**
+ * Constructs a new LocationMetadata.
+ * @param [properties] Properties to set
+ */
+ constructor(properties?: google.cloud.functions.v2alpha.ILocationMetadata);
+
+ /** LocationMetadata environments. */
+ public environments: google.cloud.functions.v2alpha.Environment[];
+
+ /**
+ * Creates a new LocationMetadata instance using the specified properties.
+ * @param [properties] Properties to set
+ * @returns LocationMetadata instance
+ */
+ public static create(properties?: google.cloud.functions.v2alpha.ILocationMetadata): google.cloud.functions.v2alpha.LocationMetadata;
+
+ /**
+ * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.functions.v2alpha.LocationMetadata.verify|verify} messages.
+ * @param message LocationMetadata message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encode(message: google.cloud.functions.v2alpha.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.functions.v2alpha.LocationMetadata.verify|verify} messages.
+ * @param message LocationMetadata message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encodeDelimited(message: google.cloud.functions.v2alpha.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Decodes a LocationMetadata message from the specified reader or buffer.
+ * @param reader Reader or buffer to decode from
+ * @param [length] Message length if known beforehand
+ * @returns LocationMetadata
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.functions.v2alpha.LocationMetadata;
+
+ /**
+ * Decodes a LocationMetadata message from the specified reader or buffer, length delimited.
+ * @param reader Reader or buffer to decode from
+ * @returns LocationMetadata
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.functions.v2alpha.LocationMetadata;
+
+ /**
+ * Verifies a LocationMetadata message.
+ * @param message Plain object to verify
+ * @returns `null` if valid, otherwise the reason why it is not
+ */
+ public static verify(message: { [k: string]: any }): (string|null);
+
+ /**
+ * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types.
+ * @param object Plain object
+ * @returns LocationMetadata
+ */
+ public static fromObject(object: { [k: string]: any }): google.cloud.functions.v2alpha.LocationMetadata;
+
+ /**
+ * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified.
+ * @param message LocationMetadata
+ * @param [options] Conversion options
+ * @returns Plain object
+ */
+ public static toObject(message: google.cloud.functions.v2alpha.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
+
+ /**
+ * Converts this LocationMetadata to JSON.
+ * @returns JSON object
+ */
+ public toJSON(): { [k: string]: any };
+
+ /**
+ * Gets the default type url for LocationMetadata
+ * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
+ * @returns The default type url
+ */
+ public static getTypeUrl(typeUrlPrefix?: string): string;
+ }
+
/** Properties of a Stage. */
interface IStage {
@@ -10181,9 +10434,6 @@ export namespace google {
/** Function name */
name?: (string|null);
- /** Function environment */
- environment?: (google.cloud.functions.v2beta.Environment|keyof typeof google.cloud.functions.v2beta.Environment|null);
-
/** Function description */
description?: (string|null);
@@ -10207,6 +10457,15 @@ export namespace google {
/** Function stateMessages */
stateMessages?: (google.cloud.functions.v2beta.IStateMessage[]|null);
+
+ /** Function environment */
+ environment?: (google.cloud.functions.v2beta.Environment|keyof typeof google.cloud.functions.v2beta.Environment|null);
+
+ /** Function url */
+ url?: (string|null);
+
+ /** Function kmsKeyName */
+ kmsKeyName?: (string|null);
}
/** Represents a Function. */
@@ -10221,9 +10480,6 @@ export namespace google {
/** Function name. */
public name: string;
- /** Function environment. */
- public environment: (google.cloud.functions.v2beta.Environment|keyof typeof google.cloud.functions.v2beta.Environment);
-
/** Function description. */
public description: string;
@@ -10248,6 +10504,15 @@ export namespace google {
/** Function stateMessages. */
public stateMessages: google.cloud.functions.v2beta.IStateMessage[];
+ /** Function environment. */
+ public environment: (google.cloud.functions.v2beta.Environment|keyof typeof google.cloud.functions.v2beta.Environment);
+
+ /** Function url. */
+ public url: string;
+
+ /** Function kmsKeyName. */
+ public kmsKeyName: string;
+
/**
* Creates a new Function instance using the specified properties.
* @param [properties] Properties to set
@@ -10937,6 +11202,9 @@ export namespace google {
/** BuildConfig environmentVariables */
environmentVariables?: ({ [k: string]: string }|null);
+ /** BuildConfig dockerRegistry */
+ dockerRegistry?: (google.cloud.functions.v2beta.BuildConfig.DockerRegistry|keyof typeof google.cloud.functions.v2beta.BuildConfig.DockerRegistry|null);
+
/** BuildConfig dockerRepository */
dockerRepository?: (string|null);
}
@@ -10971,6 +11239,9 @@ export namespace google {
/** BuildConfig environmentVariables. */
public environmentVariables: { [k: string]: string };
+ /** BuildConfig dockerRegistry. */
+ public dockerRegistry: (google.cloud.functions.v2beta.BuildConfig.DockerRegistry|keyof typeof google.cloud.functions.v2beta.BuildConfig.DockerRegistry);
+
/** BuildConfig dockerRepository. */
public dockerRepository: string;
@@ -11052,6 +11323,16 @@ export namespace google {
public static getTypeUrl(typeUrlPrefix?: string): string;
}
+ namespace BuildConfig {
+
+ /** DockerRegistry enum. */
+ enum DockerRegistry {
+ DOCKER_REGISTRY_UNSPECIFIED = 0,
+ CONTAINER_REGISTRY = 1,
+ ARTIFACT_REGISTRY = 2
+ }
+ }
+
/** Properties of a ServiceConfig. */
interface IServiceConfig {
@@ -11064,6 +11345,9 @@ export namespace google {
/** ServiceConfig availableMemory */
availableMemory?: (string|null);
+ /** ServiceConfig availableCpu */
+ availableCpu?: (string|null);
+
/** ServiceConfig environmentVariables */
environmentVariables?: ({ [k: string]: string }|null);
@@ -11099,9 +11383,15 @@ export namespace google {
/** ServiceConfig revision */
revision?: (string|null);
- }
- /** Represents a ServiceConfig. */
+ /** ServiceConfig maxInstanceRequestConcurrency */
+ maxInstanceRequestConcurrency?: (number|null);
+
+ /** ServiceConfig securityLevel */
+ securityLevel?: (google.cloud.functions.v2beta.ServiceConfig.SecurityLevel|keyof typeof google.cloud.functions.v2beta.ServiceConfig.SecurityLevel|null);
+ }
+
+ /** Represents a ServiceConfig. */
class ServiceConfig implements IServiceConfig {
/**
@@ -11119,6 +11409,9 @@ export namespace google {
/** ServiceConfig availableMemory. */
public availableMemory: string;
+ /** ServiceConfig availableCpu. */
+ public availableCpu: string;
+
/** ServiceConfig environmentVariables. */
public environmentVariables: { [k: string]: string };
@@ -11155,6 +11448,12 @@ export namespace google {
/** ServiceConfig revision. */
public revision: string;
+ /** ServiceConfig maxInstanceRequestConcurrency. */
+ public maxInstanceRequestConcurrency: number;
+
+ /** ServiceConfig securityLevel. */
+ public securityLevel: (google.cloud.functions.v2beta.ServiceConfig.SecurityLevel|keyof typeof google.cloud.functions.v2beta.ServiceConfig.SecurityLevel);
+
/**
* Creates a new ServiceConfig instance using the specified properties.
* @param [properties] Properties to set
@@ -11249,6 +11548,13 @@ export namespace google {
ALLOW_INTERNAL_ONLY = 2,
ALLOW_INTERNAL_AND_GCLB = 3
}
+
+ /** SecurityLevel enum. */
+ enum SecurityLevel {
+ SECURITY_LEVEL_UNSPECIFIED = 0,
+ SECURE_ALWAYS = 1,
+ SECURE_OPTIONAL = 2
+ }
}
/** Properties of a SecretEnvVar. */
@@ -12486,6 +12792,9 @@ export namespace google {
/** GenerateUploadUrlRequest parent */
parent?: (string|null);
+
+ /** GenerateUploadUrlRequest kmsKeyName */
+ kmsKeyName?: (string|null);
}
/** Represents a GenerateUploadUrlRequest. */
@@ -12500,6 +12809,9 @@ export namespace google {
/** GenerateUploadUrlRequest parent. */
public parent: string;
+ /** GenerateUploadUrlRequest kmsKeyName. */
+ public kmsKeyName: string;
+
/**
* Creates a new GenerateUploadUrlRequest instance using the specified properties.
* @param [properties] Properties to set
@@ -13355,6 +13667,103 @@ export namespace google {
public static getTypeUrl(typeUrlPrefix?: string): string;
}
+ /** Properties of a LocationMetadata. */
+ interface ILocationMetadata {
+
+ /** LocationMetadata environments */
+ environments?: (google.cloud.functions.v2beta.Environment[]|null);
+ }
+
+ /** Represents a LocationMetadata. */
+ class LocationMetadata implements ILocationMetadata {
+
+ /**
+ * Constructs a new LocationMetadata.
+ * @param [properties] Properties to set
+ */
+ constructor(properties?: google.cloud.functions.v2beta.ILocationMetadata);
+
+ /** LocationMetadata environments. */
+ public environments: google.cloud.functions.v2beta.Environment[];
+
+ /**
+ * Creates a new LocationMetadata instance using the specified properties.
+ * @param [properties] Properties to set
+ * @returns LocationMetadata instance
+ */
+ public static create(properties?: google.cloud.functions.v2beta.ILocationMetadata): google.cloud.functions.v2beta.LocationMetadata;
+
+ /**
+ * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.functions.v2beta.LocationMetadata.verify|verify} messages.
+ * @param message LocationMetadata message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encode(message: google.cloud.functions.v2beta.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.functions.v2beta.LocationMetadata.verify|verify} messages.
+ * @param message LocationMetadata message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encodeDelimited(message: google.cloud.functions.v2beta.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Decodes a LocationMetadata message from the specified reader or buffer.
+ * @param reader Reader or buffer to decode from
+ * @param [length] Message length if known beforehand
+ * @returns LocationMetadata
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.functions.v2beta.LocationMetadata;
+
+ /**
+ * Decodes a LocationMetadata message from the specified reader or buffer, length delimited.
+ * @param reader Reader or buffer to decode from
+ * @returns LocationMetadata
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.functions.v2beta.LocationMetadata;
+
+ /**
+ * Verifies a LocationMetadata message.
+ * @param message Plain object to verify
+ * @returns `null` if valid, otherwise the reason why it is not
+ */
+ public static verify(message: { [k: string]: any }): (string|null);
+
+ /**
+ * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types.
+ * @param object Plain object
+ * @returns LocationMetadata
+ */
+ public static fromObject(object: { [k: string]: any }): google.cloud.functions.v2beta.LocationMetadata;
+
+ /**
+ * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified.
+ * @param message LocationMetadata
+ * @param [options] Conversion options
+ * @returns Plain object
+ */
+ public static toObject(message: google.cloud.functions.v2beta.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
+
+ /**
+ * Converts this LocationMetadata to JSON.
+ * @returns JSON object
+ */
+ public toJSON(): { [k: string]: any };
+
+ /**
+ * Gets the default type url for LocationMetadata
+ * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
+ * @returns The default type url
+ */
+ public static getTypeUrl(typeUrlPrefix?: string): string;
+ }
+
/** Properties of a Stage. */
interface IStage {
@@ -17484,200 +17893,303 @@ export namespace google {
}
}
- /** Properties of a FieldMask. */
- interface IFieldMask {
+ /** Properties of an Any. */
+ interface IAny {
- /** FieldMask paths */
- paths?: (string[]|null);
+ /** Any type_url */
+ type_url?: (string|null);
+
+ /** Any value */
+ value?: (Uint8Array|string|null);
}
- /** Represents a FieldMask. */
- class FieldMask implements IFieldMask {
+ /** Represents an Any. */
+ class Any implements IAny {
/**
- * Constructs a new FieldMask.
+ * Constructs a new Any.
* @param [properties] Properties to set
*/
- constructor(properties?: google.protobuf.IFieldMask);
+ constructor(properties?: google.protobuf.IAny);
- /** FieldMask paths. */
- public paths: string[];
+ /** Any type_url. */
+ public type_url: string;
+
+ /** Any value. */
+ public value: (Uint8Array|string);
/**
- * Creates a new FieldMask instance using the specified properties.
+ * Creates a new Any instance using the specified properties.
* @param [properties] Properties to set
- * @returns FieldMask instance
+ * @returns Any instance
*/
- public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask;
+ public static create(properties?: google.protobuf.IAny): google.protobuf.Any;
/**
- * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
- * @param message FieldMask message or plain object to encode
+ * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.
+ * @param message Any message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
- public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer;
+ public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer;
/**
- * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
- * @param message FieldMask message or plain object to encode
+ * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.
+ * @param message Any message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
- public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer;
+ public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer;
/**
- * Decodes a FieldMask message from the specified reader or buffer.
+ * Decodes an Any message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
- * @returns FieldMask
+ * @returns Any
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask;
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any;
/**
- * Decodes a FieldMask message from the specified reader or buffer, length delimited.
+ * Decodes an Any message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
- * @returns FieldMask
+ * @returns Any
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask;
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any;
/**
- * Verifies a FieldMask message.
+ * Verifies an Any message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
- * Creates a FieldMask message from a plain object. Also converts values to their respective internal types.
+ * Creates an Any message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
- * @returns FieldMask
+ * @returns Any
*/
- public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask;
+ public static fromObject(object: { [k: string]: any }): google.protobuf.Any;
/**
- * Creates a plain object from a FieldMask message. Also converts values to other types if specified.
- * @param message FieldMask
+ * Creates a plain object from an Any message. Also converts values to other types if specified.
+ * @param message Any
* @param [options] Conversion options
* @returns Plain object
*/
- public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any };
+ public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
- * Converts this FieldMask to JSON.
+ * Converts this Any to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
- * Gets the default type url for FieldMask
+ * Gets the default type url for Any
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
- /** Properties of an Any. */
- interface IAny {
+ /** Properties of a Timestamp. */
+ interface ITimestamp {
- /** Any type_url */
- type_url?: (string|null);
+ /** Timestamp seconds */
+ seconds?: (number|Long|string|null);
- /** Any value */
- value?: (Uint8Array|string|null);
+ /** Timestamp nanos */
+ nanos?: (number|null);
}
- /** Represents an Any. */
- class Any implements IAny {
+ /** Represents a Timestamp. */
+ class Timestamp implements ITimestamp {
/**
- * Constructs a new Any.
+ * Constructs a new Timestamp.
* @param [properties] Properties to set
*/
- constructor(properties?: google.protobuf.IAny);
+ constructor(properties?: google.protobuf.ITimestamp);
- /** Any type_url. */
- public type_url: string;
+ /** Timestamp seconds. */
+ public seconds: (number|Long|string);
- /** Any value. */
- public value: (Uint8Array|string);
+ /** Timestamp nanos. */
+ public nanos: number;
/**
- * Creates a new Any instance using the specified properties.
+ * Creates a new Timestamp instance using the specified properties.
* @param [properties] Properties to set
- * @returns Any instance
+ * @returns Timestamp instance
*/
- public static create(properties?: google.protobuf.IAny): google.protobuf.Any;
+ public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp;
/**
- * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.
- * @param message Any message or plain object to encode
+ * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
+ * @param message Timestamp message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
- public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer;
+ public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer;
/**
- * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.
- * @param message Any message or plain object to encode
+ * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
+ * @param message Timestamp message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
- public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer;
+ public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer;
/**
- * Decodes an Any message from the specified reader or buffer.
+ * Decodes a Timestamp message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
- * @returns Any
+ * @returns Timestamp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any;
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp;
/**
- * Decodes an Any message from the specified reader or buffer, length delimited.
+ * Decodes a Timestamp message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
- * @returns Any
+ * @returns Timestamp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any;
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp;
/**
- * Verifies an Any message.
+ * Verifies a Timestamp message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
- * Creates an Any message from a plain object. Also converts values to their respective internal types.
+ * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
- * @returns Any
+ * @returns Timestamp
*/
- public static fromObject(object: { [k: string]: any }): google.protobuf.Any;
+ public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp;
/**
- * Creates a plain object from an Any message. Also converts values to other types if specified.
- * @param message Any
+ * Creates a plain object from a Timestamp message. Also converts values to other types if specified.
+ * @param message Timestamp
* @param [options] Conversion options
* @returns Plain object
*/
- public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any };
+ public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
- * Converts this Any to JSON.
+ * Converts this Timestamp to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
- * Gets the default type url for Any
+ * Gets the default type url for Timestamp
+ * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
+ * @returns The default type url
+ */
+ public static getTypeUrl(typeUrlPrefix?: string): string;
+ }
+
+ /** Properties of a FieldMask. */
+ interface IFieldMask {
+
+ /** FieldMask paths */
+ paths?: (string[]|null);
+ }
+
+ /** Represents a FieldMask. */
+ class FieldMask implements IFieldMask {
+
+ /**
+ * Constructs a new FieldMask.
+ * @param [properties] Properties to set
+ */
+ constructor(properties?: google.protobuf.IFieldMask);
+
+ /** FieldMask paths. */
+ public paths: string[];
+
+ /**
+ * Creates a new FieldMask instance using the specified properties.
+ * @param [properties] Properties to set
+ * @returns FieldMask instance
+ */
+ public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask;
+
+ /**
+ * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
+ * @param message FieldMask message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
+ * @param message FieldMask message or plain object to encode
+ * @param [writer] Writer to encode to
+ * @returns Writer
+ */
+ public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer;
+
+ /**
+ * Decodes a FieldMask message from the specified reader or buffer.
+ * @param reader Reader or buffer to decode from
+ * @param [length] Message length if known beforehand
+ * @returns FieldMask
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask;
+
+ /**
+ * Decodes a FieldMask message from the specified reader or buffer, length delimited.
+ * @param reader Reader or buffer to decode from
+ * @returns FieldMask
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask;
+
+ /**
+ * Verifies a FieldMask message.
+ * @param message Plain object to verify
+ * @returns `null` if valid, otherwise the reason why it is not
+ */
+ public static verify(message: { [k: string]: any }): (string|null);
+
+ /**
+ * Creates a FieldMask message from a plain object. Also converts values to their respective internal types.
+ * @param object Plain object
+ * @returns FieldMask
+ */
+ public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask;
+
+ /**
+ * Creates a plain object from a FieldMask message. Also converts values to other types if specified.
+ * @param message FieldMask
+ * @param [options] Conversion options
+ * @returns Plain object
+ */
+ public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any };
+
+ /**
+ * Converts this FieldMask to JSON.
+ * @returns JSON object
+ */
+ public toJSON(): { [k: string]: any };
+
+ /**
+ * Gets the default type url for FieldMask
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
@@ -17877,109 +18389,6 @@ export namespace google {
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
-
- /** Properties of a Timestamp. */
- interface ITimestamp {
-
- /** Timestamp seconds */
- seconds?: (number|Long|string|null);
-
- /** Timestamp nanos */
- nanos?: (number|null);
- }
-
- /** Represents a Timestamp. */
- class Timestamp implements ITimestamp {
-
- /**
- * Constructs a new Timestamp.
- * @param [properties] Properties to set
- */
- constructor(properties?: google.protobuf.ITimestamp);
-
- /** Timestamp seconds. */
- public seconds: (number|Long|string);
-
- /** Timestamp nanos. */
- public nanos: number;
-
- /**
- * Creates a new Timestamp instance using the specified properties.
- * @param [properties] Properties to set
- * @returns Timestamp instance
- */
- public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp;
-
- /**
- * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
- * @param message Timestamp message or plain object to encode
- * @param [writer] Writer to encode to
- * @returns Writer
- */
- public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer;
-
- /**
- * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
- * @param message Timestamp message or plain object to encode
- * @param [writer] Writer to encode to
- * @returns Writer
- */
- public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer;
-
- /**
- * Decodes a Timestamp message from the specified reader or buffer.
- * @param reader Reader or buffer to decode from
- * @param [length] Message length if known beforehand
- * @returns Timestamp
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp;
-
- /**
- * Decodes a Timestamp message from the specified reader or buffer, length delimited.
- * @param reader Reader or buffer to decode from
- * @returns Timestamp
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp;
-
- /**
- * Verifies a Timestamp message.
- * @param message Plain object to verify
- * @returns `null` if valid, otherwise the reason why it is not
- */
- public static verify(message: { [k: string]: any }): (string|null);
-
- /**
- * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
- * @param object Plain object
- * @returns Timestamp
- */
- public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp;
-
- /**
- * Creates a plain object from a Timestamp message. Also converts values to other types if specified.
- * @param message Timestamp
- * @param [options] Conversion options
- * @returns Plain object
- */
- public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any };
-
- /**
- * Converts this Timestamp to JSON.
- * @returns JSON object
- */
- public toJSON(): { [k: string]: any };
-
- /**
- * Gets the default type url for Timestamp
- * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
- * @returns The default type url
- */
- public static getTypeUrl(typeUrlPrefix?: string): string;
- }
}
/** Namespace iam. */
diff --git a/packages/google-cloud-functions/protos/protos.js b/packages/google-cloud-functions/protos/protos.js
index 49abe9fc5ba..e5a4b8fbf5b 100644
--- a/packages/google-cloud-functions/protos/protos.js
+++ b/packages/google-cloud-functions/protos/protos.js
@@ -7338,7 +7338,6 @@
* @memberof google.cloud.functions.v2
* @interface IFunction
* @property {string|null} [name] Function name
- * @property {google.cloud.functions.v2.Environment|null} [environment] Function environment
* @property {string|null} [description] Function description
* @property {google.cloud.functions.v2.IBuildConfig|null} [buildConfig] Function buildConfig
* @property {google.cloud.functions.v2.IServiceConfig|null} [serviceConfig] Function serviceConfig
@@ -7347,8 +7346,9 @@
* @property {google.protobuf.ITimestamp|null} [updateTime] Function updateTime
* @property {Object.|null} [labels] Function labels
* @property {Array.|null} [stateMessages] Function stateMessages
- * @property {string|null} [kmsKeyName] Function kmsKeyName
+ * @property {google.cloud.functions.v2.Environment|null} [environment] Function environment
* @property {string|null} [url] Function url
+ * @property {string|null} [kmsKeyName] Function kmsKeyName
*/
/**
@@ -7376,14 +7376,6 @@
*/
Function.prototype.name = "";
- /**
- * Function environment.
- * @member {google.cloud.functions.v2.Environment} environment
- * @memberof google.cloud.functions.v2.Function
- * @instance
- */
- Function.prototype.environment = 0;
-
/**
* Function description.
* @member {string} description
@@ -7449,12 +7441,12 @@
Function.prototype.stateMessages = $util.emptyArray;
/**
- * Function kmsKeyName.
- * @member {string} kmsKeyName
+ * Function environment.
+ * @member {google.cloud.functions.v2.Environment} environment
* @memberof google.cloud.functions.v2.Function
* @instance
*/
- Function.prototype.kmsKeyName = "";
+ Function.prototype.environment = 0;
/**
* Function url.
@@ -7464,6 +7456,14 @@
*/
Function.prototype.url = "";
+ /**
+ * Function kmsKeyName.
+ * @member {string} kmsKeyName
+ * @memberof google.cloud.functions.v2.Function
+ * @instance
+ */
+ Function.prototype.kmsKeyName = "";
+
/**
* Creates a new Function instance using the specified properties.
* @function create
@@ -7552,10 +7552,6 @@
message.name = reader.string();
break;
}
- case 10: {
- message.environment = reader.int32();
- break;
- }
case 2: {
message.description = reader.string();
break;
@@ -7609,14 +7605,18 @@
message.stateMessages.push($root.google.cloud.functions.v2.StateMessage.decode(reader, reader.uint32()));
break;
}
- case 25: {
- message.kmsKeyName = reader.string();
+ case 10: {
+ message.environment = reader.int32();
break;
}
case 14: {
message.url = reader.string();
break;
}
+ case 25: {
+ message.kmsKeyName = reader.string();
+ break;
+ }
default:
reader.skipType(tag & 7);
break;
@@ -7655,15 +7655,6 @@
if (message.name != null && message.hasOwnProperty("name"))
if (!$util.isString(message.name))
return "name: string expected";
- if (message.environment != null && message.hasOwnProperty("environment"))
- switch (message.environment) {
- default:
- return "environment: enum value expected";
- case 0:
- case 1:
- case 2:
- break;
- }
if (message.description != null && message.hasOwnProperty("description"))
if (!$util.isString(message.description))
return "description: string expected";
@@ -7716,12 +7707,21 @@
return "stateMessages." + error;
}
}
- if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName"))
- if (!$util.isString(message.kmsKeyName))
- return "kmsKeyName: string expected";
+ if (message.environment != null && message.hasOwnProperty("environment"))
+ switch (message.environment) {
+ default:
+ return "environment: enum value expected";
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
if (message.url != null && message.hasOwnProperty("url"))
if (!$util.isString(message.url))
return "url: string expected";
+ if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName"))
+ if (!$util.isString(message.kmsKeyName))
+ return "kmsKeyName: string expected";
return null;
};
@@ -7739,26 +7739,6 @@
var message = new $root.google.cloud.functions.v2.Function();
if (object.name != null)
message.name = String(object.name);
- switch (object.environment) {
- default:
- if (typeof object.environment === "number") {
- message.environment = object.environment;
- break;
- }
- break;
- case "ENVIRONMENT_UNSPECIFIED":
- case 0:
- message.environment = 0;
- break;
- case "GEN_1":
- case 1:
- message.environment = 1;
- break;
- case "GEN_2":
- case 2:
- message.environment = 2;
- break;
- }
if (object.description != null)
message.description = String(object.description);
if (object.buildConfig != null) {
@@ -7830,10 +7810,30 @@
message.stateMessages[i] = $root.google.cloud.functions.v2.StateMessage.fromObject(object.stateMessages[i]);
}
}
- if (object.kmsKeyName != null)
- message.kmsKeyName = String(object.kmsKeyName);
+ switch (object.environment) {
+ default:
+ if (typeof object.environment === "number") {
+ message.environment = object.environment;
+ break;
+ }
+ break;
+ case "ENVIRONMENT_UNSPECIFIED":
+ case 0:
+ message.environment = 0;
+ break;
+ case "GEN_1":
+ case 1:
+ message.environment = 1;
+ break;
+ case "GEN_2":
+ case 2:
+ message.environment = 2;
+ break;
+ }
if (object.url != null)
message.url = String(object.url);
+ if (object.kmsKeyName != null)
+ message.kmsKeyName = String(object.kmsKeyName);
return message;
};
@@ -15760,6 +15760,257 @@
return OperationMetadata;
})();
+ v2.LocationMetadata = (function() {
+
+ /**
+ * Properties of a LocationMetadata.
+ * @memberof google.cloud.functions.v2
+ * @interface ILocationMetadata
+ * @property {Array.|null} [environments] LocationMetadata environments
+ */
+
+ /**
+ * Constructs a new LocationMetadata.
+ * @memberof google.cloud.functions.v2
+ * @classdesc Represents a LocationMetadata.
+ * @implements ILocationMetadata
+ * @constructor
+ * @param {google.cloud.functions.v2.ILocationMetadata=} [properties] Properties to set
+ */
+ function LocationMetadata(properties) {
+ this.environments = [];
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * LocationMetadata environments.
+ * @member {Array.} environments
+ * @memberof google.cloud.functions.v2.LocationMetadata
+ * @instance
+ */
+ LocationMetadata.prototype.environments = $util.emptyArray;
+
+ /**
+ * Creates a new LocationMetadata instance using the specified properties.
+ * @function create
+ * @memberof google.cloud.functions.v2.LocationMetadata
+ * @static
+ * @param {google.cloud.functions.v2.ILocationMetadata=} [properties] Properties to set
+ * @returns {google.cloud.functions.v2.LocationMetadata} LocationMetadata instance
+ */
+ LocationMetadata.create = function create(properties) {
+ return new LocationMetadata(properties);
+ };
+
+ /**
+ * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.functions.v2.LocationMetadata.verify|verify} messages.
+ * @function encode
+ * @memberof google.cloud.functions.v2.LocationMetadata
+ * @static
+ * @param {google.cloud.functions.v2.ILocationMetadata} message LocationMetadata message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ LocationMetadata.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.environments != null && message.environments.length) {
+ writer.uint32(/* id 1, wireType 2 =*/10).fork();
+ for (var i = 0; i < message.environments.length; ++i)
+ writer.int32(message.environments[i]);
+ writer.ldelim();
+ }
+ return writer;
+ };
+
+ /**
+ * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.functions.v2.LocationMetadata.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof google.cloud.functions.v2.LocationMetadata
+ * @static
+ * @param {google.cloud.functions.v2.ILocationMetadata} message LocationMetadata message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a LocationMetadata message from the specified reader or buffer.
+ * @function decode
+ * @memberof google.cloud.functions.v2.LocationMetadata
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {google.cloud.functions.v2.LocationMetadata} LocationMetadata
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ LocationMetadata.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.functions.v2.LocationMetadata();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1: {
+ if (!(message.environments && message.environments.length))
+ message.environments = [];
+ if ((tag & 7) === 2) {
+ var end2 = reader.uint32() + reader.pos;
+ while (reader.pos < end2)
+ message.environments.push(reader.int32());
+ } else
+ message.environments.push(reader.int32());
+ break;
+ }
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a LocationMetadata message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof google.cloud.functions.v2.LocationMetadata
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {google.cloud.functions.v2.LocationMetadata} LocationMetadata
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ LocationMetadata.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a LocationMetadata message.
+ * @function verify
+ * @memberof google.cloud.functions.v2.LocationMetadata
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ LocationMetadata.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.environments != null && message.hasOwnProperty("environments")) {
+ if (!Array.isArray(message.environments))
+ return "environments: array expected";
+ for (var i = 0; i < message.environments.length; ++i)
+ switch (message.environments[i]) {
+ default:
+ return "environments: enum value[] expected";
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
+ }
+ return null;
+ };
+
+ /**
+ * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof google.cloud.functions.v2.LocationMetadata
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {google.cloud.functions.v2.LocationMetadata} LocationMetadata
+ */
+ LocationMetadata.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.cloud.functions.v2.LocationMetadata)
+ return object;
+ var message = new $root.google.cloud.functions.v2.LocationMetadata();
+ if (object.environments) {
+ if (!Array.isArray(object.environments))
+ throw TypeError(".google.cloud.functions.v2.LocationMetadata.environments: array expected");
+ message.environments = [];
+ for (var i = 0; i < object.environments.length; ++i)
+ switch (object.environments[i]) {
+ default:
+ if (typeof object.environments[i] === "number") {
+ message.environments[i] = object.environments[i];
+ break;
+ }
+ case "ENVIRONMENT_UNSPECIFIED":
+ case 0:
+ message.environments[i] = 0;
+ break;
+ case "GEN_1":
+ case 1:
+ message.environments[i] = 1;
+ break;
+ case "GEN_2":
+ case 2:
+ message.environments[i] = 2;
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof google.cloud.functions.v2.LocationMetadata
+ * @static
+ * @param {google.cloud.functions.v2.LocationMetadata} message LocationMetadata
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ LocationMetadata.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.arrays || options.defaults)
+ object.environments = [];
+ if (message.environments && message.environments.length) {
+ object.environments = [];
+ for (var j = 0; j < message.environments.length; ++j)
+ object.environments[j] = options.enums === String ? $root.google.cloud.functions.v2.Environment[message.environments[j]] === undefined ? message.environments[j] : $root.google.cloud.functions.v2.Environment[message.environments[j]] : message.environments[j];
+ }
+ return object;
+ };
+
+ /**
+ * Converts this LocationMetadata to JSON.
+ * @function toJSON
+ * @memberof google.cloud.functions.v2.LocationMetadata
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ LocationMetadata.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ /**
+ * Gets the default type url for LocationMetadata
+ * @function getTypeUrl
+ * @memberof google.cloud.functions.v2.LocationMetadata
+ * @static
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
+ * @returns {string} The default type url
+ */
+ LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
+ if (typeUrlPrefix === undefined) {
+ typeUrlPrefix = "type.googleapis.com";
+ }
+ return typeUrlPrefix + "/google.cloud.functions.v2.LocationMetadata";
+ };
+
+ return LocationMetadata;
+ })();
+
v2.Stage = (function() {
/**
@@ -16550,7 +16801,6 @@
* @memberof google.cloud.functions.v2alpha
* @interface IFunction
* @property {string|null} [name] Function name
- * @property {google.cloud.functions.v2alpha.Environment|null} [environment] Function environment
* @property {string|null} [description] Function description
* @property {google.cloud.functions.v2alpha.IBuildConfig|null} [buildConfig] Function buildConfig
* @property {google.cloud.functions.v2alpha.IServiceConfig|null} [serviceConfig] Function serviceConfig
@@ -16559,6 +16809,9 @@
* @property {google.protobuf.ITimestamp|null} [updateTime] Function updateTime
* @property {Object.|null} [labels] Function labels
* @property {Array.|null} [stateMessages] Function stateMessages
+ * @property {google.cloud.functions.v2alpha.Environment|null} [environment] Function environment
+ * @property {string|null} [url] Function url
+ * @property {string|null} [kmsKeyName] Function kmsKeyName
*/
/**
@@ -16586,14 +16839,6 @@
*/
Function.prototype.name = "";
- /**
- * Function environment.
- * @member {google.cloud.functions.v2alpha.Environment} environment
- * @memberof google.cloud.functions.v2alpha.Function
- * @instance
- */
- Function.prototype.environment = 0;
-
/**
* Function description.
* @member {string} description
@@ -16658,6 +16903,30 @@
*/
Function.prototype.stateMessages = $util.emptyArray;
+ /**
+ * Function environment.
+ * @member {google.cloud.functions.v2alpha.Environment} environment
+ * @memberof google.cloud.functions.v2alpha.Function
+ * @instance
+ */
+ Function.prototype.environment = 0;
+
+ /**
+ * Function url.
+ * @member {string} url
+ * @memberof google.cloud.functions.v2alpha.Function
+ * @instance
+ */
+ Function.prototype.url = "";
+
+ /**
+ * Function kmsKeyName.
+ * @member {string} kmsKeyName
+ * @memberof google.cloud.functions.v2alpha.Function
+ * @instance
+ */
+ Function.prototype.kmsKeyName = "";
+
/**
* Creates a new Function instance using the specified properties.
* @function create
@@ -16704,6 +16973,10 @@
$root.google.cloud.functions.v2alpha.StateMessage.encode(message.stateMessages[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
if (message.environment != null && Object.hasOwnProperty.call(message, "environment"))
writer.uint32(/* id 10, wireType 0 =*/80).int32(message.environment);
+ if (message.url != null && Object.hasOwnProperty.call(message, "url"))
+ writer.uint32(/* id 14, wireType 2 =*/114).string(message.url);
+ if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName"))
+ writer.uint32(/* id 25, wireType 2 =*/202).string(message.kmsKeyName);
return writer;
};
@@ -16742,10 +17015,6 @@
message.name = reader.string();
break;
}
- case 10: {
- message.environment = reader.int32();
- break;
- }
case 2: {
message.description = reader.string();
break;
@@ -16799,6 +17068,18 @@
message.stateMessages.push($root.google.cloud.functions.v2alpha.StateMessage.decode(reader, reader.uint32()));
break;
}
+ case 10: {
+ message.environment = reader.int32();
+ break;
+ }
+ case 14: {
+ message.url = reader.string();
+ break;
+ }
+ case 25: {
+ message.kmsKeyName = reader.string();
+ break;
+ }
default:
reader.skipType(tag & 7);
break;
@@ -16837,15 +17118,6 @@
if (message.name != null && message.hasOwnProperty("name"))
if (!$util.isString(message.name))
return "name: string expected";
- if (message.environment != null && message.hasOwnProperty("environment"))
- switch (message.environment) {
- default:
- return "environment: enum value expected";
- case 0:
- case 1:
- case 2:
- break;
- }
if (message.description != null && message.hasOwnProperty("description"))
if (!$util.isString(message.description))
return "description: string expected";
@@ -16898,6 +17170,21 @@
return "stateMessages." + error;
}
}
+ if (message.environment != null && message.hasOwnProperty("environment"))
+ switch (message.environment) {
+ default:
+ return "environment: enum value expected";
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
+ if (message.url != null && message.hasOwnProperty("url"))
+ if (!$util.isString(message.url))
+ return "url: string expected";
+ if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName"))
+ if (!$util.isString(message.kmsKeyName))
+ return "kmsKeyName: string expected";
return null;
};
@@ -16915,26 +17202,6 @@
var message = new $root.google.cloud.functions.v2alpha.Function();
if (object.name != null)
message.name = String(object.name);
- switch (object.environment) {
- default:
- if (typeof object.environment === "number") {
- message.environment = object.environment;
- break;
- }
- break;
- case "ENVIRONMENT_UNSPECIFIED":
- case 0:
- message.environment = 0;
- break;
- case "GEN_1":
- case 1:
- message.environment = 1;
- break;
- case "GEN_2":
- case 2:
- message.environment = 2;
- break;
- }
if (object.description != null)
message.description = String(object.description);
if (object.buildConfig != null) {
@@ -17006,6 +17273,30 @@
message.stateMessages[i] = $root.google.cloud.functions.v2alpha.StateMessage.fromObject(object.stateMessages[i]);
}
}
+ switch (object.environment) {
+ default:
+ if (typeof object.environment === "number") {
+ message.environment = object.environment;
+ break;
+ }
+ break;
+ case "ENVIRONMENT_UNSPECIFIED":
+ case 0:
+ message.environment = 0;
+ break;
+ case "GEN_1":
+ case 1:
+ message.environment = 1;
+ break;
+ case "GEN_2":
+ case 2:
+ message.environment = 2;
+ break;
+ }
+ if (object.url != null)
+ message.url = String(object.url);
+ if (object.kmsKeyName != null)
+ message.kmsKeyName = String(object.kmsKeyName);
return message;
};
@@ -17035,6 +17326,8 @@
object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
object.updateTime = null;
object.environment = options.enums === String ? "ENVIRONMENT_UNSPECIFIED" : 0;
+ object.url = "";
+ object.kmsKeyName = "";
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
@@ -17063,6 +17356,10 @@
}
if (message.environment != null && message.hasOwnProperty("environment"))
object.environment = options.enums === String ? $root.google.cloud.functions.v2alpha.Environment[message.environment] === undefined ? message.environment : $root.google.cloud.functions.v2alpha.Environment[message.environment] : message.environment;
+ if (message.url != null && message.hasOwnProperty("url"))
+ object.url = message.url;
+ if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName"))
+ object.kmsKeyName = message.kmsKeyName;
return object;
};
@@ -18563,6 +18860,7 @@
* @property {google.cloud.functions.v2alpha.ISourceProvenance|null} [sourceProvenance] BuildConfig sourceProvenance
* @property {string|null} [workerPool] BuildConfig workerPool
* @property {Object.|null} [environmentVariables] BuildConfig environmentVariables
+ * @property {google.cloud.functions.v2alpha.BuildConfig.DockerRegistry|null} [dockerRegistry] BuildConfig dockerRegistry
* @property {string|null} [dockerRepository] BuildConfig dockerRepository
*/
@@ -18638,6 +18936,14 @@
*/
BuildConfig.prototype.environmentVariables = $util.emptyObject;
+ /**
+ * BuildConfig dockerRegistry.
+ * @member {google.cloud.functions.v2alpha.BuildConfig.DockerRegistry} dockerRegistry
+ * @memberof google.cloud.functions.v2alpha.BuildConfig
+ * @instance
+ */
+ BuildConfig.prototype.dockerRegistry = 0;
+
/**
* BuildConfig dockerRepository.
* @member {string} dockerRepository
@@ -18687,6 +18993,8 @@
writer.uint32(/* id 7, wireType 2 =*/58).string(message.dockerRepository);
if (message.sourceProvenance != null && Object.hasOwnProperty.call(message, "sourceProvenance"))
$root.google.cloud.functions.v2alpha.SourceProvenance.encode(message.sourceProvenance, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
+ if (message.dockerRegistry != null && Object.hasOwnProperty.call(message, "dockerRegistry"))
+ writer.uint32(/* id 10, wireType 0 =*/80).int32(message.dockerRegistry);
return writer;
};
@@ -18768,6 +19076,10 @@
message.environmentVariables[key] = value;
break;
}
+ case 10: {
+ message.dockerRegistry = reader.int32();
+ break;
+ }
case 7: {
message.dockerRepository = reader.string();
break;
@@ -18837,6 +19149,15 @@
if (!$util.isString(message.environmentVariables[key[i]]))
return "environmentVariables: string{k:string} expected";
}
+ if (message.dockerRegistry != null && message.hasOwnProperty("dockerRegistry"))
+ switch (message.dockerRegistry) {
+ default:
+ return "dockerRegistry: enum value expected";
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
if (message.dockerRepository != null && message.hasOwnProperty("dockerRepository"))
if (!$util.isString(message.dockerRepository))
return "dockerRepository: string expected";
@@ -18880,6 +19201,26 @@
for (var keys = Object.keys(object.environmentVariables), i = 0; i < keys.length; ++i)
message.environmentVariables[keys[i]] = String(object.environmentVariables[keys[i]]);
}
+ switch (object.dockerRegistry) {
+ default:
+ if (typeof object.dockerRegistry === "number") {
+ message.dockerRegistry = object.dockerRegistry;
+ break;
+ }
+ break;
+ case "DOCKER_REGISTRY_UNSPECIFIED":
+ case 0:
+ message.dockerRegistry = 0;
+ break;
+ case "CONTAINER_REGISTRY":
+ case 1:
+ message.dockerRegistry = 1;
+ break;
+ case "ARTIFACT_REGISTRY":
+ case 2:
+ message.dockerRegistry = 2;
+ break;
+ }
if (object.dockerRepository != null)
message.dockerRepository = String(object.dockerRepository);
return message;
@@ -18908,6 +19249,7 @@
object.workerPool = "";
object.dockerRepository = "";
object.sourceProvenance = null;
+ object.dockerRegistry = options.enums === String ? "DOCKER_REGISTRY_UNSPECIFIED" : 0;
}
if (message.build != null && message.hasOwnProperty("build"))
object.build = message.build;
@@ -18929,6 +19271,8 @@
object.dockerRepository = message.dockerRepository;
if (message.sourceProvenance != null && message.hasOwnProperty("sourceProvenance"))
object.sourceProvenance = $root.google.cloud.functions.v2alpha.SourceProvenance.toObject(message.sourceProvenance, options);
+ if (message.dockerRegistry != null && message.hasOwnProperty("dockerRegistry"))
+ object.dockerRegistry = options.enums === String ? $root.google.cloud.functions.v2alpha.BuildConfig.DockerRegistry[message.dockerRegistry] === undefined ? message.dockerRegistry : $root.google.cloud.functions.v2alpha.BuildConfig.DockerRegistry[message.dockerRegistry] : message.dockerRegistry;
return object;
};
@@ -18958,6 +19302,22 @@
return typeUrlPrefix + "/google.cloud.functions.v2alpha.BuildConfig";
};
+ /**
+ * DockerRegistry enum.
+ * @name google.cloud.functions.v2alpha.BuildConfig.DockerRegistry
+ * @enum {number}
+ * @property {number} DOCKER_REGISTRY_UNSPECIFIED=0 DOCKER_REGISTRY_UNSPECIFIED value
+ * @property {number} CONTAINER_REGISTRY=1 CONTAINER_REGISTRY value
+ * @property {number} ARTIFACT_REGISTRY=2 ARTIFACT_REGISTRY value
+ */
+ BuildConfig.DockerRegistry = (function() {
+ var valuesById = {}, values = Object.create(valuesById);
+ values[valuesById[0] = "DOCKER_REGISTRY_UNSPECIFIED"] = 0;
+ values[valuesById[1] = "CONTAINER_REGISTRY"] = 1;
+ values[valuesById[2] = "ARTIFACT_REGISTRY"] = 2;
+ return values;
+ })();
+
return BuildConfig;
})();
@@ -18970,6 +19330,7 @@
* @property {string|null} [service] ServiceConfig service
* @property {number|null} [timeoutSeconds] ServiceConfig timeoutSeconds
* @property {string|null} [availableMemory] ServiceConfig availableMemory
+ * @property {string|null} [availableCpu] ServiceConfig availableCpu
* @property {Object.|null} [environmentVariables] ServiceConfig environmentVariables
* @property {number|null} [maxInstanceCount] ServiceConfig maxInstanceCount
* @property {number|null} [minInstanceCount] ServiceConfig minInstanceCount
@@ -18982,6 +19343,8 @@
* @property {Array.|null} [secretEnvironmentVariables] ServiceConfig secretEnvironmentVariables
* @property {Array.|null} [secretVolumes] ServiceConfig secretVolumes
* @property {string|null} [revision] ServiceConfig revision
+ * @property {number|null} [maxInstanceRequestConcurrency] ServiceConfig maxInstanceRequestConcurrency
+ * @property {google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel|null} [securityLevel] ServiceConfig securityLevel
*/
/**
@@ -19026,6 +19389,14 @@
*/
ServiceConfig.prototype.availableMemory = "";
+ /**
+ * ServiceConfig availableCpu.
+ * @member {string} availableCpu
+ * @memberof google.cloud.functions.v2alpha.ServiceConfig
+ * @instance
+ */
+ ServiceConfig.prototype.availableCpu = "";
+
/**
* ServiceConfig environmentVariables.
* @member {Object.} environmentVariables
@@ -19122,6 +19493,22 @@
*/
ServiceConfig.prototype.revision = "";
+ /**
+ * ServiceConfig maxInstanceRequestConcurrency.
+ * @member {number} maxInstanceRequestConcurrency
+ * @memberof google.cloud.functions.v2alpha.ServiceConfig
+ * @instance
+ */
+ ServiceConfig.prototype.maxInstanceRequestConcurrency = 0;
+
+ /**
+ * ServiceConfig securityLevel.
+ * @member {google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel} securityLevel
+ * @memberof google.cloud.functions.v2alpha.ServiceConfig
+ * @instance
+ */
+ ServiceConfig.prototype.securityLevel = 0;
+
/**
* Creates a new ServiceConfig instance using the specified properties.
* @function create
@@ -19179,6 +19566,12 @@
if (message.secretVolumes != null && message.secretVolumes.length)
for (var i = 0; i < message.secretVolumes.length; ++i)
$root.google.cloud.functions.v2alpha.SecretVolume.encode(message.secretVolumes[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim();
+ if (message.maxInstanceRequestConcurrency != null && Object.hasOwnProperty.call(message, "maxInstanceRequestConcurrency"))
+ writer.uint32(/* id 20, wireType 0 =*/160).int32(message.maxInstanceRequestConcurrency);
+ if (message.securityLevel != null && Object.hasOwnProperty.call(message, "securityLevel"))
+ writer.uint32(/* id 21, wireType 0 =*/168).int32(message.securityLevel);
+ if (message.availableCpu != null && Object.hasOwnProperty.call(message, "availableCpu"))
+ writer.uint32(/* id 22, wireType 2 =*/178).string(message.availableCpu);
return writer;
};
@@ -19225,6 +19618,10 @@
message.availableMemory = reader.string();
break;
}
+ case 22: {
+ message.availableCpu = reader.string();
+ break;
+ }
case 4: {
if (message.environmentVariables === $util.emptyObject)
message.environmentVariables = {};
@@ -19296,6 +19693,14 @@
message.revision = reader.string();
break;
}
+ case 20: {
+ message.maxInstanceRequestConcurrency = reader.int32();
+ break;
+ }
+ case 21: {
+ message.securityLevel = reader.int32();
+ break;
+ }
default:
reader.skipType(tag & 7);
break;
@@ -19340,6 +19745,9 @@
if (message.availableMemory != null && message.hasOwnProperty("availableMemory"))
if (!$util.isString(message.availableMemory))
return "availableMemory: string expected";
+ if (message.availableCpu != null && message.hasOwnProperty("availableCpu"))
+ if (!$util.isString(message.availableCpu))
+ return "availableCpu: string expected";
if (message.environmentVariables != null && message.hasOwnProperty("environmentVariables")) {
if (!$util.isObject(message.environmentVariables))
return "environmentVariables: object expected";
@@ -19406,6 +19814,18 @@
if (message.revision != null && message.hasOwnProperty("revision"))
if (!$util.isString(message.revision))
return "revision: string expected";
+ if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency"))
+ if (!$util.isInteger(message.maxInstanceRequestConcurrency))
+ return "maxInstanceRequestConcurrency: integer expected";
+ if (message.securityLevel != null && message.hasOwnProperty("securityLevel"))
+ switch (message.securityLevel) {
+ default:
+ return "securityLevel: enum value expected";
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
return null;
};
@@ -19427,6 +19847,8 @@
message.timeoutSeconds = object.timeoutSeconds | 0;
if (object.availableMemory != null)
message.availableMemory = String(object.availableMemory);
+ if (object.availableCpu != null)
+ message.availableCpu = String(object.availableCpu);
if (object.environmentVariables) {
if (typeof object.environmentVariables !== "object")
throw TypeError(".google.cloud.functions.v2alpha.ServiceConfig.environmentVariables: object expected");
@@ -19512,6 +19934,28 @@
}
if (object.revision != null)
message.revision = String(object.revision);
+ if (object.maxInstanceRequestConcurrency != null)
+ message.maxInstanceRequestConcurrency = object.maxInstanceRequestConcurrency | 0;
+ switch (object.securityLevel) {
+ default:
+ if (typeof object.securityLevel === "number") {
+ message.securityLevel = object.securityLevel;
+ break;
+ }
+ break;
+ case "SECURITY_LEVEL_UNSPECIFIED":
+ case 0:
+ message.securityLevel = 0;
+ break;
+ case "SECURE_ALWAYS":
+ case 1:
+ message.securityLevel = 1;
+ break;
+ case "SECURE_OPTIONAL":
+ case 2:
+ message.securityLevel = 2;
+ break;
+ }
return message;
};
@@ -19547,6 +19991,9 @@
object.availableMemory = "";
object.allTrafficOnLatestRevision = false;
object.revision = "";
+ object.maxInstanceRequestConcurrency = 0;
+ object.securityLevel = options.enums === String ? "SECURITY_LEVEL_UNSPECIFIED" : 0;
+ object.availableCpu = "";
}
if (message.service != null && message.hasOwnProperty("service"))
object.service = message.service;
@@ -19588,6 +20035,12 @@
for (var j = 0; j < message.secretVolumes.length; ++j)
object.secretVolumes[j] = $root.google.cloud.functions.v2alpha.SecretVolume.toObject(message.secretVolumes[j], options);
}
+ if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency"))
+ object.maxInstanceRequestConcurrency = message.maxInstanceRequestConcurrency;
+ if (message.securityLevel != null && message.hasOwnProperty("securityLevel"))
+ object.securityLevel = options.enums === String ? $root.google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel[message.securityLevel] === undefined ? message.securityLevel : $root.google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel[message.securityLevel] : message.securityLevel;
+ if (message.availableCpu != null && message.hasOwnProperty("availableCpu"))
+ object.availableCpu = message.availableCpu;
return object;
};
@@ -19651,6 +20104,22 @@
return values;
})();
+ /**
+ * SecurityLevel enum.
+ * @name google.cloud.functions.v2alpha.ServiceConfig.SecurityLevel
+ * @enum {number}
+ * @property {number} SECURITY_LEVEL_UNSPECIFIED=0 SECURITY_LEVEL_UNSPECIFIED value
+ * @property {number} SECURE_ALWAYS=1 SECURE_ALWAYS value
+ * @property {number} SECURE_OPTIONAL=2 SECURE_OPTIONAL value
+ */
+ ServiceConfig.SecurityLevel = (function() {
+ var valuesById = {}, values = Object.create(valuesById);
+ values[valuesById[0] = "SECURITY_LEVEL_UNSPECIFIED"] = 0;
+ values[valuesById[1] = "SECURE_ALWAYS"] = 1;
+ values[valuesById[2] = "SECURE_OPTIONAL"] = 2;
+ return values;
+ })();
+
return ServiceConfig;
})();
@@ -22615,6 +23084,7 @@
* @memberof google.cloud.functions.v2alpha
* @interface IGenerateUploadUrlRequest
* @property {string|null} [parent] GenerateUploadUrlRequest parent
+ * @property {string|null} [kmsKeyName] GenerateUploadUrlRequest kmsKeyName
*/
/**
@@ -22640,6 +23110,14 @@
*/
GenerateUploadUrlRequest.prototype.parent = "";
+ /**
+ * GenerateUploadUrlRequest kmsKeyName.
+ * @member {string} kmsKeyName
+ * @memberof google.cloud.functions.v2alpha.GenerateUploadUrlRequest
+ * @instance
+ */
+ GenerateUploadUrlRequest.prototype.kmsKeyName = "";
+
/**
* Creates a new GenerateUploadUrlRequest instance using the specified properties.
* @function create
@@ -22666,6 +23144,8 @@
writer = $Writer.create();
if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
+ if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName"))
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName);
return writer;
};
@@ -22704,6 +23184,10 @@
message.parent = reader.string();
break;
}
+ case 2: {
+ message.kmsKeyName = reader.string();
+ break;
+ }
default:
reader.skipType(tag & 7);
break;
@@ -22742,6 +23226,9 @@
if (message.parent != null && message.hasOwnProperty("parent"))
if (!$util.isString(message.parent))
return "parent: string expected";
+ if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName"))
+ if (!$util.isString(message.kmsKeyName))
+ return "kmsKeyName: string expected";
return null;
};
@@ -22759,6 +23246,8 @@
var message = new $root.google.cloud.functions.v2alpha.GenerateUploadUrlRequest();
if (object.parent != null)
message.parent = String(object.parent);
+ if (object.kmsKeyName != null)
+ message.kmsKeyName = String(object.kmsKeyName);
return message;
};
@@ -22775,10 +23264,14 @@
if (!options)
options = {};
var object = {};
- if (options.defaults)
+ if (options.defaults) {
object.parent = "";
+ object.kmsKeyName = "";
+ }
if (message.parent != null && message.hasOwnProperty("parent"))
object.parent = message.parent;
+ if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName"))
+ object.kmsKeyName = message.kmsKeyName;
return object;
};
@@ -24730,6 +25223,257 @@
return OperationMetadata;
})();
+ v2alpha.LocationMetadata = (function() {
+
+ /**
+ * Properties of a LocationMetadata.
+ * @memberof google.cloud.functions.v2alpha
+ * @interface ILocationMetadata
+ * @property {Array.|null} [environments] LocationMetadata environments
+ */
+
+ /**
+ * Constructs a new LocationMetadata.
+ * @memberof google.cloud.functions.v2alpha
+ * @classdesc Represents a LocationMetadata.
+ * @implements ILocationMetadata
+ * @constructor
+ * @param {google.cloud.functions.v2alpha.ILocationMetadata=} [properties] Properties to set
+ */
+ function LocationMetadata(properties) {
+ this.environments = [];
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * LocationMetadata environments.
+ * @member {Array.} environments
+ * @memberof google.cloud.functions.v2alpha.LocationMetadata
+ * @instance
+ */
+ LocationMetadata.prototype.environments = $util.emptyArray;
+
+ /**
+ * Creates a new LocationMetadata instance using the specified properties.
+ * @function create
+ * @memberof google.cloud.functions.v2alpha.LocationMetadata
+ * @static
+ * @param {google.cloud.functions.v2alpha.ILocationMetadata=} [properties] Properties to set
+ * @returns {google.cloud.functions.v2alpha.LocationMetadata} LocationMetadata instance
+ */
+ LocationMetadata.create = function create(properties) {
+ return new LocationMetadata(properties);
+ };
+
+ /**
+ * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.functions.v2alpha.LocationMetadata.verify|verify} messages.
+ * @function encode
+ * @memberof google.cloud.functions.v2alpha.LocationMetadata
+ * @static
+ * @param {google.cloud.functions.v2alpha.ILocationMetadata} message LocationMetadata message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ LocationMetadata.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.environments != null && message.environments.length) {
+ writer.uint32(/* id 1, wireType 2 =*/10).fork();
+ for (var i = 0; i < message.environments.length; ++i)
+ writer.int32(message.environments[i]);
+ writer.ldelim();
+ }
+ return writer;
+ };
+
+ /**
+ * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.functions.v2alpha.LocationMetadata.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof google.cloud.functions.v2alpha.LocationMetadata
+ * @static
+ * @param {google.cloud.functions.v2alpha.ILocationMetadata} message LocationMetadata message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a LocationMetadata message from the specified reader or buffer.
+ * @function decode
+ * @memberof google.cloud.functions.v2alpha.LocationMetadata
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {google.cloud.functions.v2alpha.LocationMetadata} LocationMetadata
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ LocationMetadata.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.functions.v2alpha.LocationMetadata();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1: {
+ if (!(message.environments && message.environments.length))
+ message.environments = [];
+ if ((tag & 7) === 2) {
+ var end2 = reader.uint32() + reader.pos;
+ while (reader.pos < end2)
+ message.environments.push(reader.int32());
+ } else
+ message.environments.push(reader.int32());
+ break;
+ }
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a LocationMetadata message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof google.cloud.functions.v2alpha.LocationMetadata
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {google.cloud.functions.v2alpha.LocationMetadata} LocationMetadata
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ LocationMetadata.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a LocationMetadata message.
+ * @function verify
+ * @memberof google.cloud.functions.v2alpha.LocationMetadata
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ LocationMetadata.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.environments != null && message.hasOwnProperty("environments")) {
+ if (!Array.isArray(message.environments))
+ return "environments: array expected";
+ for (var i = 0; i < message.environments.length; ++i)
+ switch (message.environments[i]) {
+ default:
+ return "environments: enum value[] expected";
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
+ }
+ return null;
+ };
+
+ /**
+ * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof google.cloud.functions.v2alpha.LocationMetadata
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {google.cloud.functions.v2alpha.LocationMetadata} LocationMetadata
+ */
+ LocationMetadata.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.cloud.functions.v2alpha.LocationMetadata)
+ return object;
+ var message = new $root.google.cloud.functions.v2alpha.LocationMetadata();
+ if (object.environments) {
+ if (!Array.isArray(object.environments))
+ throw TypeError(".google.cloud.functions.v2alpha.LocationMetadata.environments: array expected");
+ message.environments = [];
+ for (var i = 0; i < object.environments.length; ++i)
+ switch (object.environments[i]) {
+ default:
+ if (typeof object.environments[i] === "number") {
+ message.environments[i] = object.environments[i];
+ break;
+ }
+ case "ENVIRONMENT_UNSPECIFIED":
+ case 0:
+ message.environments[i] = 0;
+ break;
+ case "GEN_1":
+ case 1:
+ message.environments[i] = 1;
+ break;
+ case "GEN_2":
+ case 2:
+ message.environments[i] = 2;
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof google.cloud.functions.v2alpha.LocationMetadata
+ * @static
+ * @param {google.cloud.functions.v2alpha.LocationMetadata} message LocationMetadata
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ LocationMetadata.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.arrays || options.defaults)
+ object.environments = [];
+ if (message.environments && message.environments.length) {
+ object.environments = [];
+ for (var j = 0; j < message.environments.length; ++j)
+ object.environments[j] = options.enums === String ? $root.google.cloud.functions.v2alpha.Environment[message.environments[j]] === undefined ? message.environments[j] : $root.google.cloud.functions.v2alpha.Environment[message.environments[j]] : message.environments[j];
+ }
+ return object;
+ };
+
+ /**
+ * Converts this LocationMetadata to JSON.
+ * @function toJSON
+ * @memberof google.cloud.functions.v2alpha.LocationMetadata
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ LocationMetadata.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ /**
+ * Gets the default type url for LocationMetadata
+ * @function getTypeUrl
+ * @memberof google.cloud.functions.v2alpha.LocationMetadata
+ * @static
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
+ * @returns {string} The default type url
+ */
+ LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
+ if (typeUrlPrefix === undefined) {
+ typeUrlPrefix = "type.googleapis.com";
+ }
+ return typeUrlPrefix + "/google.cloud.functions.v2alpha.LocationMetadata";
+ };
+
+ return LocationMetadata;
+ })();
+
v2alpha.Stage = (function() {
/**
@@ -25520,7 +26264,6 @@
* @memberof google.cloud.functions.v2beta
* @interface IFunction
* @property {string|null} [name] Function name
- * @property {google.cloud.functions.v2beta.Environment|null} [environment] Function environment
* @property {string|null} [description] Function description
* @property {google.cloud.functions.v2beta.IBuildConfig|null} [buildConfig] Function buildConfig
* @property {google.cloud.functions.v2beta.IServiceConfig|null} [serviceConfig] Function serviceConfig
@@ -25529,6 +26272,9 @@
* @property {google.protobuf.ITimestamp|null} [updateTime] Function updateTime
* @property {Object.|null} [labels] Function labels
* @property {Array.|null} [stateMessages] Function stateMessages
+ * @property {google.cloud.functions.v2beta.Environment|null} [environment] Function environment
+ * @property {string|null} [url] Function url
+ * @property {string|null} [kmsKeyName] Function kmsKeyName
*/
/**
@@ -25556,14 +26302,6 @@
*/
Function.prototype.name = "";
- /**
- * Function environment.
- * @member {google.cloud.functions.v2beta.Environment} environment
- * @memberof google.cloud.functions.v2beta.Function
- * @instance
- */
- Function.prototype.environment = 0;
-
/**
* Function description.
* @member {string} description
@@ -25628,6 +26366,30 @@
*/
Function.prototype.stateMessages = $util.emptyArray;
+ /**
+ * Function environment.
+ * @member {google.cloud.functions.v2beta.Environment} environment
+ * @memberof google.cloud.functions.v2beta.Function
+ * @instance
+ */
+ Function.prototype.environment = 0;
+
+ /**
+ * Function url.
+ * @member {string} url
+ * @memberof google.cloud.functions.v2beta.Function
+ * @instance
+ */
+ Function.prototype.url = "";
+
+ /**
+ * Function kmsKeyName.
+ * @member {string} kmsKeyName
+ * @memberof google.cloud.functions.v2beta.Function
+ * @instance
+ */
+ Function.prototype.kmsKeyName = "";
+
/**
* Creates a new Function instance using the specified properties.
* @function create
@@ -25674,6 +26436,10 @@
$root.google.cloud.functions.v2beta.StateMessage.encode(message.stateMessages[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
if (message.environment != null && Object.hasOwnProperty.call(message, "environment"))
writer.uint32(/* id 10, wireType 0 =*/80).int32(message.environment);
+ if (message.url != null && Object.hasOwnProperty.call(message, "url"))
+ writer.uint32(/* id 14, wireType 2 =*/114).string(message.url);
+ if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName"))
+ writer.uint32(/* id 25, wireType 2 =*/202).string(message.kmsKeyName);
return writer;
};
@@ -25712,10 +26478,6 @@
message.name = reader.string();
break;
}
- case 10: {
- message.environment = reader.int32();
- break;
- }
case 2: {
message.description = reader.string();
break;
@@ -25769,6 +26531,18 @@
message.stateMessages.push($root.google.cloud.functions.v2beta.StateMessage.decode(reader, reader.uint32()));
break;
}
+ case 10: {
+ message.environment = reader.int32();
+ break;
+ }
+ case 14: {
+ message.url = reader.string();
+ break;
+ }
+ case 25: {
+ message.kmsKeyName = reader.string();
+ break;
+ }
default:
reader.skipType(tag & 7);
break;
@@ -25807,15 +26581,6 @@
if (message.name != null && message.hasOwnProperty("name"))
if (!$util.isString(message.name))
return "name: string expected";
- if (message.environment != null && message.hasOwnProperty("environment"))
- switch (message.environment) {
- default:
- return "environment: enum value expected";
- case 0:
- case 1:
- case 2:
- break;
- }
if (message.description != null && message.hasOwnProperty("description"))
if (!$util.isString(message.description))
return "description: string expected";
@@ -25868,6 +26633,21 @@
return "stateMessages." + error;
}
}
+ if (message.environment != null && message.hasOwnProperty("environment"))
+ switch (message.environment) {
+ default:
+ return "environment: enum value expected";
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
+ if (message.url != null && message.hasOwnProperty("url"))
+ if (!$util.isString(message.url))
+ return "url: string expected";
+ if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName"))
+ if (!$util.isString(message.kmsKeyName))
+ return "kmsKeyName: string expected";
return null;
};
@@ -25885,26 +26665,6 @@
var message = new $root.google.cloud.functions.v2beta.Function();
if (object.name != null)
message.name = String(object.name);
- switch (object.environment) {
- default:
- if (typeof object.environment === "number") {
- message.environment = object.environment;
- break;
- }
- break;
- case "ENVIRONMENT_UNSPECIFIED":
- case 0:
- message.environment = 0;
- break;
- case "GEN_1":
- case 1:
- message.environment = 1;
- break;
- case "GEN_2":
- case 2:
- message.environment = 2;
- break;
- }
if (object.description != null)
message.description = String(object.description);
if (object.buildConfig != null) {
@@ -25976,6 +26736,30 @@
message.stateMessages[i] = $root.google.cloud.functions.v2beta.StateMessage.fromObject(object.stateMessages[i]);
}
}
+ switch (object.environment) {
+ default:
+ if (typeof object.environment === "number") {
+ message.environment = object.environment;
+ break;
+ }
+ break;
+ case "ENVIRONMENT_UNSPECIFIED":
+ case 0:
+ message.environment = 0;
+ break;
+ case "GEN_1":
+ case 1:
+ message.environment = 1;
+ break;
+ case "GEN_2":
+ case 2:
+ message.environment = 2;
+ break;
+ }
+ if (object.url != null)
+ message.url = String(object.url);
+ if (object.kmsKeyName != null)
+ message.kmsKeyName = String(object.kmsKeyName);
return message;
};
@@ -26005,6 +26789,8 @@
object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
object.updateTime = null;
object.environment = options.enums === String ? "ENVIRONMENT_UNSPECIFIED" : 0;
+ object.url = "";
+ object.kmsKeyName = "";
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
@@ -26033,6 +26819,10 @@
}
if (message.environment != null && message.hasOwnProperty("environment"))
object.environment = options.enums === String ? $root.google.cloud.functions.v2beta.Environment[message.environment] === undefined ? message.environment : $root.google.cloud.functions.v2beta.Environment[message.environment] : message.environment;
+ if (message.url != null && message.hasOwnProperty("url"))
+ object.url = message.url;
+ if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName"))
+ object.kmsKeyName = message.kmsKeyName;
return object;
};
@@ -27533,6 +28323,7 @@
* @property {google.cloud.functions.v2beta.ISourceProvenance|null} [sourceProvenance] BuildConfig sourceProvenance
* @property {string|null} [workerPool] BuildConfig workerPool
* @property {Object.|null} [environmentVariables] BuildConfig environmentVariables
+ * @property {google.cloud.functions.v2beta.BuildConfig.DockerRegistry|null} [dockerRegistry] BuildConfig dockerRegistry
* @property {string|null} [dockerRepository] BuildConfig dockerRepository
*/
@@ -27608,6 +28399,14 @@
*/
BuildConfig.prototype.environmentVariables = $util.emptyObject;
+ /**
+ * BuildConfig dockerRegistry.
+ * @member {google.cloud.functions.v2beta.BuildConfig.DockerRegistry} dockerRegistry
+ * @memberof google.cloud.functions.v2beta.BuildConfig
+ * @instance
+ */
+ BuildConfig.prototype.dockerRegistry = 0;
+
/**
* BuildConfig dockerRepository.
* @member {string} dockerRepository
@@ -27657,6 +28456,8 @@
writer.uint32(/* id 7, wireType 2 =*/58).string(message.dockerRepository);
if (message.sourceProvenance != null && Object.hasOwnProperty.call(message, "sourceProvenance"))
$root.google.cloud.functions.v2beta.SourceProvenance.encode(message.sourceProvenance, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
+ if (message.dockerRegistry != null && Object.hasOwnProperty.call(message, "dockerRegistry"))
+ writer.uint32(/* id 10, wireType 0 =*/80).int32(message.dockerRegistry);
return writer;
};
@@ -27738,6 +28539,10 @@
message.environmentVariables[key] = value;
break;
}
+ case 10: {
+ message.dockerRegistry = reader.int32();
+ break;
+ }
case 7: {
message.dockerRepository = reader.string();
break;
@@ -27807,6 +28612,15 @@
if (!$util.isString(message.environmentVariables[key[i]]))
return "environmentVariables: string{k:string} expected";
}
+ if (message.dockerRegistry != null && message.hasOwnProperty("dockerRegistry"))
+ switch (message.dockerRegistry) {
+ default:
+ return "dockerRegistry: enum value expected";
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
if (message.dockerRepository != null && message.hasOwnProperty("dockerRepository"))
if (!$util.isString(message.dockerRepository))
return "dockerRepository: string expected";
@@ -27850,6 +28664,26 @@
for (var keys = Object.keys(object.environmentVariables), i = 0; i < keys.length; ++i)
message.environmentVariables[keys[i]] = String(object.environmentVariables[keys[i]]);
}
+ switch (object.dockerRegistry) {
+ default:
+ if (typeof object.dockerRegistry === "number") {
+ message.dockerRegistry = object.dockerRegistry;
+ break;
+ }
+ break;
+ case "DOCKER_REGISTRY_UNSPECIFIED":
+ case 0:
+ message.dockerRegistry = 0;
+ break;
+ case "CONTAINER_REGISTRY":
+ case 1:
+ message.dockerRegistry = 1;
+ break;
+ case "ARTIFACT_REGISTRY":
+ case 2:
+ message.dockerRegistry = 2;
+ break;
+ }
if (object.dockerRepository != null)
message.dockerRepository = String(object.dockerRepository);
return message;
@@ -27878,6 +28712,7 @@
object.workerPool = "";
object.dockerRepository = "";
object.sourceProvenance = null;
+ object.dockerRegistry = options.enums === String ? "DOCKER_REGISTRY_UNSPECIFIED" : 0;
}
if (message.build != null && message.hasOwnProperty("build"))
object.build = message.build;
@@ -27899,6 +28734,8 @@
object.dockerRepository = message.dockerRepository;
if (message.sourceProvenance != null && message.hasOwnProperty("sourceProvenance"))
object.sourceProvenance = $root.google.cloud.functions.v2beta.SourceProvenance.toObject(message.sourceProvenance, options);
+ if (message.dockerRegistry != null && message.hasOwnProperty("dockerRegistry"))
+ object.dockerRegistry = options.enums === String ? $root.google.cloud.functions.v2beta.BuildConfig.DockerRegistry[message.dockerRegistry] === undefined ? message.dockerRegistry : $root.google.cloud.functions.v2beta.BuildConfig.DockerRegistry[message.dockerRegistry] : message.dockerRegistry;
return object;
};
@@ -27928,6 +28765,22 @@
return typeUrlPrefix + "/google.cloud.functions.v2beta.BuildConfig";
};
+ /**
+ * DockerRegistry enum.
+ * @name google.cloud.functions.v2beta.BuildConfig.DockerRegistry
+ * @enum {number}
+ * @property {number} DOCKER_REGISTRY_UNSPECIFIED=0 DOCKER_REGISTRY_UNSPECIFIED value
+ * @property {number} CONTAINER_REGISTRY=1 CONTAINER_REGISTRY value
+ * @property {number} ARTIFACT_REGISTRY=2 ARTIFACT_REGISTRY value
+ */
+ BuildConfig.DockerRegistry = (function() {
+ var valuesById = {}, values = Object.create(valuesById);
+ values[valuesById[0] = "DOCKER_REGISTRY_UNSPECIFIED"] = 0;
+ values[valuesById[1] = "CONTAINER_REGISTRY"] = 1;
+ values[valuesById[2] = "ARTIFACT_REGISTRY"] = 2;
+ return values;
+ })();
+
return BuildConfig;
})();
@@ -27940,6 +28793,7 @@
* @property {string|null} [service] ServiceConfig service
* @property {number|null} [timeoutSeconds] ServiceConfig timeoutSeconds
* @property {string|null} [availableMemory] ServiceConfig availableMemory
+ * @property {string|null} [availableCpu] ServiceConfig availableCpu
* @property {Object.|null} [environmentVariables] ServiceConfig environmentVariables
* @property {number|null} [maxInstanceCount] ServiceConfig maxInstanceCount
* @property {number|null} [minInstanceCount] ServiceConfig minInstanceCount
@@ -27952,6 +28806,8 @@
* @property {Array.|null} [secretEnvironmentVariables] ServiceConfig secretEnvironmentVariables
* @property {Array.|null} [secretVolumes] ServiceConfig secretVolumes
* @property {string|null} [revision] ServiceConfig revision
+ * @property {number|null} [maxInstanceRequestConcurrency] ServiceConfig maxInstanceRequestConcurrency
+ * @property {google.cloud.functions.v2beta.ServiceConfig.SecurityLevel|null} [securityLevel] ServiceConfig securityLevel
*/
/**
@@ -27996,6 +28852,14 @@
*/
ServiceConfig.prototype.availableMemory = "";
+ /**
+ * ServiceConfig availableCpu.
+ * @member {string} availableCpu
+ * @memberof google.cloud.functions.v2beta.ServiceConfig
+ * @instance
+ */
+ ServiceConfig.prototype.availableCpu = "";
+
/**
* ServiceConfig environmentVariables.
* @member {Object.} environmentVariables
@@ -28092,6 +28956,22 @@
*/
ServiceConfig.prototype.revision = "";
+ /**
+ * ServiceConfig maxInstanceRequestConcurrency.
+ * @member {number} maxInstanceRequestConcurrency
+ * @memberof google.cloud.functions.v2beta.ServiceConfig
+ * @instance
+ */
+ ServiceConfig.prototype.maxInstanceRequestConcurrency = 0;
+
+ /**
+ * ServiceConfig securityLevel.
+ * @member {google.cloud.functions.v2beta.ServiceConfig.SecurityLevel} securityLevel
+ * @memberof google.cloud.functions.v2beta.ServiceConfig
+ * @instance
+ */
+ ServiceConfig.prototype.securityLevel = 0;
+
/**
* Creates a new ServiceConfig instance using the specified properties.
* @function create
@@ -28149,6 +29029,12 @@
if (message.secretVolumes != null && message.secretVolumes.length)
for (var i = 0; i < message.secretVolumes.length; ++i)
$root.google.cloud.functions.v2beta.SecretVolume.encode(message.secretVolumes[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim();
+ if (message.maxInstanceRequestConcurrency != null && Object.hasOwnProperty.call(message, "maxInstanceRequestConcurrency"))
+ writer.uint32(/* id 20, wireType 0 =*/160).int32(message.maxInstanceRequestConcurrency);
+ if (message.securityLevel != null && Object.hasOwnProperty.call(message, "securityLevel"))
+ writer.uint32(/* id 21, wireType 0 =*/168).int32(message.securityLevel);
+ if (message.availableCpu != null && Object.hasOwnProperty.call(message, "availableCpu"))
+ writer.uint32(/* id 22, wireType 2 =*/178).string(message.availableCpu);
return writer;
};
@@ -28195,6 +29081,10 @@
message.availableMemory = reader.string();
break;
}
+ case 22: {
+ message.availableCpu = reader.string();
+ break;
+ }
case 4: {
if (message.environmentVariables === $util.emptyObject)
message.environmentVariables = {};
@@ -28266,6 +29156,14 @@
message.revision = reader.string();
break;
}
+ case 20: {
+ message.maxInstanceRequestConcurrency = reader.int32();
+ break;
+ }
+ case 21: {
+ message.securityLevel = reader.int32();
+ break;
+ }
default:
reader.skipType(tag & 7);
break;
@@ -28310,6 +29208,9 @@
if (message.availableMemory != null && message.hasOwnProperty("availableMemory"))
if (!$util.isString(message.availableMemory))
return "availableMemory: string expected";
+ if (message.availableCpu != null && message.hasOwnProperty("availableCpu"))
+ if (!$util.isString(message.availableCpu))
+ return "availableCpu: string expected";
if (message.environmentVariables != null && message.hasOwnProperty("environmentVariables")) {
if (!$util.isObject(message.environmentVariables))
return "environmentVariables: object expected";
@@ -28376,6 +29277,18 @@
if (message.revision != null && message.hasOwnProperty("revision"))
if (!$util.isString(message.revision))
return "revision: string expected";
+ if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency"))
+ if (!$util.isInteger(message.maxInstanceRequestConcurrency))
+ return "maxInstanceRequestConcurrency: integer expected";
+ if (message.securityLevel != null && message.hasOwnProperty("securityLevel"))
+ switch (message.securityLevel) {
+ default:
+ return "securityLevel: enum value expected";
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
return null;
};
@@ -28397,6 +29310,8 @@
message.timeoutSeconds = object.timeoutSeconds | 0;
if (object.availableMemory != null)
message.availableMemory = String(object.availableMemory);
+ if (object.availableCpu != null)
+ message.availableCpu = String(object.availableCpu);
if (object.environmentVariables) {
if (typeof object.environmentVariables !== "object")
throw TypeError(".google.cloud.functions.v2beta.ServiceConfig.environmentVariables: object expected");
@@ -28482,6 +29397,28 @@
}
if (object.revision != null)
message.revision = String(object.revision);
+ if (object.maxInstanceRequestConcurrency != null)
+ message.maxInstanceRequestConcurrency = object.maxInstanceRequestConcurrency | 0;
+ switch (object.securityLevel) {
+ default:
+ if (typeof object.securityLevel === "number") {
+ message.securityLevel = object.securityLevel;
+ break;
+ }
+ break;
+ case "SECURITY_LEVEL_UNSPECIFIED":
+ case 0:
+ message.securityLevel = 0;
+ break;
+ case "SECURE_ALWAYS":
+ case 1:
+ message.securityLevel = 1;
+ break;
+ case "SECURE_OPTIONAL":
+ case 2:
+ message.securityLevel = 2;
+ break;
+ }
return message;
};
@@ -28517,6 +29454,9 @@
object.availableMemory = "";
object.allTrafficOnLatestRevision = false;
object.revision = "";
+ object.maxInstanceRequestConcurrency = 0;
+ object.securityLevel = options.enums === String ? "SECURITY_LEVEL_UNSPECIFIED" : 0;
+ object.availableCpu = "";
}
if (message.service != null && message.hasOwnProperty("service"))
object.service = message.service;
@@ -28558,6 +29498,12 @@
for (var j = 0; j < message.secretVolumes.length; ++j)
object.secretVolumes[j] = $root.google.cloud.functions.v2beta.SecretVolume.toObject(message.secretVolumes[j], options);
}
+ if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency"))
+ object.maxInstanceRequestConcurrency = message.maxInstanceRequestConcurrency;
+ if (message.securityLevel != null && message.hasOwnProperty("securityLevel"))
+ object.securityLevel = options.enums === String ? $root.google.cloud.functions.v2beta.ServiceConfig.SecurityLevel[message.securityLevel] === undefined ? message.securityLevel : $root.google.cloud.functions.v2beta.ServiceConfig.SecurityLevel[message.securityLevel] : message.securityLevel;
+ if (message.availableCpu != null && message.hasOwnProperty("availableCpu"))
+ object.availableCpu = message.availableCpu;
return object;
};
@@ -28621,6 +29567,22 @@
return values;
})();
+ /**
+ * SecurityLevel enum.
+ * @name google.cloud.functions.v2beta.ServiceConfig.SecurityLevel
+ * @enum {number}
+ * @property {number} SECURITY_LEVEL_UNSPECIFIED=0 SECURITY_LEVEL_UNSPECIFIED value
+ * @property {number} SECURE_ALWAYS=1 SECURE_ALWAYS value
+ * @property {number} SECURE_OPTIONAL=2 SECURE_OPTIONAL value
+ */
+ ServiceConfig.SecurityLevel = (function() {
+ var valuesById = {}, values = Object.create(valuesById);
+ values[valuesById[0] = "SECURITY_LEVEL_UNSPECIFIED"] = 0;
+ values[valuesById[1] = "SECURE_ALWAYS"] = 1;
+ values[valuesById[2] = "SECURE_OPTIONAL"] = 2;
+ return values;
+ })();
+
return ServiceConfig;
})();
@@ -31585,6 +32547,7 @@
* @memberof google.cloud.functions.v2beta
* @interface IGenerateUploadUrlRequest
* @property {string|null} [parent] GenerateUploadUrlRequest parent
+ * @property {string|null} [kmsKeyName] GenerateUploadUrlRequest kmsKeyName
*/
/**
@@ -31610,6 +32573,14 @@
*/
GenerateUploadUrlRequest.prototype.parent = "";
+ /**
+ * GenerateUploadUrlRequest kmsKeyName.
+ * @member {string} kmsKeyName
+ * @memberof google.cloud.functions.v2beta.GenerateUploadUrlRequest
+ * @instance
+ */
+ GenerateUploadUrlRequest.prototype.kmsKeyName = "";
+
/**
* Creates a new GenerateUploadUrlRequest instance using the specified properties.
* @function create
@@ -31636,6 +32607,8 @@
writer = $Writer.create();
if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
+ if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName"))
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName);
return writer;
};
@@ -31674,6 +32647,10 @@
message.parent = reader.string();
break;
}
+ case 2: {
+ message.kmsKeyName = reader.string();
+ break;
+ }
default:
reader.skipType(tag & 7);
break;
@@ -31712,6 +32689,9 @@
if (message.parent != null && message.hasOwnProperty("parent"))
if (!$util.isString(message.parent))
return "parent: string expected";
+ if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName"))
+ if (!$util.isString(message.kmsKeyName))
+ return "kmsKeyName: string expected";
return null;
};
@@ -31729,6 +32709,8 @@
var message = new $root.google.cloud.functions.v2beta.GenerateUploadUrlRequest();
if (object.parent != null)
message.parent = String(object.parent);
+ if (object.kmsKeyName != null)
+ message.kmsKeyName = String(object.kmsKeyName);
return message;
};
@@ -31745,10 +32727,14 @@
if (!options)
options = {};
var object = {};
- if (options.defaults)
+ if (options.defaults) {
object.parent = "";
+ object.kmsKeyName = "";
+ }
if (message.parent != null && message.hasOwnProperty("parent"))
object.parent = message.parent;
+ if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName"))
+ object.kmsKeyName = message.kmsKeyName;
return object;
};
@@ -33700,6 +34686,257 @@
return OperationMetadata;
})();
+ v2beta.LocationMetadata = (function() {
+
+ /**
+ * Properties of a LocationMetadata.
+ * @memberof google.cloud.functions.v2beta
+ * @interface ILocationMetadata
+ * @property {Array.|null} [environments] LocationMetadata environments
+ */
+
+ /**
+ * Constructs a new LocationMetadata.
+ * @memberof google.cloud.functions.v2beta
+ * @classdesc Represents a LocationMetadata.
+ * @implements ILocationMetadata
+ * @constructor
+ * @param {google.cloud.functions.v2beta.ILocationMetadata=} [properties] Properties to set
+ */
+ function LocationMetadata(properties) {
+ this.environments = [];
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * LocationMetadata environments.
+ * @member {Array.} environments
+ * @memberof google.cloud.functions.v2beta.LocationMetadata
+ * @instance
+ */
+ LocationMetadata.prototype.environments = $util.emptyArray;
+
+ /**
+ * Creates a new LocationMetadata instance using the specified properties.
+ * @function create
+ * @memberof google.cloud.functions.v2beta.LocationMetadata
+ * @static
+ * @param {google.cloud.functions.v2beta.ILocationMetadata=} [properties] Properties to set
+ * @returns {google.cloud.functions.v2beta.LocationMetadata} LocationMetadata instance
+ */
+ LocationMetadata.create = function create(properties) {
+ return new LocationMetadata(properties);
+ };
+
+ /**
+ * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.functions.v2beta.LocationMetadata.verify|verify} messages.
+ * @function encode
+ * @memberof google.cloud.functions.v2beta.LocationMetadata
+ * @static
+ * @param {google.cloud.functions.v2beta.ILocationMetadata} message LocationMetadata message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ LocationMetadata.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ if (message.environments != null && message.environments.length) {
+ writer.uint32(/* id 1, wireType 2 =*/10).fork();
+ for (var i = 0; i < message.environments.length; ++i)
+ writer.int32(message.environments[i]);
+ writer.ldelim();
+ }
+ return writer;
+ };
+
+ /**
+ * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.functions.v2beta.LocationMetadata.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof google.cloud.functions.v2beta.LocationMetadata
+ * @static
+ * @param {google.cloud.functions.v2beta.ILocationMetadata} message LocationMetadata message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes a LocationMetadata message from the specified reader or buffer.
+ * @function decode
+ * @memberof google.cloud.functions.v2beta.LocationMetadata
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {google.cloud.functions.v2beta.LocationMetadata} LocationMetadata
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ LocationMetadata.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.functions.v2beta.LocationMetadata();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1: {
+ if (!(message.environments && message.environments.length))
+ message.environments = [];
+ if ((tag & 7) === 2) {
+ var end2 = reader.uint32() + reader.pos;
+ while (reader.pos < end2)
+ message.environments.push(reader.int32());
+ } else
+ message.environments.push(reader.int32());
+ break;
+ }
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes a LocationMetadata message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof google.cloud.functions.v2beta.LocationMetadata
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {google.cloud.functions.v2beta.LocationMetadata} LocationMetadata
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ LocationMetadata.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies a LocationMetadata message.
+ * @function verify
+ * @memberof google.cloud.functions.v2beta.LocationMetadata
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ LocationMetadata.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ if (message.environments != null && message.hasOwnProperty("environments")) {
+ if (!Array.isArray(message.environments))
+ return "environments: array expected";
+ for (var i = 0; i < message.environments.length; ++i)
+ switch (message.environments[i]) {
+ default:
+ return "environments: enum value[] expected";
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
+ }
+ return null;
+ };
+
+ /**
+ * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof google.cloud.functions.v2beta.LocationMetadata
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {google.cloud.functions.v2beta.LocationMetadata} LocationMetadata
+ */
+ LocationMetadata.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.cloud.functions.v2beta.LocationMetadata)
+ return object;
+ var message = new $root.google.cloud.functions.v2beta.LocationMetadata();
+ if (object.environments) {
+ if (!Array.isArray(object.environments))
+ throw TypeError(".google.cloud.functions.v2beta.LocationMetadata.environments: array expected");
+ message.environments = [];
+ for (var i = 0; i < object.environments.length; ++i)
+ switch (object.environments[i]) {
+ default:
+ if (typeof object.environments[i] === "number") {
+ message.environments[i] = object.environments[i];
+ break;
+ }
+ case "ENVIRONMENT_UNSPECIFIED":
+ case 0:
+ message.environments[i] = 0;
+ break;
+ case "GEN_1":
+ case 1:
+ message.environments[i] = 1;
+ break;
+ case "GEN_2":
+ case 2:
+ message.environments[i] = 2;
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof google.cloud.functions.v2beta.LocationMetadata
+ * @static
+ * @param {google.cloud.functions.v2beta.LocationMetadata} message LocationMetadata
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ LocationMetadata.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.arrays || options.defaults)
+ object.environments = [];
+ if (message.environments && message.environments.length) {
+ object.environments = [];
+ for (var j = 0; j < message.environments.length; ++j)
+ object.environments[j] = options.enums === String ? $root.google.cloud.functions.v2beta.Environment[message.environments[j]] === undefined ? message.environments[j] : $root.google.cloud.functions.v2beta.Environment[message.environments[j]] : message.environments[j];
+ }
+ return object;
+ };
+
+ /**
+ * Converts this LocationMetadata to JSON.
+ * @function toJSON
+ * @memberof google.cloud.functions.v2beta.LocationMetadata
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ LocationMetadata.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ /**
+ * Gets the default type url for LocationMetadata
+ * @function getTypeUrl
+ * @memberof google.cloud.functions.v2beta.LocationMetadata
+ * @static
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
+ * @returns {string} The default type url
+ */
+ LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
+ if (typeUrlPrefix === undefined) {
+ typeUrlPrefix = "type.googleapis.com";
+ }
+ return typeUrlPrefix + "/google.cloud.functions.v2beta.LocationMetadata";
+ };
+
+ return LocationMetadata;
+ })();
+
v2beta.Stage = (function() {
/**
@@ -45259,225 +46496,6 @@
return GeneratedCodeInfo;
})();
- protobuf.FieldMask = (function() {
-
- /**
- * Properties of a FieldMask.
- * @memberof google.protobuf
- * @interface IFieldMask
- * @property {Array.|null} [paths] FieldMask paths
- */
-
- /**
- * Constructs a new FieldMask.
- * @memberof google.protobuf
- * @classdesc Represents a FieldMask.
- * @implements IFieldMask
- * @constructor
- * @param {google.protobuf.IFieldMask=} [properties] Properties to set
- */
- function FieldMask(properties) {
- this.paths = [];
- if (properties)
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
- if (properties[keys[i]] != null)
- this[keys[i]] = properties[keys[i]];
- }
-
- /**
- * FieldMask paths.
- * @member {Array.} paths
- * @memberof google.protobuf.FieldMask
- * @instance
- */
- FieldMask.prototype.paths = $util.emptyArray;
-
- /**
- * Creates a new FieldMask instance using the specified properties.
- * @function create
- * @memberof google.protobuf.FieldMask
- * @static
- * @param {google.protobuf.IFieldMask=} [properties] Properties to set
- * @returns {google.protobuf.FieldMask} FieldMask instance
- */
- FieldMask.create = function create(properties) {
- return new FieldMask(properties);
- };
-
- /**
- * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
- * @function encode
- * @memberof google.protobuf.FieldMask
- * @static
- * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- FieldMask.encode = function encode(message, writer) {
- if (!writer)
- writer = $Writer.create();
- if (message.paths != null && message.paths.length)
- for (var i = 0; i < message.paths.length; ++i)
- writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]);
- return writer;
- };
-
- /**
- * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
- * @function encodeDelimited
- * @memberof google.protobuf.FieldMask
- * @static
- * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- FieldMask.encodeDelimited = function encodeDelimited(message, writer) {
- return this.encode(message, writer).ldelim();
- };
-
- /**
- * Decodes a FieldMask message from the specified reader or buffer.
- * @function decode
- * @memberof google.protobuf.FieldMask
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @param {number} [length] Message length if known beforehand
- * @returns {google.protobuf.FieldMask} FieldMask
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- FieldMask.decode = function decode(reader, length) {
- if (!(reader instanceof $Reader))
- reader = $Reader.create(reader);
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask();
- while (reader.pos < end) {
- var tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (!(message.paths && message.paths.length))
- message.paths = [];
- message.paths.push(reader.string());
- break;
- }
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- };
-
- /**
- * Decodes a FieldMask message from the specified reader or buffer, length delimited.
- * @function decodeDelimited
- * @memberof google.protobuf.FieldMask
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {google.protobuf.FieldMask} FieldMask
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- FieldMask.decodeDelimited = function decodeDelimited(reader) {
- if (!(reader instanceof $Reader))
- reader = new $Reader(reader);
- return this.decode(reader, reader.uint32());
- };
-
- /**
- * Verifies a FieldMask message.
- * @function verify
- * @memberof google.protobuf.FieldMask
- * @static
- * @param {Object.} message Plain object to verify
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
- */
- FieldMask.verify = function verify(message) {
- if (typeof message !== "object" || message === null)
- return "object expected";
- if (message.paths != null && message.hasOwnProperty("paths")) {
- if (!Array.isArray(message.paths))
- return "paths: array expected";
- for (var i = 0; i < message.paths.length; ++i)
- if (!$util.isString(message.paths[i]))
- return "paths: string[] expected";
- }
- return null;
- };
-
- /**
- * Creates a FieldMask message from a plain object. Also converts values to their respective internal types.
- * @function fromObject
- * @memberof google.protobuf.FieldMask
- * @static
- * @param {Object.} object Plain object
- * @returns {google.protobuf.FieldMask} FieldMask
- */
- FieldMask.fromObject = function fromObject(object) {
- if (object instanceof $root.google.protobuf.FieldMask)
- return object;
- var message = new $root.google.protobuf.FieldMask();
- if (object.paths) {
- if (!Array.isArray(object.paths))
- throw TypeError(".google.protobuf.FieldMask.paths: array expected");
- message.paths = [];
- for (var i = 0; i < object.paths.length; ++i)
- message.paths[i] = String(object.paths[i]);
- }
- return message;
- };
-
- /**
- * Creates a plain object from a FieldMask message. Also converts values to other types if specified.
- * @function toObject
- * @memberof google.protobuf.FieldMask
- * @static
- * @param {google.protobuf.FieldMask} message FieldMask
- * @param {$protobuf.IConversionOptions} [options] Conversion options
- * @returns {Object.} Plain object
- */
- FieldMask.toObject = function toObject(message, options) {
- if (!options)
- options = {};
- var object = {};
- if (options.arrays || options.defaults)
- object.paths = [];
- if (message.paths && message.paths.length) {
- object.paths = [];
- for (var j = 0; j < message.paths.length; ++j)
- object.paths[j] = message.paths[j];
- }
- return object;
- };
-
- /**
- * Converts this FieldMask to JSON.
- * @function toJSON
- * @memberof google.protobuf.FieldMask
- * @instance
- * @returns {Object.} JSON object
- */
- FieldMask.prototype.toJSON = function toJSON() {
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
- };
-
- /**
- * Gets the default type url for FieldMask
- * @function getTypeUrl
- * @memberof google.protobuf.FieldMask
- * @static
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
- * @returns {string} The default type url
- */
- FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
- if (typeUrlPrefix === undefined) {
- typeUrlPrefix = "type.googleapis.com";
- }
- return typeUrlPrefix + "/google.protobuf.FieldMask";
- };
-
- return FieldMask;
- })();
-
protobuf.Any = (function() {
/**
@@ -45714,25 +46732,25 @@
return Any;
})();
- protobuf.Duration = (function() {
+ protobuf.Timestamp = (function() {
/**
- * Properties of a Duration.
+ * Properties of a Timestamp.
* @memberof google.protobuf
- * @interface IDuration
- * @property {number|Long|null} [seconds] Duration seconds
- * @property {number|null} [nanos] Duration nanos
+ * @interface ITimestamp
+ * @property {number|Long|null} [seconds] Timestamp seconds
+ * @property {number|null} [nanos] Timestamp nanos
*/
/**
- * Constructs a new Duration.
+ * Constructs a new Timestamp.
* @memberof google.protobuf
- * @classdesc Represents a Duration.
- * @implements IDuration
+ * @classdesc Represents a Timestamp.
+ * @implements ITimestamp
* @constructor
- * @param {google.protobuf.IDuration=} [properties] Properties to set
+ * @param {google.protobuf.ITimestamp=} [properties] Properties to set
*/
- function Duration(properties) {
+ function Timestamp(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
@@ -45740,43 +46758,43 @@
}
/**
- * Duration seconds.
+ * Timestamp seconds.
* @member {number|Long} seconds
- * @memberof google.protobuf.Duration
+ * @memberof google.protobuf.Timestamp
* @instance
*/
- Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
+ Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
- * Duration nanos.
+ * Timestamp nanos.
* @member {number} nanos
- * @memberof google.protobuf.Duration
+ * @memberof google.protobuf.Timestamp
* @instance
*/
- Duration.prototype.nanos = 0;
+ Timestamp.prototype.nanos = 0;
/**
- * Creates a new Duration instance using the specified properties.
+ * Creates a new Timestamp instance using the specified properties.
* @function create
- * @memberof google.protobuf.Duration
+ * @memberof google.protobuf.Timestamp
* @static
- * @param {google.protobuf.IDuration=} [properties] Properties to set
- * @returns {google.protobuf.Duration} Duration instance
+ * @param {google.protobuf.ITimestamp=} [properties] Properties to set
+ * @returns {google.protobuf.Timestamp} Timestamp instance
*/
- Duration.create = function create(properties) {
- return new Duration(properties);
+ Timestamp.create = function create(properties) {
+ return new Timestamp(properties);
};
/**
- * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
+ * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
* @function encode
- * @memberof google.protobuf.Duration
+ * @memberof google.protobuf.Timestamp
* @static
- * @param {google.protobuf.IDuration} message Duration message or plain object to encode
+ * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
- Duration.encode = function encode(message, writer) {
+ Timestamp.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
@@ -45787,33 +46805,33 @@
};
/**
- * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
+ * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
* @function encodeDelimited
- * @memberof google.protobuf.Duration
+ * @memberof google.protobuf.Timestamp
* @static
- * @param {google.protobuf.IDuration} message Duration message or plain object to encode
+ * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
- Duration.encodeDelimited = function encodeDelimited(message, writer) {
+ Timestamp.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
- * Decodes a Duration message from the specified reader or buffer.
+ * Decodes a Timestamp message from the specified reader or buffer.
* @function decode
- * @memberof google.protobuf.Duration
+ * @memberof google.protobuf.Timestamp
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
- * @returns {google.protobuf.Duration} Duration
+ * @returns {google.protobuf.Timestamp} Timestamp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- Duration.decode = function decode(reader, length) {
+ Timestamp.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration();
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
@@ -45834,30 +46852,30 @@
};
/**
- * Decodes a Duration message from the specified reader or buffer, length delimited.
+ * Decodes a Timestamp message from the specified reader or buffer, length delimited.
* @function decodeDelimited
- * @memberof google.protobuf.Duration
+ * @memberof google.protobuf.Timestamp
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {google.protobuf.Duration} Duration
+ * @returns {google.protobuf.Timestamp} Timestamp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- Duration.decodeDelimited = function decodeDelimited(reader) {
+ Timestamp.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
- * Verifies a Duration message.
+ * Verifies a Timestamp message.
* @function verify
- * @memberof google.protobuf.Duration
+ * @memberof google.protobuf.Timestamp
* @static
* @param {Object.} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
- Duration.verify = function verify(message) {
+ Timestamp.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.seconds != null && message.hasOwnProperty("seconds"))
@@ -45870,17 +46888,17 @@
};
/**
- * Creates a Duration message from a plain object. Also converts values to their respective internal types.
+ * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
* @function fromObject
- * @memberof google.protobuf.Duration
+ * @memberof google.protobuf.Timestamp
* @static
* @param {Object.} object Plain object
- * @returns {google.protobuf.Duration} Duration
+ * @returns {google.protobuf.Timestamp} Timestamp
*/
- Duration.fromObject = function fromObject(object) {
- if (object instanceof $root.google.protobuf.Duration)
+ Timestamp.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.protobuf.Timestamp)
return object;
- var message = new $root.google.protobuf.Duration();
+ var message = new $root.google.protobuf.Timestamp();
if (object.seconds != null)
if ($util.Long)
(message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
@@ -45896,15 +46914,15 @@
};
/**
- * Creates a plain object from a Duration message. Also converts values to other types if specified.
+ * Creates a plain object from a Timestamp message. Also converts values to other types if specified.
* @function toObject
- * @memberof google.protobuf.Duration
+ * @memberof google.protobuf.Timestamp
* @static
- * @param {google.protobuf.Duration} message Duration
+ * @param {google.protobuf.Timestamp} message Timestamp
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.} Plain object
*/
- Duration.toObject = function toObject(message, options) {
+ Timestamp.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
@@ -45927,51 +46945,53 @@
};
/**
- * Converts this Duration to JSON.
+ * Converts this Timestamp to JSON.
* @function toJSON
- * @memberof google.protobuf.Duration
+ * @memberof google.protobuf.Timestamp
* @instance
* @returns {Object.} JSON object
*/
- Duration.prototype.toJSON = function toJSON() {
+ Timestamp.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
- * Gets the default type url for Duration
+ * Gets the default type url for Timestamp
* @function getTypeUrl
- * @memberof google.protobuf.Duration
+ * @memberof google.protobuf.Timestamp
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
- Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
+ Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
- return typeUrlPrefix + "/google.protobuf.Duration";
+ return typeUrlPrefix + "/google.protobuf.Timestamp";
};
- return Duration;
+ return Timestamp;
})();
- protobuf.Empty = (function() {
+ protobuf.FieldMask = (function() {
/**
- * Properties of an Empty.
+ * Properties of a FieldMask.
* @memberof google.protobuf
- * @interface IEmpty
+ * @interface IFieldMask
+ * @property {Array.|null} [paths] FieldMask paths
*/
/**
- * Constructs a new Empty.
+ * Constructs a new FieldMask.
* @memberof google.protobuf
- * @classdesc Represents an Empty.
- * @implements IEmpty
+ * @classdesc Represents a FieldMask.
+ * @implements IFieldMask
* @constructor
- * @param {google.protobuf.IEmpty=} [properties] Properties to set
+ * @param {google.protobuf.IFieldMask=} [properties] Properties to set
*/
- function Empty(properties) {
+ function FieldMask(properties) {
+ this.paths = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
@@ -45979,63 +46999,80 @@
}
/**
- * Creates a new Empty instance using the specified properties.
+ * FieldMask paths.
+ * @member {Array.} paths
+ * @memberof google.protobuf.FieldMask
+ * @instance
+ */
+ FieldMask.prototype.paths = $util.emptyArray;
+
+ /**
+ * Creates a new FieldMask instance using the specified properties.
* @function create
- * @memberof google.protobuf.Empty
+ * @memberof google.protobuf.FieldMask
* @static
- * @param {google.protobuf.IEmpty=} [properties] Properties to set
- * @returns {google.protobuf.Empty} Empty instance
+ * @param {google.protobuf.IFieldMask=} [properties] Properties to set
+ * @returns {google.protobuf.FieldMask} FieldMask instance
*/
- Empty.create = function create(properties) {
- return new Empty(properties);
+ FieldMask.create = function create(properties) {
+ return new FieldMask(properties);
};
/**
- * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.
+ * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
* @function encode
- * @memberof google.protobuf.Empty
+ * @memberof google.protobuf.FieldMask
* @static
- * @param {google.protobuf.IEmpty} message Empty message or plain object to encode
+ * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
- Empty.encode = function encode(message, writer) {
+ FieldMask.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
+ if (message.paths != null && message.paths.length)
+ for (var i = 0; i < message.paths.length; ++i)
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]);
return writer;
};
/**
- * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.
+ * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
* @function encodeDelimited
- * @memberof google.protobuf.Empty
+ * @memberof google.protobuf.FieldMask
* @static
- * @param {google.protobuf.IEmpty} message Empty message or plain object to encode
+ * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
- Empty.encodeDelimited = function encodeDelimited(message, writer) {
+ FieldMask.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
- * Decodes an Empty message from the specified reader or buffer.
+ * Decodes a FieldMask message from the specified reader or buffer.
* @function decode
- * @memberof google.protobuf.Empty
+ * @memberof google.protobuf.FieldMask
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
- * @returns {google.protobuf.Empty} Empty
+ * @returns {google.protobuf.FieldMask} FieldMask
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- Empty.decode = function decode(reader, length) {
+ FieldMask.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty();
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
+ case 1: {
+ if (!(message.paths && message.paths.length))
+ message.paths = [];
+ message.paths.push(reader.string());
+ break;
+ }
default:
reader.skipType(tag & 7);
break;
@@ -46045,110 +47082,135 @@
};
/**
- * Decodes an Empty message from the specified reader or buffer, length delimited.
+ * Decodes a FieldMask message from the specified reader or buffer, length delimited.
* @function decodeDelimited
- * @memberof google.protobuf.Empty
+ * @memberof google.protobuf.FieldMask
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {google.protobuf.Empty} Empty
+ * @returns {google.protobuf.FieldMask} FieldMask
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- Empty.decodeDelimited = function decodeDelimited(reader) {
+ FieldMask.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
- * Verifies an Empty message.
+ * Verifies a FieldMask message.
* @function verify
- * @memberof google.protobuf.Empty
+ * @memberof google.protobuf.FieldMask
* @static
* @param {Object.} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
- Empty.verify = function verify(message) {
+ FieldMask.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
+ if (message.paths != null && message.hasOwnProperty("paths")) {
+ if (!Array.isArray(message.paths))
+ return "paths: array expected";
+ for (var i = 0; i < message.paths.length; ++i)
+ if (!$util.isString(message.paths[i]))
+ return "paths: string[] expected";
+ }
return null;
};
/**
- * Creates an Empty message from a plain object. Also converts values to their respective internal types.
+ * Creates a FieldMask message from a plain object. Also converts values to their respective internal types.
* @function fromObject
- * @memberof google.protobuf.Empty
+ * @memberof google.protobuf.FieldMask
* @static
* @param {Object.} object Plain object
- * @returns {google.protobuf.Empty} Empty
+ * @returns {google.protobuf.FieldMask} FieldMask
*/
- Empty.fromObject = function fromObject(object) {
- if (object instanceof $root.google.protobuf.Empty)
+ FieldMask.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.protobuf.FieldMask)
return object;
- return new $root.google.protobuf.Empty();
+ var message = new $root.google.protobuf.FieldMask();
+ if (object.paths) {
+ if (!Array.isArray(object.paths))
+ throw TypeError(".google.protobuf.FieldMask.paths: array expected");
+ message.paths = [];
+ for (var i = 0; i < object.paths.length; ++i)
+ message.paths[i] = String(object.paths[i]);
+ }
+ return message;
};
/**
- * Creates a plain object from an Empty message. Also converts values to other types if specified.
+ * Creates a plain object from a FieldMask message. Also converts values to other types if specified.
* @function toObject
- * @memberof google.protobuf.Empty
+ * @memberof google.protobuf.FieldMask
* @static
- * @param {google.protobuf.Empty} message Empty
+ * @param {google.protobuf.FieldMask} message FieldMask
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.} Plain object
*/
- Empty.toObject = function toObject() {
- return {};
+ FieldMask.toObject = function toObject(message, options) {
+ if (!options)
+ options = {};
+ var object = {};
+ if (options.arrays || options.defaults)
+ object.paths = [];
+ if (message.paths && message.paths.length) {
+ object.paths = [];
+ for (var j = 0; j < message.paths.length; ++j)
+ object.paths[j] = message.paths[j];
+ }
+ return object;
};
/**
- * Converts this Empty to JSON.
+ * Converts this FieldMask to JSON.
* @function toJSON
- * @memberof google.protobuf.Empty
+ * @memberof google.protobuf.FieldMask
* @instance
* @returns {Object.} JSON object
*/
- Empty.prototype.toJSON = function toJSON() {
+ FieldMask.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
- * Gets the default type url for Empty
+ * Gets the default type url for FieldMask
* @function getTypeUrl
- * @memberof google.protobuf.Empty
+ * @memberof google.protobuf.FieldMask
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
- Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
+ FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
- return typeUrlPrefix + "/google.protobuf.Empty";
+ return typeUrlPrefix + "/google.protobuf.FieldMask";
};
- return Empty;
+ return FieldMask;
})();
- protobuf.Timestamp = (function() {
+ protobuf.Duration = (function() {
/**
- * Properties of a Timestamp.
+ * Properties of a Duration.
* @memberof google.protobuf
- * @interface ITimestamp
- * @property {number|Long|null} [seconds] Timestamp seconds
- * @property {number|null} [nanos] Timestamp nanos
+ * @interface IDuration
+ * @property {number|Long|null} [seconds] Duration seconds
+ * @property {number|null} [nanos] Duration nanos
*/
/**
- * Constructs a new Timestamp.
+ * Constructs a new Duration.
* @memberof google.protobuf
- * @classdesc Represents a Timestamp.
- * @implements ITimestamp
+ * @classdesc Represents a Duration.
+ * @implements IDuration
* @constructor
- * @param {google.protobuf.ITimestamp=} [properties] Properties to set
+ * @param {google.protobuf.IDuration=} [properties] Properties to set
*/
- function Timestamp(properties) {
+ function Duration(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
@@ -46156,43 +47218,43 @@
}
/**
- * Timestamp seconds.
+ * Duration seconds.
* @member {number|Long} seconds
- * @memberof google.protobuf.Timestamp
+ * @memberof google.protobuf.Duration
* @instance
*/
- Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
+ Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
- * Timestamp nanos.
+ * Duration nanos.
* @member {number} nanos
- * @memberof google.protobuf.Timestamp
+ * @memberof google.protobuf.Duration
* @instance
*/
- Timestamp.prototype.nanos = 0;
+ Duration.prototype.nanos = 0;
/**
- * Creates a new Timestamp instance using the specified properties.
+ * Creates a new Duration instance using the specified properties.
* @function create
- * @memberof google.protobuf.Timestamp
+ * @memberof google.protobuf.Duration
* @static
- * @param {google.protobuf.ITimestamp=} [properties] Properties to set
- * @returns {google.protobuf.Timestamp} Timestamp instance
+ * @param {google.protobuf.IDuration=} [properties] Properties to set
+ * @returns {google.protobuf.Duration} Duration instance
*/
- Timestamp.create = function create(properties) {
- return new Timestamp(properties);
+ Duration.create = function create(properties) {
+ return new Duration(properties);
};
/**
- * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
+ * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
* @function encode
- * @memberof google.protobuf.Timestamp
+ * @memberof google.protobuf.Duration
* @static
- * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
+ * @param {google.protobuf.IDuration} message Duration message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
- Timestamp.encode = function encode(message, writer) {
+ Duration.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
@@ -46203,33 +47265,33 @@
};
/**
- * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
+ * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
* @function encodeDelimited
- * @memberof google.protobuf.Timestamp
+ * @memberof google.protobuf.Duration
* @static
- * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
+ * @param {google.protobuf.IDuration} message Duration message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
- Timestamp.encodeDelimited = function encodeDelimited(message, writer) {
+ Duration.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
- * Decodes a Timestamp message from the specified reader or buffer.
+ * Decodes a Duration message from the specified reader or buffer.
* @function decode
- * @memberof google.protobuf.Timestamp
+ * @memberof google.protobuf.Duration
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
- * @returns {google.protobuf.Timestamp} Timestamp
+ * @returns {google.protobuf.Duration} Duration
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- Timestamp.decode = function decode(reader, length) {
+ Duration.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp();
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
@@ -46250,30 +47312,30 @@
};
/**
- * Decodes a Timestamp message from the specified reader or buffer, length delimited.
+ * Decodes a Duration message from the specified reader or buffer, length delimited.
* @function decodeDelimited
- * @memberof google.protobuf.Timestamp
+ * @memberof google.protobuf.Duration
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {google.protobuf.Timestamp} Timestamp
+ * @returns {google.protobuf.Duration} Duration
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
- Timestamp.decodeDelimited = function decodeDelimited(reader) {
+ Duration.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
- * Verifies a Timestamp message.
+ * Verifies a Duration message.
* @function verify
- * @memberof google.protobuf.Timestamp
+ * @memberof google.protobuf.Duration
* @static
* @param {Object.} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
- Timestamp.verify = function verify(message) {
+ Duration.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.seconds != null && message.hasOwnProperty("seconds"))
@@ -46286,17 +47348,17 @@
};
/**
- * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
+ * Creates a Duration message from a plain object. Also converts values to their respective internal types.
* @function fromObject
- * @memberof google.protobuf.Timestamp
+ * @memberof google.protobuf.Duration
* @static
* @param {Object.} object Plain object
- * @returns {google.protobuf.Timestamp} Timestamp
+ * @returns {google.protobuf.Duration} Duration
*/
- Timestamp.fromObject = function fromObject(object) {
- if (object instanceof $root.google.protobuf.Timestamp)
+ Duration.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.protobuf.Duration)
return object;
- var message = new $root.google.protobuf.Timestamp();
+ var message = new $root.google.protobuf.Duration();
if (object.seconds != null)
if ($util.Long)
(message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
@@ -46312,15 +47374,15 @@
};
/**
- * Creates a plain object from a Timestamp message. Also converts values to other types if specified.
+ * Creates a plain object from a Duration message. Also converts values to other types if specified.
* @function toObject
- * @memberof google.protobuf.Timestamp
+ * @memberof google.protobuf.Duration
* @static
- * @param {google.protobuf.Timestamp} message Timestamp
+ * @param {google.protobuf.Duration} message Duration
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.} Plain object
*/
- Timestamp.toObject = function toObject(message, options) {
+ Duration.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
@@ -46343,32 +47405,207 @@
};
/**
- * Converts this Timestamp to JSON.
+ * Converts this Duration to JSON.
* @function toJSON
- * @memberof google.protobuf.Timestamp
+ * @memberof google.protobuf.Duration
* @instance
* @returns {Object.} JSON object
*/
- Timestamp.prototype.toJSON = function toJSON() {
+ Duration.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
- * Gets the default type url for Timestamp
+ * Gets the default type url for Duration
* @function getTypeUrl
- * @memberof google.protobuf.Timestamp
+ * @memberof google.protobuf.Duration
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
- Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
+ Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
- return typeUrlPrefix + "/google.protobuf.Timestamp";
+ return typeUrlPrefix + "/google.protobuf.Duration";
};
- return Timestamp;
+ return Duration;
+ })();
+
+ protobuf.Empty = (function() {
+
+ /**
+ * Properties of an Empty.
+ * @memberof google.protobuf
+ * @interface IEmpty
+ */
+
+ /**
+ * Constructs a new Empty.
+ * @memberof google.protobuf
+ * @classdesc Represents an Empty.
+ * @implements IEmpty
+ * @constructor
+ * @param {google.protobuf.IEmpty=} [properties] Properties to set
+ */
+ function Empty(properties) {
+ if (properties)
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
+ if (properties[keys[i]] != null)
+ this[keys[i]] = properties[keys[i]];
+ }
+
+ /**
+ * Creates a new Empty instance using the specified properties.
+ * @function create
+ * @memberof google.protobuf.Empty
+ * @static
+ * @param {google.protobuf.IEmpty=} [properties] Properties to set
+ * @returns {google.protobuf.Empty} Empty instance
+ */
+ Empty.create = function create(properties) {
+ return new Empty(properties);
+ };
+
+ /**
+ * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.
+ * @function encode
+ * @memberof google.protobuf.Empty
+ * @static
+ * @param {google.protobuf.IEmpty} message Empty message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ Empty.encode = function encode(message, writer) {
+ if (!writer)
+ writer = $Writer.create();
+ return writer;
+ };
+
+ /**
+ * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.
+ * @function encodeDelimited
+ * @memberof google.protobuf.Empty
+ * @static
+ * @param {google.protobuf.IEmpty} message Empty message or plain object to encode
+ * @param {$protobuf.Writer} [writer] Writer to encode to
+ * @returns {$protobuf.Writer} Writer
+ */
+ Empty.encodeDelimited = function encodeDelimited(message, writer) {
+ return this.encode(message, writer).ldelim();
+ };
+
+ /**
+ * Decodes an Empty message from the specified reader or buffer.
+ * @function decode
+ * @memberof google.protobuf.Empty
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @param {number} [length] Message length if known beforehand
+ * @returns {google.protobuf.Empty} Empty
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ Empty.decode = function decode(reader, length) {
+ if (!(reader instanceof $Reader))
+ reader = $Reader.create(reader);
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty();
+ while (reader.pos < end) {
+ var tag = reader.uint32();
+ switch (tag >>> 3) {
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ };
+
+ /**
+ * Decodes an Empty message from the specified reader or buffer, length delimited.
+ * @function decodeDelimited
+ * @memberof google.protobuf.Empty
+ * @static
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
+ * @returns {google.protobuf.Empty} Empty
+ * @throws {Error} If the payload is not a reader or valid buffer
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
+ */
+ Empty.decodeDelimited = function decodeDelimited(reader) {
+ if (!(reader instanceof $Reader))
+ reader = new $Reader(reader);
+ return this.decode(reader, reader.uint32());
+ };
+
+ /**
+ * Verifies an Empty message.
+ * @function verify
+ * @memberof google.protobuf.Empty
+ * @static
+ * @param {Object.} message Plain object to verify
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
+ */
+ Empty.verify = function verify(message) {
+ if (typeof message !== "object" || message === null)
+ return "object expected";
+ return null;
+ };
+
+ /**
+ * Creates an Empty message from a plain object. Also converts values to their respective internal types.
+ * @function fromObject
+ * @memberof google.protobuf.Empty
+ * @static
+ * @param {Object.} object Plain object
+ * @returns {google.protobuf.Empty} Empty
+ */
+ Empty.fromObject = function fromObject(object) {
+ if (object instanceof $root.google.protobuf.Empty)
+ return object;
+ return new $root.google.protobuf.Empty();
+ };
+
+ /**
+ * Creates a plain object from an Empty message. Also converts values to other types if specified.
+ * @function toObject
+ * @memberof google.protobuf.Empty
+ * @static
+ * @param {google.protobuf.Empty} message Empty
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
+ * @returns {Object.} Plain object
+ */
+ Empty.toObject = function toObject() {
+ return {};
+ };
+
+ /**
+ * Converts this Empty to JSON.
+ * @function toJSON
+ * @memberof google.protobuf.Empty
+ * @instance
+ * @returns {Object.} JSON object
+ */
+ Empty.prototype.toJSON = function toJSON() {
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
+ };
+
+ /**
+ * Gets the default type url for Empty
+ * @function getTypeUrl
+ * @memberof google.protobuf.Empty
+ * @static
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
+ * @returns {string} The default type url
+ */
+ Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
+ if (typeUrlPrefix === undefined) {
+ typeUrlPrefix = "type.googleapis.com";
+ }
+ return typeUrlPrefix + "/google.protobuf.Empty";
+ };
+
+ return Empty;
})();
return protobuf;
diff --git a/packages/google-cloud-functions/protos/protos.json b/packages/google-cloud-functions/protos/protos.json
index b4479d70e73..b9497f52180 100644
--- a/packages/google-cloud-functions/protos/protos.json
+++ b/packages/google-cloud-functions/protos/protos.json
@@ -1014,10 +1014,6 @@
"type": "string",
"id": 1
},
- "environment": {
- "type": "Environment",
- "id": 10
- },
"description": {
"type": "string",
"id": 2
@@ -1061,12 +1057,9 @@
"(google.api.field_behavior)": "OUTPUT_ONLY"
}
},
- "kmsKeyName": {
- "type": "string",
- "id": 25,
- "options": {
- "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey"
- }
+ "environment": {
+ "type": "Environment",
+ "id": 10
},
"url": {
"type": "string",
@@ -1074,6 +1067,13 @@
"options": {
"(google.api.field_behavior)": "OUTPUT_ONLY"
}
+ },
+ "kmsKeyName": {
+ "type": "string",
+ "id": 25,
+ "options": {
+ "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey"
+ }
}
},
"nested": {
@@ -1247,10 +1247,7 @@
},
"dockerRegistry": {
"type": "DockerRegistry",
- "id": 10,
- "options": {
- "(google.api.field_behavior)": "OPTIONAL"
- }
+ "id": 10
},
"dockerRepository": {
"type": "string",
@@ -1796,6 +1793,15 @@
}
}
},
+ "LocationMetadata": {
+ "fields": {
+ "environments": {
+ "rule": "repeated",
+ "type": "Environment",
+ "id": 1
+ }
+ }
+ },
"Stage": {
"fields": {
"name": {
@@ -1855,8 +1861,8 @@
"java_outer_classname": "FunctionsProto",
"java_package": "com.google.cloud.functions.v2alpha",
"objc_class_prefix": "GCF",
- "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic",
- "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}"
+ "(google.api.resource_definition).type": "cloudkms.googleapis.com/CryptoKey",
+ "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
},
"nested": {
"FunctionService": {
@@ -2054,10 +2060,6 @@
"type": "string",
"id": 1
},
- "environment": {
- "type": "Environment",
- "id": 10
- },
"description": {
"type": "string",
"id": 2
@@ -2100,6 +2102,24 @@
"options": {
"(google.api.field_behavior)": "OUTPUT_ONLY"
}
+ },
+ "environment": {
+ "type": "Environment",
+ "id": 10
+ },
+ "url": {
+ "type": "string",
+ "id": 14,
+ "options": {
+ "(google.api.field_behavior)": "OUTPUT_ONLY"
+ }
+ },
+ "kmsKeyName": {
+ "type": "string",
+ "id": 25,
+ "options": {
+ "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey"
+ }
}
},
"nested": {
@@ -2271,14 +2291,26 @@
"type": "string",
"id": 6
},
+ "dockerRegistry": {
+ "type": "DockerRegistry",
+ "id": 10
+ },
"dockerRepository": {
"type": "string",
"id": 7,
"options": {
- "(google.api.field_behavior)": "OPTIONAL",
"(google.api.resource_reference).type": "artifactregistry.googleapis.com/Repository"
}
}
+ },
+ "nested": {
+ "DockerRegistry": {
+ "values": {
+ "DOCKER_REGISTRY_UNSPECIFIED": 0,
+ "CONTAINER_REGISTRY": 1,
+ "ARTIFACT_REGISTRY": 2
+ }
+ }
}
},
"ServiceConfig": {
@@ -2299,6 +2331,10 @@
"type": "string",
"id": 13
},
+ "availableCpu": {
+ "type": "string",
+ "id": 22
+ },
"environmentVariables": {
"keyType": "string",
"type": "string",
@@ -2358,6 +2394,14 @@
"options": {
"(google.api.field_behavior)": "OUTPUT_ONLY"
}
+ },
+ "maxInstanceRequestConcurrency": {
+ "type": "int32",
+ "id": 20
+ },
+ "securityLevel": {
+ "type": "SecurityLevel",
+ "id": 21
}
},
"nested": {
@@ -2375,6 +2419,13 @@
"ALLOW_INTERNAL_ONLY": 2,
"ALLOW_INTERNAL_AND_GCLB": 3
}
+ },
+ "SecurityLevel": {
+ "values": {
+ "SECURITY_LEVEL_UNSPECIFIED": 0,
+ "SECURE_ALWAYS": 1,
+ "SECURE_OPTIONAL": 2
+ }
}
}
},
@@ -2642,6 +2693,13 @@
"(google.api.field_behavior)": "REQUIRED",
"(google.api.resource_reference).type": "locations.googleapis.com/Location"
}
+ },
+ "kmsKeyName": {
+ "type": "string",
+ "id": 2,
+ "options": {
+ "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey"
+ }
}
}
},
@@ -2781,6 +2839,15 @@
}
}
},
+ "LocationMetadata": {
+ "fields": {
+ "environments": {
+ "rule": "repeated",
+ "type": "Environment",
+ "id": 1
+ }
+ }
+ },
"Stage": {
"fields": {
"name": {
@@ -2840,8 +2907,8 @@
"java_outer_classname": "FunctionsProto",
"java_package": "com.google.cloud.functions.v2beta",
"objc_class_prefix": "GCF",
- "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic",
- "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}"
+ "(google.api.resource_definition).type": "cloudkms.googleapis.com/CryptoKey",
+ "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
},
"nested": {
"FunctionService": {
@@ -3039,10 +3106,6 @@
"type": "string",
"id": 1
},
- "environment": {
- "type": "Environment",
- "id": 10
- },
"description": {
"type": "string",
"id": 2
@@ -3085,6 +3148,24 @@
"options": {
"(google.api.field_behavior)": "OUTPUT_ONLY"
}
+ },
+ "environment": {
+ "type": "Environment",
+ "id": 10
+ },
+ "url": {
+ "type": "string",
+ "id": 14,
+ "options": {
+ "(google.api.field_behavior)": "OUTPUT_ONLY"
+ }
+ },
+ "kmsKeyName": {
+ "type": "string",
+ "id": 25,
+ "options": {
+ "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey"
+ }
}
},
"nested": {
@@ -3256,14 +3337,26 @@
"type": "string",
"id": 6
},
+ "dockerRegistry": {
+ "type": "DockerRegistry",
+ "id": 10
+ },
"dockerRepository": {
"type": "string",
"id": 7,
"options": {
- "(google.api.field_behavior)": "OPTIONAL",
"(google.api.resource_reference).type": "artifactregistry.googleapis.com/Repository"
}
}
+ },
+ "nested": {
+ "DockerRegistry": {
+ "values": {
+ "DOCKER_REGISTRY_UNSPECIFIED": 0,
+ "CONTAINER_REGISTRY": 1,
+ "ARTIFACT_REGISTRY": 2
+ }
+ }
}
},
"ServiceConfig": {
@@ -3284,6 +3377,10 @@
"type": "string",
"id": 13
},
+ "availableCpu": {
+ "type": "string",
+ "id": 22
+ },
"environmentVariables": {
"keyType": "string",
"type": "string",
@@ -3343,6 +3440,14 @@
"options": {
"(google.api.field_behavior)": "OUTPUT_ONLY"
}
+ },
+ "maxInstanceRequestConcurrency": {
+ "type": "int32",
+ "id": 20
+ },
+ "securityLevel": {
+ "type": "SecurityLevel",
+ "id": 21
}
},
"nested": {
@@ -3360,6 +3465,13 @@
"ALLOW_INTERNAL_ONLY": 2,
"ALLOW_INTERNAL_AND_GCLB": 3
}
+ },
+ "SecurityLevel": {
+ "values": {
+ "SECURITY_LEVEL_UNSPECIFIED": 0,
+ "SECURE_ALWAYS": 1,
+ "SECURE_OPTIONAL": 2
+ }
}
}
},
@@ -3627,6 +3739,13 @@
"(google.api.field_behavior)": "REQUIRED",
"(google.api.resource_reference).type": "locations.googleapis.com/Location"
}
+ },
+ "kmsKeyName": {
+ "type": "string",
+ "id": 2,
+ "options": {
+ "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey"
+ }
}
}
},
@@ -3766,6 +3885,15 @@
}
}
},
+ "LocationMetadata": {
+ "fields": {
+ "environments": {
+ "rule": "repeated",
+ "type": "Environment",
+ "id": 1
+ }
+ }
+ },
"Stage": {
"fields": {
"name": {
@@ -4963,15 +5091,6 @@
}
}
},
- "FieldMask": {
- "fields": {
- "paths": {
- "rule": "repeated",
- "type": "string",
- "id": 1
- }
- }
- },
"Any": {
"fields": {
"type_url": {
@@ -4984,7 +5103,7 @@
}
}
},
- "Duration": {
+ "Timestamp": {
"fields": {
"seconds": {
"type": "int64",
@@ -4996,10 +5115,16 @@
}
}
},
- "Empty": {
- "fields": {}
+ "FieldMask": {
+ "fields": {
+ "paths": {
+ "rule": "repeated",
+ "type": "string",
+ "id": 1
+ }
+ }
},
- "Timestamp": {
+ "Duration": {
"fields": {
"seconds": {
"type": "int64",
@@ -5010,6 +5135,9 @@
"id": 2
}
}
+ },
+ "Empty": {
+ "fields": {}
}
}
},
diff --git a/packages/google-cloud-functions/samples/README.md b/packages/google-cloud-functions/samples/README.md
index d893421d77f..6bbc06056d4 100644
--- a/packages/google-cloud-functions/samples/README.md
+++ b/packages/google-cloud-functions/samples/README.md
@@ -48,7 +48,6 @@
* [Function_service.list_runtimes](#function_service.list_runtimes)
* [Function_service.update_function](#function_service.update_function)
* [Quickstart](#quickstart)
- * [Quickstart.test](#quickstart.test)
## Before you begin
@@ -672,23 +671,6 @@ __Usage:__
`node packages/google-cloud-functions/samples/quickstart.js`
------
-
-
-
-
-### Quickstart.test
-
-View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-functions/samples/test/quickstart.test.js).
-
-[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-functions/samples/test/quickstart.test.js,samples/README.md)
-
-__Usage:__
-
-
-`node packages/google-cloud-functions/samples/test/quickstart.test.js`
-
-
diff --git a/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js b/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js
index 8123cdbc6ff..dbb4c91641e 100644
--- a/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js
+++ b/packages/google-cloud-functions/samples/generated/v1/cloud_functions_service.create_function.js
@@ -29,8 +29,8 @@ function main(location, function1) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
- * Required. The project and location in which the function should be created, specified
- * in the format `projects/* /locations/*`
+ * Required. The project and location in which the function should be created,
+ * specified in the format `projects/* /locations/*`
*/
// const location = 'abc123'
/**
diff --git a/packages/google-cloud-functions/samples/generated/v1/snippet_metadata.google.cloud.functions.v1.json b/packages/google-cloud-functions/samples/generated/v1/snippet_metadata.google.cloud.functions.v1.json
index 3fe3030b6b9..41cafa9ca8e 100644
--- a/packages/google-cloud-functions/samples/generated/v1/snippet_metadata.google.cloud.functions.v1.json
+++ b/packages/google-cloud-functions/samples/generated/v1/snippet_metadata.google.cloud.functions.v1.json
@@ -1,7 +1,7 @@
{
"clientLibrary": {
"name": "nodejs-functions",
- "version": "2.4.0",
+ "version": "2.4.1",
"language": "TYPESCRIPT",
"apis": [
{
@@ -103,7 +103,7 @@
"regionTag": "cloudfunctions_v1_generated_CloudFunctionsService_CreateFunction_async",
"title": "CloudFunctionsService createFunction Sample",
"origin": "API_DEFINITION",
- "description": " 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.",
+ "description": " Creates a new function. If a function with the given name already exists in the specified project, the long running operation returns an `ALREADY_EXISTS` error.",
"canonical": true,
"file": "cloud_functions_service.create_function.js",
"language": "JAVASCRIPT",
@@ -191,7 +191,7 @@
"regionTag": "cloudfunctions_v1_generated_CloudFunctionsService_DeleteFunction_async",
"title": "CloudFunctionsService deleteFunction Sample",
"origin": "API_DEFINITION",
- "description": " 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.",
+ "description": " Deletes a function with the given name from the specified project. If the given function is used by some trigger, the trigger is updated to remove this function.",
"canonical": true,
"file": "cloud_functions_service.delete_function.js",
"language": "JAVASCRIPT",
@@ -275,7 +275,7 @@
"regionTag": "cloudfunctions_v1_generated_CloudFunctionsService_GenerateUploadUrl_async",
"title": "CloudFunctionsService generateUploadUrl Sample",
"origin": "API_DEFINITION",
- "description": " 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`",
+ "description": " 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 an HTTP PUT request, these two headers must be specified: * `content-type: application/zip` * `x-goog-content-length-range: 0,104857600` And this header must NOT be specified: * `Authorization: Bearer YOUR_TOKEN`",
"canonical": true,
"file": "cloud_functions_service.generate_upload_url.js",
"language": "JAVASCRIPT",
@@ -319,7 +319,7 @@
"regionTag": "cloudfunctions_v1_generated_CloudFunctionsService_GenerateDownloadUrl_async",
"title": "CloudFunctionsService generateDownloadUrl Sample",
"origin": "API_DEFINITION",
- "description": " 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",
+ "description": " Returns a signed URL for downloading deployed function source code. The URL is only valid for a limited period and must 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",
"canonical": true,
"file": "cloud_functions_service.generate_download_url.js",
"language": "JAVASCRIPT",
@@ -455,7 +455,7 @@
"regionTag": "cloudfunctions_v1_generated_CloudFunctionsService_TestIamPermissions_async",
"title": "CloudFunctionsService testIamPermissions Sample",
"origin": "API_DEFINITION",
- "description": " 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.",
+ "description": " Tests the specified permissions against the IAM access control policy for a function. If the function does not exist, this returns an empty set of permissions, not a NOT_FOUND error.",
"canonical": true,
"file": "cloud_functions_service.test_iam_permissions.js",
"language": "JAVASCRIPT",
diff --git a/packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js b/packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js
index a38d4bf7647..e5ad4b903cb 100644
--- a/packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js
+++ b/packages/google-cloud-functions/samples/generated/v2/function_service.generate_upload_url.js
@@ -34,7 +34,7 @@ function main(parent) {
*/
// const parent = 'abc123'
/**
- * Resource name of a KMS crypto key (managed by the user) used to
+ * Preview Resource name of a KMS crypto key (managed by the user) used to
* encrypt/decrypt function source code objects in intermediate Cloud Storage
* buckets. When you generate an upload url and upload your source code, it
* gets copied to an intermediate Cloud Storage bucket. The source code is
diff --git a/packages/google-cloud-functions/samples/generated/v2/snippet_metadata.google.cloud.functions.v2.json b/packages/google-cloud-functions/samples/generated/v2/snippet_metadata.google.cloud.functions.v2.json
index d4e5aa304a6..2a095dc4e6d 100644
--- a/packages/google-cloud-functions/samples/generated/v2/snippet_metadata.google.cloud.functions.v2.json
+++ b/packages/google-cloud-functions/samples/generated/v2/snippet_metadata.google.cloud.functions.v2.json
@@ -1,7 +1,7 @@
{
"clientLibrary": {
"name": "nodejs-functions",
- "version": "2.4.0",
+ "version": "2.4.1",
"language": "TYPESCRIPT",
"apis": [
{
diff --git a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js
index ff03605baf7..0f5680a4aa3 100644
--- a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js
+++ b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.create_function.js
@@ -29,8 +29,8 @@ function main(parent, function1) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
- * Required. The project and location in which the function should be created, specified
- * in the format `projects/* /locations/*`
+ * Required. The project and location in which the function should be created,
+ * specified in the format `projects/* /locations/*`
*/
// const parent = 'abc123'
/**
diff --git a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js
index 31bc30fa7e3..aef6c59f518 100644
--- a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js
+++ b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_download_url.js
@@ -29,8 +29,8 @@ function main(name) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
- * Required. The name of function for which source code Google Cloud Storage signed
- * URL should be generated.
+ * Required. The name of function for which source code Google Cloud Storage
+ * signed URL should be generated.
*/
// const name = 'abc123'
diff --git a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js
index df16519d713..06ed9cd3085 100644
--- a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js
+++ b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.generate_upload_url.js
@@ -29,10 +29,26 @@ function main(parent) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
- * Required. The project and location in which the Google Cloud Storage signed URL
- * should be generated, specified in the format `projects/* /locations/*`.
+ * Required. The project and location in which the Google Cloud Storage signed
+ * URL should be generated, specified in the format `projects/* /locations/*`.
*/
// const parent = 'abc123'
+ /**
+ * Preview Resource name of a KMS crypto key (managed by the user) used to
+ * encrypt/decrypt function source code objects in intermediate Cloud Storage
+ * buckets. When you generate an upload url and upload your source code, it
+ * gets copied to an intermediate Cloud Storage bucket. The source code is
+ * then copied to a versioned directory in the sources bucket in the consumer
+ * project during the function deployment.
+ * It must match the pattern
+ * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+ * The Google Cloud Functions service account
+ * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+ * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+ * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+ * Key/KeyRing/Project/Organization (least access preferred).
+ */
+ // const kmsKeyName = 'abc123'
// Imports the Functions library
const {FunctionServiceClient} = require('@google-cloud/functions').v2alpha;
diff --git a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js
index d57906c8de3..9e131b18177 100644
--- a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js
+++ b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_functions.js
@@ -29,16 +29,19 @@ function main(parent) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
- * Required. The project and location from which the function should be listed,
- * specified in the format `projects/* /locations/*`
- * If you want to list functions in all locations, use "-" in place of a
- * location. When listing functions in all locations, if one or more
- * location(s) are unreachable, the response will contain functions from all
- * reachable locations along with the names of any unreachable locations.
+ * Required. The project and location from which the function should be
+ * listed, specified in the format `projects/* /locations/*` If you want to
+ * list functions in all locations, use "-" in place of a location. When
+ * listing functions in all locations, if one or more location(s) are
+ * unreachable, the response will contain functions from all reachable
+ * locations along with the names of any unreachable locations.
*/
// const parent = 'abc123'
/**
- * Maximum number of functions to return per call.
+ * Maximum number of functions to return per call. The largest allowed
+ * page_size is 1,000, if the page_size is omitted or specified as greater
+ * than 1,000 then it will be replaced as 1,000. The size of the list
+ * response can be less than specified when used with filters.
*/
// const pageSize = 1234
/**
diff --git a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js
index 9445b4dbb54..9a5754e50d3 100644
--- a/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js
+++ b/packages/google-cloud-functions/samples/generated/v2alpha/function_service.list_runtimes.js
@@ -29,8 +29,8 @@ function main(parent) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
- * Required. The project and location from which the runtimes should be listed,
- * specified in the format `projects/* /locations/*`
+ * Required. The project and location from which the runtimes should be
+ * listed, specified in the format `projects/* /locations/*`
*/
// const parent = 'abc123'
/**
diff --git a/packages/google-cloud-functions/samples/generated/v2alpha/snippet_metadata.google.cloud.functions.v2alpha.json b/packages/google-cloud-functions/samples/generated/v2alpha/snippet_metadata.google.cloud.functions.v2alpha.json
index 3654494c305..7ecda0aa592 100644
--- a/packages/google-cloud-functions/samples/generated/v2alpha/snippet_metadata.google.cloud.functions.v2alpha.json
+++ b/packages/google-cloud-functions/samples/generated/v2alpha/snippet_metadata.google.cloud.functions.v2alpha.json
@@ -1,7 +1,7 @@
{
"clientLibrary": {
"name": "nodejs-functions",
- "version": "2.4.0",
+ "version": "2.4.1",
"language": "TYPESCRIPT",
"apis": [
{
@@ -62,7 +62,7 @@
"segments": [
{
"start": 25,
- "end": 82,
+ "end": 85,
"type": "FULL"
}
],
@@ -250,7 +250,7 @@
"segments": [
{
"start": 25,
- "end": 54,
+ "end": 70,
"type": "FULL"
}
],
@@ -262,6 +262,10 @@
{
"name": "parent",
"type": "TYPE_STRING"
+ },
+ {
+ "name": "kms_key_name",
+ "type": "TYPE_STRING"
}
],
"resultType": ".google.cloud.functions.v2alpha.GenerateUploadUrlResponse",
diff --git a/packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js b/packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js
index 8a66e94ed05..aed5e22444d 100644
--- a/packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js
+++ b/packages/google-cloud-functions/samples/generated/v2beta/function_service.create_function.js
@@ -29,8 +29,8 @@ function main(parent, function1) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
- * Required. The project and location in which the function should be created, specified
- * in the format `projects/* /locations/*`
+ * Required. The project and location in which the function should be created,
+ * specified in the format `projects/* /locations/*`
*/
// const parent = 'abc123'
/**
diff --git a/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js b/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js
index 0031d52029b..cc28d633047 100644
--- a/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js
+++ b/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_download_url.js
@@ -29,8 +29,8 @@ function main(name) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
- * Required. The name of function for which source code Google Cloud Storage signed
- * URL should be generated.
+ * Required. The name of function for which source code Google Cloud Storage
+ * signed URL should be generated.
*/
// const name = 'abc123'
diff --git a/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js b/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js
index ad28b36f996..a148b14523d 100644
--- a/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js
+++ b/packages/google-cloud-functions/samples/generated/v2beta/function_service.generate_upload_url.js
@@ -29,10 +29,26 @@ function main(parent) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
- * Required. The project and location in which the Google Cloud Storage signed URL
- * should be generated, specified in the format `projects/* /locations/*`.
+ * Required. The project and location in which the Google Cloud Storage signed
+ * URL should be generated, specified in the format `projects/* /locations/*`.
*/
// const parent = 'abc123'
+ /**
+ * Preview Resource name of a KMS crypto key (managed by the user) used to
+ * encrypt/decrypt function source code objects in intermediate Cloud Storage
+ * buckets. When you generate an upload url and upload your source code, it
+ * gets copied to an intermediate Cloud Storage bucket. The source code is
+ * then copied to a versioned directory in the sources bucket in the consumer
+ * project during the function deployment.
+ * It must match the pattern
+ * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+ * The Google Cloud Functions service account
+ * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+ * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+ * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+ * Key/KeyRing/Project/Organization (least access preferred).
+ */
+ // const kmsKeyName = 'abc123'
// Imports the Functions library
const {FunctionServiceClient} = require('@google-cloud/functions').v2beta;
diff --git a/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js b/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js
index 31ce53abc21..c1eaa32538e 100644
--- a/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js
+++ b/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_functions.js
@@ -29,16 +29,19 @@ function main(parent) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
- * Required. The project and location from which the function should be listed,
- * specified in the format `projects/* /locations/*`
- * If you want to list functions in all locations, use "-" in place of a
- * location. When listing functions in all locations, if one or more
- * location(s) are unreachable, the response will contain functions from all
- * reachable locations along with the names of any unreachable locations.
+ * Required. The project and location from which the function should be
+ * listed, specified in the format `projects/* /locations/*` If you want to
+ * list functions in all locations, use "-" in place of a location. When
+ * listing functions in all locations, if one or more location(s) are
+ * unreachable, the response will contain functions from all reachable
+ * locations along with the names of any unreachable locations.
*/
// const parent = 'abc123'
/**
- * Maximum number of functions to return per call.
+ * Maximum number of functions to return per call. The largest allowed
+ * page_size is 1,000, if the page_size is omitted or specified as greater
+ * than 1,000 then it will be replaced as 1,000. The size of the list
+ * response can be less than specified when used with filters.
*/
// const pageSize = 1234
/**
diff --git a/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js b/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js
index 534741537f7..7e10600b474 100644
--- a/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js
+++ b/packages/google-cloud-functions/samples/generated/v2beta/function_service.list_runtimes.js
@@ -29,8 +29,8 @@ function main(parent) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
- * Required. The project and location from which the runtimes should be listed,
- * specified in the format `projects/* /locations/*`
+ * Required. The project and location from which the runtimes should be
+ * listed, specified in the format `projects/* /locations/*`
*/
// const parent = 'abc123'
/**
diff --git a/packages/google-cloud-functions/samples/generated/v2beta/snippet_metadata.google.cloud.functions.v2beta.json b/packages/google-cloud-functions/samples/generated/v2beta/snippet_metadata.google.cloud.functions.v2beta.json
index 451cd271188..a487e445633 100644
--- a/packages/google-cloud-functions/samples/generated/v2beta/snippet_metadata.google.cloud.functions.v2beta.json
+++ b/packages/google-cloud-functions/samples/generated/v2beta/snippet_metadata.google.cloud.functions.v2beta.json
@@ -1,7 +1,7 @@
{
"clientLibrary": {
"name": "nodejs-functions",
- "version": "2.4.0",
+ "version": "2.4.1",
"language": "TYPESCRIPT",
"apis": [
{
@@ -62,7 +62,7 @@
"segments": [
{
"start": 25,
- "end": 82,
+ "end": 85,
"type": "FULL"
}
],
@@ -250,7 +250,7 @@
"segments": [
{
"start": 25,
- "end": 54,
+ "end": 70,
"type": "FULL"
}
],
@@ -262,6 +262,10 @@
{
"name": "parent",
"type": "TYPE_STRING"
+ },
+ {
+ "name": "kms_key_name",
+ "type": "TYPE_STRING"
}
],
"resultType": ".google.cloud.functions.v2beta.GenerateUploadUrlResponse",
diff --git a/packages/google-cloud-functions/src/v1/cloud_functions_service_client.ts b/packages/google-cloud-functions/src/v1/cloud_functions_service_client.ts
index 75b56ce389d..1a0d6feb4b3 100644
--- a/packages/google-cloud-functions/src/v1/cloud_functions_service_client.ts
+++ b/packages/google-cloud-functions/src/v1/cloud_functions_service_client.ts
@@ -27,6 +27,8 @@ import type {
LROperation,
PaginationCallback,
GaxCall,
+ LocationsClient,
+ LocationProtos,
} from 'google-gax';
import {Transform} from 'stream';
import * as protos from '../../protos/protos';
@@ -61,6 +63,7 @@ export class CloudFunctionsServiceClient {
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: {[name: string]: Function};
+ locationsClient: LocationsClient;
pathTemplates: {[name: string]: gax.PathTemplate};
operationsClient: gax.OperationsClient;
cloudFunctionsServiceStub?: Promise<{[name: string]: Function}>;
@@ -159,6 +162,10 @@ export class CloudFunctionsServiceClient {
if (servicePath === staticMembers.servicePath) {
this.auth.defaultScopes = staticMembers.scopes;
}
+ this.locationsClient = new this._gaxModule.LocationsClient(
+ this._gaxGrpc,
+ opts
+ );
// Determine the client header string.
const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
@@ -612,12 +619,12 @@ export class CloudFunctionsServiceClient {
* 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:
+ * When making an HTTP PUT request, these two headers must be specified:
*
* * `content-type: application/zip`
* * `x-goog-content-length-range: 0,104857600`
*
- * And this header SHOULD NOT be specified:
+ * And this header must NOT be specified:
*
* * `Authorization: Bearer YOUR_TOKEN`
*
@@ -730,9 +737,9 @@ export class CloudFunctionsServiceClient {
}
/**
* Returns a signed URL for downloading deployed function source code.
- * The URL is only valid for a limited period and should be used within
+ * The URL is only valid for a limited period and must be used within
* minutes after generation.
- * For more information about the signed URL usage see:
+ * For more information about the signed URL usage, see:
* https://cloud.google.com/storage/docs/access-control/signed-urls
*
* @param {Object} request
@@ -1015,7 +1022,7 @@ export class CloudFunctionsServiceClient {
/**
* 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
+ * If the function does not exist, this returns an empty set of
* permissions, not a NOT_FOUND error.
*
* @param {Object} request
@@ -1107,14 +1114,14 @@ export class CloudFunctionsServiceClient {
/**
* Creates a new function. If a function with the given name already exists in
- * the specified project, the long running operation will return
+ * the specified project, the long running operation returns an
* `ALREADY_EXISTS` error.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.location
- * Required. The project and location in which the function should be created, specified
- * in the format `projects/* /locations/*`
+ * Required. The project and location in which the function should be created,
+ * specified in the format `projects/* /locations/*`
* @param {google.cloud.functions.v1.CloudFunction} request.function
* Required. Function to be created.
* @param {object} [options]
@@ -1390,7 +1397,7 @@ export class CloudFunctionsServiceClient {
}
/**
* 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
+ * given function is used by some trigger, the trigger is updated to
* remove this function.
*
* @param {Object} request
@@ -1741,6 +1748,261 @@ export class CloudFunctionsServiceClient {
callSettings
) as AsyncIterable;
}
+ /**
+ * Gets information about a location.
+ *
+ * @param {Object} request
+ * The request object that will be sent.
+ * @param {string} request.name
+ * Resource name for the location.
+ * @param {object} [options]
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
+ * @returns {Promise} - The promise which resolves to an array.
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
+ * Please see the
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
+ * for more details and examples.
+ * @example
+ * ```
+ * const [response] = await client.getLocation(request);
+ * ```
+ */
+ getLocation(
+ request: LocationProtos.google.cloud.location.IGetLocationRequest,
+ options?:
+ | gax.CallOptions
+ | Callback<
+ LocationProtos.google.cloud.location.ILocation,
+ | LocationProtos.google.cloud.location.IGetLocationRequest
+ | null
+ | undefined,
+ {} | null | undefined
+ >,
+ callback?: Callback<
+ LocationProtos.google.cloud.location.ILocation,
+ | LocationProtos.google.cloud.location.IGetLocationRequest
+ | null
+ | undefined,
+ {} | null | undefined
+ >
+ ): Promise {
+ return this.locationsClient.getLocation(request, options, callback);
+ }
+
+ /**
+ * Lists information about the supported locations for this service. Returns an iterable object.
+ *
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
+ * @param {Object} request
+ * The request object that will be sent.
+ * @param {string} request.name
+ * The resource that owns the locations collection, if applicable.
+ * @param {string} request.filter
+ * The standard list filter.
+ * @param {number} request.pageSize
+ * The standard list page size.
+ * @param {string} request.pageToken
+ * The standard list page token.
+ * @param {object} [options]
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
+ * @returns {Object}
+ * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
+ * When you iterate the returned iterable, each element will be an object representing
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
+ * so you can stop the iteration when you don't need more results.
+ * Please see the
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
+ * for more details and examples.
+ * @example
+ * ```
+ * const iterable = client.listLocationsAsync(request);
+ * for await (const response of iterable) {
+ * // process response
+ * }
+ * ```
+ */
+ listLocationsAsync(
+ request: LocationProtos.google.cloud.location.IListLocationsRequest,
+ options?: CallOptions
+ ): AsyncIterable {
+ return this.locationsClient.listLocationsAsync(request, options);
+ }
+
+ /**
+ * Gets the latest state of a long-running operation. Clients can use this
+ * method to poll the operation result at intervals as recommended by the API
+ * service.
+ *
+ * @param {Object} request - The request object that will be sent.
+ * @param {string} request.name - The name of the operation resource.
+ * @param {Object=} options
+ * Optional parameters. You can override the default settings for this call,
+ * e.g, timeout, retries, paginations, etc. See {@link
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
+ * for the details.
+ * @param {function(?Error, ?Object)=} callback
+ * The function which will be called with the result of the API call.
+ *
+ * The second parameter to the callback is an object representing
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
+ * @return {Promise} - The promise which resolves to an array.
+ * The first element of the array is an object representing
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
+ * The promise has a method named "cancel" which cancels the ongoing API call.
+ *
+ * @example
+ * ```
+ * const client = longrunning.operationsClient();
+ * const name = '';
+ * const [response] = await client.getOperation({name});
+ * // doThingsWith(response)
+ * ```
+ */
+ getOperation(
+ request: protos.google.longrunning.GetOperationRequest,
+ options?:
+ | gax.CallOptions
+ | Callback<
+ protos.google.longrunning.Operation,
+ protos.google.longrunning.GetOperationRequest,
+ {} | null | undefined
+ >,
+ callback?: Callback<
+ protos.google.longrunning.Operation,
+ protos.google.longrunning.GetOperationRequest,
+ {} | null | undefined
+ >
+ ): Promise<[protos.google.longrunning.Operation]> {
+ return this.operationsClient.getOperation(request, options, callback);
+ }
+ /**
+ * Lists operations that match the specified filter in the request. If the
+ * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
+ *
+ * For-await-of syntax is used with the iterable to recursively get response element on-demand.
+ *
+ * @param {Object} request - The request object that will be sent.
+ * @param {string} request.name - The name of the operation collection.
+ * @param {string} request.filter - The standard list filter.
+ * @param {number=} request.pageSize -
+ * The maximum number of resources contained in the underlying API
+ * response. If page streaming is performed per-resource, this
+ * parameter does not affect the return value. If page streaming is
+ * performed per-page, this determines the maximum number of
+ * resources in a page.
+ * @param {Object=} options
+ * Optional parameters. You can override the default settings for this call,
+ * e.g, timeout, retries, paginations, etc. See {@link
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
+ * details.
+ * @returns {Object}
+ * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
+ *
+ * @example
+ * ```
+ * const client = longrunning.operationsClient();
+ * for await (const response of client.listOperationsAsync(request));
+ * // doThingsWith(response)
+ * ```
+ */
+ listOperationsAsync(
+ request: protos.google.longrunning.ListOperationsRequest,
+ options?: gax.CallOptions
+ ): AsyncIterable {
+ return this.operationsClient.listOperationsAsync(request, options);
+ }
+ /**
+ * Starts asynchronous cancellation on a long-running operation. The server
+ * makes a best effort to cancel the operation, but success is not
+ * guaranteed. If the server doesn't support this method, it returns
+ * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
+ * {@link Operations.GetOperation} or
+ * other methods to check whether the cancellation succeeded or whether the
+ * operation completed despite cancellation. On successful cancellation,
+ * the operation is not deleted; instead, it becomes an operation with
+ * an {@link Operation.error} value with a {@link google.rpc.Status.code} of
+ * 1, corresponding to `Code.CANCELLED`.
+ *
+ * @param {Object} request - The request object that will be sent.
+ * @param {string} request.name - The name of the operation resource to be cancelled.
+ * @param {Object=} options
+ * Optional parameters. You can override the default settings for this call,
+ * e.g, timeout, retries, paginations, etc. See {@link
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
+ * details.
+ * @param {function(?Error)=} callback
+ * The function which will be called with the result of the API call.
+ * @return {Promise} - The promise which resolves when API call finishes.
+ * The promise has a method named "cancel" which cancels the ongoing API
+ * call.
+ *
+ * @example
+ * ```
+ * const client = longrunning.operationsClient();
+ * await client.cancelOperation({name: ''});
+ * ```
+ */
+ cancelOperation(
+ request: protos.google.longrunning.CancelOperationRequest,
+ options?:
+ | gax.CallOptions
+ | Callback<
+ protos.google.protobuf.Empty,
+ protos.google.longrunning.CancelOperationRequest,
+ {} | undefined | null
+ >,
+ callback?: Callback<
+ protos.google.longrunning.CancelOperationRequest,
+ protos.google.protobuf.Empty,
+ {} | undefined | null
+ >
+ ): Promise {
+ return this.operationsClient.cancelOperation(request, options, callback);
+ }
+
+ /**
+ * Deletes a long-running operation. This method indicates that the client is
+ * no longer interested in the operation result. It does not cancel the
+ * operation. If the server doesn't support this method, it returns
+ * `google.rpc.Code.UNIMPLEMENTED`.
+ *
+ * @param {Object} request - The request object that will be sent.
+ * @param {string} request.name - The name of the operation resource to be deleted.
+ * @param {Object=} options
+ * Optional parameters. You can override the default settings for this call,
+ * e.g, timeout, retries, paginations, etc. See {@link
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
+ * for the details.
+ * @param {function(?Error)=} callback
+ * The function which will be called with the result of the API call.
+ * @return {Promise} - The promise which resolves when API call finishes.
+ * The promise has a method named "cancel" which cancels the ongoing API
+ * call.
+ *
+ * @example
+ * ```
+ * const client = longrunning.operationsClient();
+ * await client.deleteOperation({name: ''});
+ * ```
+ */
+ deleteOperation(
+ request: protos.google.longrunning.DeleteOperationRequest,
+ options?:
+ | gax.CallOptions
+ | Callback<
+ protos.google.protobuf.Empty,
+ protos.google.longrunning.DeleteOperationRequest,
+ {} | null | undefined
+ >,
+ callback?: Callback<
+ protos.google.protobuf.Empty,
+ protos.google.longrunning.DeleteOperationRequest,
+ {} | null | undefined
+ >
+ ): Promise {
+ return this.operationsClient.deleteOperation(request, options, callback);
+ }
+
// --------------------
// -- Path templates --
// --------------------
@@ -1967,6 +2229,7 @@ export class CloudFunctionsServiceClient {
return this.cloudFunctionsServiceStub.then(stub => {
this._terminated = true;
stub.close();
+ this.locationsClient.close();
this.operationsClient.close();
});
}
diff --git a/packages/google-cloud-functions/src/v2/function_service_client.ts b/packages/google-cloud-functions/src/v2/function_service_client.ts
index 8146297f6e4..2a2877757a3 100644
--- a/packages/google-cloud-functions/src/v2/function_service_client.ts
+++ b/packages/google-cloud-functions/src/v2/function_service_client.ts
@@ -586,7 +586,7 @@ export class FunctionServiceClient {
* Required. The project and location in which the Google Cloud Storage signed
* URL should be generated, specified in the format `projects/* /locations/*`.
* @param {string} request.kmsKeyName
- * Resource name of a KMS crypto key (managed by the user) used to
+ * [Preview] Resource name of a KMS crypto key (managed by the user) used to
* encrypt/decrypt function source code objects in intermediate Cloud Storage
* buckets. When you generate an upload url and upload your source code, it
* gets copied to an intermediate Cloud Storage bucket. The source code is
diff --git a/packages/google-cloud-functions/src/v2alpha/function_service_client.ts b/packages/google-cloud-functions/src/v2alpha/function_service_client.ts
index dfefec58c0b..45f7d9e4f42 100644
--- a/packages/google-cloud-functions/src/v2alpha/function_service_client.ts
+++ b/packages/google-cloud-functions/src/v2alpha/function_service_client.ts
@@ -207,6 +207,9 @@ export class FunctionServiceClient {
connectorPathTemplate: new this._gaxModule.PathTemplate(
'projects/{project}/locations/{location}/connectors/{connector}'
),
+ cryptoKeyPathTemplate: new this._gaxModule.PathTemplate(
+ 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}'
+ ),
functionPathTemplate: new this._gaxModule.PathTemplate(
'projects/{project}/locations/{location}/functions/{function}'
),
@@ -586,8 +589,24 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
- * Required. The project and location in which the Google Cloud Storage signed URL
- * should be generated, specified in the format `projects/* /locations/*`.
+ * Required. The project and location in which the Google Cloud Storage signed
+ * URL should be generated, specified in the format `projects/* /locations/*`.
+ * @param {string} request.kmsKeyName
+ * [Preview] Resource name of a KMS crypto key (managed by the user) used to
+ * encrypt/decrypt function source code objects in intermediate Cloud Storage
+ * buckets. When you generate an upload url and upload your source code, it
+ * gets copied to an intermediate Cloud Storage bucket. The source code is
+ * then copied to a versioned directory in the sources bucket in the consumer
+ * project during the function deployment.
+ *
+ * It must match the pattern
+ * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+ *
+ * The Google Cloud Functions service account
+ * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+ * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+ * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+ * Key/KeyRing/Project/Organization (least access preferred).
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
@@ -688,8 +707,8 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.name
- * Required. The name of function for which source code Google Cloud Storage signed
- * URL should be generated.
+ * Required. The name of function for which source code Google Cloud Storage
+ * signed URL should be generated.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
@@ -786,8 +805,8 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
- * Required. The project and location from which the runtimes should be listed,
- * specified in the format `projects/* /locations/*`
+ * Required. The project and location from which the runtimes should be
+ * listed, specified in the format `projects/* /locations/*`
* @param {string} request.filter
* The filter for Runtimes that match the filter expression,
* following the syntax outlined in https://google.aip.dev/160.
@@ -884,8 +903,8 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
- * Required. The project and location in which the function should be created, specified
- * in the format `projects/* /locations/*`
+ * Required. The project and location in which the function should be created,
+ * specified in the format `projects/* /locations/*`
* @param {google.cloud.functions.v2alpha.Function} request.function
* Required. Function to be created.
* @param {string} request.functionId
@@ -1313,14 +1332,17 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
- * Required. The project and location from which the function should be listed,
- * specified in the format `projects/* /locations/*`
- * If you want to list functions in all locations, use "-" in place of a
- * location. When listing functions in all locations, if one or more
- * location(s) are unreachable, the response will contain functions from all
- * reachable locations along with the names of any unreachable locations.
+ * Required. The project and location from which the function should be
+ * listed, specified in the format `projects/* /locations/*` If you want to
+ * list functions in all locations, use "-" in place of a location. When
+ * listing functions in all locations, if one or more location(s) are
+ * unreachable, the response will contain functions from all reachable
+ * locations along with the names of any unreachable locations.
* @param {number} request.pageSize
- * Maximum number of functions to return per call.
+ * Maximum number of functions to return per call. The largest allowed
+ * page_size is 1,000, if the page_size is omitted or specified as greater
+ * than 1,000 then it will be replaced as 1,000. The size of the list
+ * response can be less than specified when used with filters.
* @param {string} request.pageToken
* The value returned by the last
* `ListFunctionsResponse`; indicates that
@@ -1426,14 +1448,17 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
- * Required. The project and location from which the function should be listed,
- * specified in the format `projects/* /locations/*`
- * If you want to list functions in all locations, use "-" in place of a
- * location. When listing functions in all locations, if one or more
- * location(s) are unreachable, the response will contain functions from all
- * reachable locations along with the names of any unreachable locations.
+ * Required. The project and location from which the function should be
+ * listed, specified in the format `projects/* /locations/*` If you want to
+ * list functions in all locations, use "-" in place of a location. When
+ * listing functions in all locations, if one or more location(s) are
+ * unreachable, the response will contain functions from all reachable
+ * locations along with the names of any unreachable locations.
* @param {number} request.pageSize
- * Maximum number of functions to return per call.
+ * Maximum number of functions to return per call. The largest allowed
+ * page_size is 1,000, if the page_size is omitted or specified as greater
+ * than 1,000 then it will be replaced as 1,000. The size of the list
+ * response can be less than specified when used with filters.
* @param {string} request.pageToken
* The value returned by the last
* `ListFunctionsResponse`; indicates that
@@ -1487,14 +1512,17 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
- * Required. The project and location from which the function should be listed,
- * specified in the format `projects/* /locations/*`
- * If you want to list functions in all locations, use "-" in place of a
- * location. When listing functions in all locations, if one or more
- * location(s) are unreachable, the response will contain functions from all
- * reachable locations along with the names of any unreachable locations.
+ * Required. The project and location from which the function should be
+ * listed, specified in the format `projects/* /locations/*` If you want to
+ * list functions in all locations, use "-" in place of a location. When
+ * listing functions in all locations, if one or more location(s) are
+ * unreachable, the response will contain functions from all reachable
+ * locations along with the names of any unreachable locations.
* @param {number} request.pageSize
- * Maximum number of functions to return per call.
+ * Maximum number of functions to return per call. The largest allowed
+ * page_size is 1,000, if the page_size is omitted or specified as greater
+ * than 1,000 then it will be replaced as 1,000. The size of the list
+ * response can be less than specified when used with filters.
* @param {string} request.pageToken
* The value returned by the last
* `ListFunctionsResponse`; indicates that
@@ -2090,6 +2118,77 @@ export class FunctionServiceClient {
.connector;
}
+ /**
+ * Return a fully-qualified cryptoKey resource name string.
+ *
+ * @param {string} project
+ * @param {string} location
+ * @param {string} key_ring
+ * @param {string} crypto_key
+ * @returns {string} Resource name string.
+ */
+ cryptoKeyPath(
+ project: string,
+ location: string,
+ keyRing: string,
+ cryptoKey: string
+ ) {
+ return this.pathTemplates.cryptoKeyPathTemplate.render({
+ project: project,
+ location: location,
+ key_ring: keyRing,
+ crypto_key: cryptoKey,
+ });
+ }
+
+ /**
+ * Parse the project from CryptoKey resource.
+ *
+ * @param {string} cryptoKeyName
+ * A fully-qualified path representing CryptoKey resource.
+ * @returns {string} A string representing the project.
+ */
+ matchProjectFromCryptoKeyName(cryptoKeyName: string) {
+ return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName)
+ .project;
+ }
+
+ /**
+ * Parse the location from CryptoKey resource.
+ *
+ * @param {string} cryptoKeyName
+ * A fully-qualified path representing CryptoKey resource.
+ * @returns {string} A string representing the location.
+ */
+ matchLocationFromCryptoKeyName(cryptoKeyName: string) {
+ return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName)
+ .location;
+ }
+
+ /**
+ * Parse the key_ring from CryptoKey resource.
+ *
+ * @param {string} cryptoKeyName
+ * A fully-qualified path representing CryptoKey resource.
+ * @returns {string} A string representing the key_ring.
+ */
+ matchKeyRingFromCryptoKeyName(cryptoKeyName: string) {
+ return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName)
+ .key_ring;
+ }
+
+ /**
+ * Parse the crypto_key from CryptoKey resource.
+ *
+ * @param {string} cryptoKeyName
+ * A fully-qualified path representing CryptoKey resource.
+ * @returns {string} A string representing the crypto_key.
+ */
+ matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) {
+ return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName)
+ .crypto_key;
+ }
+
/**
* Return a fully-qualified function resource name string.
*
diff --git a/packages/google-cloud-functions/src/v2beta/function_service_client.ts b/packages/google-cloud-functions/src/v2beta/function_service_client.ts
index e36cde632c9..09df44ecd6e 100644
--- a/packages/google-cloud-functions/src/v2beta/function_service_client.ts
+++ b/packages/google-cloud-functions/src/v2beta/function_service_client.ts
@@ -207,6 +207,9 @@ export class FunctionServiceClient {
connectorPathTemplate: new this._gaxModule.PathTemplate(
'projects/{project}/locations/{location}/connectors/{connector}'
),
+ cryptoKeyPathTemplate: new this._gaxModule.PathTemplate(
+ 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}'
+ ),
functionPathTemplate: new this._gaxModule.PathTemplate(
'projects/{project}/locations/{location}/functions/{function}'
),
@@ -586,8 +589,24 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
- * Required. The project and location in which the Google Cloud Storage signed URL
- * should be generated, specified in the format `projects/* /locations/*`.
+ * Required. The project and location in which the Google Cloud Storage signed
+ * URL should be generated, specified in the format `projects/* /locations/*`.
+ * @param {string} request.kmsKeyName
+ * [Preview] Resource name of a KMS crypto key (managed by the user) used to
+ * encrypt/decrypt function source code objects in intermediate Cloud Storage
+ * buckets. When you generate an upload url and upload your source code, it
+ * gets copied to an intermediate Cloud Storage bucket. The source code is
+ * then copied to a versioned directory in the sources bucket in the consumer
+ * project during the function deployment.
+ *
+ * It must match the pattern
+ * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+ *
+ * The Google Cloud Functions service account
+ * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+ * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+ * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+ * Key/KeyRing/Project/Organization (least access preferred).
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
@@ -688,8 +707,8 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.name
- * Required. The name of function for which source code Google Cloud Storage signed
- * URL should be generated.
+ * Required. The name of function for which source code Google Cloud Storage
+ * signed URL should be generated.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
@@ -786,8 +805,8 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
- * Required. The project and location from which the runtimes should be listed,
- * specified in the format `projects/* /locations/*`
+ * Required. The project and location from which the runtimes should be
+ * listed, specified in the format `projects/* /locations/*`
* @param {string} request.filter
* The filter for Runtimes that match the filter expression,
* following the syntax outlined in https://google.aip.dev/160.
@@ -884,8 +903,8 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
- * Required. The project and location in which the function should be created, specified
- * in the format `projects/* /locations/*`
+ * Required. The project and location in which the function should be created,
+ * specified in the format `projects/* /locations/*`
* @param {google.cloud.functions.v2beta.Function} request.function
* Required. Function to be created.
* @param {string} request.functionId
@@ -1313,14 +1332,17 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
- * Required. The project and location from which the function should be listed,
- * specified in the format `projects/* /locations/*`
- * If you want to list functions in all locations, use "-" in place of a
- * location. When listing functions in all locations, if one or more
- * location(s) are unreachable, the response will contain functions from all
- * reachable locations along with the names of any unreachable locations.
+ * Required. The project and location from which the function should be
+ * listed, specified in the format `projects/* /locations/*` If you want to
+ * list functions in all locations, use "-" in place of a location. When
+ * listing functions in all locations, if one or more location(s) are
+ * unreachable, the response will contain functions from all reachable
+ * locations along with the names of any unreachable locations.
* @param {number} request.pageSize
- * Maximum number of functions to return per call.
+ * Maximum number of functions to return per call. The largest allowed
+ * page_size is 1,000, if the page_size is omitted or specified as greater
+ * than 1,000 then it will be replaced as 1,000. The size of the list
+ * response can be less than specified when used with filters.
* @param {string} request.pageToken
* The value returned by the last
* `ListFunctionsResponse`; indicates that
@@ -1426,14 +1448,17 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
- * Required. The project and location from which the function should be listed,
- * specified in the format `projects/* /locations/*`
- * If you want to list functions in all locations, use "-" in place of a
- * location. When listing functions in all locations, if one or more
- * location(s) are unreachable, the response will contain functions from all
- * reachable locations along with the names of any unreachable locations.
+ * Required. The project and location from which the function should be
+ * listed, specified in the format `projects/* /locations/*` If you want to
+ * list functions in all locations, use "-" in place of a location. When
+ * listing functions in all locations, if one or more location(s) are
+ * unreachable, the response will contain functions from all reachable
+ * locations along with the names of any unreachable locations.
* @param {number} request.pageSize
- * Maximum number of functions to return per call.
+ * Maximum number of functions to return per call. The largest allowed
+ * page_size is 1,000, if the page_size is omitted or specified as greater
+ * than 1,000 then it will be replaced as 1,000. The size of the list
+ * response can be less than specified when used with filters.
* @param {string} request.pageToken
* The value returned by the last
* `ListFunctionsResponse`; indicates that
@@ -1487,14 +1512,17 @@ export class FunctionServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
- * Required. The project and location from which the function should be listed,
- * specified in the format `projects/* /locations/*`
- * If you want to list functions in all locations, use "-" in place of a
- * location. When listing functions in all locations, if one or more
- * location(s) are unreachable, the response will contain functions from all
- * reachable locations along with the names of any unreachable locations.
+ * Required. The project and location from which the function should be
+ * listed, specified in the format `projects/* /locations/*` If you want to
+ * list functions in all locations, use "-" in place of a location. When
+ * listing functions in all locations, if one or more location(s) are
+ * unreachable, the response will contain functions from all reachable
+ * locations along with the names of any unreachable locations.
* @param {number} request.pageSize
- * Maximum number of functions to return per call.
+ * Maximum number of functions to return per call. The largest allowed
+ * page_size is 1,000, if the page_size is omitted or specified as greater
+ * than 1,000 then it will be replaced as 1,000. The size of the list
+ * response can be less than specified when used with filters.
* @param {string} request.pageToken
* The value returned by the last
* `ListFunctionsResponse`; indicates that
@@ -2090,6 +2118,77 @@ export class FunctionServiceClient {
.connector;
}
+ /**
+ * Return a fully-qualified cryptoKey resource name string.
+ *
+ * @param {string} project
+ * @param {string} location
+ * @param {string} key_ring
+ * @param {string} crypto_key
+ * @returns {string} Resource name string.
+ */
+ cryptoKeyPath(
+ project: string,
+ location: string,
+ keyRing: string,
+ cryptoKey: string
+ ) {
+ return this.pathTemplates.cryptoKeyPathTemplate.render({
+ project: project,
+ location: location,
+ key_ring: keyRing,
+ crypto_key: cryptoKey,
+ });
+ }
+
+ /**
+ * Parse the project from CryptoKey resource.
+ *
+ * @param {string} cryptoKeyName
+ * A fully-qualified path representing CryptoKey resource.
+ * @returns {string} A string representing the project.
+ */
+ matchProjectFromCryptoKeyName(cryptoKeyName: string) {
+ return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName)
+ .project;
+ }
+
+ /**
+ * Parse the location from CryptoKey resource.
+ *
+ * @param {string} cryptoKeyName
+ * A fully-qualified path representing CryptoKey resource.
+ * @returns {string} A string representing the location.
+ */
+ matchLocationFromCryptoKeyName(cryptoKeyName: string) {
+ return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName)
+ .location;
+ }
+
+ /**
+ * Parse the key_ring from CryptoKey resource.
+ *
+ * @param {string} cryptoKeyName
+ * A fully-qualified path representing CryptoKey resource.
+ * @returns {string} A string representing the key_ring.
+ */
+ matchKeyRingFromCryptoKeyName(cryptoKeyName: string) {
+ return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName)
+ .key_ring;
+ }
+
+ /**
+ * Parse the crypto_key from CryptoKey resource.
+ *
+ * @param {string} cryptoKeyName
+ * A fully-qualified path representing CryptoKey resource.
+ * @returns {string} A string representing the crypto_key.
+ */
+ matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) {
+ return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName)
+ .crypto_key;
+ }
+
/**
* Return a fully-qualified function resource name string.
*
diff --git a/packages/google-cloud-functions/test/gapic_cloud_functions_service_v1.ts b/packages/google-cloud-functions/test/gapic_cloud_functions_service_v1.ts
index c5fb1e0d342..154f507e9e3 100644
--- a/packages/google-cloud-functions/test/gapic_cloud_functions_service_v1.ts
+++ b/packages/google-cloud-functions/test/gapic_cloud_functions_service_v1.ts
@@ -25,7 +25,12 @@ import * as cloudfunctionsserviceModule from '../src';
import {PassThrough} from 'stream';
-import {protobuf, LROperation, operationsProtos} from 'google-gax';
+import {
+ protobuf,
+ LROperation,
+ operationsProtos,
+ LocationProtos,
+} from 'google-gax';
// Dynamically loaded proto JSON is needed to get the type information
// to fill in default values for request objects
@@ -2142,6 +2147,525 @@ describe('v1.CloudFunctionsServiceClient', () => {
);
});
});
+ describe('getLocation', () => {
+ it('invokes getLocation without error', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ client.initialize();
+ const request = generateSampleMessage(
+ new LocationProtos.google.cloud.location.GetLocationRequest()
+ );
+ request.name = '';
+ const expectedHeaderRequestParams = 'name=';
+ const expectedOptions = {
+ otherArgs: {
+ headers: {
+ 'x-goog-request-params': expectedHeaderRequestParams,
+ },
+ },
+ };
+ const expectedResponse = generateSampleMessage(
+ new LocationProtos.google.cloud.location.Location()
+ );
+ client.locationsClient.getLocation = stubSimpleCall(expectedResponse);
+ const response = await client.getLocation(request, expectedOptions);
+ assert.deepStrictEqual(response, [expectedResponse]);
+ assert(
+ (client.locationsClient.getLocation as SinonStub)
+ .getCall(0)
+ .calledWith(request, expectedOptions, undefined)
+ );
+ });
+ it('invokes getLocation without error using callback', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ client.initialize();
+ const request = generateSampleMessage(
+ new LocationProtos.google.cloud.location.GetLocationRequest()
+ );
+ request.name = '';
+ const expectedHeaderRequestParams = 'name=';
+ const expectedOptions = {
+ otherArgs: {
+ headers: {
+ 'x-goog-request-params': expectedHeaderRequestParams,
+ },
+ },
+ };
+ const expectedResponse = generateSampleMessage(
+ new LocationProtos.google.cloud.location.Location()
+ );
+ client.locationsClient.getLocation = sinon
+ .stub()
+ .callsArgWith(2, null, expectedResponse);
+ const promise = new Promise((resolve, reject) => {
+ client.getLocation(
+ request,
+ expectedOptions,
+ (
+ err?: Error | null,
+ result?: LocationProtos.google.cloud.location.ILocation | null
+ ) => {
+ if (err) {
+ reject(err);
+ } else {
+ resolve(result);
+ }
+ }
+ );
+ });
+ const response = await promise;
+ assert.deepStrictEqual(response, expectedResponse);
+ assert((client.locationsClient.getLocation as SinonStub).getCall(0));
+ });
+ it('invokes getLocation with error', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ client.initialize();
+ const request = generateSampleMessage(
+ new LocationProtos.google.cloud.location.GetLocationRequest()
+ );
+ request.name = '';
+ const expectedHeaderRequestParams = 'name=';
+ const expectedOptions = {
+ otherArgs: {
+ headers: {
+ 'x-goog-request-params': expectedHeaderRequestParams,
+ },
+ },
+ };
+ const expectedError = new Error('expected');
+ client.locationsClient.getLocation = stubSimpleCall(
+ undefined,
+ expectedError
+ );
+ await assert.rejects(
+ client.getLocation(request, expectedOptions),
+ expectedError
+ );
+ assert(
+ (client.locationsClient.getLocation as SinonStub)
+ .getCall(0)
+ .calledWith(request, expectedOptions, undefined)
+ );
+ });
+ });
+ describe('listLocationsAsync', () => {
+ it('uses async iteration with listLocations without error', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ client.initialize();
+ const request = generateSampleMessage(
+ new LocationProtos.google.cloud.location.ListLocationsRequest()
+ );
+ request.name = '';
+ const expectedHeaderRequestParams = 'name=';
+ const expectedResponse = [
+ generateSampleMessage(
+ new LocationProtos.google.cloud.location.Location()
+ ),
+ generateSampleMessage(
+ new LocationProtos.google.cloud.location.Location()
+ ),
+ generateSampleMessage(
+ new LocationProtos.google.cloud.location.Location()
+ ),
+ ];
+ client.locationsClient.descriptors.page.listLocations.asyncIterate =
+ stubAsyncIterationCall(expectedResponse);
+ const responses: LocationProtos.google.cloud.location.ILocation[] = [];
+ const iterable = client.listLocationsAsync(request);
+ for await (const resource of iterable) {
+ responses.push(resource!);
+ }
+ assert.deepStrictEqual(responses, expectedResponse);
+ assert.deepStrictEqual(
+ (
+ client.locationsClient.descriptors.page.listLocations
+ .asyncIterate as SinonStub
+ ).getCall(0).args[1],
+ request
+ );
+ assert(
+ (
+ client.locationsClient.descriptors.page.listLocations
+ .asyncIterate as SinonStub
+ )
+ .getCall(0)
+ .args[2].otherArgs.headers['x-goog-request-params'].includes(
+ expectedHeaderRequestParams
+ )
+ );
+ });
+ it('uses async iteration with listLocations with error', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ client.initialize();
+ const request = generateSampleMessage(
+ new LocationProtos.google.cloud.location.ListLocationsRequest()
+ );
+ request.name = '';
+ const expectedHeaderRequestParams = 'name=';
+ const expectedError = new Error('expected');
+ client.locationsClient.descriptors.page.listLocations.asyncIterate =
+ stubAsyncIterationCall(undefined, expectedError);
+ const iterable = client.listLocationsAsync(request);
+ await assert.rejects(async () => {
+ const responses: LocationProtos.google.cloud.location.ILocation[] = [];
+ for await (const resource of iterable) {
+ responses.push(resource!);
+ }
+ });
+ assert.deepStrictEqual(
+ (
+ client.locationsClient.descriptors.page.listLocations
+ .asyncIterate as SinonStub
+ ).getCall(0).args[1],
+ request
+ );
+ assert(
+ (
+ client.locationsClient.descriptors.page.listLocations
+ .asyncIterate as SinonStub
+ )
+ .getCall(0)
+ .args[2].otherArgs.headers['x-goog-request-params'].includes(
+ expectedHeaderRequestParams
+ )
+ );
+ });
+ });
+ describe('getOperation', () => {
+ it('invokes getOperation without error', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ client.initialize();
+ const request = generateSampleMessage(
+ new operationsProtos.google.longrunning.GetOperationRequest()
+ );
+ const expectedResponse = generateSampleMessage(
+ new operationsProtos.google.longrunning.Operation()
+ );
+ client.operationsClient.getOperation = stubSimpleCall(expectedResponse);
+ const response = await client.getOperation(request);
+ assert.deepStrictEqual(response, [expectedResponse]);
+ assert(
+ (client.operationsClient.getOperation as SinonStub)
+ .getCall(0)
+ .calledWith(request)
+ );
+ });
+ it('invokes getOperation without error using callback', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ const request = generateSampleMessage(
+ new operationsProtos.google.longrunning.GetOperationRequest()
+ );
+ const expectedResponse = generateSampleMessage(
+ new operationsProtos.google.longrunning.Operation()
+ );
+ client.operationsClient.getOperation = sinon
+ .stub()
+ .callsArgWith(2, null, expectedResponse);
+ const promise = new Promise((resolve, reject) => {
+ client.operationsClient.getOperation(
+ request,
+ undefined,
+ (
+ err?: Error | null,
+ result?: operationsProtos.google.longrunning.Operation | null
+ ) => {
+ if (err) {
+ reject(err);
+ } else {
+ resolve(result);
+ }
+ }
+ );
+ });
+ const response = await promise;
+ assert.deepStrictEqual(response, expectedResponse);
+ assert((client.operationsClient.getOperation as SinonStub).getCall(0));
+ });
+ it('invokes getOperation with error', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ const request = generateSampleMessage(
+ new operationsProtos.google.longrunning.GetOperationRequest()
+ );
+ const expectedError = new Error('expected');
+ client.operationsClient.getOperation = stubSimpleCall(
+ undefined,
+ expectedError
+ );
+ await assert.rejects(async () => {
+ await client.getOperation(request);
+ }, expectedError);
+ assert(
+ (client.operationsClient.getOperation as SinonStub)
+ .getCall(0)
+ .calledWith(request)
+ );
+ });
+ });
+ describe('cancelOperation', () => {
+ it('invokes cancelOperation without error', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ client.initialize();
+ const request = generateSampleMessage(
+ new operationsProtos.google.longrunning.CancelOperationRequest()
+ );
+ const expectedResponse = generateSampleMessage(
+ new protos.google.protobuf.Empty()
+ );
+ client.operationsClient.cancelOperation =
+ stubSimpleCall(expectedResponse);
+ const response = await client.cancelOperation(request);
+ assert.deepStrictEqual(response, [expectedResponse]);
+ assert(
+ (client.operationsClient.cancelOperation as SinonStub)
+ .getCall(0)
+ .calledWith(request)
+ );
+ });
+ it('invokes cancelOperation without error using callback', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ const request = generateSampleMessage(
+ new operationsProtos.google.longrunning.CancelOperationRequest()
+ );
+ const expectedResponse = generateSampleMessage(
+ new protos.google.protobuf.Empty()
+ );
+ client.operationsClient.cancelOperation = sinon
+ .stub()
+ .callsArgWith(2, null, expectedResponse);
+ const promise = new Promise((resolve, reject) => {
+ client.operationsClient.cancelOperation(
+ request,
+ undefined,
+ (
+ err?: Error | null,
+ result?: protos.google.protobuf.Empty | null
+ ) => {
+ if (err) {
+ reject(err);
+ } else {
+ resolve(result);
+ }
+ }
+ );
+ });
+ const response = await promise;
+ assert.deepStrictEqual(response, expectedResponse);
+ assert((client.operationsClient.cancelOperation as SinonStub).getCall(0));
+ });
+ it('invokes cancelOperation with error', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ const request = generateSampleMessage(
+ new operationsProtos.google.longrunning.CancelOperationRequest()
+ );
+ const expectedError = new Error('expected');
+ client.operationsClient.cancelOperation = stubSimpleCall(
+ undefined,
+ expectedError
+ );
+ await assert.rejects(async () => {
+ await client.cancelOperation(request);
+ }, expectedError);
+ assert(
+ (client.operationsClient.cancelOperation as SinonStub)
+ .getCall(0)
+ .calledWith(request)
+ );
+ });
+ });
+ describe('deleteOperation', () => {
+ it('invokes deleteOperation without error', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ client.initialize();
+ const request = generateSampleMessage(
+ new operationsProtos.google.longrunning.DeleteOperationRequest()
+ );
+ const expectedResponse = generateSampleMessage(
+ new protos.google.protobuf.Empty()
+ );
+ client.operationsClient.deleteOperation =
+ stubSimpleCall(expectedResponse);
+ const response = await client.deleteOperation(request);
+ assert.deepStrictEqual(response, [expectedResponse]);
+ assert(
+ (client.operationsClient.deleteOperation as SinonStub)
+ .getCall(0)
+ .calledWith(request)
+ );
+ });
+ it('invokes deleteOperation without error using callback', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ const request = generateSampleMessage(
+ new operationsProtos.google.longrunning.DeleteOperationRequest()
+ );
+ const expectedResponse = generateSampleMessage(
+ new protos.google.protobuf.Empty()
+ );
+ client.operationsClient.deleteOperation = sinon
+ .stub()
+ .callsArgWith(2, null, expectedResponse);
+ const promise = new Promise((resolve, reject) => {
+ client.operationsClient.deleteOperation(
+ request,
+ undefined,
+ (
+ err?: Error | null,
+ result?: protos.google.protobuf.Empty | null
+ ) => {
+ if (err) {
+ reject(err);
+ } else {
+ resolve(result);
+ }
+ }
+ );
+ });
+ const response = await promise;
+ assert.deepStrictEqual(response, expectedResponse);
+ assert((client.operationsClient.deleteOperation as SinonStub).getCall(0));
+ });
+ it('invokes deleteOperation with error', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ const request = generateSampleMessage(
+ new operationsProtos.google.longrunning.DeleteOperationRequest()
+ );
+ const expectedError = new Error('expected');
+ client.operationsClient.deleteOperation = stubSimpleCall(
+ undefined,
+ expectedError
+ );
+ await assert.rejects(async () => {
+ await client.deleteOperation(request);
+ }, expectedError);
+ assert(
+ (client.operationsClient.deleteOperation as SinonStub)
+ .getCall(0)
+ .calledWith(request)
+ );
+ });
+ });
+ describe('listOperationsAsync', () => {
+ it('uses async iteration with listOperations without error', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ const request = generateSampleMessage(
+ new operationsProtos.google.longrunning.ListOperationsRequest()
+ );
+ const expectedResponse = [
+ generateSampleMessage(
+ new operationsProtos.google.longrunning.ListOperationsResponse()
+ ),
+ generateSampleMessage(
+ new operationsProtos.google.longrunning.ListOperationsResponse()
+ ),
+ generateSampleMessage(
+ new operationsProtos.google.longrunning.ListOperationsResponse()
+ ),
+ ];
+ client.operationsClient.descriptor.listOperations.asyncIterate =
+ stubAsyncIterationCall(expectedResponse);
+ const responses: operationsProtos.google.longrunning.ListOperationsResponse[] =
+ [];
+ const iterable = client.operationsClient.listOperationsAsync(request);
+ for await (const resource of iterable) {
+ responses.push(resource!);
+ }
+ assert.deepStrictEqual(responses, expectedResponse);
+ assert.deepStrictEqual(
+ (
+ client.operationsClient.descriptor.listOperations
+ .asyncIterate as SinonStub
+ ).getCall(0).args[1],
+ request
+ );
+ });
+ it('uses async iteration with listOperations with error', async () => {
+ const client =
+ new cloudfunctionsserviceModule.v1.CloudFunctionsServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ client.initialize();
+ const request = generateSampleMessage(
+ new operationsProtos.google.longrunning.ListOperationsRequest()
+ );
+ const expectedError = new Error('expected');
+ client.operationsClient.descriptor.listOperations.asyncIterate =
+ stubAsyncIterationCall(undefined, expectedError);
+ const iterable = client.operationsClient.listOperationsAsync(request);
+ await assert.rejects(async () => {
+ const responses: operationsProtos.google.longrunning.ListOperationsResponse[] =
+ [];
+ for await (const resource of iterable) {
+ responses.push(resource!);
+ }
+ });
+ assert.deepStrictEqual(
+ (
+ client.operationsClient.descriptor.listOperations
+ .asyncIterate as SinonStub
+ ).getCall(0).args[1],
+ request
+ );
+ });
+ });
describe('Path templates', () => {
describe('cloudFunction', () => {
diff --git a/packages/google-cloud-functions/test/gapic_function_service_v2alpha.ts b/packages/google-cloud-functions/test/gapic_function_service_v2alpha.ts
index 28bc8e754e8..8712ec21e15 100644
--- a/packages/google-cloud-functions/test/gapic_function_service_v2alpha.ts
+++ b/packages/google-cloud-functions/test/gapic_function_service_v2alpha.ts
@@ -2717,6 +2717,82 @@ describe('v2alpha.FunctionServiceClient', () => {
});
});
+ describe('cryptoKey', () => {
+ const fakePath = '/rendered/path/cryptoKey';
+ const expectedParameters = {
+ project: 'projectValue',
+ location: 'locationValue',
+ key_ring: 'keyRingValue',
+ crypto_key: 'cryptoKeyValue',
+ };
+ const client = new functionserviceModule.v2alpha.FunctionServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ client.initialize();
+ client.pathTemplates.cryptoKeyPathTemplate.render = sinon
+ .stub()
+ .returns(fakePath);
+ client.pathTemplates.cryptoKeyPathTemplate.match = sinon
+ .stub()
+ .returns(expectedParameters);
+
+ it('cryptoKeyPath', () => {
+ const result = client.cryptoKeyPath(
+ 'projectValue',
+ 'locationValue',
+ 'keyRingValue',
+ 'cryptoKeyValue'
+ );
+ assert.strictEqual(result, fakePath);
+ assert(
+ (client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub)
+ .getCall(-1)
+ .calledWith(expectedParameters)
+ );
+ });
+
+ it('matchProjectFromCryptoKeyName', () => {
+ const result = client.matchProjectFromCryptoKeyName(fakePath);
+ assert.strictEqual(result, 'projectValue');
+ assert(
+ (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub)
+ .getCall(-1)
+ .calledWith(fakePath)
+ );
+ });
+
+ it('matchLocationFromCryptoKeyName', () => {
+ const result = client.matchLocationFromCryptoKeyName(fakePath);
+ assert.strictEqual(result, 'locationValue');
+ assert(
+ (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub)
+ .getCall(-1)
+ .calledWith(fakePath)
+ );
+ });
+
+ it('matchKeyRingFromCryptoKeyName', () => {
+ const result = client.matchKeyRingFromCryptoKeyName(fakePath);
+ assert.strictEqual(result, 'keyRingValue');
+ assert(
+ (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub)
+ .getCall(-1)
+ .calledWith(fakePath)
+ );
+ });
+
+ it('matchCryptoKeyFromCryptoKeyName', () => {
+ const result = client.matchCryptoKeyFromCryptoKeyName(fakePath);
+ assert.strictEqual(result, 'cryptoKeyValue');
+ assert(
+ (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub)
+ .getCall(-1)
+ .calledWith(fakePath)
+ );
+ });
+ });
+
describe('function', () => {
const fakePath = '/rendered/path/function';
const expectedParameters = {
diff --git a/packages/google-cloud-functions/test/gapic_function_service_v2beta.ts b/packages/google-cloud-functions/test/gapic_function_service_v2beta.ts
index 47baf117fa3..b09c085b301 100644
--- a/packages/google-cloud-functions/test/gapic_function_service_v2beta.ts
+++ b/packages/google-cloud-functions/test/gapic_function_service_v2beta.ts
@@ -2717,6 +2717,82 @@ describe('v2beta.FunctionServiceClient', () => {
});
});
+ describe('cryptoKey', () => {
+ const fakePath = '/rendered/path/cryptoKey';
+ const expectedParameters = {
+ project: 'projectValue',
+ location: 'locationValue',
+ key_ring: 'keyRingValue',
+ crypto_key: 'cryptoKeyValue',
+ };
+ const client = new functionserviceModule.v2beta.FunctionServiceClient({
+ credentials: {client_email: 'bogus', private_key: 'bogus'},
+ projectId: 'bogus',
+ });
+ client.initialize();
+ client.pathTemplates.cryptoKeyPathTemplate.render = sinon
+ .stub()
+ .returns(fakePath);
+ client.pathTemplates.cryptoKeyPathTemplate.match = sinon
+ .stub()
+ .returns(expectedParameters);
+
+ it('cryptoKeyPath', () => {
+ const result = client.cryptoKeyPath(
+ 'projectValue',
+ 'locationValue',
+ 'keyRingValue',
+ 'cryptoKeyValue'
+ );
+ assert.strictEqual(result, fakePath);
+ assert(
+ (client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub)
+ .getCall(-1)
+ .calledWith(expectedParameters)
+ );
+ });
+
+ it('matchProjectFromCryptoKeyName', () => {
+ const result = client.matchProjectFromCryptoKeyName(fakePath);
+ assert.strictEqual(result, 'projectValue');
+ assert(
+ (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub)
+ .getCall(-1)
+ .calledWith(fakePath)
+ );
+ });
+
+ it('matchLocationFromCryptoKeyName', () => {
+ const result = client.matchLocationFromCryptoKeyName(fakePath);
+ assert.strictEqual(result, 'locationValue');
+ assert(
+ (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub)
+ .getCall(-1)
+ .calledWith(fakePath)
+ );
+ });
+
+ it('matchKeyRingFromCryptoKeyName', () => {
+ const result = client.matchKeyRingFromCryptoKeyName(fakePath);
+ assert.strictEqual(result, 'keyRingValue');
+ assert(
+ (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub)
+ .getCall(-1)
+ .calledWith(fakePath)
+ );
+ });
+
+ it('matchCryptoKeyFromCryptoKeyName', () => {
+ const result = client.matchCryptoKeyFromCryptoKeyName(fakePath);
+ assert.strictEqual(result, 'cryptoKeyValue');
+ assert(
+ (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub)
+ .getCall(-1)
+ .calledWith(fakePath)
+ );
+ });
+ });
+
describe('function', () => {
const fakePath = '/rendered/path/function';
const expectedParameters = {