From 9cea23801782159c2b55cd5b954eea963064a3d3 Mon Sep 17 00:00:00 2001 From: Santiago Quiroga Date: Thu, 11 Jun 2026 12:15:35 -0700 Subject: [PATCH] chore: migrate google-cloud-functions to librarian --- librarian.yaml | 3 +- packages/google-cloud-functions/.OwlBot.yaml | 19 ---- .../.repo-metadata.json | 31 +++--- .../src/v1/cloud_functions_service_client.ts | 94 +++++++++++++++++++ .../test/gapic_cloud_functions_service_v1.ts | 1 + 5 files changed, 111 insertions(+), 37 deletions(-) delete mode 100644 packages/google-cloud-functions/.OwlBot.yaml diff --git a/librarian.yaml b/librarian.yaml index e15d9948ad80..c6920a558141 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -850,10 +850,9 @@ libraries: - path: google/cloud/functions/v2beta - path: google/cloud/functions/v2alpha copyright_year: "2026" - skip_generate: true nodejs: default_version: v1 - mixins: google.longrunning.Operations;google.cloud.location.Locations + mixins: google.longrunning.Operations;google.cloud.location.Locations;google.iam.v1.IAMPolicy - name: google-cloud-gdchardwaremanagement version: 0.10.1 apis: diff --git a/packages/google-cloud-functions/.OwlBot.yaml b/packages/google-cloud-functions/.OwlBot.yaml deleted file mode 100644 index 0b4e825402d0..000000000000 --- a/packages/google-cloud-functions/.OwlBot.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -deep-copy-regex: - - source: /google/cloud/functions/google-cloud-functions-nodejs - dest: /owl-bot-staging/google-cloud-functions - -api-name: functions \ No newline at end of file diff --git a/packages/google-cloud-functions/.repo-metadata.json b/packages/google-cloud-functions/.repo-metadata.json index 2cae5d418def..de358237caac 100644 --- a/packages/google-cloud-functions/.repo-metadata.json +++ b/packages/google-cloud-functions/.repo-metadata.json @@ -1,17 +1,16 @@ { - "issue_tracker": "", - "distribution_name": "@google-cloud/functions", - "product_documentation": "https://cloud.google.com/functions", - "api_id": "cloudfunctions.googleapis.com", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/functions/latest", - "repo": "googleapis/google-cloud-node", - "release_level": "stable", - "requires_billing": false, - "name_pretty": "Google Cloud Functions", - "name": "nodejs-functions", - "codeowner_team": "@googleapis/aap-dpes", - "default_version": "v1", - "language": "nodejs", - "api_shortname": "cloudfunctions", - "library_type": "GAPIC_AUTO" -} + "api_description": "Manages lightweight user-provided functions executed in response to events.", + "api_id": "cloudfunctions.googleapis.com", + "api_shortname": "cloudfunctions", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/functions/latest", + "default_version": "v1", + "distribution_name": "@google-cloud/functions", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559729", + "language": "nodejs", + "library_type": "GAPIC_AUTO", + "name": "cloudfunctions", + "name_pretty": "Cloud Functions", + "product_documentation": "https://cloud.google.com/functions/docs", + "release_level": "stable", + "repo": "googleapis/google-cloud-node" +} \ No newline at end of file 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 c2babe1ce6aa..6a8aef8a9fbf 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, + IamClient, + IamProtos, LocationsClient, LocationProtos, } from 'google-gax'; @@ -69,6 +71,7 @@ export class CloudFunctionsServiceClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: { [name: string]: Function }; + iamClient: IamClient; locationsClient: LocationsClient; pathTemplates: { [name: string]: gax.PathTemplate }; operationsClient: gax.OperationsClient; @@ -186,6 +189,8 @@ export class CloudFunctionsServiceClient { if (servicePath === this._servicePath) { this.auth.defaultScopes = staticMembers.scopes; } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + this.locationsClient = new this._gaxModule.LocationsClient( this._gaxGrpc, opts, @@ -2235,6 +2240,92 @@ export class CloudFunctionsServiceClient { callSettings, ) as AsyncIterable; } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ /** * Gets information about a location. @@ -2763,6 +2854,9 @@ export class CloudFunctionsServiceClient { this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); + this.iamClient.close().catch((err) => { + throw err; + }); this.locationsClient.close().catch((err) => { throw err; }); 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 0f7bb9f5f47a..11f4bd56ba32 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 @@ -29,6 +29,7 @@ import { protobuf, LROperation, operationsProtos, + IamProtos, LocationProtos, } from 'google-gax';