From 8d69509962dbea0931019f586a2187688307b7f0 Mon Sep 17 00:00:00 2001 From: Sophia Yang <171981480+yangyzs@users.noreply.github.com> Date: Mon, 20 Jul 2026 13:25:30 -0400 Subject: [PATCH 1/3] chore: modernize post-processing for 13 libraries Remove legacy owlbot.py scripts and migrate configurations to librarian.yaml for the following libraries: - kms - logging - monitoring - monitoring-dashboards - network-management - os-login - pubsub - securitycenter - service-management - spanner - storage - tasks - vision For https://github.com/googleapis/librarian/issues/6931 TAG=agy CONV=bf7d8d16-0d5b-4778-9ed0-5601d1ebc219 --- java-kms/README.md | 15 +- java-kms/owlbot.py | 310 ----- java-logging/README.md | 14 +- java-logging/owlbot.py | 88 -- java-monitoring-dashboards/README.md | 15 +- java-monitoring-dashboards/owlbot.py | 41 - java-monitoring/README.md | 15 +- java-monitoring/owlbot.py | 57 - java-network-management/README.md | 15 +- java-network-management/owlbot.py | 199 --- java-os-login/README.md | 15 +- java-os-login/owlbot.py | 105 -- java-pubsub/README.md | 14 +- java-pubsub/owlbot.py | 102 -- java-securitycenter/README.md | 11 +- java-securitycenter/owlbot.py | 82 -- java-service-management/README.md | 15 +- java-service-management/owlbot.py | 59 - java-spanner/README.md | 14 +- java-spanner/owlbot.py | 36 - java-storage/README.md | 21 +- java-storage/owlbot.py | 41 - java-tasks/README.md | 15 +- java-tasks/owlbot.py | 77 -- java-vision/README.md | 15 +- java-vision/owlbot.py | 248 ---- librarian.yaml | 1869 +++++++++++++++++++++++++- 27 files changed, 1977 insertions(+), 1531 deletions(-) delete mode 100644 java-kms/owlbot.py delete mode 100644 java-logging/owlbot.py delete mode 100644 java-monitoring-dashboards/owlbot.py delete mode 100644 java-monitoring/owlbot.py delete mode 100644 java-network-management/owlbot.py delete mode 100644 java-os-login/owlbot.py delete mode 100644 java-pubsub/owlbot.py delete mode 100644 java-securitycenter/owlbot.py delete mode 100644 java-service-management/owlbot.py delete mode 100644 java-spanner/owlbot.py delete mode 100644 java-storage/owlbot.py delete mode 100644 java-tasks/owlbot.py delete mode 100644 java-vision/owlbot.py diff --git a/java-kms/README.md b/java-kms/README.md index 91a18a9770fe..8110bc739a8f 100644 --- a/java-kms/README.md +++ b/java-kms/README.md @@ -11,7 +11,6 @@ Java idiomatic client for [Cloud Key Management Service][product-docs]. ## Quickstart - If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: ```xml @@ -46,6 +45,14 @@ If you are using Maven without the BOM, add this to your dependencies: ``` +If you are using Gradle 5.x or later, add this to your dependencies: + +```Groovy +implementation platform('com.google.cloud:libraries-bom:26.83.0') + +implementation 'com.google.cloud:google-cloud-kms' +``` + If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -71,7 +78,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Key Management Service [API enabled][enable-api]. - +You will need to [enable billing][enable-billing] to use Google Cloud Key Management Service. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -147,8 +154,6 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning - - This library follows [Semantic Versioning](http://semver.org/). @@ -187,7 +192,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE - +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudkms.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/java-kms/owlbot.py b/java-kms/owlbot.py deleted file mode 100644 index fa3391e3090a..000000000000 --- a/java-kms/owlbot.py +++ /dev/null @@ -1,310 +0,0 @@ -# Copyright 2021 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 -# -# https://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. - -import synthtool as s -from synthtool.languages import java - -IMPLEMENTS_RESOURCE_NAME = "implements ResourceName" -EXTENDS_KEY_NAME = "extends KeyName" - -ENCRYPT_INSERTION_POINT = r'(\s+public final EncryptResponse encrypt\(ResourceName.*\) {\n.*\n.*\n.*\n.*\n.*\n.*return encrypt\(request\);\n\s+})' -SET_IAM_INSERTION_POINT = r'(\s+public final Policy setIamPolicy\(SetIamPolicyRequest request\) {\n\s+return.*\n\s+})' -GET_IAM_INSERTION_POINT = r'(\s+public final Policy getIamPolicy\(GetIamPolicyRequest request\) {\n\s+return.*\n\s+})' -TEST_IAM_INSERTION_POINT = r'(\s+public final TestIamPermissionsResponse testIamPermissions\(TestIamPermissionsRequest request\) {\n\s+return.*\n\s+})' - -ENCRYPT_METHOD = """ - // ADDED BY SYNTH - /** - * Encrypts data, so that it can only be recovered by a call to - * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The - * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - * - *

Sample code: - * - *


-   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
-   *   CryptoKeyPathName name = CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
-   *   ByteString plaintext = ByteString.copyFromUtf8("");
-   *   EncryptResponse response = keyManagementServiceClient.encrypt(name, plaintext);
-   * }
-   * 
- * - * @param name Required. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] or - * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for encryption. - *

If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server will use its - * [primary version][google.cloud.kms.v1.CryptoKey.primary]. - * @param plaintext Required. The data to encrypt. Must be no larger than 64KiB. - *

The maximum size depends on the key version's - * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For - * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the plaintext must be no - * larger than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined - * length of the plaintext and additional_authenticated_data fields must be no larger than - * 8KiB. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final EncryptResponse encrypt(CryptoKeyPathName name, ByteString plaintext) { - EncryptRequest request = - EncryptRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setPlaintext(plaintext) - .build(); - return encrypt(request); - } -""" - - -SET_IAM_METHODS = """ - // ADDED BY SYNTH - /** - * Sets the access control policy on the specified resource. Replaces any existing policy. - * - *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED - * - *

Sample code: - * - *


-   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
-   *   KeyName resource = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]");
-   *   Policy policy = Policy.newBuilder().build();
-   *   Policy response = keyManagementServiceClient.setIamPolicy(resource, policy);
-   * }
-   * 
- * - * @param resource REQUIRED: The resource for which the policy is being specified. See the - * operation documentation for the appropriate value for this field. - * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the - * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud - * Platform services (such as Projects) might reject them. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy setIamPolicy(KeyName resource, Policy policy) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) - .setPolicy(policy) - .build(); - return setIamPolicy(request); - } - - // ADDED BY SYNTH - /** - * Sets the access control policy on the specified resource. Replaces any existing policy. - * - *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED - * - *

Sample code: - * - *


-   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
-   *   KeyName resource = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]");
-   *   Policy policy = Policy.newBuilder().build();
-   *   Policy response = keyManagementServiceClient.setIamPolicy(resource.toString(), policy);
-   * }
-   * 
- * - * @param resource REQUIRED: The resource for which the policy is being specified. See the - * operation documentation for the appropriate value for this field. - * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the - * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud - * Platform services (such as Projects) might reject them. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy setIamPolicy(String resource, Policy policy) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); - return setIamPolicy(request); - } -""" - -GET_IAM_METHODS = """ - // ADDED BY SYNTH - /** - * Gets the access control policy for a resource. Returns an empty policy if the resource exists - * and does not have a policy set. - * - *

Sample code: - * - *


-   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
-   *   KeyName resource = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]");
-   *   Policy response = keyManagementServiceClient.getIamPolicy(resource);
-   * }
-   * 
- * - * @param resource REQUIRED: The resource for which the policy is being requested. See the - * operation documentation for the appropriate value for this field. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy getIamPolicy(KeyName resource) { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) - .build(); - return getIamPolicy(request); - } - - // ADDED BY SYNTH - /** - * Gets the access control policy for a resource. Returns an empty policy if the resource exists - * and does not have a policy set. - * - *

Sample code: - * - *


-   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
-   *   KeyName resource = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]");
-   *   Policy response = keyManagementServiceClient.getIamPolicy(resource.toString());
-   * }
-   * 
- * - * @param resource REQUIRED: The resource for which the policy is being requested. See the - * operation documentation for the appropriate value for this field. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Policy getIamPolicy(String resource) { - GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); - return getIamPolicy(request); - } -""" - -TEST_IAM_METHODS = """ - // ADDED BY SYNTH - /** - * 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. - * - *

Sample code: - * - *


-   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
-   *   KeyName resource = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]");
-   *   List<String> permissions = new ArrayList<>();
-   *   TestIamPermissionsResponse response = keyManagementServiceClient.testIamPermissions(resource, permissions);
-   * }
-   * 
- * - * @param resource REQUIRED: The resource for which the policy detail is being requested. See the - * operation documentation for the appropriate value for this field. - * @param permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final TestIamPermissionsResponse testIamPermissions( - KeyName resource, List permissions) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) - .addAllPermissions(permissions) - .build(); - return testIamPermissions(request); - } - - // ADDED BY SYNTH - /** - * 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. - * - *

Sample code: - * - *


-   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
-   *   KeyName resource = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]");
-   *   List<String> permissions = new ArrayList<>();
-   *   TestIamPermissionsResponse response = keyManagementServiceClient.testIamPermissions(resource.toString(), permissions);
-   * }
-   * 
- * - * @param resource REQUIRED: The resource for which the policy detail is being requested. See the - * operation documentation for the appropriate value for this field. - * @param permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final TestIamPermissionsResponse testIamPermissions( - String resource, List permissions) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(resource) - .addAllPermissions(permissions) - .build(); - return testIamPermissions(request); - } -""" - -for library in s.get_staging_dirs(): - # put any special-case replacements here - s.replace( - "**/KeyManagementServiceClient.java", - ENCRYPT_INSERTION_POINT, - "\g<1>\n\n" + ENCRYPT_METHOD - ) - - s.replace( - "**/KeyManagementServiceClient.java", - GET_IAM_INSERTION_POINT, - "\g<1>\n\n" + GET_IAM_METHODS - ) - - s.replace( - "**/KeyManagementServiceClient.java", - SET_IAM_INSERTION_POINT, - "\g<1>\n\n" + SET_IAM_METHODS - ) - - s.replace( - "**/KeyManagementServiceClient.java", - TEST_IAM_INSERTION_POINT, - "\g<1>\n\n" + TEST_IAM_METHODS - ) - - s.replace( - "**/KeyRingName.java", - IMPLEMENTS_RESOURCE_NAME, - EXTENDS_KEY_NAME - ) - - s.replace( - "**/CryptoKeyName.java", - IMPLEMENTS_RESOURCE_NAME, - EXTENDS_KEY_NAME) - - s.move(library) - -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/java-logging/README.md b/java-logging/README.md index c90a29ba45de..878b5683eb3a 100644 --- a/java-logging/README.md +++ b/java-logging/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.55.0 + 26.83.0 pom import @@ -31,9 +31,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud google-cloud-logging - - ``` If you are using Maven without the BOM, add this to your dependencies: @@ -43,9 +41,8 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-logging - 3.21.3 + 3.35.0 - ``` If you are using Gradle 5.x or later, add this to your dependencies: @@ -55,6 +52,7 @@ implementation platform('com.google.cloud:libraries-bom:26.83.0') implementation 'com.google.cloud:google-cloud-logging' ``` + If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -80,7 +78,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Logging [API enabled][enable-api]. - +You will need to [enable billing][enable-billing] to use Google Cloud Logging. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -416,8 +414,6 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning - - This library follows [Semantic Versioning](http://semver.org/). @@ -456,7 +452,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE - +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=logging.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/java-logging/owlbot.py b/java-logging/owlbot.py deleted file mode 100644 index 871de98a56af..000000000000 --- a/java-logging/owlbot.py +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright 2026 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 -# -# https://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. - -import synthtool as s -from synthtool.languages import java - -import os -DEPRECATION_JAVADOC = 'Please use {{@link #{new_method}}} instead' -def _append_if_not_contained(src: str, dest: str, file: str): - if src in dest: - return dest - return f'{dest}\n{src}' -def append_new_content(src: str, dest: str): - s.move(src, dest, merge=_append_if_not_contained) -append_new_content('.kokoro/common_env_vars.cfg', '.kokoro/common.cfg') -tracked_subdirs = ['continuous', 'presubmit', 'release', 'nightly'] -for subdir in tracked_subdirs: - for path, subdirs, files in os.walk(f'.kokoro/{subdir}'): - for name in files: - if name == 'common.cfg': - file_path = os.path.join(path, name) - append_new_content('.kokoro/common_env_vars.cfg', file_path) - -for library in s.get_staging_dirs(): - # put any special-case replacements here - java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static String formatBillingAccountName(String billingAccount)', 'formatBillingAccountName', 'formatBillingAccountCmekSettingsName') - java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static String formatBillingAccountCmekSettingsName(String billingAccount)', DEPRECATION_JAVADOC.format(new_method='formatBillingAccountName(String)')) - java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static String formatFolderName(String folder)', 'formatFolderName', 'formatFolderCmekSettingsName') - java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static String formatFolderCmekSettingsName(String folder)', DEPRECATION_JAVADOC.format(new_method='formatFolderName(String)')) - java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static String formatOrganizationName(String organization)', 'formatOrganizationName', 'formatOrganizationCmekSettingsName') - java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static String formatOrganizationCmekSettingsName(String organization)', DEPRECATION_JAVADOC.format(new_method='formatOrganizationName(String)')) - java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static String formatProjectName(String project)', 'formatProjectName', 'formatProjectCmekSettingsName') - java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static String formatProjectCmekSettingsName(String project)', DEPRECATION_JAVADOC.format(new_method='formatProjectName(String)')) - java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static BillingAccountCmekSettingsBuilder newBillingAccountBuilder()', 'newBillingAccountBuilder', 'newBillingAccountCmekSettingsBuilder') - java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static BillingAccountCmekSettingsBuilder newBillingAccountCmekSettingsBuilder()', DEPRECATION_JAVADOC.format(new_method='newBillingAccountBuilder()')) - s.replace('**/CmekSettingsName', 'return newBillingAccountBuilder', 'return newBillingAccountCmekSettingsBuilder') - java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static FolderCmekSettingsBuilder newFolderBuilder()', 'newFolderBuilder', 'newFolderCmekSettingsBuilder') - java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static FolderCmekSettingsBuilder newFolderCmekSettingsBuilder()', DEPRECATION_JAVADOC.format(new_method='newFolderBuilder()')) - s.replace('**/CmekSettingsName.java', 'return newFolderBuilder', 'return newFolderCmekSettingsBuilder') - java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static OrganizationCmekSettingsBuilder newOrganizationBuilder()', 'newOrganizationBuilder', 'newOrganizationCmekSettingsBuilder') - java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static OrganizationCmekSettingsBuilder newOrganizationCmekSettingsBuilder()', DEPRECATION_JAVADOC.format(new_method='newOrganizationBuilder()')) - s.replace('**/CmekSettingsName.java', 'return newOrganizationBuilder', 'return newOrganizationCmekSettingsBuilder') - java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static Builder newProjectBuilder()', 'newProjectBuilder', 'newProjectCmekSettingsBuilder') - java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static Builder newProjectCmekSettingsBuilder()', DEPRECATION_JAVADOC.format(new_method='newProjectBuilder()')) - java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static CmekSettingsName ofBillingAccountName(String billingAccount)', 'ofBillingAccountName', 'ofBillingAccountCmekSettingsName') - java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static CmekSettingsName ofBillingAccountCmekSettingsName(String billingAccount)', DEPRECATION_JAVADOC.format(new_method='ofBillingAccountName(String)')) - s.replace('**/CmekSettingsName.java', 'return ofBillingAccountName', 'return ofBillingAccountCmekSettingsName') - java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static CmekSettingsName ofFolderName(String folder)', 'ofFolderName', 'ofFolderCmekSettingsName') - java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static CmekSettingsName ofFolderCmekSettingsName(String folder)', DEPRECATION_JAVADOC.format(new_method='ofFolderName(String)')) - s.replace('**/CmekSettingsName.java', 'return ofFolderName', 'return ofFolderCmekSettingsName') - java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static CmekSettingsName ofOrganizationName(String organization)', 'ofOrganizationName', 'ofOrganizationCmekSettingsName') - java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static CmekSettingsName ofOrganizationCmekSettingsName(String organization)', DEPRECATION_JAVADOC.format(new_method='ofOrganizationName(String)')) - s.replace('**/CmekSettingsName.java', 'return ofOrganizationName', 'return ofOrganizationCmekSettingsName') - java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static CmekSettingsName ofProjectName(String project)', 'ofProjectName', 'ofProjectCmekSettingsName') - java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static CmekSettingsName ofProjectCmekSettingsName(String project)', DEPRECATION_JAVADOC.format(new_method='ofProjectName(String)')) - s.replace('**/CmekSettingsName.java', 'return ofProjectName', 'return ofProjectCmekSettingsName') - s.replace('**/CmekSettingsName.java', 'BillingAccountBuilder', 'BillingAccountCmekSettingsBuilder') - s.replace('**/CmekSettingsName.java', 'FolderBuilder', 'FolderCmekSettingsBuilder') - s.replace('**/CmekSettingsName.java', 'OrganizationBuilder', 'OrganizationCmekSettingsBuilder') - s.replace('**/ConfigClientTest.java', 'CmekSettingsName.ofProjectName', 'CmekSettingsName.ofProjectCmekSettingsName') - s.move(library) -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/java-monitoring-dashboards/README.md b/java-monitoring-dashboards/README.md index 6ca587c29353..60c0938f07e7 100644 --- a/java-monitoring-dashboards/README.md +++ b/java-monitoring-dashboards/README.md @@ -11,7 +11,6 @@ Java idiomatic client for [Monitoring Dashboards][product-docs]. ## Quickstart - If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: ```xml @@ -46,6 +45,14 @@ If you are using Maven without the BOM, add this to your dependencies: ``` +If you are using Gradle 5.x or later, add this to your dependencies: + +```Groovy +implementation platform('com.google.cloud:libraries-bom:26.83.0') + +implementation 'com.google.cloud:google-cloud-monitoring-dashboard' +``` + If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -71,7 +78,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Monitoring Dashboards [API enabled][enable-api]. - +You will need to [enable billing][enable-billing] to use Google Monitoring Dashboards. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -147,8 +154,6 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning - - This library follows [Semantic Versioning](http://semver.org/). @@ -187,7 +192,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE - +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=monitoring.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/java-monitoring-dashboards/owlbot.py b/java-monitoring-dashboards/owlbot.py deleted file mode 100644 index 00e13df1cae9..000000000000 --- a/java-monitoring-dashboards/owlbot.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2021 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 -# -# https://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. - -import synthtool as s -from synthtool.languages import java -import os - - -for library in s.get_staging_dirs(): - # put any special-case replacements here - os.remove("owl-bot-staging/v1/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DrilldownsProto.java") - os.remove("owl-bot-staging/v1/proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ServiceMonitoringProto.java") - s.move(library) - -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/java-monitoring/README.md b/java-monitoring/README.md index 45eea4fef0f5..417496656aa1 100644 --- a/java-monitoring/README.md +++ b/java-monitoring/README.md @@ -11,7 +11,6 @@ Java idiomatic client for [Stackdriver Monitoring][product-docs]. ## Quickstart - If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: ```xml @@ -46,6 +45,14 @@ If you are using Maven without the BOM, add this to your dependencies: ``` +If you are using Gradle 5.x or later, add this to your dependencies: + +```Groovy +implementation platform('com.google.cloud:libraries-bom:26.83.0') + +implementation 'com.google.cloud:google-cloud-monitoring' +``` + If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -71,7 +78,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Stackdriver Monitoring [API enabled][enable-api]. - +You will need to [enable billing][enable-billing] to use Google Stackdriver Monitoring. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -147,8 +154,6 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning - - This library follows [Semantic Versioning](http://semver.org/). @@ -187,7 +192,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE - +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=monitoring.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/java-monitoring/owlbot.py b/java-monitoring/owlbot.py deleted file mode 100644 index 88890072e420..000000000000 --- a/java-monitoring/owlbot.py +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2021 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 -# -# https://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. - -import synthtool as s -from synthtool.languages import java - -def fix_resource(client, version, name): - s.replace( - [f'owl-bot-staging/{version}/google-cloud-monitoring/**/{version}/{client}.java'], - f'import com.google.monitoring.{version}.{name}', - 'import com.google.api.resourcenames.ResourceName', - ) - - s.replace( - [f'owl-bot-staging/{version}/google-cloud-monitoring/**/{version}/{client}.java'], - name, - 'ResourceName', - ) -version='v3' -for library in s.get_staging_dirs(): - # put any special-case replacements here - fix_resource('AlertPolicyServiceClient', version, 'FolderName') - fix_resource('GroupServiceClient', version, 'FolderName') - fix_resource('MetricServiceClient', version, 'FolderName') - fix_resource('NotificationChannelServiceClient', version, 'FolderName') - fix_resource('ServiceMonitoringServiceClient', version, 'FolderName') - fix_resource('UptimeCheckServiceClient', version, 'FolderName') - - s.move(library) - -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/java-network-management/README.md b/java-network-management/README.md index d4b027d4bbc6..32de675fa39b 100644 --- a/java-network-management/README.md +++ b/java-network-management/README.md @@ -11,7 +11,6 @@ Java idiomatic client for [Network Management API][product-docs]. ## Quickstart - If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: ```xml @@ -46,6 +45,14 @@ If you are using Maven without the BOM, add this to your dependencies: ``` +If you are using Gradle 5.x or later, add this to your dependencies: + +```Groovy +implementation platform('com.google.cloud:libraries-bom:26.83.0') + +implementation 'com.google.cloud:google-cloud-network-management' +``` + If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -71,7 +78,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Network Management API [API enabled][enable-api]. - +You will need to [enable billing][enable-billing] to use Google Network Management API. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -147,8 +154,6 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning - - This library follows [Semantic Versioning](http://semver.org/). @@ -187,7 +192,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE - +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=networkmanagement.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/java-network-management/owlbot.py b/java-network-management/owlbot.py deleted file mode 100644 index b6b136fc50b4..000000000000 --- a/java-network-management/owlbot.py +++ /dev/null @@ -1,199 +0,0 @@ -# Copyright 2021 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 -# -# https://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. - -import synthtool as s -from synthtool.languages import java - -v1_file_name = "owl-bot-staging/v1/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientHttpJsonTest.java" -v1beta1_file_name = "owl-bot-staging/v1beta1/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientHttpJsonTest.java" -v1beta1_vpcflowlogs_file_name = "owl-bot-staging/v1beta1/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/VpcFlowLogsServiceClientHttpJsonTest.java" -v1_vpcflowlogs_file_name = "owl-bot-staging/v1/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/VpcFlowLogsServiceClientHttpJsonTest.java" -v1beta1_org_vpcflowlogs_file_name = "owl-bot-staging/v1beta1/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/OrganizationVpcFlowLogsServiceClientHttpJsonTest.java" -v1_org_vpcflowlogs_file_name = "owl-bot-staging/v1/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/OrganizationVpcFlowLogsServiceClientHttpJsonTest.java" - -for library in s.get_staging_dirs(): - # put any special-case replacements here - s.replace( - v1_file_name, - r'^import org.junit.Test;', - 'import org.junit.Ignore;\nimport org.junit.Test;' - ) - s.replace( - v1_file_name, - r"\s+@Test\n\s+public void setIamPolicyTest\(\) throws Exception.*", - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")\n@Test\npublic void setIamPolicyTest() throws Exception {' - ) - s.replace( - v1_file_name, - r'\s+@Test\n\s+public void getIamPolicyTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")\n@Test\npublic void getIamPolicyTest() throws Exception {' - ) - s.replace( - v1_file_name, - r'\s+@Test\n\s+public void testIamPermissionsTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void testIamPermissionsTest() throws Exception {' - ) - s.replace( - v1_file_name, - r'\s+@Test\n\s+public void listConnectivityTestsTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void listConnectivityTestsTest() throws Exception {' - ) - s.replace( - v1_file_name, - r'\s+@Test\n\s+public void createConnectivityTestTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void createConnectivityTestTest() throws Exception {' - ) - s.replace( - v1beta1_file_name, - r'^import org.junit.Test;', - 'import org.junit.Ignore;\nimport org.junit.Test;' - ) - s.replace( - v1beta1_file_name, - r"\s+@Test\n\s+public void setIamPolicyTest\(\) throws Exception.*", - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")\n@Test\npublic void setIamPolicyTest() throws Exception {' - ) - s.replace( - v1beta1_file_name, - r'\s+@Test\n\s+public void getIamPolicyTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")\n@Test\npublic void getIamPolicyTest() throws Exception {' - ) - s.replace( - v1beta1_file_name, - r'\s+@Test\n\s+public void testIamPermissionsTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void testIamPermissionsTest() throws Exception {' - ) - s.replace( - v1beta1_file_name, - r'\s+@Test\n\s+public void listConnectivityTestsTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void listConnectivityTestsTest() throws Exception {' - ) - s.replace( - v1beta1_file_name, - r'\s+@Test\n\s+public void createConnectivityTestTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void createConnectivityTestTest() throws Exception {' - ) - s.replace( - v1beta1_vpcflowlogs_file_name, - r'^import org.junit.Test;', - 'import org.junit.Ignore;\nimport org.junit.Test;' - ) - s.replace( - v1beta1_vpcflowlogs_file_name, - r"\s+@Test\n\s+public void setIamPolicyTest\(\) throws Exception.*", - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")\n@Test\npublic void setIamPolicyTest() throws Exception {' - ) - s.replace( - v1beta1_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void getIamPolicyTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")\n@Test\npublic void getIamPolicyTest() throws Exception {' - ) - s.replace( - v1beta1_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void testIamPermissionsTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void testIamPermissionsTest() throws Exception {' - ) - s.replace( - v1beta1_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void createVpcFlowLogsConfigTest3\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void createVpcFlowLogsConfigTest3() throws Exception {' - ) - s.replace( - v1beta1_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void createVpcFlowLogsConfigTest4\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void createVpcFlowLogsConfigTest4() throws Exception {' - ) - s.replace( - v1beta1_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void listVpcFlowLogsConfigsTest2\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void listVpcFlowLogsConfigsTest2() throws Exception {' - ) - s.replace( - v1_vpcflowlogs_file_name, - r'^import org.junit.Test;', - 'import org.junit.Ignore;\nimport org.junit.Test;' - ) - s.replace( - v1_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void createVpcFlowLogsConfigTest3\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void createVpcFlowLogsConfigTest3() throws Exception {' - ) - s.replace( - v1_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void createVpcFlowLogsConfigTest4\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void createVpcFlowLogsConfigTest4() throws Exception {' - ) - s.replace( - v1_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void listVpcFlowLogsConfigsTest2\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void listVpcFlowLogsConfigsTest2() throws Exception {' - ) - s.replace( - v1beta1_org_vpcflowlogs_file_name, - r'^import org.junit.Test;', - 'import org.junit.Ignore;\nimport org.junit.Test;' - ) - s.replace( - v1beta1_org_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void createVpcFlowLogsConfigTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void createVpcFlowLogsConfigTest() throws Exception {' - ) - s.replace( - v1beta1_org_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void createVpcFlowLogsConfigTest2\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void createVpcFlowLogsConfigTest2() throws Exception {' - ) - s.replace( - v1beta1_org_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void listVpcFlowLogsConfigsTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void listVpcFlowLogsConfigsTest() throws Exception {' - ) - s.replace( - v1_org_vpcflowlogs_file_name, - r'^import org.junit.Test;', - 'import org.junit.Ignore;\nimport org.junit.Test;' - ) - s.replace( - v1_org_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void createVpcFlowLogsConfigTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void createVpcFlowLogsConfigTest() throws Exception {' - ) - s.replace( - v1_org_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void createVpcFlowLogsConfigTest2\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void createVpcFlowLogsConfigTest2() throws Exception {' - ) - s.replace( - v1_org_vpcflowlogs_file_name, - r'\s+@Test\n\s+public void listVpcFlowLogsConfigsTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void listVpcFlowLogsConfigsTest() throws Exception {' - ) - s.move(library) - -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/java-os-login/README.md b/java-os-login/README.md index 78aab49cf5c4..1ce9ad8ed962 100644 --- a/java-os-login/README.md +++ b/java-os-login/README.md @@ -11,7 +11,6 @@ Java idiomatic client for [Cloud OS Login][product-docs]. ## Quickstart - If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: ```xml @@ -46,6 +45,14 @@ If you are using Maven without the BOM, add this to your dependencies: ``` +If you are using Gradle 5.x or later, add this to your dependencies: + +```Groovy +implementation platform('com.google.cloud:libraries-bom:26.83.0') + +implementation 'com.google.cloud:google-cloud-os-login' +``` + If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -71,7 +78,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Cloud OS Login [API enabled][enable-api]. - +You will need to [enable billing][enable-billing] to use Google Cloud OS Login. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -147,8 +154,6 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning - - This library follows [Semantic Versioning](http://semver.org/). @@ -187,7 +192,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE - +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=oslogin.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/java-os-login/owlbot.py b/java-os-login/owlbot.py deleted file mode 100644 index 063f516fe236..000000000000 --- a/java-os-login/owlbot.py +++ /dev/null @@ -1,105 +0,0 @@ -# Copyright 2021 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 -# -# https://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. - -import synthtool as s -from synthtool.languages import java -import shutil - - -for library in s.get_staging_dirs(): - # put any special-case replacements here - s.replace('**/OsLoginServiceClient.java', 'PosixAccountName', 'ProjectName') - s.replace('**/OsLoginServiceClient.java', 'SshPublicKeyName', - 'FingerprintName') - s.replace('**/OsLoginServiceClientTest.java', 'PosixAccountName', - 'ProjectName') - s.replace('**/OsLoginServiceClientTest.java', 'SshPublicKeyName', - 'FingerprintName') - - # Copy of Resource name helper classes from v1 and import replacements - # Todo: remove before next major release(lines 36 - 60) - shutil.copy( - 'owl-bot-staging/v1/proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/common/UserName.java', - 'owl-bot-staging/v1/proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/UserName.java') - s.replace( - 'owl-bot-staging/v1/proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/UserName.java', - 'package com.google.cloud.oslogin.common;', - 'package com.google.cloud.oslogin.v1;') - s.replace('**/OsLoginServiceClient.java', - 'import com.google.cloud.oslogin.common.FingerprintName;', - 'import com.google.cloud.oslogin.v1.FingerprintName;') - s.replace('**/OsLoginServiceClient.java', - 'import com.google.cloud.oslogin.common.UserName;', - 'import com.google.cloud.oslogin.v1.UserName;') - s.replace('**/OsLoginServiceClient.java', - 'import com.google.cloud.oslogin.common.ProjectName;', - 'import com.google.cloud.oslogin.v1.ProjectName;') - s.replace('**/OsLoginServiceClientTest.java', - 'import com.google.cloud.oslogin.common.FingerprintName;', - 'import com.google.cloud.oslogin.v1.FingerprintName;') - s.replace('**/OsLoginServiceClientTest.java', - 'import com.google.cloud.oslogin.common.UserName;', - 'import com.google.cloud.oslogin.v1.UserName;') - s.replace('**/OsLoginServiceClientTest.java', - 'import com.google.cloud.oslogin.common.ProjectName;', - 'import com.google.cloud.oslogin.v1.ProjectName;') - - # put any special-case replacements here - s.replace('**/OsLoginServiceClientHttpJsonTest.java', 'PosixAccountName', 'ProjectName') - s.replace('**/OsLoginServiceClientHttpJsonTest.java', 'SshPublicKeyName', - 'FingerprintName') - s.replace('**/OsLoginServiceClientHttpJsonTest.java', 'PosixAccountName', - 'ProjectName') - s.replace('**/OsLoginServiceClientHttpJsonTest.java', 'SshPublicKeyName', - 'FingerprintName') - - # Copy of Resource name helper classes from v1 and import replacements - - s.replace('**/OsLoginServiceClientHttpJsonTest.java', - 'import com.google.cloud.oslogin.common.FingerprintName;', - 'import com.google.cloud.oslogin.v1.FingerprintName;') - s.replace('**/OsLoginServiceClientHttpJsonTest.java', - 'import com.google.cloud.oslogin.common.UserName;', - 'import com.google.cloud.oslogin.v1.UserName;') - s.replace('**/OsLoginServiceClientHttpJsonTest.java', - 'import com.google.cloud.oslogin.common.ProjectName;', - 'import com.google.cloud.oslogin.v1.ProjectName;') - s.replace('**/OsLoginServiceClientHttpJsonTest.java', - 'import com.google.cloud.oslogin.common.FingerprintName;', - 'import com.google.cloud.oslogin.v1.FingerprintName;') - s.replace('**/OsLoginServiceClientHttpJsonTest.java', - 'import com.google.cloud.oslogin.common.UserName;', - 'import com.google.cloud.oslogin.v1.UserName;') - s.replace('**/OsLoginServiceClientHttpJsonTest.java', - 'import com.google.cloud.oslogin.common.ProjectName;', - 'import com.google.cloud.oslogin.v1.ProjectName;') - - s.move(library) - -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/java-pubsub/README.md b/java-pubsub/README.md index d10395ea2f47..7153dde7df04 100644 --- a/java-pubsub/README.md +++ b/java-pubsub/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.76.0 + 26.83.0 pom import @@ -31,9 +31,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud google-cloud-pubsub - - ``` If you are using Maven without the BOM, add this to your dependencies: @@ -43,9 +41,8 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-pubsub - 1.148.0 + 1.152.0 - ``` If you are using Gradle 5.x or later, add this to your dependencies: @@ -55,6 +52,7 @@ implementation platform('com.google.cloud:libraries-bom:26.83.0') implementation 'com.google.cloud:google-cloud-pubsub' ``` + If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -80,7 +78,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Pub/Sub [API enabled][enable-api]. - +You will need to [enable billing][enable-billing] to use Google Cloud Pub/Sub. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -373,8 +371,6 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning - - This library follows [Semantic Versioning](http://semver.org/). @@ -413,7 +409,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE - +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=pubsub.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/java-pubsub/owlbot.py b/java-pubsub/owlbot.py deleted file mode 100644 index 8a4b098b701c..000000000000 --- a/java-pubsub/owlbot.py +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright 2026 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 -# -# https://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. - -import synthtool as s -from synthtool.languages import java - -service = 'pubsub' -version = 'v1' -GET_IAM_POLICY_TOPIC = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD\n /**\n * Gets the access control policy for a resource. Returns an empty policy if the resource exists\n * and does not have a policy set.\n *\n *

Sample code:\n *\n *

\n   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {\n   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");\n   *   Policy response = topicAdminClient.getIamPolicy(formattedResource);\n   * }\n   * 
\n *\n * @param resource REQUIRED: The resource for which the policy is being requested. See the\n * operation documentation for the appropriate value for this field.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead.\n */\n @Deprecated\n public final Policy getIamPolicy(String resource) {\n GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); \n return getIamPolicy(request);\n }\n' -GET_IAM_POLICY_SUBSCRIPTION = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD\n /**\n * Gets the access control policy for a resource. Returns an empty policy if the resource exists\n * and does not have a policy set.\n *\n *

Sample code:\n *\n *

\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");\n   *   Policy response = subscriptionAdminClient.getIamPolicy(formattedResource);\n   * }\n   * 
\n *\n * @param resource REQUIRED: The resource for which the policy is being requested. See the\n * operation documentation for the appropriate value for this field.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead.\n */\n @Deprecated\n public final Policy getIamPolicy(String resource) {\n GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); \n return getIamPolicy(request);\n }\n' -GET_IAM_POLICY_PREVIOUS = '(\\s+public final Policy getIamPolicy\\(GetIamPolicyRequest request\\) {\\n\\s+return .*\\n\\s+})' -SET_IAM_POLICY_TOPIC = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD\n /**\n * Sets the access control policy on the specified resource. Replaces any existing policy.\n *\n *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED\n *\n *

Sample code:\n *\n *

\n   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {\n   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");\n   *   Policy policy = Policy.newBuilder().build();\n   *   Policy response = topicAdminClient.setIamPolicy(formattedResource, policy);\n   * }\n   * 
\n *\n * @param resource REQUIRED: The resource for which the policy is being specified. See the\n * operation documentation for the appropriate value for this field.\n * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the\n * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud\n * Platform services (such as Projects) might reject them.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead.\n */\n @Deprecated\n public final Policy setIamPolicy(String resource, Policy policy) { \n SetIamPolicyRequest request = \n SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); \n return setIamPolicy(request); \n }\n' -SET_IAM_POLICY_SUBSCRIPTION = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD\n /**\n * Sets the access control policy on the specified resource. Replaces any existing policy.\n *\n *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED\n *\n *

Sample code:\n *\n *

\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");\n   *   Policy policy = Policy.newBuilder().build();\n   *   Policy response = subscriptionAdminClient.setIamPolicy(formattedResource, policy);\n   * }\n   * 
\n *\n * @param resource REQUIRED: The resource for which the policy is being specified. See the\n * operation documentation for the appropriate value for this field.\n * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the\n * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud\n * Platform services (such as Projects) might reject them.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead.\n */\n @Deprecated\n public final Policy setIamPolicy(String resource, Policy policy) { \n SetIamPolicyRequest request = \n SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); \n return setIamPolicy(request); \n }\n' -SET_IAM_POLICY_PREVIOUS = '(\\s+public final Policy setIamPolicy\\(SetIamPolicyRequest request\\) {\\n\\s+return .*\\n\\s+})' -TEST_IAM_PERMISSIONS_TOPIC = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD\n /**\n * Returns permissions that a caller has on the specified resource. If the resource does not\n * exist, this will return an empty set of permissions, not a NOT_FOUND error.\n *\n *

Note: This operation is designed to be used for building permission-aware UIs and\n * command-line tools, not for authorization checking. This operation may "fail open" without\n * warning.\n *\n *

Sample code:\n *\n *

\n   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {\n   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");\n   *   List<String> permissions = new ArrayList<>();\n   *   TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(formattedResource, permissions);\n   * }\n   * 
\n *\n * @param resource REQUIRED: The resource for which the policy detail is being requested. See the\n * operation documentation for the appropriate value for this field.\n * @param permissions The set of permissions to check for the `resource`. Permissions with\n * wildcards (such as \'*\' or \'storage.*\') are not allowed. For more information see\n * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead.\n */\n @Deprecated\n public final TestIamPermissionsResponse testIamPermissions( \n String resource, List permissions) { \n TestIamPermissionsRequest request = \n TestIamPermissionsRequest.newBuilder() \n .setResource(resource) \n .addAllPermissions(permissions) \n .build(); \n return testIamPermissions(request); \n }\n' -TEST_IAM_PERMISSIONS_SUBSCRIPTION = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD\n /**\n * Returns permissions that a caller has on the specified resource. If the resource does not\n * exist, this will return an empty set of permissions, not a NOT_FOUND error.\n *\n *

Note: This operation is designed to be used for building permission-aware UIs and\n * command-line tools, not for authorization checking. This operation may "fail open" without\n * warning.\n *\n *

Sample code:\n *\n *

\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");\n   *   List<String> permissions = new ArrayList<>();\n   *   TestIamPermissionsResponse response = subscriptionAdminClient.testIamPermissions(formattedResource, permissions);\n   * }\n   * 
\n *\n * @param resource REQUIRED: The resource for which the policy detail is being requested. See the\n * operation documentation for the appropriate value for this field.\n * @param permissions The set of permissions to check for the `resource`. Permissions with\n * wildcards (such as \'*\' or \'storage.*\') are not allowed. For more information see\n * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead.\n */\n @Deprecated\n public final TestIamPermissionsResponse testIamPermissions( \n String resource, List permissions) { \n TestIamPermissionsRequest request = \n TestIamPermissionsRequest.newBuilder() \n .setResource(resource) \n .addAllPermissions(permissions) \n .build(); \n return testIamPermissions(request); \n }\n' -TEST_IAM_PERMISSIONS_PREVIOUS = '(\\s+public final TestIamPermissionsResponse testIamPermissions\\(TestIamPermissionsRequest request\\) {\\n\\s+return .*\\n\\s+})' -CREATE_TOPIC = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD\n /**\n * Creates the given topic with the given name. See the <a\n * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name\n * rules</a>.\n *\n *

Sample code:\n *\n *

\n   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {\n   *   ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");\n   *   Topic response = topicAdminClient.createTopic(name);\n   * }\n   * 
\n *\n * @param name Required. The name of the topic. It must have the format\n * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only\n * letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`),\n * tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in\n * length, and it must not start with `"goog"`.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #createTopic(TopicName)} instead.\n */\n @Deprecated\n public final Topic createTopic(ProjectTopicName name) {\n Topic request = Topic.newBuilder().setName(name == null ? null : name.toString()).build();\n return createTopic(request);\n }\n' -CREATE_TOPIC_PREVIOUS = '(\\s+public final Topic createTopic\\(String name\\) {\\n\\s+.*\\n\\s+return.*\\n\\s+})' -DELETE_TOPIC = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD\n /**\n * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a\n * topic is deleted, a new topic may be created with the same name; this is an entirely new topic\n * with none of the old configuration or subscriptions. Existing subscriptions to this topic are\n * not deleted, but their `topic` field is set to `_deleted-topic_`.\n *\n *

Sample code:\n *\n *

\n   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {\n   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");\n   *   topicAdminClient.deleteTopic(topic);\n   * }\n   * 
\n *\n * @param topic Required. Name of the topic to delete. Format is\n * `projects/{project}/topics/{topic}`.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #deleteTopic(TopicName)} instead.\n */\n @Deprecated\n public final void deleteTopic(ProjectTopicName topic) {\n DeleteTopicRequest request =\n DeleteTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build();\n deleteTopic(request);\n }\n' -GET_TOPIC_PREVIOUS = '(\\s+public final Topic getTopic\\(String topic\\) {\\n\\s+.*\\n\\s+return.*\\n\\s+})' -GET_TOPIC = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD\n /**\n * Gets the configuration of a topic.\n *\n *

Sample code:\n *\n *

\n   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {\n   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");\n   *   Topic response = topicAdminClient.getTopic(topic);\n   * }\n   * 
\n *\n * @param topic Required. The name of the topic to get. Format is\n * `projects/{project}/topics/{topic}`.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #getTopic(TopicName)} instead.\n */\n @Deprecated\n public final Topic getTopic(ProjectTopicName topic) {\n GetTopicRequest request =\n GetTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build();\n return getTopic(request);\n }\n' -DELETE_TOPIC_PREVIOUS = '(\\s+public final void deleteTopic\\(String topic\\) {\\n\\s+.*\\n\\s+deleteTopic.*\\n\\s+})' -LIST_TOPIC_SUBSCRIPTIONS = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD\n /**\n * Lists the names of the subscriptions on this topic.\n *\n *

Sample code:\n *\n *

\n   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {\n   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");\n   *   for (ProjectSubscriptionName element : topicAdminClient.listTopicSubscriptions(topic).iterateAllAsProjectSubscriptionName()) {\n   *     // doThingsWith(element);\n   *   }\n   * }\n   * 
\n *\n * @param topic Required. The name of the topic that subscriptions are attached to. Format is\n * `projects/{project}/topics/{topic}`.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #listTopicSubscriptions(TopicName)} instead.\n */\n @Deprecated\n public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(ProjectTopicName topic) {\n ListTopicSubscriptionsRequest request =\n ListTopicSubscriptionsRequest.newBuilder()\n .setTopic(topic == null ? null : topic.toString())\n .build();\n return listTopicSubscriptions(request);\n }\n' -LIST_TOPIC_SUBSCRIPTIONS_PREVIOUS = '(\\s+public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions\\(String topic\\) {\\n\\s+.*\\n\\s+.*\\n\\s+return.*\\n\\s+})' -CREATE_SUBSCRIPTION_PREVIOUS = '(\\s+public final Subscription createSubscription\\(Subscription request\\) {\\n\\s+return.*\\n\\s+})' -CREATE_SUBSCRIPTION = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD\n /**\n * Creates a subscription to a given topic. See the <a\n * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name\n * rules</a>. If the subscription already exists, returns `ALREADY_EXISTS`. If the\n * corresponding topic doesn\'t exist, returns `NOT_FOUND`.\n *\n *

If the name is not provided in the request, the server will assign a random name for this\n * subscription on the same project as the topic, conforming to the [resource name\n * format](https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is\n * populated in the returned Subscription object. Note that for REST API requests, you must\n * specify a name in the request.\n *\n *

Sample code:\n *\n *

\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");\n   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");\n   *   PushConfig pushConfig = PushConfig.newBuilder().build();\n   *   int ackDeadlineSeconds = 0;\n   *   Subscription response = subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);\n   * }\n   * 
\n *\n * @param name Required. The name of the subscription. It must have the format\n * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a\n * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores\n * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3\n * and 255 characters in length, and it must not start with `"goog"`.\n * @param topic Required. The name of the topic from which this subscription is receiving\n * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be\n * `_deleted-topic_` if the topic has been deleted.\n * @param pushConfig If push delivery is used with this subscription, this field is used to\n * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack\n * messages using API methods.\n * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits\n * for the subscriber to acknowledge receipt before resending the message. In the interval\n * after the message is delivered and before it is acknowledged, it is considered to be\n * <i>outstanding</i>. During that time period, the message will not be\n * redelivered (on a best-effort basis).\n *

For pull subscriptions, this value is used as the initial value for the ack deadline. To\n * override this value for a given message, call `ModifyAckDeadline` with the corresponding\n * `ack_id` if using non-streaming pull or send the `ack_id` in a\n * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline\n * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds\n * (10 minutes). If this parameter is 0, a default value of 10 seconds is used.\n *

For push delivery, this value is also used to set the request timeout for the call to\n * the push endpoint.\n *

If the subscriber never acknowledges the message, the Pub/Sub system will eventually\n * redeliver the message.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #createSubscription(SubscriptionName, TopicName, PushConfig, int)} instead.\n */\n @Deprecated\n public final Subscription createSubscription(\n ProjectSubscriptionName name,\n ProjectTopicName topic,\n PushConfig pushConfig,\n int ackDeadlineSeconds) {\n Subscription request =\n Subscription.newBuilder()\n .setName(name == null ? null : name.toString())\n .setTopic(topic == null ? null : topic.toString())\n .setPushConfig(pushConfig)\n .setAckDeadlineSeconds(ackDeadlineSeconds)\n .build();\n return createSubscription(request);\n }\n \n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Creates a subscription to a given topic. See the [resource name rules]\n * (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already\n * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn\'t exist, returns\n * `NOT_FOUND`.\n *\n *

If the name is not provided in the request, the server will assign a random name for this\n * subscription on the same project as the topic, conforming to the [resource name format]\n * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in\n * the returned Subscription object. Note that for REST API requests, you must specify a name in\n * the request.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");\n   *   String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();\n   *   PushConfig pushConfig = PushConfig.newBuilder().build();\n   *   int ackDeadlineSeconds = 2135351438;\n   *   Subscription response =\n   *       subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);\n   * }\n   * }
\n *\n * @param name Required. The name of the subscription. It must have the format\n * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a\n * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores\n * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3\n * and 255 characters in length, and it must not start with `"goog"`.\n * @param topic Required. The name of the topic from which this subscription is receiving\n * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be\n * `_deleted-topic_` if the topic has been deleted.\n * @param pushConfig If push delivery is used with this subscription, this field is used to\n * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack\n * messages using API methods.\n * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits\n * for the subscriber to acknowledge receipt before resending the message. In the interval\n * after the message is delivered and before it is acknowledged, it is considered to be\n * <i>outstanding</i>. During that time period, the message will not be\n * redelivered (on a best-effort basis).\n *

For pull subscriptions, this value is used as the initial value for the ack deadline. To\n * override this value for a given message, call `ModifyAckDeadline` with the corresponding\n * `ack_id` if using non-streaming pull or send the `ack_id` in a\n * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline\n * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds\n * (10 minutes). If this parameter is 0, a default value of 10 seconds is used.\n *

For push delivery, this value is also used to set the request timeout for the call to\n * the push endpoint.\n *

If the subscriber never acknowledges the message, the Pub/Sub system will eventually\n * redeliver the message.\n * @deprecated Use {@link #createSubscription(SubscriptionName, String, PushConfig, int)} instead.\n */\n @Deprecated\n public final Subscription createSubscription(\n ProjectSubscriptionName name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) {\n Subscription request =\n Subscription.newBuilder()\n .setName(name == null ? null : name.toString())\n .setTopic(topic)\n .setPushConfig(pushConfig)\n .setAckDeadlineSeconds(ackDeadlineSeconds)\n .build();\n return createSubscription(request);\n }\n \n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Creates a subscription to a given topic. See the [resource name rules]\n * (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already\n * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn\'t exist, returns\n * `NOT_FOUND`.\n *\n *

If the name is not provided in the request, the server will assign a random name for this\n * subscription on the same project as the topic, conforming to the [resource name format]\n * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in\n * the returned Subscription object. Note that for REST API requests, you must specify a name in\n * the request.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");\n   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");\n   *   PushConfig pushConfig = PushConfig.newBuilder().build();\n   *   int ackDeadlineSeconds = 2135351438;\n   *   Subscription response =\n   *       subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);\n   * }\n   * }
\n *\n * @param name Required. The name of the subscription. It must have the format\n * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a\n * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores\n * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3\n * and 255 characters in length, and it must not start with `"goog"`.\n * @param topic Required. The name of the topic from which this subscription is receiving\n * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be\n * `_deleted-topic_` if the topic has been deleted.\n * @param pushConfig If push delivery is used with this subscription, this field is used to\n * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack\n * messages using API methods.\n * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits\n * for the subscriber to acknowledge receipt before resending the message. In the interval\n * after the message is delivered and before it is acknowledged, it is considered to be\n * <i>outstanding</i>. During that time period, the message will not be\n * redelivered (on a best-effort basis).\n *

For pull subscriptions, this value is used as the initial value for the ack deadline. To\n * override this value for a given message, call `ModifyAckDeadline` with the corresponding\n * `ack_id` if using non-streaming pull or send the `ack_id` in a\n * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline\n * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds\n * (10 minutes). If this parameter is 0, a default value of 10 seconds is used.\n *

For push delivery, this value is also used to set the request timeout for the call to\n * the push endpoint.\n *

If the subscriber never acknowledges the message, the Pub/Sub system will eventually\n * redeliver the message.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #createSubscription(SubscriptionName, TopicName, PushConfig, int)} instead.\n */\n @Deprecated\n public final Subscription createSubscription(\n ProjectSubscriptionName name,\n TopicName topic,\n PushConfig pushConfig,\n int ackDeadlineSeconds) {\n Subscription request =\n Subscription.newBuilder()\n .setName(name == null ? null : name.toString())\n .setTopic(topic == null ? null : topic.toString())\n .setPushConfig(pushConfig)\n .setAckDeadlineSeconds(ackDeadlineSeconds)\n .build();\n return createSubscription(request);\n }\n' -GET_SUBSCRIPTION_PREVIOUS = '(\\s+public final Subscription getSubscription\\(GetSubscriptionRequest request\\) {\\n\\s+return.*\\n\\s+})' -GET_SUBSCRIPTION = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Gets the configuration details of a subscription.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");\n   *   Subscription response = subscriptionAdminClient.getSubscription(subscription);\n   * }\n   * }
\n *\n * @param subscription Required. The name of the subscription to get. Format is\n * `projects/{project}/subscriptions/{sub}`.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #getSubscription(SubscriptionName)} instead. \n */\n @Deprecated\n public final Subscription getSubscription(ProjectSubscriptionName subscription) {\n GetSubscriptionRequest request =\n GetSubscriptionRequest.newBuilder()\n .setSubscription(subscription == null ? null : subscription.toString())\n .build();\n return getSubscription(request);\n }\n' -DELETE_SUBSCRIPTION_PREVIOUS = '(\\s+public final void deleteSubscription\\(DeleteSubscriptionRequest request\\) {\\n\\s+deleteSubscription.*\\n\\s+})' -DELETE_SUBSCRIPTION = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Deletes an existing subscription. All messages retained in the subscription are immediately\n * dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is\n * deleted, a new one may be created with the same name, but the new one has no association with\n * the old subscription or its topic unless the same topic is specified.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");\n   *   subscriptionAdminClient.deleteSubscription(subscription);\n   * }\n   * }
\n *\n * @param subscription Required. The subscription to delete. Format is\n * `projects/{project}/subscriptions/{sub}`.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #deleteSubscription(SubscriptionName)} instead.\n */\n @Deprecated\n public final void deleteSubscription(ProjectSubscriptionName subscription) {\n DeleteSubscriptionRequest request =\n DeleteSubscriptionRequest.newBuilder()\n .setSubscription(subscription == null ? null : subscription.toString())\n .build();\n deleteSubscription(request);\n }\n' -MODIFY_ACK_DEADLINE_PREVIOUS = '(\\s+public final void modifyAckDeadline\\(ModifyAckDeadlineRequest request\\) {\\n\\s+modifyAckDeadline.*\\n\\s+})' -MODIFY_ACK_DEADLINE = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Modifies the ack deadline for a specific message. This method is useful to indicate that more\n * time is needed to process a message by the subscriber, or to make the message available for\n * redelivery if the processing was interrupted. Note that this does not modify the\n * subscription-level `ackDeadlineSeconds` used for subsequent messages.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");\n   *   List ackIds = new ArrayList<>();\n   *   int ackDeadlineSeconds = 2135351438;\n   *   subscriptionAdminClient.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds);\n   * }\n   * }
\n *\n * @param subscription Required. The name of the subscription. Format is\n * `projects/{project}/subscriptions/{sub}`.\n * @param ackIds Required. List of acknowledgment IDs.\n * @param ackDeadlineSeconds Required. The new ack deadline with respect to the time this request\n * was sent to the Pub/Sub system. For example, if the value is 10, the new ack deadline will\n * expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying zero might\n * immediately make the message available for delivery to another subscriber client. This\n * typically results in an increase in the rate of message redeliveries (that is, duplicates).\n * The minimum deadline you can specify is 0 seconds. The maximum deadline you can specify is\n * 600 seconds (10 minutes).\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #modifyAckDeadline(SubscriptionName, List, int)} instead.\n */\n @Deprecated\n final void modifyAckDeadline(\n ProjectSubscriptionName subscription, List ackIds, int ackDeadlineSeconds) {\n ModifyAckDeadlineRequest request =\n ModifyAckDeadlineRequest.newBuilder()\n .setSubscription(subscription == null ? null : subscription.toString())\n .addAllAckIds(ackIds)\n .setAckDeadlineSeconds(ackDeadlineSeconds)\n .build();\n modifyAckDeadline(request);\n }\n' -ACKNOWLEDGE_PREVIOUS = '(\\s+public final void acknowledge\\(AcknowledgeRequest request\\) {\\n\\s+acknowledge.*\\n\\s+})' -ACKNOWLEDGE = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The\n * Pub/Sub system can remove the relevant messages from the subscription.\n *\n *

Acknowledging a message whose ack deadline has expired may succeed, but such a message may\n * be redelivered later. Acknowledging a message more than once will not result in an error.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");\n   *   List ackIds = new ArrayList<>();\n   *   subscriptionAdminClient.acknowledge(subscription, ackIds);\n   * }\n   * }
\n *\n * @param subscription Required. The subscription whose message is being acknowledged. Format is\n * `projects/{project}/subscriptions/{sub}`.\n * @param ackIds Required. The acknowledgment ID for the messages being acknowledged that was\n * returned by the Pub/Sub system in the `Pull` response. Must not be empty.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #acknowledge(SubscriptionName, List)} instead.\n */\n @Deprecated\n public final void acknowledge(ProjectSubscriptionName subscription, List ackIds) {\n AcknowledgeRequest request =\n AcknowledgeRequest.newBuilder()\n .setSubscription(subscription == null ? null : subscription.toString())\n .addAllAckIds(ackIds)\n .build();\n acknowledge(request);\n }\n' -PULL_PREVIOUS = '(\\s+public final PullResponse pull\\(PullRequest request\\) {\\n\\s+return.*\\n\\s+})' -PULL = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many\n * concurrent pull requests pending for the given subscription.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");\n   *   int maxMessages = 496131527;\n   *   PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages);\n   * }\n   * }
\n *\n * @param subscription Required. The subscription from which messages should be pulled. Format is\n * `projects/{project}/subscriptions/{sub}`.\n * @param maxMessages Required. The maximum number of messages to return for this request. Must be\n * a positive integer. The Pub/Sub system may return fewer than the number specified.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #pull(SubscriptionName, int)} instead.\n */\n @Deprecated\n public final PullResponse pull(ProjectSubscriptionName subscription, int maxMessages) {\n PullRequest request =\n PullRequest.newBuilder()\n .setSubscription(subscription == null ? null : subscription.toString())\n .setMaxMessages(maxMessages)\n .build();\n return pull(request);\n }\n \n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many\n * concurrent pull requests pending for the given subscription.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");\n   *   boolean returnImmediately = true;\n   *   int maxMessages = 496131527;\n   *   PullResponse response =\n   *       subscriptionAdminClient.pull(subscription, returnImmediately, maxMessages);\n   * }\n   * }
\n *\n * @param subscription Required. The subscription from which messages should be pulled. Format is\n * `projects/{project}/subscriptions/{sub}`.\n * @param returnImmediately Optional. If this field set to true, the system will respond\n * immediately even if it there are no messages available to return in the `Pull` response.\n * Otherwise, the system may wait (for a bounded amount of time) until at least one message is\n * available, rather than returning no messages. Warning: setting this field to `true` is\n * discouraged because it adversely impacts the performance of `Pull` operations. We recommend\n * that users do not set this field.\n * @param maxMessages Required. The maximum number of messages to return for this request. Must be\n * a positive integer. The Pub/Sub system may return fewer than the number specified.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #pull(SubscriptionName, boolean, int)} instead.\n */\n @Deprecated\n final PullResponse pull(\n ProjectSubscriptionName subscription, boolean returnImmediately, int maxMessages) {\n PullRequest request =\n PullRequest.newBuilder()\n .setSubscription(subscription == null ? null : subscription.toString())\n .setReturnImmediately(returnImmediately)\n .setMaxMessages(maxMessages)\n .build();\n return pull(request);\n }\n' -MODIFY_PUSH_CONFIG_PREVIOUS = '(\\s+public final void modifyPushConfig\\(ModifyPushConfigRequest request\\) {\\n\\s+modifyPushConfig.*\\n\\s+})' -MODIFY_PUSH_CONFIG = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Modifies the `PushConfig` for a specified subscription.\n *\n *

This may be used to change a push subscription to a pull one (signified by an empty\n * `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push\n * subscription. Messages will accumulate for delivery continuously through the call regardless of\n * changes to the `PushConfig`.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");\n   *   PushConfig pushConfig = PushConfig.newBuilder().build();\n   *   subscriptionAdminClient.modifyPushConfig(subscription, pushConfig);\n   * }\n   * }
\n *\n * @param subscription Required. The name of the subscription. Format is\n * `projects/{project}/subscriptions/{sub}`.\n * @param pushConfig Required. The push configuration for future deliveries.\n *

An empty `pushConfig` indicates that the Pub/Sub system should stop pushing messages\n * from the given subscription and allow messages to be pulled and acknowledged - effectively\n * pausing the subscription if `Pull` or `StreamingPull` is not called.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use {@link #modifyPushConfig(SubscriptionName, PushConfig)} instead.\n */\n @Deprecated\n public final void modifyPushConfig(ProjectSubscriptionName subscription, PushConfig pushConfig) {\n ModifyPushConfigRequest request =\n ModifyPushConfigRequest.newBuilder()\n .setSubscription(subscription == null ? null : subscription.toString())\n .setPushConfig(pushConfig)\n .build();\n modifyPushConfig(request);\n }\n' -CREATE_SNAPSHOT_PREVIOUS = '(\\s+public final Snapshot createSnapshot\\(CreateSnapshotRequest request\\) {\\n\\s+return.*\\n\\s+})' -CREATE_SNAPSHOT = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Creates a snapshot from the requested subscription. Snapshots are used in\n * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to\n * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of\n * messages in an existing subscription to the state captured by a snapshot. If the snapshot\n * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn\'t exist, returns\n * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would\n * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the\n * `Snapshot.expire_time` field. If the name is not provided in the request, the server will\n * assign a random name for this snapshot on the same project as the subscription, conforming to\n * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The\n * generated name is populated in the returned Snapshot object. Note that for REST API requests,\n * you must specify a name in the request.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");\n   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");\n   *   Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);\n   * }\n   * }
\n *\n * @param name Required. User-provided name for this snapshot. If the name is not provided in the\n * request, the server will assign a random name for this snapshot on the same project as the\n * subscription. Note that for REST API requests, you must specify a name. See the <a\n * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name\n * rules</a>. Format is `projects/{project}/snapshots/{snap}`.\n * @param subscription Required. The subscription whose backlog the snapshot retains.\n * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the\n * subscription. More precisely, this is defined as the messages in the subscription\'s backlog\n * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as\n * well as: (b) Any messages published to the subscription\'s topic following the successful\n * completion of the CreateSnapshot request. Format is\n * `projects/{project}/subscriptions/{sub}`.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use Use {@link #createSnapshot(SnapshotName, SubscriptionName)} instead.\n */\n @Deprecated\n public final Snapshot createSnapshot(\n ProjectSnapshotName name, ProjectSubscriptionName subscription) {\n CreateSnapshotRequest request =\n CreateSnapshotRequest.newBuilder()\n .setName(name == null ? null : name.toString())\n .setSubscription(subscription == null ? null : subscription.toString())\n .build();\n return createSnapshot(request);\n }\n \n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Creates a snapshot from the requested subscription. Snapshots are used in\n * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to\n * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of\n * messages in an existing subscription to the state captured by a snapshot. If the snapshot\n * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn\'t exist, returns\n * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would\n * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the\n * `Snapshot.expire_time` field. If the name is not provided in the request, the server will\n * assign a random name for this snapshot on the same project as the subscription, conforming to\n * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The\n * generated name is populated in the returned Snapshot object. Note that for REST API requests,\n * you must specify a name in the request.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   String name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();\n   *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");\n   *   Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);\n   * }\n   * }
\n *\n * @param name Required. User-provided name for this snapshot. If the name is not provided in the\n * request, the server will assign a random name for this snapshot on the same project as the\n * subscription. Note that for REST API requests, you must specify a name. See the <a\n * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name\n * rules</a>. Format is `projects/{project}/snapshots/{snap}`.\n * @param subscription Required. The subscription whose backlog the snapshot retains.\n * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the\n * subscription. More precisely, this is defined as the messages in the subscription\'s backlog\n * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as\n * well as: (b) Any messages published to the subscription\'s topic following the successful\n * completion of the CreateSnapshot request. Format is\n * `projects/{project}/subscriptions/{sub}`.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use Use {@link #createSnapshot(String, SubscriptionName)} instead.\n */\n @Deprecated\n public final Snapshot createSnapshot(String name, ProjectSubscriptionName subscription) {\n CreateSnapshotRequest request =\n CreateSnapshotRequest.newBuilder()\n .setName(name)\n .setSubscription(subscription == null ? null : subscription.toString())\n .build();\n return createSnapshot(request);\n }\n \n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Creates a snapshot from the requested subscription. Snapshots are used in\n * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to\n * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of\n * messages in an existing subscription to the state captured by a snapshot. If the snapshot\n * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn\'t exist, returns\n * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would\n * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the\n * `Snapshot.expire_time` field. If the name is not provided in the request, the server will\n * assign a random name for this snapshot on the same project as the subscription, conforming to\n * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The\n * generated name is populated in the returned Snapshot object. Note that for REST API requests,\n * you must specify a name in the request.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");\n   *   String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();\n   *   Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);\n   * }\n   * }
\n *\n * @param name Required. User-provided name for this snapshot. If the name is not provided in the\n * request, the server will assign a random name for this snapshot on the same project as the\n * subscription. Note that for REST API requests, you must specify a name. See the <a\n * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name\n * rules</a>. Format is `projects/{project}/snapshots/{snap}`.\n * @param subscription Required. The subscription whose backlog the snapshot retains.\n * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the\n * subscription. More precisely, this is defined as the messages in the subscription\'s backlog\n * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as\n * well as: (b) Any messages published to the subscription\'s topic following the successful\n * completion of the CreateSnapshot request. Format is\n * `projects/{project}/subscriptions/{sub}`.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use Use {@link #createSnapshot(SnapshotName, String)} instead.\n */\n @Deprecated\n public final Snapshot createSnapshot(ProjectSnapshotName name, String subscription) {\n CreateSnapshotRequest request =\n CreateSnapshotRequest.newBuilder()\n .setName(name == null ? null : name.toString())\n .setSubscription(subscription)\n .build();\n return createSnapshot(request);\n }\n' -DELETE_SNAPSHOT_PREVIOUS = '(\\s+public final void deleteSnapshot\\(DeleteSnapshotRequest request\\) {\\n\\s+deleteSnapshot.*\\n\\s+})' -DELETE_SNAPSHOT = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Removes an existing snapshot. Snapshots are used in [Seek]\n * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage\n * message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in\n * an existing subscription to the state captured by a snapshot. When the snapshot is deleted, all\n * messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new\n * one may be created with the same name, but the new one has no association with the old snapshot\n * or its subscription, unless the same subscription is specified.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");\n   *   subscriptionAdminClient.deleteSnapshot(snapshot);\n   * }\n   * }
\n *\n * @param snapshot Required. The name of the snapshot to delete. Format is\n * `projects/{project}/snapshots/{snap}`.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use Use {@link #deleteSnapshot(SnapshotName)} instead.\n */\n @Deprecated\n public final void deleteSnapshot(ProjectSnapshotName snapshot) {\n DeleteSnapshotRequest request =\n DeleteSnapshotRequest.newBuilder()\n .setSnapshot(snapshot == null ? null : snapshot.toString())\n .build();\n deleteSnapshot(request);\n }\n' -GET_SNAPSHOT_PREVIOUS = '(\\s+public final Snapshot getSnapshot\\(GetSnapshotRequest request\\) {\\n\\s+return.*\\n\\s+})' -GET_SNAPSHOT = '\n // AUTO-GENERATED DOCUMENTATION AND METHOD.\n /**\n * Gets the configuration details of a snapshot. Snapshots are used in <a\n * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which\n * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment\n * state of messages in an existing subscription to the state captured by a snapshot.\n *\n *

Sample code:\n *\n *

{@code\n   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {\n   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");\n   *   Snapshot response = subscriptionAdminClient.getSnapshot(snapshot);\n   * }\n   * }
\n *\n * @param snapshot Required. The name of the snapshot to get. Format is\n * `projects/{project}/snapshots/{snap}`.\n * @throws com.google.api.gax.rpc.ApiException if the remote call fails\n * @deprecated Use Use {@link #getSnapshot(SnapshotName)} instead.\n */\n @Deprecated\n public final Snapshot getSnapshot(ProjectSnapshotName snapshot) {\n GetSnapshotRequest request =\n GetSnapshotRequest.newBuilder()\n .setSnapshot(snapshot == null ? null : snapshot.toString())\n .build();\n return getSnapshot(request);\n } \n' -PACKAGE = 'package com.google.cloud.pubsub.v1;' -IMPORT_PROJECT_TOPIC_NAME = 'import com.google.pubsub.v1.ProjectTopicName;' -IMPORT_PROJECT_SUBSCRIPTION_NAME = 'import com.google.pubsub.v1.ProjectSubscriptionName;' -IMPORT_PROJECT_SNAPSHOT_NAME = 'import com.google.pubsub.v1.ProjectSnapshotName;' - -for library in s.get_staging_dirs(): - # put any special-case replacements here - s.replace('**/stub/SubscriberStubSettings.java', 'setMaxInboundMessageSize\\(Integer.MAX_VALUE\\)', 'setMaxInboundMessageSize(20 << 20)') - s.replace('**/TopicAdminClient.java', GET_IAM_POLICY_PREVIOUS, '\\g<1>\n\n' + GET_IAM_POLICY_TOPIC) - s.replace('**/TopicAdminClient.java', SET_IAM_POLICY_PREVIOUS, '\\g<1>\n\n' + SET_IAM_POLICY_TOPIC) - s.replace('**/TopicAdminClient.java', TEST_IAM_PERMISSIONS_PREVIOUS, '\\g<1>\n\n' + TEST_IAM_PERMISSIONS_TOPIC) - s.replace('**/SubscriptionAdminClient.java', GET_IAM_POLICY_PREVIOUS, '\\g<1>\n\n' + GET_IAM_POLICY_SUBSCRIPTION) - s.replace('**/SubscriptionAdminClient.java', SET_IAM_POLICY_PREVIOUS, '\\g<1>\n\n' + SET_IAM_POLICY_SUBSCRIPTION) - s.replace('**/SubscriptionAdminClient.java', TEST_IAM_PERMISSIONS_PREVIOUS, '\\g<1>\n\n' + TEST_IAM_PERMISSIONS_SUBSCRIPTION) - s.replace('**/TopicAdminClient.java', CREATE_TOPIC_PREVIOUS, '\\g<1>\n\n' + CREATE_TOPIC) - s.replace('**/TopicAdminClient.java', DELETE_TOPIC_PREVIOUS, '\\g<1>\n\n' + DELETE_TOPIC) - s.replace('**/TopicAdminClient.java', LIST_TOPIC_SUBSCRIPTIONS_PREVIOUS, '\\g<1>\n\n' + LIST_TOPIC_SUBSCRIPTIONS) - s.replace('**/TopicAdminClient.java', GET_TOPIC_PREVIOUS, '\\g<1>\n\n' + GET_TOPIC) - s.replace('**/SubscriptionAdminClient.java', CREATE_SUBSCRIPTION_PREVIOUS, '\\g<1>\n\n' + CREATE_SUBSCRIPTION) - s.replace('**/SubscriptionAdminClient.java', DELETE_SUBSCRIPTION_PREVIOUS, '\\g<1>\n\n' + DELETE_SUBSCRIPTION) - s.replace('**/SubscriptionAdminClient.java', GET_SUBSCRIPTION_PREVIOUS, '\\g<1>\n\n' + GET_SUBSCRIPTION) - s.replace('**/SubscriptionAdminClient.java', MODIFY_ACK_DEADLINE_PREVIOUS, '\\g<1>\n\n' + MODIFY_ACK_DEADLINE) - s.replace('**/SubscriptionAdminClient.java', ACKNOWLEDGE_PREVIOUS, '\\g<1>\n\n' + ACKNOWLEDGE) - s.replace('**/SubscriptionAdminClient.java', PULL_PREVIOUS, '\\g<1>\n\n' + PULL) - s.replace('**/SubscriptionAdminClient.java', MODIFY_PUSH_CONFIG_PREVIOUS, '\\g<1>\n\n' + MODIFY_PUSH_CONFIG) - s.replace('**/SubscriptionAdminClient.java', CREATE_SNAPSHOT_PREVIOUS, '\\g<1>\n\n' + CREATE_SNAPSHOT) - s.replace('**/SubscriptionAdminClient.java', GET_SNAPSHOT_PREVIOUS, '\\g<1>\n\n' + GET_SNAPSHOT) - s.replace('**/SubscriptionAdminClient.java', DELETE_SNAPSHOT_PREVIOUS, '\\g<1>\n\n' + DELETE_SNAPSHOT) - s.replace('**/*AdminClient.java', PACKAGE, PACKAGE + '\n\n' + IMPORT_PROJECT_TOPIC_NAME + '\n' + IMPORT_PROJECT_SUBSCRIPTION_NAME + '\n' + IMPORT_PROJECT_SNAPSHOT_NAME + '\n') - s.move(library) -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/java-securitycenter/README.md b/java-securitycenter/README.md index 538ef7e86577..e6fffdbaa7ce 100644 --- a/java-securitycenter/README.md +++ b/java-securitycenter/README.md @@ -11,7 +11,6 @@ Java idiomatic client for [Security Command Center][product-docs]. ## Quickstart - If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: ```xml @@ -46,6 +45,14 @@ If you are using Maven without the BOM, add this to your dependencies: ``` +If you are using Gradle 5.x or later, add this to your dependencies: + +```Groovy +implementation platform('com.google.cloud:libraries-bom:26.83.0') + +implementation 'com.google.cloud:google-cloud-securitycenter' +``` + If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -147,8 +154,6 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning - - This library follows [Semantic Versioning](http://semver.org/). diff --git a/java-securitycenter/owlbot.py b/java-securitycenter/owlbot.py deleted file mode 100644 index 8cb9f4e18b89..000000000000 --- a/java-securitycenter/owlbot.py +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 2021 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 -# -# https://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. - -import synthtool as s -from synthtool.languages import java - - -for library in s.get_staging_dirs(): - # put any special-case replacements here - # TODO: remove for next major release (2.0.0) - version = library.parts[len(library.parts) - 1] - s.replace( - [f"owl-bot-staging/{version}/proto-google-cloud-securitycenter-{version}/src/main/java/com/google/cloud/securitycenter/{version}/SecurityMarksName.java"], - "formatOrganizationAssetName\(", - "formatOrganizationAssetSecurityMarksName(" - ) - s.replace( - [f"owl-bot-staging/{version}/proto-google-cloud-securitycenter-{version}/src/main/java/com/google/cloud/securitycenter/{version}/SecurityMarksName.java"], - "formatOrganizationSourceFindingName\(", - "formatOrganizationSourceFindingSecurityMarksName(" - ) - s.replace( - [f"owl-bot-staging/{version}/proto-google-cloud-securitycenter-{version}/src/main/java/com/google/cloud/securitycenter/{version}/SecurityMarksName.java"], - "newOrganizationAssetBuilder\(", - "newOrganizationAssetSecurityMarksBuilder(" - ) - s.replace( - [f"owl-bot-staging/{version}/proto-google-cloud-securitycenter-{version}/src/main/java/com/google/cloud/securitycenter/{version}/SecurityMarksName.java"], - "newOrganizationSourceFindingBuilder\(", - "newOrganizationSourceFindingSecurityMarksBuilder(" - ) - s.replace( - [f"owl-bot-staging/{version}/proto-google-cloud-securitycenter-{version}/src/main/java/com/google/cloud/securitycenter/{version}/SecurityMarksName.java"], - "ofOrganizationAssetName\(", - "ofOrganizationAssetSecurityMarksName(" - ) - s.replace( - [f"owl-bot-staging/{version}/proto-google-cloud-securitycenter-{version}/src/main/java/com/google/cloud/securitycenter/{version}/SecurityMarksName.java"], - "ofOrganizationSourceFindingName\(", - "ofOrganizationSourceFindingSecurityMarksName(" - ) - s.replace( - [f"owl-bot-staging/{version}/proto-google-cloud-securitycenter-{version}/src/main/java/com/google/cloud/securitycenter/{version}/SecurityMarksName.java"], - "OrganizationSourceFindingBuilder", - "OrganizationSourceFindingSecurityMarksBuilder", - ) - - s.replace( - [f"owl-bot-staging/{version}/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/{version}/SecurityCenterClientTest.java"], - "SecurityMarksName.ofOrganizationAssetName", - "SecurityMarksName.ofOrganizationAssetSecurityMarksName" - ) - s.move(library) - -s.remove_staging_dirs() - -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/java-service-management/README.md b/java-service-management/README.md index 3b628208e5da..cfacc124da38 100644 --- a/java-service-management/README.md +++ b/java-service-management/README.md @@ -11,7 +11,6 @@ Java idiomatic client for [Service Management API][product-docs]. ## Quickstart - If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: ```xml @@ -46,6 +45,14 @@ If you are using Maven without the BOM, add this to your dependencies: ``` +If you are using Gradle 5.x or later, add this to your dependencies: + +```Groovy +implementation platform('com.google.cloud:libraries-bom:26.83.0') + +implementation 'com.google.cloud:google-cloud-service-management' +``` + If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -71,7 +78,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Service Management API [API enabled][enable-api]. - +You will need to [enable billing][enable-billing] to use Google Service Management API. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -147,8 +154,6 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning - - This library follows [Semantic Versioning](http://semver.org/). @@ -187,7 +192,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE - +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=servicemanagement.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/java-service-management/owlbot.py b/java-service-management/owlbot.py deleted file mode 100644 index 259d9f4177d5..000000000000 --- a/java-service-management/owlbot.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2021 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 -# -# https://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. - -import synthtool as s -from synthtool.languages import java - -file_name = "owl-bot-staging/v1/google-cloud-service-management/src/test/java/com/google/cloud/api/servicemanagement/v1/ServiceManagerClientHttpJsonTest.java" - -for library in s.get_staging_dirs(): - # put any special-case replacements here - s.replace( - file_name, - r'^import org.junit.Test;', - 'import org.junit.Ignore;\nimport org.junit.Test;' - ) - s.replace( - file_name, - r"\s+@Test\n\s+public void setIamPolicyTest\(\) throws Exception.*", - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")\n@Test\npublic void setIamPolicyTest() throws Exception {' - ) - s.replace( - file_name, - r'\s+@Test\n\s+public void getIamPolicyTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")\n@Test\npublic void getIamPolicyTest() throws Exception {' - ) - s.replace( - file_name, - r'\s+@Test\n\s+public void testIamPermissionsTest\(\) throws Exception.*', - '@Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839")@Test\npublic void testIamPermissionsTest() throws Exception {' - ) - s.move(library) - -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/java-spanner/README.md b/java-spanner/README.md index acd53c4b0f00..20b7c1dcc675 100644 --- a/java-spanner/README.md +++ b/java-spanner/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.80.0 + 26.83.0 pom import @@ -31,7 +31,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud google-cloud-spanner - + ``` If you are using Maven without the BOM, add this to your dependencies: @@ -41,9 +41,8 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-spanner - 6.116.1 + 6.119.0 - ``` If you are using Gradle 5.x or later, add this to your dependencies: @@ -53,6 +52,7 @@ implementation platform('com.google.cloud:libraries-bom:26.83.0') implementation 'com.google.cloud:google-cloud-spanner' ``` + If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -78,7 +78,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Spanner [API enabled][enable-api]. - +You will need to [enable billing][enable-billing] to use Google Cloud Spanner. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -522,8 +522,6 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning - - This library follows [Semantic Versioning](http://semver.org/). @@ -562,7 +560,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE - +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=spanner.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/java-spanner/owlbot.py b/java-spanner/owlbot.py deleted file mode 100644 index 193523318929..000000000000 --- a/java-spanner/owlbot.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2026 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 -# -# https://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. - -import synthtool as s -from synthtool.languages import java - -for library in s.get_staging_dirs(): - # put any special-case replacements here - s.move(library) -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/java-storage/README.md b/java-storage/README.md index 765b9e9ac930..e248bb63f57a 100644 --- a/java-storage/README.md +++ b/java-storage/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.78.0 + 26.83.0 pom import @@ -31,12 +31,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud google-cloud-storage - - com.google.cloud - google-cloud-storage-control - - ``` If you are using Maven without the BOM, add this to your dependencies: @@ -46,14 +41,8 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-storage - 2.64.0 - - - com.google.cloud - google-cloud-storage-control - 2.64.0 + 2.70.0 - ``` If you are using Gradle 5.x or later, add this to your dependencies: @@ -63,6 +52,7 @@ implementation platform('com.google.cloud:libraries-bom:26.83.0') implementation 'com.google.cloud:google-cloud-storage' ``` + If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -88,7 +78,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Storage [API enabled][enable-api]. - +You will need to [enable billing][enable-billing] to use Google Cloud Storage. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -446,7 +436,6 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning - This library follows [Semantic Versioning](http://semver.org/), but does update [Storage interface](src/main/java/com.google.cloud.storage/Storage.java) to introduce new methods which can break your implementations if you implement this interface for testing purposes. @@ -486,7 +475,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE - +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=storage.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/java-storage/owlbot.py b/java-storage/owlbot.py deleted file mode 100644 index b912766a8f43..000000000000 --- a/java-storage/owlbot.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2026 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 -# -# https://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. - -import synthtool as s -from synthtool.languages import java - -'This script is used to synthesize generated parts of this library.' -import os - -for library in s.get_staging_dirs(): - # put any special-case replacements here - if os.path.exists('owl-bot-staging/v2/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/gapic_metadata.json'): - os.remove('owl-bot-staging/v2/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/gapic_metadata.json') - s.move(library) -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/java-tasks/README.md b/java-tasks/README.md index c4dc3b9fe243..6c5d9fd66bee 100644 --- a/java-tasks/README.md +++ b/java-tasks/README.md @@ -11,7 +11,6 @@ Java idiomatic client for [Cloud Tasks][product-docs]. ## Quickstart - If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: ```xml @@ -46,6 +45,14 @@ If you are using Maven without the BOM, add this to your dependencies: ``` +If you are using Gradle 5.x or later, add this to your dependencies: + +```Groovy +implementation platform('com.google.cloud:libraries-bom:26.83.0') + +implementation 'com.google.cloud:google-cloud-tasks' +``` + If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -71,7 +78,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Tasks [API enabled][enable-api]. - +You will need to [enable billing][enable-billing] to use Google Cloud Tasks. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -147,8 +154,6 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning - - This library follows [Semantic Versioning](http://semver.org/). @@ -187,7 +192,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE - +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudtasks.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/java-tasks/owlbot.py b/java-tasks/owlbot.py deleted file mode 100644 index 2caf98504cb7..000000000000 --- a/java-tasks/owlbot.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 2021 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 -# -# https://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. - -import synthtool as s -from synthtool.languages import java - - -GET_IAM_POLICY = """ - public final Policy getIamPolicy(QueueName queueName) { - return getIamPolicy((ResourceName) queueName); - } -""" -GET_IAM_POLICY_PREVIOUS = r'(\s+public final Policy getIamPolicy\(GetIamPolicyRequest request\) {\n\s+return .*\n\s+})' - -SET_IAM_POLICY = """ - public final Policy setIamPolicy(QueueName queue, Policy policy) { - return setIamPolicy((ResourceName) queue, policy); - } -""" -SET_IAM_POLICY_PREVIOUS = r'(\s+public final Policy setIamPolicy\(SetIamPolicyRequest request\) {\n\s+return .*\n\s+})' - -TEST_IAM_POLICY = """ - public final TestIamPermissionsResponse testIamPermissions( - QueueName queue, List permissions) { - return testIamPermissions((ResourceName) queue, permissions); - } -""" -TEST_IAM_POLICY_PREVIOUS = r'(\spublic final TestIamPermissionsResponse testIamPermissions\(TestIamPermissionsRequest request\) {\n\s+return .*\n\s+})' - -for library in s.get_staging_dirs(): - # put any special-case replacements here - version = library.parts[len(library.parts) - 1] - service = 'tasks' - s.replace( - f'owl-bot-staging/{version}/google-cloud-{service}/src/main/java/com/google/cloud/tasks/{version}/CloudTasksClient.java', - GET_IAM_POLICY_PREVIOUS, - "\g<1>\n\n" + GET_IAM_POLICY - ) - s.replace( - f'owl-bot-staging/{version}/google-cloud-{service}/src/main/java/com/google/cloud/tasks/{version}/CloudTasksClient.java', - SET_IAM_POLICY_PREVIOUS, - "\g<1>\n\n" + SET_IAM_POLICY - ) - s.replace( - f'owl-bot-staging/{version}/google-cloud-{service}/src/main/java/com/google/cloud/tasks/{version}/CloudTasksClient.java', - TEST_IAM_POLICY_PREVIOUS, - "\g<1>\n\n" + TEST_IAM_POLICY - ) - s.move(library) - -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/java-vision/README.md b/java-vision/README.md index 7638b3518251..eb13569fd83a 100644 --- a/java-vision/README.md +++ b/java-vision/README.md @@ -11,7 +11,6 @@ Java idiomatic client for [Cloud Vision][product-docs]. ## Quickstart - If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: ```xml @@ -46,6 +45,14 @@ If you are using Maven without the BOM, add this to your dependencies: ``` +If you are using Gradle 5.x or later, add this to your dependencies: + +```Groovy +implementation platform('com.google.cloud:libraries-bom:26.83.0') + +implementation 'com.google.cloud:google-cloud-vision' +``` + If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -71,7 +78,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Vision [API enabled][enable-api]. - +You will need to [enable billing][enable-billing] to use Google Cloud Vision. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -147,8 +154,6 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning - - This library follows [Semantic Versioning](http://semver.org/). @@ -187,7 +192,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE - +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=vision.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/java-vision/owlbot.py b/java-vision/owlbot.py deleted file mode 100644 index c1cbef537575..000000000000 --- a/java-vision/owlbot.py +++ /dev/null @@ -1,248 +0,0 @@ -# Copyright 2021 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 -# -# https://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. - -import synthtool as s -from synthtool.languages import java - - -# restore deprecated resource name helpers -# TODO: remove in version 2.0.0 -DEPRECATED_RESOURCE_NAME_HELPERS = """ - -private static final PathTemplate LOCATION_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); - -private static final PathTemplate PRODUCT_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/products/{product}"); - -private static final PathTemplate PRODUCT_SET_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/productSets/{product_set}"); - -private static final PathTemplate REFERENCE_IMAGE_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}"); - -/** - * Formats a string containing the fully-qualified path to represent a location resource. - * - * @deprecated Use the {@link LocationName} class instead. - */ -@Deprecated -public static final String formatLocationName(String project, String location) { - return LOCATION_PATH_TEMPLATE.instantiate( - "project", project, - "location", location); -} - -/** - * Formats a string containing the fully-qualified path to represent a product resource. - * - * @deprecated Use the {@link ProductName} class instead. - */ -@Deprecated -public static final String formatProductName(String project, String location, String product) { - return PRODUCT_PATH_TEMPLATE.instantiate( - "project", project, - "location", location, - "product", product); -} - -/** - * Formats a string containing the fully-qualified path to represent a product_set resource. - * - * @deprecated Use the {@link ProductSetName} class instead. - */ -@Deprecated -public static final String formatProductSetName( - String project, String location, String productSet) { - return PRODUCT_SET_PATH_TEMPLATE.instantiate( - "project", project, - "location", location, - "product_set", productSet); -} - -/** - * Formats a string containing the fully-qualified path to represent a reference_image resource. - * - * @deprecated Use the {@link ReferenceImageName} class instead. - */ -@Deprecated -public static final String formatReferenceImageName( - String project, String location, String product, String referenceImage) { - return REFERENCE_IMAGE_PATH_TEMPLATE.instantiate( - "project", project, - "location", location, - "product", product, - "reference_image", referenceImage); -} - -/** - * Parses the project from the given fully-qualified path which represents a location resource. - * - * @deprecated Use the {@link LocationName} class instead. - */ -@Deprecated -public static final String parseProjectFromLocationName(String locationName) { - return LOCATION_PATH_TEMPLATE.parse(locationName).get("project"); -} - -/** - * Parses the location from the given fully-qualified path which represents a location resource. - * - * @deprecated Use the {@link LocationName} class instead. - */ -@Deprecated -public static final String parseLocationFromLocationName(String locationName) { - return LOCATION_PATH_TEMPLATE.parse(locationName).get("location"); -} - -/** - * Parses the project from the given fully-qualified path which represents a product resource. - * - * @deprecated Use the {@link ProductName} class instead. - */ -@Deprecated -public static final String parseProjectFromProductName(String productName) { - return PRODUCT_PATH_TEMPLATE.parse(productName).get("project"); -} - -/** - * Parses the location from the given fully-qualified path which represents a product resource. - * - * @deprecated Use the {@link ProductName} class instead. - */ -@Deprecated -public static final String parseLocationFromProductName(String productName) { - return PRODUCT_PATH_TEMPLATE.parse(productName).get("location"); -} - -/** - * Parses the product from the given fully-qualified path which represents a product resource. - * - * @deprecated Use the {@link ProductName} class instead. - */ -@Deprecated -public static final String parseProductFromProductName(String productName) { - return PRODUCT_PATH_TEMPLATE.parse(productName).get("product"); -} - -/** - * Parses the project from the given fully-qualified path which represents a product_set resource. - * - * @deprecated Use the {@link ProductSetName} class instead. - */ -@Deprecated -public static final String parseProjectFromProductSetName(String productSetName) { - return PRODUCT_SET_PATH_TEMPLATE.parse(productSetName).get("project"); -} - -/** - * Parses the location from the given fully-qualified path which represents a product_set - * resource. - * - * @deprecated Use the {@link ProductSetName} class instead. - */ -@Deprecated -public static final String parseLocationFromProductSetName(String productSetName) { - return PRODUCT_SET_PATH_TEMPLATE.parse(productSetName).get("location"); -} - -/** - * Parses the product_set from the given fully-qualified path which represents a product_set - * resource. - * - * @deprecated Use the {@link ProductSetName} class instead. - */ -@Deprecated -public static final String parseProductSetFromProductSetName(String productSetName) { - return PRODUCT_SET_PATH_TEMPLATE.parse(productSetName).get("product_set"); -} - -/** - * Parses the project from the given fully-qualified path which represents a reference_image - * resource. - * - * @deprecated Use the {@link ReferenceImageName} class instead. - */ -@Deprecated -public static final String parseProjectFromReferenceImageName(String referenceImageName) { - return REFERENCE_IMAGE_PATH_TEMPLATE.parse(referenceImageName).get("project"); -} - -/** - * Parses the location from the given fully-qualified path which represents a reference_image - * resource. - * - * @deprecated Use the {@link ReferenceImageName} class instead. - */ -@Deprecated -public static final String parseLocationFromReferenceImageName(String referenceImageName) { - return REFERENCE_IMAGE_PATH_TEMPLATE.parse(referenceImageName).get("location"); -} - -/** - * Parses the product from the given fully-qualified path which represents a reference_image - * resource. - * - * @deprecated Use the {@link ReferenceImageName} class instead. - */ -@Deprecated -public static final String parseProductFromReferenceImageName(String referenceImageName) { - return REFERENCE_IMAGE_PATH_TEMPLATE.parse(referenceImageName).get("product"); -} - -/** - * Parses the reference_image from the given fully-qualified path which represents a - * reference_image resource. - * - * @deprecated Use the {@link ReferenceImageName} class instead. - */ -@Deprecated -public static final String parseReferenceImageFromReferenceImageName(String referenceImageName) { - return REFERENCE_IMAGE_PATH_TEMPLATE.parse(referenceImageName).get("reference_image"); -} -""" - -for library in s.get_staging_dirs(): - # put any special-case replacements here - s.replace( - "owl-bot-staging/v1/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java", - "private final OperationsClient operationsClient;", - f"private final OperationsClient operationsClient;\n{DEPRECATED_RESOURCE_NAME_HELPERS}" - ) - s.replace( - "owl-bot-staging/v1/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java", - "import com.google.api.gax.rpc.UnaryCallable;", - "import com.google.api.gax.rpc.UnaryCallable;\nimport com.google.api.pathtemplate.PathTemplate;" - ) - s.move(library) - -s.remove_staging_dirs() -java.common_templates( - monorepo=True, - excludes=[ - ".github/*", - ".kokoro/*", - "samples/*", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "renovate.json", - ".gitignore" -]) diff --git a/librarian.yaml b/librarian.yaml index 8cba66d2bc7b..b62ee62075c5 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. language: java -version: v0.27.0 +version: v0.27.1 repo: googleapis/google-cloud-java sources: googleapis: @@ -2375,6 +2375,212 @@ libraries: name_pretty_override: Merchant Order Tracking API product_documentation_override: https://developers.google.com/merchant/api - name: kms + postprocess: + replace: + - path: proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyName.java + original: implements ResourceName + replacement: extends KeyName + - path: proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyRingName.java + original: implements ResourceName + replacement: extends KeyName + replace_regex: + - path: google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceClient.java + pattern: | + (?s)(public final Policy setIamPolicy\(SetIamPolicyRequest request\) \{\s*return setIamPolicyCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // ADDED BY SYNTH + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+               * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+               *   KeyName resource = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]");
+               *   Policy policy = Policy.newBuilder().build();
+               *   Policy response = keyManagementServiceClient.setIamPolicy(resource, policy);
+               * }
+               * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(KeyName resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setPolicy(policy) + .build(); + return setIamPolicy(request); + } + + // ADDED BY SYNTH + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+               * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+               *   KeyName resource = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]");
+               *   Policy policy = Policy.newBuilder().build();
+               *   Policy response = keyManagementServiceClient.setIamPolicy(resource.toString(), policy);
+               * }
+               * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + - path: google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceClient.java + pattern: | + (?s)(public final Policy getIamPolicy\(GetIamPolicyRequest request\) \{\s*return getIamPolicyCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // ADDED BY SYNTH + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+               * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+               *   KeyName resource = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]");
+               *   Policy response = keyManagementServiceClient.getIamPolicy(resource);
+               * }
+               * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(KeyName resource) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicy(request); + } + + // ADDED BY SYNTH + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+               * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+               *   KeyName resource = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]");
+               *   Policy response = keyManagementServiceClient.getIamPolicy(resource.toString());
+               * }
+               * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } + - path: google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceClient.java + pattern: | + (?s)(public final TestIamPermissionsResponse testIamPermissions\(TestIamPermissionsRequest request\) \{\s*return testIamPermissionsCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // ADDED BY SYNTH + /** + * 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. + * + *

Sample code: + * + *


+               * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+               *   KeyName resource = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]");
+               *   List<String> permissions = new ArrayList<>();
+               *   TestIamPermissionsResponse response = keyManagementServiceClient.testIamPermissions(resource, permissions);
+               * }
+               * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + KeyName resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // ADDED BY SYNTH + /** + * 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. + * + *

Sample code: + * + *


+               * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+               *   KeyName resource = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]");
+               *   List<String> permissions = new ArrayList<>();
+               *   TestIamPermissionsResponse response = keyManagementServiceClient.testIamPermissions(resource.toString(), permissions);
+               * }
+               * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } version: 2.98.0-SNAPSHOT apis: - path: google/cloud/kms/v1 @@ -2456,6 +2662,153 @@ libraries: product_documentation_override: https://cloud.google.com/location-finder/docs/overview rpc_documentation: https://cloud.google.com/locationfinder/docs/reference/rest - name: logging + postprocess: + replace: + - path: google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigClientTest.java + original: CmekSettingsName.ofProjectName + replacement: CmekSettingsName.ofProjectCmekSettingsName + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + original: OrganizationBuilder + replacement: OrganizationCmekSettingsBuilder + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + original: FolderBuilder + replacement: FolderCmekSettingsBuilder + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + original: BillingAccountBuilder + replacement: BillingAccountCmekSettingsBuilder + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + original: ofProjectName(matchMap.get("project")) + replacement: ofProjectCmekSettingsName(matchMap.get("project")) + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + original: ofOrganizationName(matchMap.get("organization")) + replacement: ofOrganizationCmekSettingsName(matchMap.get("organization")) + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + original: ofFolderName(matchMap.get("folder")) + replacement: ofFolderCmekSettingsName(matchMap.get("folder")) + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + original: ofBillingAccountName(matchMap.get("billing_account")) + replacement: ofBillingAccountCmekSettingsName(matchMap.get("billing_account")) + replace_regex: + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + pattern: | + (?s)(\s*public static Builder newProjectBuilder\(\) \{\s*return new Builder\(\);\s*\}) + replacement: | + $1 + + /** + * @deprecated Please use {@link #newProjectBuilder()} instead + */ + @Deprecated + public static Builder newProjectCmekSettingsBuilder() { + return new Builder(); + } + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + pattern: | + (?s)(\s*public static CmekSettingsName ofProjectName\(String project\) \{\s*return newBuilder\(\)\.setProject\(project\)\.build\(\);\s*\}) + replacement: | + $1 + + /** + * @deprecated Please use {@link #ofProjectName(String)} instead + */ + @Deprecated + public static CmekSettingsName ofProjectCmekSettingsName(String project) { + return newBuilder().setProject(project).build(); + } + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + pattern: | + (?s)(\s*public static CmekSettingsName ofOrganizationName\(String organization\) \{\s*return newOrganizationCmekSettingsBuilder\(\)\.setOrganization\(organization\)\.build\(\);\s*\}) + replacement: | + $1 + + /** + * @deprecated Please use {@link #ofOrganizationName(String)} instead + */ + @Deprecated + public static CmekSettingsName ofOrganizationCmekSettingsName(String organization) { + return newOrganizationCmekSettingsBuilder().setOrganization(organization).build(); + } + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + pattern: | + (?s)(\s*public static CmekSettingsName ofFolderName\(String folder\) \{\s*return newFolderCmekSettingsBuilder\(\)\.setFolder\(folder\)\.build\(\);\s*\}) + replacement: | + $1 + + /** + * @deprecated Please use {@link #ofFolderName(String)} instead + */ + @Deprecated + public static CmekSettingsName ofFolderCmekSettingsName(String folder) { + return newFolderCmekSettingsBuilder().setFolder(folder).build(); + } + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + pattern: | + (?s)(\s*public static CmekSettingsName ofBillingAccountName\(String billingAccount\) \{\s*return newBillingAccountCmekSettingsBuilder\(\)\.setBillingAccount\(billingAccount\)\.build\(\);\s*\}) + replacement: | + $1 + + /** + * @deprecated Please use {@link #ofBillingAccountName(String)} instead + */ + @Deprecated + public static CmekSettingsName ofBillingAccountCmekSettingsName(String billingAccount) { + return newBillingAccountCmekSettingsBuilder().setBillingAccount(billingAccount).build(); + } + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + pattern: | + (?s)(\s*public static String formatProjectName\(String project\) \{\s*return newBuilder\(\)\.setProject\(project\)\.build\(\)\.toString\(\);\s*\}) + replacement: | + $1 + + /** + * @deprecated Please use {@link #formatProjectName(String)} instead + */ + @Deprecated + public static String formatProjectCmekSettingsName(String project) { + return newBuilder().setProject(project).build().toString(); + } + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + pattern: | + (?s)(\s*public static String formatOrganizationName\(String organization\) \{\s*return newOrganizationCmekSettingsBuilder\(\)\.setOrganization\(organization\)\.build\(\)\.toString\(\);\s*\}) + replacement: | + $1 + + /** + * @deprecated Please use {@link #formatOrganizationName(String)} instead + */ + @Deprecated + public static String formatOrganizationCmekSettingsName(String organization) { + return newOrganizationCmekSettingsBuilder().setOrganization(organization).build().toString(); + } + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + pattern: | + (?s)(\s*public static String formatFolderName\(String folder\) \{\s*return newFolderCmekSettingsBuilder\(\)\.setFolder\(folder\)\.build\(\)\.toString\(\);\s*\}) + replacement: | + $1 + + /** + * @deprecated Please use {@link #formatFolderName(String)} instead + */ + @Deprecated + public static String formatFolderCmekSettingsName(String folder) { + return newFolderCmekSettingsBuilder().setFolder(folder).build().toString(); + } + - path: proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java + pattern: | + (?s)(\s*public static String formatBillingAccountName\(String billingAccount\) \{\s*return newBillingAccountCmekSettingsBuilder\(\)\s*\.setBillingAccount\(billingAccount\)\s*\.build\(\)\s*\.toString\(\);\s*\}) + replacement: | + $1 + + /** + * @deprecated Please use {@link #formatBillingAccountName(String)} instead + */ + @Deprecated + public static String formatBillingAccountCmekSettingsName(String billingAccount) { + return newBillingAccountCmekSettingsBuilder() + .setBillingAccount(billingAccount) + .build() + .toString(); + } version: 3.36.0-SNAPSHOT apis: - path: google/logging/v2 @@ -2753,6 +3106,44 @@ libraries: name_pretty_override: Model Armor API product_documentation_override: https://cloud.google.com/security-command-center/docs/model-armor-overview - name: monitoring + postprocess: + replace: + - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java + original: com.google.monitoring.v3.FolderName + replacement: com.google.api.resourcenames.ResourceName + - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java + original: FolderName + replacement: ResourceName + - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceClient.java + original: com.google.monitoring.v3.FolderName + replacement: com.google.api.resourcenames.ResourceName + - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceClient.java + original: FolderName + replacement: ResourceName + - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java + original: com.google.monitoring.v3.FolderName + replacement: com.google.api.resourcenames.ResourceName + - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java + original: FolderName + replacement: ResourceName + - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java + original: com.google.monitoring.v3.FolderName + replacement: com.google.api.resourcenames.ResourceName + - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java + original: FolderName + replacement: ResourceName + - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java + original: com.google.monitoring.v3.FolderName + replacement: com.google.api.resourcenames.ResourceName + - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java + original: FolderName + replacement: ResourceName + - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java + original: com.google.monitoring.v3.FolderName + replacement: com.google.api.resourcenames.ResourceName + - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java + original: FolderName + replacement: ResourceName version: 3.96.0-SNAPSHOT apis: - path: google/monitoring/v3 @@ -2764,6 +3155,10 @@ libraries: name_pretty_override: Stackdriver Monitoring product_documentation_override: https://cloud.google.com/monitoring/docs - name: monitoring-dashboards + postprocess: + remove_file: + - proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DrilldownsProto.java + - proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ServiceMonitoringProto.java version: 2.97.0-SNAPSHOT apis: - path: google/monitoring/dashboard/v1 @@ -2796,6 +3191,244 @@ libraries: name_pretty_override: NetApp API product_documentation_override: https://cloud.google.com/netapp/volumes/docs/discover/overview - name: network-management + postprocess: + replace: + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/OrganizationVpcFlowLogsServiceClientHttpJsonTest.java + original: | + import org.junit.Test; + replacement: | + import org.junit.Ignore; + import org.junit.Test; + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/OrganizationVpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void listVpcFlowLogsConfigsTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void listVpcFlowLogsConfigsTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/OrganizationVpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void createVpcFlowLogsConfigTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void createVpcFlowLogsConfigTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/OrganizationVpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void createVpcFlowLogsConfigTest2() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void createVpcFlowLogsConfigTest2() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientHttpJsonTest.java + original: | + import org.junit.Test; + replacement: | + import org.junit.Ignore; + import org.junit.Test; + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientHttpJsonTest.java + original: |2 + @Test + public void listConnectivityTestsTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void listConnectivityTestsTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientHttpJsonTest.java + original: |2 + @Test + public void createConnectivityTestTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void createConnectivityTestTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientHttpJsonTest.java + original: |2 + @Test + public void setIamPolicyTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void setIamPolicyTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientHttpJsonTest.java + original: |2 + @Test + public void getIamPolicyTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void getIamPolicyTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientHttpJsonTest.java + original: |2 + @Test + public void testIamPermissionsTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void testIamPermissionsTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/VpcFlowLogsServiceClientHttpJsonTest.java + original: | + import org.junit.Test; + replacement: | + import org.junit.Ignore; + import org.junit.Test; + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/VpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void listVpcFlowLogsConfigsTest2() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void listVpcFlowLogsConfigsTest2() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/VpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void createVpcFlowLogsConfigTest3() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void createVpcFlowLogsConfigTest3() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/VpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void createVpcFlowLogsConfigTest4() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void createVpcFlowLogsConfigTest4() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/OrganizationVpcFlowLogsServiceClientHttpJsonTest.java + original: | + import org.junit.Test; + replacement: | + import org.junit.Ignore; + import org.junit.Test; + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/OrganizationVpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void listVpcFlowLogsConfigsTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void listVpcFlowLogsConfigsTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/OrganizationVpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void createVpcFlowLogsConfigTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void createVpcFlowLogsConfigTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/OrganizationVpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void createVpcFlowLogsConfigTest2() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void createVpcFlowLogsConfigTest2() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientHttpJsonTest.java + original: | + import org.junit.Test; + replacement: | + import org.junit.Ignore; + import org.junit.Test; + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientHttpJsonTest.java + original: |2 + @Test + public void listConnectivityTestsTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void listConnectivityTestsTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientHttpJsonTest.java + original: |2 + @Test + public void createConnectivityTestTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void createConnectivityTestTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientHttpJsonTest.java + original: |2 + @Test + public void setIamPolicyTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void setIamPolicyTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientHttpJsonTest.java + original: |2 + @Test + public void getIamPolicyTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void getIamPolicyTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientHttpJsonTest.java + original: |2 + @Test + public void testIamPermissionsTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void testIamPermissionsTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/VpcFlowLogsServiceClientHttpJsonTest.java + original: | + import org.junit.Test; + replacement: | + import org.junit.Ignore; + import org.junit.Test; + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/VpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void listVpcFlowLogsConfigsTest2() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void listVpcFlowLogsConfigsTest2() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/VpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void createVpcFlowLogsConfigTest3() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void createVpcFlowLogsConfigTest3() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/VpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void createVpcFlowLogsConfigTest4() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void createVpcFlowLogsConfigTest4() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/VpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void setIamPolicyTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void setIamPolicyTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/VpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void getIamPolicyTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void getIamPolicyTest() throws Exception { + - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/VpcFlowLogsServiceClientHttpJsonTest.java + original: |2 + @Test + public void testIamPermissionsTest() throws Exception { + replacement: |2 + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") + @Test + public void testIamPermissionsTest() throws Exception { version: 1.96.0-SNAPSHOT apis: - path: google/cloud/networkmanagement/v1 @@ -2965,6 +3598,59 @@ libraries: - proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/PosixAccountName.java - proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/ProjectName.java - proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/SshPublicKeyName.java + postprocess: + copy_file: + - src: proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/common/UserName.java + dst: proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/UserName.java + replace: + - path: proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/UserName.java + original: package com.google.cloud.oslogin.common; + replacement: package com.google.cloud.oslogin.v1; + - path: google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java + original: PosixAccountName + replacement: ProjectName + - path: google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java + original: SshPublicKeyName + replacement: FingerprintName + - path: google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java + original: import com.google.cloud.oslogin.common.FingerprintName; + replacement: import com.google.cloud.oslogin.v1.FingerprintName; + - path: google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java + original: import com.google.cloud.oslogin.common.UserName; + replacement: import com.google.cloud.oslogin.v1.UserName; + - path: google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java + original: import com.google.cloud.oslogin.common.ProjectName; + replacement: import com.google.cloud.oslogin.v1.ProjectName; + - path: google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1/OsLoginServiceClientTest.java + original: PosixAccountName + replacement: ProjectName + - path: google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1/OsLoginServiceClientTest.java + original: SshPublicKeyName + replacement: FingerprintName + - path: google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1/OsLoginServiceClientTest.java + original: import com.google.cloud.oslogin.common.FingerprintName; + replacement: import com.google.cloud.oslogin.v1.FingerprintName; + - path: google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1/OsLoginServiceClientTest.java + original: import com.google.cloud.oslogin.common.UserName; + replacement: import com.google.cloud.oslogin.v1.UserName; + - path: google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1/OsLoginServiceClientTest.java + original: import com.google.cloud.oslogin.common.ProjectName; + replacement: import com.google.cloud.oslogin.v1.ProjectName; + - path: google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1/OsLoginServiceClientHttpJsonTest.java + original: PosixAccountName + replacement: ProjectName + - path: google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1/OsLoginServiceClientHttpJsonTest.java + original: SshPublicKeyName + replacement: FingerprintName + - path: google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1/OsLoginServiceClientHttpJsonTest.java + original: import com.google.cloud.oslogin.common.FingerprintName; + replacement: import com.google.cloud.oslogin.v1.FingerprintName; + - path: google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1/OsLoginServiceClientHttpJsonTest.java + original: import com.google.cloud.oslogin.common.UserName; + replacement: import com.google.cloud.oslogin.v1.UserName; + - path: google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1/OsLoginServiceClientHttpJsonTest.java + original: import com.google.cloud.oslogin.common.ProjectName; + replacement: import com.google.cloud.oslogin.v1.ProjectName; java: api_description_override: manages OS login configuration for Directory API users. issue_tracker_override: https://issuetracker.google.com/savedsearches/559755 @@ -3077,6 +3763,1098 @@ libraries: product_documentation_override: https://cloud.google.com/certificate-manager/docs/public-ca rpc_documentation: https://cloud.google.com/certificate-manager/docs/reference/public-ca/rpc - name: pubsub + postprocess: + replace: + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java + original: setMaxInboundMessageSize(Integer.MAX_VALUE) + replacement: setMaxInboundMessageSize(20 << 20) + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java + original: package com.google.cloud.pubsub.v1; + replacement: | + package com.google.cloud.pubsub.v1; + + import com.google.pubsub.v1.ProjectSnapshotName; + import com.google.pubsub.v1.ProjectSubscriptionName; + import com.google.pubsub.v1.ProjectTopicName; + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + original: package com.google.cloud.pubsub.v1; + replacement: | + package com.google.cloud.pubsub.v1; + + import com.google.pubsub.v1.ProjectSnapshotName; + import com.google.pubsub.v1.ProjectSubscriptionName; + import com.google.pubsub.v1.ProjectTopicName; + replace_regex: + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java + pattern: | + (?s)(public final Topic createTopic\(String name\) \{\s*Topic request = Topic\.newBuilder\(\)\.setName\(name\)\.build\(\);\s*return createTopic\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates the given topic with the given name. See the <a + * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name + * rules</a>. + * + *

Sample code: + * + *


+               * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+               *   ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+               *   Topic response = topicAdminClient.createTopic(name);
+               * }
+               * 
+ * + * @param name Required. The name of the topic. It must have the format + * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only + * letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), + * tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in + * length, and it must not start with `"goog"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #createTopic(TopicName)} instead. + */ + @Deprecated + public final Topic createTopic(ProjectTopicName name) { + Topic request = Topic.newBuilder().setName(name == null ? null : name.toString()).build(); + return createTopic(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java + pattern: | + (?s)(public final Topic getTopic\(String topic\) \{\s*GetTopicRequest request = GetTopicRequest\.newBuilder\(\)\.setTopic\(topic\)\.build\(\);\s*return getTopic\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the configuration of a topic. + * + *

Sample code: + * + *


+               * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+               *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+               *   Topic response = topicAdminClient.getTopic(topic);
+               * }
+               * 
+ * + * @param topic Required. The name of the topic to get. Format is + * `projects/{project}/topics/{topic}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #getTopic(TopicName)} instead. + */ + @Deprecated + public final Topic getTopic(ProjectTopicName topic) { + GetTopicRequest request = + GetTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); + return getTopic(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java + pattern: | + (?s)(public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions\(String topic\) \{\s*ListTopicSubscriptionsRequest request =\s*ListTopicSubscriptionsRequest\.newBuilder\(\)\.setTopic\(topic\)\.build\(\);\s*return listTopicSubscriptions\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the names of the subscriptions on this topic. + * + *

Sample code: + * + *


+               * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+               *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+               *   for (ProjectSubscriptionName element : topicAdminClient.listTopicSubscriptions(topic).iterateAllAsProjectSubscriptionName()) {
+               *     // doThingsWith(element);
+               *   }
+               * }
+               * 
+ * + * @param topic Required. The name of the topic that subscriptions are attached to. Format is + * `projects/{project}/topics/{topic}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #listTopicSubscriptions(TopicName)} instead. + */ + @Deprecated + public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(ProjectTopicName topic) { + ListTopicSubscriptionsRequest request = + ListTopicSubscriptionsRequest.newBuilder() + .setTopic(topic == null ? null : topic.toString()) + .build(); + return listTopicSubscriptions(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java + pattern: | + (?s)(public final void deleteTopic\(String topic\) \{\s*DeleteTopicRequest request = DeleteTopicRequest\.newBuilder\(\)\.setTopic\(topic\)\.build\(\);\s*deleteTopic\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a + * topic is deleted, a new topic may be created with the same name; this is an entirely new topic + * with none of the old configuration or subscriptions. Existing subscriptions to this topic are + * not deleted, but their `topic` field is set to `_deleted-topic_`. + * + *

Sample code: + * + *


+               * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+               *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+               *   topicAdminClient.deleteTopic(topic);
+               * }
+               * 
+ * + * @param topic Required. Name of the topic to delete. Format is + * `projects/{project}/topics/{topic}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #deleteTopic(TopicName)} instead. + */ + @Deprecated + public final void deleteTopic(ProjectTopicName topic) { + DeleteTopicRequest request = + DeleteTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); + deleteTopic(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java + pattern: | + (?s)(public final Policy setIamPolicy\(SetIamPolicyRequest request\) \{\s*return setIamPolicyCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+               * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+               *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+               *   Policy policy = Policy.newBuilder().build();
+               *   Policy response = topicAdminClient.setIamPolicy(formattedResource, policy);
+               * }
+               * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead. + */ + @Deprecated + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java + pattern: | + (?s)(public final Policy getIamPolicy\(GetIamPolicyRequest request\) \{\s*return getIamPolicyCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+               * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+               *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+               *   Policy response = topicAdminClient.getIamPolicy(formattedResource);
+               * }
+               * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead. + */ + @Deprecated + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java + pattern: | + (?s)(public final TestIamPermissionsResponse testIamPermissions\(TestIamPermissionsRequest request\) \{\s*return testIamPermissionsCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + *

Sample code: + * + *


+               * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+               *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+               *   List<String> permissions = new ArrayList<>();
+               *   TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(formattedResource, permissions);
+               * }
+               * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead. + */ + @Deprecated + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + pattern: | + (?s)(public final Subscription createSubscription\(Subscription request\) \{\s*return createSubscriptionCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a subscription to a given topic. See the <a + * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name + * rules</a>. If the subscription already exists, returns `ALREADY_EXISTS`. If the + * corresponding topic doesn't exist, returns `NOT_FOUND`. + * + *

If the name is not provided in the request, the server will assign a random name for this + * subscription on the same project as the topic, conforming to the [resource name + * format](https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is + * populated in the returned Subscription object. Note that for REST API requests, you must + * specify a name in the request. + * + *

Sample code: + * + *


+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+               *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+               *   PushConfig pushConfig = PushConfig.newBuilder().build();
+               *   int ackDeadlineSeconds = 0;
+               *   Subscription response = subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
+               * }
+               * 
+ * + * @param name Required. The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a + * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores + * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 + * and 255 characters in length, and it must not start with `"goog"`. + * @param topic Required. The name of the topic from which this subscription is receiving + * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be + * `_deleted-topic_` if the topic has been deleted. + * @param pushConfig If push delivery is used with this subscription, this field is used to + * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack + * messages using API methods. + * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits + * for the subscriber to acknowledge receipt before resending the message. In the interval + * after the message is delivered and before it is acknowledged, it is considered to be + * <i>outstanding</i>. During that time period, the message will not be + * redelivered (on a best-effort basis). + *

For pull subscriptions, this value is used as the initial value for the ack deadline. To + * override this value for a given message, call `ModifyAckDeadline` with the corresponding + * `ack_id` if using non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline + * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds + * (10 minutes). If this parameter is 0, a default value of 10 seconds is used. + *

For push delivery, this value is also used to set the request timeout for the call to + * the push endpoint. + *

If the subscriber never acknowledges the message, the Pub/Sub system will eventually + * redeliver the message. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #createSubscription(SubscriptionName, TopicName, PushConfig, int)} + * instead. + */ + @Deprecated + public final Subscription createSubscription( + ProjectSubscriptionName name, + ProjectTopicName topic, + PushConfig pushConfig, + int ackDeadlineSeconds) { + Subscription request = + Subscription.newBuilder() + .setName(name == null ? null : name.toString()) + .setTopic(topic == null ? null : topic.toString()) + .setPushConfig(pushConfig) + .setAckDeadlineSeconds(ackDeadlineSeconds) + .build(); + return createSubscription(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a subscription to a given topic. See the [resource name rules] + * (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already + * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns + * `NOT_FOUND`. + * + *

If the name is not provided in the request, the server will assign a random name for this + * subscription on the same project as the topic, conforming to the [resource name format] + * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in + * the returned Subscription object. Note that for REST API requests, you must specify a name in + * the request. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+               *   String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
+               *   PushConfig pushConfig = PushConfig.newBuilder().build();
+               *   int ackDeadlineSeconds = 2135351438;
+               *   Subscription response =
+               *       subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
+               * }
+               * }
+ * + * @param name Required. The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a + * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores + * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 + * and 255 characters in length, and it must not start with `"goog"`. + * @param topic Required. The name of the topic from which this subscription is receiving + * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be + * `_deleted-topic_` if the topic has been deleted. + * @param pushConfig If push delivery is used with this subscription, this field is used to + * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack + * messages using API methods. + * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits + * for the subscriber to acknowledge receipt before resending the message. In the interval + * after the message is delivered and before it is acknowledged, it is considered to be + * <i>outstanding</i>. During that time period, the message will not be + * redelivered (on a best-effort basis). + *

For pull subscriptions, this value is used as the initial value for the ack deadline. To + * override this value for a given message, call `ModifyAckDeadline` with the corresponding + * `ack_id` if using non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline + * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds + * (10 minutes). If this parameter is 0, a default value of 10 seconds is used. + *

For push delivery, this value is also used to set the request timeout for the call to + * the push endpoint. + *

If the subscriber never acknowledges the message, the Pub/Sub system will eventually + * redeliver the message. + * @deprecated Use {@link #createSubscription(SubscriptionName, String, PushConfig, int)} instead. + */ + @Deprecated + public final Subscription createSubscription( + ProjectSubscriptionName name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) { + Subscription request = + Subscription.newBuilder() + .setName(name == null ? null : name.toString()) + .setTopic(topic) + .setPushConfig(pushConfig) + .setAckDeadlineSeconds(ackDeadlineSeconds) + .build(); + return createSubscription(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a subscription to a given topic. See the [resource name rules] + * (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already + * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns + * `NOT_FOUND`. + * + *

If the name is not provided in the request, the server will assign a random name for this + * subscription on the same project as the topic, conforming to the [resource name format] + * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in + * the returned Subscription object. Note that for REST API requests, you must specify a name in + * the request. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+               *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
+               *   PushConfig pushConfig = PushConfig.newBuilder().build();
+               *   int ackDeadlineSeconds = 2135351438;
+               *   Subscription response =
+               *       subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
+               * }
+               * }
+ * + * @param name Required. The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a + * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores + * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 + * and 255 characters in length, and it must not start with `"goog"`. + * @param topic Required. The name of the topic from which this subscription is receiving + * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be + * `_deleted-topic_` if the topic has been deleted. + * @param pushConfig If push delivery is used with this subscription, this field is used to + * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack + * messages using API methods. + * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits + * for the subscriber to acknowledge receipt before resending the message. In the interval + * after the message is delivered and before it is acknowledged, it is considered to be + * <i>outstanding</i>. During that time period, the message will not be + * redelivered (on a best-effort basis). + *

For pull subscriptions, this value is used as the initial value for the ack deadline. To + * override this value for a given message, call `ModifyAckDeadline` with the corresponding + * `ack_id` if using non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline + * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds + * (10 minutes). If this parameter is 0, a default value of 10 seconds is used. + *

For push delivery, this value is also used to set the request timeout for the call to + * the push endpoint. + *

If the subscriber never acknowledges the message, the Pub/Sub system will eventually + * redeliver the message. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #createSubscription(SubscriptionName, TopicName, PushConfig, int)} + * instead. + */ + @Deprecated + public final Subscription createSubscription( + ProjectSubscriptionName name, + TopicName topic, + PushConfig pushConfig, + int ackDeadlineSeconds) { + Subscription request = + Subscription.newBuilder() + .setName(name == null ? null : name.toString()) + .setTopic(topic == null ? null : topic.toString()) + .setPushConfig(pushConfig) + .setAckDeadlineSeconds(ackDeadlineSeconds) + .build(); + return createSubscription(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + pattern: | + (?s)(public final Subscription getSubscription\(GetSubscriptionRequest request\) \{\s*return getSubscriptionCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the configuration details of a subscription. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+               *   Subscription response = subscriptionAdminClient.getSubscription(subscription);
+               * }
+               * }
+ * + * @param subscription Required. The name of the subscription to get. Format is + * `projects/{project}/subscriptions/{sub}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #getSubscription(SubscriptionName)} instead. + */ + @Deprecated + public final Subscription getSubscription(ProjectSubscriptionName subscription) { + GetSubscriptionRequest request = + GetSubscriptionRequest.newBuilder() + .setSubscription(subscription == null ? null : subscription.toString()) + .build(); + return getSubscription(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + pattern: | + (?s)(public final void deleteSubscription\(DeleteSubscriptionRequest request\) \{\s*deleteSubscriptionCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an existing subscription. All messages retained in the subscription are immediately + * dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is + * deleted, a new one may be created with the same name, but the new one has no association with + * the old subscription or its topic unless the same topic is specified. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+               *   subscriptionAdminClient.deleteSubscription(subscription);
+               * }
+               * }
+ * + * @param subscription Required. The subscription to delete. Format is + * `projects/{project}/subscriptions/{sub}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #deleteSubscription(SubscriptionName)} instead. + */ + @Deprecated + public final void deleteSubscription(ProjectSubscriptionName subscription) { + DeleteSubscriptionRequest request = + DeleteSubscriptionRequest.newBuilder() + .setSubscription(subscription == null ? null : subscription.toString()) + .build(); + deleteSubscription(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + pattern: | + (?s)(public final void modifyAckDeadline\(ModifyAckDeadlineRequest request\) \{\s*modifyAckDeadlineCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Modifies the ack deadline for a specific message. This method is useful to indicate that more + * time is needed to process a message by the subscriber, or to make the message available for + * redelivery if the processing was interrupted. Note that this does not modify the + * subscription-level `ackDeadlineSeconds` used for subsequent messages. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+               *   List ackIds = new ArrayList<>();
+               *   int ackDeadlineSeconds = 2135351438;
+               *   subscriptionAdminClient.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds);
+               * }
+               * }
+ * + * @param subscription Required. The name of the subscription. Format is + * `projects/{project}/subscriptions/{sub}`. + * @param ackIds Required. List of acknowledgment IDs. + * @param ackDeadlineSeconds Required. The new ack deadline with respect to the time this request + * was sent to the Pub/Sub system. For example, if the value is 10, the new ack deadline will + * expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying zero might + * immediately make the message available for delivery to another subscriber client. This + * typically results in an increase in the rate of message redeliveries (that is, duplicates). + * The minimum deadline you can specify is 0 seconds. The maximum deadline you can specify is + * 600 seconds (10 minutes). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #modifyAckDeadline(SubscriptionName, List, int)} instead. + */ + @Deprecated + final void modifyAckDeadline( + ProjectSubscriptionName subscription, List ackIds, int ackDeadlineSeconds) { + ModifyAckDeadlineRequest request = + ModifyAckDeadlineRequest.newBuilder() + .setSubscription(subscription == null ? null : subscription.toString()) + .addAllAckIds(ackIds) + .setAckDeadlineSeconds(ackDeadlineSeconds) + .build(); + modifyAckDeadline(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + pattern: | + (?s)(public final void acknowledge\(AcknowledgeRequest request\) \{\s*acknowledgeCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The + * Pub/Sub system can remove the relevant messages from the subscription. + * + *

Acknowledging a message whose ack deadline has expired may succeed, but such a message may + * be redelivered later. Acknowledging a message more than once will not result in an error. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+               *   List ackIds = new ArrayList<>();
+               *   subscriptionAdminClient.acknowledge(subscription, ackIds);
+               * }
+               * }
+ * + * @param subscription Required. The subscription whose message is being acknowledged. Format is + * `projects/{project}/subscriptions/{sub}`. + * @param ackIds Required. The acknowledgment ID for the messages being acknowledged that was + * returned by the Pub/Sub system in the `Pull` response. Must not be empty. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #acknowledge(SubscriptionName, List)} instead. + */ + @Deprecated + public final void acknowledge(ProjectSubscriptionName subscription, List ackIds) { + AcknowledgeRequest request = + AcknowledgeRequest.newBuilder() + .setSubscription(subscription == null ? null : subscription.toString()) + .addAllAckIds(ackIds) + .build(); + acknowledge(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + pattern: | + (?s)(public final PullResponse pull\(PullRequest request\) \{\s*return pullCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many + * concurrent pull requests pending for the given subscription. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+               *   int maxMessages = 496131527;
+               *   PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages);
+               * }
+               * }
+ * + * @param subscription Required. The subscription from which messages should be pulled. Format is + * `projects/{project}/subscriptions/{sub}`. + * @param maxMessages Required. The maximum number of messages to return for this request. Must be + * a positive integer. The Pub/Sub system may return fewer than the number specified. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #pull(SubscriptionName, int)} instead. + */ + @Deprecated + public final PullResponse pull(ProjectSubscriptionName subscription, int maxMessages) { + PullRequest request = + PullRequest.newBuilder() + .setSubscription(subscription == null ? null : subscription.toString()) + .setMaxMessages(maxMessages) + .build(); + return pull(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many + * concurrent pull requests pending for the given subscription. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+               *   boolean returnImmediately = true;
+               *   int maxMessages = 496131527;
+               *   PullResponse response =
+               *       subscriptionAdminClient.pull(subscription, returnImmediately, maxMessages);
+               * }
+               * }
+ * + * @param subscription Required. The subscription from which messages should be pulled. Format is + * `projects/{project}/subscriptions/{sub}`. + * @param returnImmediately Optional. If this field set to true, the system will respond + * immediately even if it there are no messages available to return in the `Pull` response. + * Otherwise, the system may wait (for a bounded amount of time) until at least one message is + * available, rather than returning no messages. Warning: setting this field to `true` is + * discouraged because it adversely impacts the performance of `Pull` operations. We recommend + * that users do not set this field. + * @param maxMessages Required. The maximum number of messages to return for this request. Must be + * a positive integer. The Pub/Sub system may return fewer than the number specified. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #pull(SubscriptionName, boolean, int)} instead. + */ + @Deprecated + final PullResponse pull( + ProjectSubscriptionName subscription, boolean returnImmediately, int maxMessages) { + PullRequest request = + PullRequest.newBuilder() + .setSubscription(subscription == null ? null : subscription.toString()) + .setReturnImmediately(returnImmediately) + .setMaxMessages(maxMessages) + .build(); + return pull(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + pattern: | + (?s)(public final void modifyPushConfig\(ModifyPushConfigRequest request\) \{\s*modifyPushConfigCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Modifies the `PushConfig` for a specified subscription. + * + *

This may be used to change a push subscription to a pull one (signified by an empty + * `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push + * subscription. Messages will accumulate for delivery continuously through the call regardless of + * changes to the `PushConfig`. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+               *   PushConfig pushConfig = PushConfig.newBuilder().build();
+               *   subscriptionAdminClient.modifyPushConfig(subscription, pushConfig);
+               * }
+               * }
+ * + * @param subscription Required. The name of the subscription. Format is + * `projects/{project}/subscriptions/{sub}`. + * @param pushConfig Required. The push configuration for future deliveries. + *

An empty `pushConfig` indicates that the Pub/Sub system should stop pushing messages + * from the given subscription and allow messages to be pulled and acknowledged - effectively + * pausing the subscription if `Pull` or `StreamingPull` is not called. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #modifyPushConfig(SubscriptionName, PushConfig)} instead. + */ + @Deprecated + public final void modifyPushConfig(ProjectSubscriptionName subscription, PushConfig pushConfig) { + ModifyPushConfigRequest request = + ModifyPushConfigRequest.newBuilder() + .setSubscription(subscription == null ? null : subscription.toString()) + .setPushConfig(pushConfig) + .build(); + modifyPushConfig(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + pattern: | + (?s)(public final Snapshot getSnapshot\(GetSnapshotRequest request\) \{\s*return getSnapshotCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the configuration details of a snapshot. Snapshots are used in <a + * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment + * state of messages in an existing subscription to the state captured by a snapshot. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+               *   Snapshot response = subscriptionAdminClient.getSnapshot(snapshot);
+               * }
+               * }
+ * + * @param snapshot Required. The name of the snapshot to get. Format is + * `projects/{project}/snapshots/{snap}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use Use {@link #getSnapshot(SnapshotName)} instead. + */ + @Deprecated + public final Snapshot getSnapshot(ProjectSnapshotName snapshot) { + GetSnapshotRequest request = + GetSnapshotRequest.newBuilder() + .setSnapshot(snapshot == null ? null : snapshot.toString()) + .build(); + return getSnapshot(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + pattern: | + (?s)(public final Snapshot createSnapshot\(CreateSnapshotRequest request\) \{\s*return createSnapshotCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a snapshot from the requested subscription. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to + * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of + * messages in an existing subscription to the state captured by a snapshot. If the snapshot + * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns + * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would + * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the + * `Snapshot.expire_time` field. If the name is not provided in the request, the server will + * assign a random name for this snapshot on the same project as the subscription, conforming to + * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The + * generated name is populated in the returned Snapshot object. Note that for REST API requests, + * you must specify a name in the request. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+               *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+               *   Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
+               * }
+               * }
+ * + * @param name Required. User-provided name for this snapshot. If the name is not provided in the + * request, the server will assign a random name for this snapshot on the same project as the + * subscription. Note that for REST API requests, you must specify a name. See the <a + * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name + * rules</a>. Format is `projects/{project}/snapshots/{snap}`. + * @param subscription Required. The subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the + * subscription. More precisely, this is defined as the messages in the subscription's backlog + * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as + * well as: (b) Any messages published to the subscription's topic following the successful + * completion of the CreateSnapshot request. Format is + * `projects/{project}/subscriptions/{sub}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use Use {@link #createSnapshot(SnapshotName, SubscriptionName)} instead. + */ + @Deprecated + public final Snapshot createSnapshot( + ProjectSnapshotName name, ProjectSubscriptionName subscription) { + CreateSnapshotRequest request = + CreateSnapshotRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setSubscription(subscription == null ? null : subscription.toString()) + .build(); + return createSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a snapshot from the requested subscription. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to + * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of + * messages in an existing subscription to the state captured by a snapshot. If the snapshot + * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns + * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would + * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the + * `Snapshot.expire_time` field. If the name is not provided in the request, the server will + * assign a random name for this snapshot on the same project as the subscription, conforming to + * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The + * generated name is populated in the returned Snapshot object. Note that for REST API requests, + * you must specify a name in the request. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   String name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
+               *   ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+               *   Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
+               * }
+               * }
+ * + * @param name Required. User-provided name for this snapshot. If the name is not provided in the + * request, the server will assign a random name for this snapshot on the same project as the + * subscription. Note that for REST API requests, you must specify a name. See the <a + * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name + * rules</a>. Format is `projects/{project}/snapshots/{snap}`. + * @param subscription Required. The subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the + * subscription. More precisely, this is defined as the messages in the subscription's backlog + * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as + * well as: (b) Any messages published to the subscription's topic following the successful + * completion of the CreateSnapshot request. Format is + * `projects/{project}/subscriptions/{sub}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use Use {@link #createSnapshot(String, SubscriptionName)} instead. + */ + @Deprecated + public final Snapshot createSnapshot(String name, ProjectSubscriptionName subscription) { + CreateSnapshotRequest request = + CreateSnapshotRequest.newBuilder() + .setName(name) + .setSubscription(subscription == null ? null : subscription.toString()) + .build(); + return createSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a snapshot from the requested subscription. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to + * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of + * messages in an existing subscription to the state captured by a snapshot. If the snapshot + * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns + * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would + * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the + * `Snapshot.expire_time` field. If the name is not provided in the request, the server will + * assign a random name for this snapshot on the same project as the subscription, conforming to + * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The + * generated name is populated in the returned Snapshot object. Note that for REST API requests, + * you must specify a name in the request. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+               *   String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+               *   Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
+               * }
+               * }
+ * + * @param name Required. User-provided name for this snapshot. If the name is not provided in the + * request, the server will assign a random name for this snapshot on the same project as the + * subscription. Note that for REST API requests, you must specify a name. See the <a + * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name + * rules</a>. Format is `projects/{project}/snapshots/{snap}`. + * @param subscription Required. The subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the + * subscription. More precisely, this is defined as the messages in the subscription's backlog + * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as + * well as: (b) Any messages published to the subscription's topic following the successful + * completion of the CreateSnapshot request. Format is + * `projects/{project}/subscriptions/{sub}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use Use {@link #createSnapshot(SnapshotName, String)} instead. + */ + @Deprecated + public final Snapshot createSnapshot(ProjectSnapshotName name, String subscription) { + CreateSnapshotRequest request = + CreateSnapshotRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setSubscription(subscription) + .build(); + return createSnapshot(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + pattern: | + (?s)(public final void deleteSnapshot\(DeleteSnapshotRequest request\) \{\s*deleteSnapshotCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes an existing snapshot. Snapshots are used in [Seek] + * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage + * message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in + * an existing subscription to the state captured by a snapshot. When the snapshot is deleted, all + * messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new + * one may be created with the same name, but the new one has no association with the old snapshot + * or its subscription, unless the same subscription is specified. + * + *

Sample code: + * + *

{@code
+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+               *   subscriptionAdminClient.deleteSnapshot(snapshot);
+               * }
+               * }
+ * + * @param snapshot Required. The name of the snapshot to delete. Format is + * `projects/{project}/snapshots/{snap}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use Use {@link #deleteSnapshot(SnapshotName)} instead. + */ + @Deprecated + public final void deleteSnapshot(ProjectSnapshotName snapshot) { + DeleteSnapshotRequest request = + DeleteSnapshotRequest.newBuilder() + .setSnapshot(snapshot == null ? null : snapshot.toString()) + .build(); + deleteSnapshot(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + pattern: | + (?s)(public final Policy setIamPolicy\(SetIamPolicyRequest request\) \{\s*return setIamPolicyCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+               *   Policy policy = Policy.newBuilder().build();
+               *   Policy response = subscriptionAdminClient.setIamPolicy(formattedResource, policy);
+               * }
+               * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead. + */ + @Deprecated + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + pattern: | + (?s)(public final Policy getIamPolicy\(GetIamPolicyRequest request\) \{\s*return getIamPolicyCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+               *   Policy response = subscriptionAdminClient.getIamPolicy(formattedResource);
+               * }
+               * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead. + */ + @Deprecated + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } + - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java + pattern: | + (?s)(public final TestIamPermissionsResponse testIamPermissions\(TestIamPermissionsRequest request\) \{\s*return testIamPermissionsCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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. + * + *

Sample code: + * + *


+               * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+               *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+               *   List<String> permissions = new ArrayList<>();
+               *   TestIamPermissionsResponse response = subscriptionAdminClient.testIamPermissions(formattedResource, permissions);
+               * }
+               * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead. + */ + @Deprecated + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } version: 1.153.0-SNAPSHOT apis: - path: google/pubsub/v1 @@ -3752,6 +5530,9 @@ libraries: - source: src/main/java/com/google/storage/control/v2/gapic_metadata.json destination: src/main/resources/com/google/storage/control/v2/gapic_metadata.json samples: false + postprocess: + remove_file: + - gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/gapic_metadata.json java: api_id_override: storage.googleapis.com api_description_override: 'is a durable and highly available object storage service. Google Cloud Storage is almost infinitely scalable and guarantees consistency: when a write succeeds, the latest copy of the object will be returned to any GET, globally.' @@ -3811,6 +5592,92 @@ libraries: name_pretty_override: Talent Solution product_documentation_override: https://cloud.google.com/solutions/talent-solution/ - name: tasks + postprocess: + replace_regex: + - path: google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2/CloudTasksClient.java + pattern: | + (?s)(public final Policy getIamPolicy\(GetIamPolicyRequest request\) \{\s*return getIamPolicyCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + public final Policy getIamPolicy(QueueName queueName) { + return getIamPolicy((ResourceName) queueName); + } + - path: google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2/CloudTasksClient.java + pattern: | + (?s)(public final Policy setIamPolicy\(SetIamPolicyRequest request\) \{\s*return setIamPolicyCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + public final Policy setIamPolicy(QueueName queue, Policy policy) { + return setIamPolicy((ResourceName) queue, policy); + } + - path: google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2/CloudTasksClient.java + pattern: | + (?s)(public final TestIamPermissionsResponse testIamPermissions\(TestIamPermissionsRequest request\) \{\s*return testIamPermissionsCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + public final TestIamPermissionsResponse testIamPermissions( + QueueName queue, List permissions) { + return testIamPermissions((ResourceName) queue, permissions); + } + - path: google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksClient.java + pattern: | + (?s)(public final Policy getIamPolicy\(GetIamPolicyRequest request\) \{\s*return getIamPolicyCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + public final Policy getIamPolicy(QueueName queueName) { + return getIamPolicy((ResourceName) queueName); + } + - path: google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksClient.java + pattern: | + (?s)(public final Policy setIamPolicy\(SetIamPolicyRequest request\) \{\s*return setIamPolicyCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + public final Policy setIamPolicy(QueueName queue, Policy policy) { + return setIamPolicy((ResourceName) queue, policy); + } + - path: google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksClient.java + pattern: | + (?s)(public final TestIamPermissionsResponse testIamPermissions\(TestIamPermissionsRequest request\) \{\s*return testIamPermissionsCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + public final TestIamPermissionsResponse testIamPermissions( + QueueName queue, List permissions) { + return testIamPermissions((ResourceName) queue, permissions); + } + - path: google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta3/CloudTasksClient.java + pattern: | + (?s)(public final Policy getIamPolicy\(GetIamPolicyRequest request\) \{\s*return getIamPolicyCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + public final Policy getIamPolicy(QueueName queueName) { + return getIamPolicy((ResourceName) queueName); + } + - path: google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta3/CloudTasksClient.java + pattern: | + (?s)(public final Policy setIamPolicy\(SetIamPolicyRequest request\) \{\s*return setIamPolicyCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + public final Policy setIamPolicy(QueueName queue, Policy policy) { + return setIamPolicy((ResourceName) queue, policy); + } + - path: google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta3/CloudTasksClient.java + pattern: | + (?s)(public final TestIamPermissionsResponse testIamPermissions\(TestIamPermissionsRequest request\) \{\s*return testIamPermissionsCallable\(\)\.call\(request\);\s*\}) + replacement: | + $1 + + public final TestIamPermissionsResponse testIamPermissions( + QueueName queue, List permissions) { + return testIamPermissions((ResourceName) queue, permissions); + } version: 2.95.0-SNAPSHOT apis: - path: google/cloud/tasks/v2 From 722cb532a710fb55245dda530e9f4a57be6a6840 Mon Sep 17 00:00:00 2001 From: Sophia Yang <171981480+yangyzs@users.noreply.github.com> Date: Mon, 20 Jul 2026 15:38:33 -0400 Subject: [PATCH 2/3] fix: run librarian tidy to format librarian.yaml file --- librarian.yaml | 423 ++++++++++++++++++++++++++----------------------- 1 file changed, 222 insertions(+), 201 deletions(-) diff --git a/librarian.yaml b/librarian.yaml index b62ee62075c5..39593eb483c1 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -584,22 +584,22 @@ libraries: method_operations: - path: proto-google-cloud-bigquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/DataSourceName.java action: delete - func_name: "public static List parseList(List formattedStrings)" + func_name: public static List parseList(List formattedStrings) - path: proto-google-cloud-bigquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/DataSourceName.java action: delete - func_name: "public static List toStringList(List<@Nullable DataSourceName> values)" + func_name: public static List toStringList(List<@Nullable DataSourceName> values) - path: proto-google-cloud-bigquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/TransferConfigName.java action: delete - func_name: "public static List parseList(List formattedStrings)" + func_name: public static List parseList(List formattedStrings) - path: proto-google-cloud-bigquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/TransferConfigName.java action: delete - func_name: "public static List toStringList(List<@Nullable TransferConfigName> values)" + func_name: public static List toStringList(List<@Nullable TransferConfigName> values) - path: proto-google-cloud-bigquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/RunName.java action: delete - func_name: "public static List parseList(List formattedStrings)" + func_name: public static List parseList(List formattedStrings) - path: proto-google-cloud-bigquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/RunName.java action: delete - func_name: "public static List toStringList(List<@Nullable RunName> values)" + func_name: public static List toStringList(List<@Nullable RunName> values) java: api_description_override: transfers data from partner SaaS applications to Google BigQuery on a scheduled, managed basis. issue_tracker_override: https://issuetracker.google.com/savedsearches/559654 @@ -769,60 +769,72 @@ libraries: - google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/package-info.java - google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/package-info.java postprocess: - remove_file: - - google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java - - google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java - - google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java - - google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/MockBigtable.java - - google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java replace: - path: google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtable*AdminClient.java - original: "public final void close() {" - replacement: "public void close() {" + original: public final void close() { + replacement: public void close() { - path: google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java - original: "package com.google.cloud.bigtable.data.v2.stub;" - replacement: "package com.google.cloud.bigtable.data.v2.stub;\n\nimport com.google.api.core.InternalApi;" + original: package com.google.cloud.bigtable.data.v2.stub; + replacement: |- + package com.google.cloud.bigtable.data.v2.stub; + + import com.google.api.core.InternalApi; - path: google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java - original: "package com.google.cloud.bigtable.data.v2.stub;" - replacement: "package com.google.cloud.bigtable.data.v2.stub;\n\nimport com.google.api.core.InternalApi;" + original: package com.google.cloud.bigtable.data.v2.stub; + replacement: |- + package com.google.cloud.bigtable.data.v2.stub; + + import com.google.api.core.InternalApi; - path: google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java - original: "package com.google.cloud.bigtable.data.v2.stub;" - replacement: "package com.google.cloud.bigtable.data.v2.stub;\n\nimport com.google.api.core.InternalApi;" + original: package com.google.cloud.bigtable.data.v2.stub; + replacement: |- + package com.google.cloud.bigtable.data.v2.stub; + + import com.google.api.core.InternalApi; - path: google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java - original: "package com.google.cloud.bigtable.data.v2.stub;" - replacement: "package com.google.cloud.bigtable.data.v2.stub;\n\nimport com.google.api.core.InternalApi;" + original: package com.google.cloud.bigtable.data.v2.stub; + replacement: |- + package com.google.cloud.bigtable.data.v2.stub; + + import com.google.api.core.InternalApi; replace_regex: - path: google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtable*AdminClient.java - pattern: "public static final BaseBigtable(.*)AdminClient create\\(" - replacement: "protected static BaseBigtable${1}AdminClient create(" + pattern: public static final BaseBigtable(.*)AdminClient create\( + replacement: protected static BaseBigtable${1}AdminClient create( - path: google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java - pattern: "(/\\*\\*(?s).+?\\*/\\n(?:^@[^\\n]*\\n)*)(public\\s+(?:abstract\\s+|final\\s+)?class\\s+\\w+)" + pattern: (/\*\*(?s).+?\*/\n(?:^@[^\n]*\n)*)(public\s+(?:abstract\s+|final\s+)?class\s+\w+) replacement: | /** For internal use only. */ @Generated("by gapic-generator") @InternalApi $2 - path: google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java - pattern: "(/\\*\\*(?s).+?\\*/\\n(?:^@[^\\n]*\\n)*)(public\\s+(?:abstract\\s+|final\\s+)?class\\s+\\w+)" + pattern: (/\*\*(?s).+?\*/\n(?:^@[^\n]*\n)*)(public\s+(?:abstract\s+|final\s+)?class\s+\w+) replacement: | /** For internal use only. */ @Generated("by gapic-generator") @InternalApi $2 - path: google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java - pattern: "(/\\*\\*(?s).+?\\*/\\n(?:^@[^\\n]*\\n)*)(public\\s+(?:abstract\\s+|final\\s+)?class\\s+\\w+)" + pattern: (/\*\*(?s).+?\*/\n(?:^@[^\n]*\n)*)(public\s+(?:abstract\s+|final\s+)?class\s+\w+) replacement: | /** For internal use only. */ @Generated("by gapic-generator") @InternalApi $2 - path: google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java - pattern: "(/\\*\\*(?s).+?\\*/\\n(?:^@[^\\n]*\\n)*)(public\\s+(?:abstract\\s+|final\\s+)?class\\s+\\w+)" + pattern: (/\*\*(?s).+?\*/\n(?:^@[^\n]*\n)*)(public\s+(?:abstract\s+|final\s+)?class\s+\w+) replacement: | /** For internal use only. */ @Generated("by gapic-generator") @InternalApi $2 + remove_file: + - google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java + - google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java + - google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java + - google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/MockBigtable.java + - google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java java: api_id_override: bigtable.googleapis.com api_description_override: API for reading and writing the contents of Bigtables associated with a cloud project. @@ -1258,11 +1270,13 @@ libraries: postprocess: replace: - path: google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClient.java - original: "import com.google.iam.v1.TestIamPermissionsResponse;" - replacement: "import com.google.iam.v1.TestIamPermissionsResponse;\nimport io.grafeas.v1.GrafeasClient;" + original: import com.google.iam.v1.TestIamPermissionsResponse; + replacement: |- + import com.google.iam.v1.TestIamPermissionsResponse; + import io.grafeas.v1.GrafeasClient; replace_regex: - path: google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClient.java - pattern: "(\\s+private final ContainerAnalysisStub stub;.*)" + pattern: (\s+private final ContainerAnalysisStub stub;.*) replacement: | $1 @@ -1548,54 +1562,54 @@ libraries: - proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/EnvironmentSessionName.java - proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/ProjectAgentName.java postprocess: - method_operations: - - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java - action: duplicate - func_name: "public static AgentName ofProjectName(String project)" - new_name: "ofProjectAgentName" - - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java - action: deprecate - func_name: "public static AgentName ofProjectAgentName(String project)" - deprecation_message: "Please use {@link #ofProjectName()} instead" - - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java - action: duplicate - func_name: "public static AgentName ofProjectLocationName(String project, String location)" - new_name: "ofProjectLocationAgentName" - - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java - action: deprecate - func_name: "public static AgentName ofProjectLocationAgentName(String project, String location)" - deprecation_message: "Please use {@link #ofProjectLocationName()} instead" replace: - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java - original: "public static String formatProjectName" - replacement: "public static String formatProjectAgentName" + original: public static String formatProjectName + replacement: public static String formatProjectAgentName - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java - original: "public static String formatProjectLocationName" - replacement: "public static String formatProjectLocationAgentName" + original: public static String formatProjectLocationName + replacement: public static String formatProjectLocationAgentName - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java - original: "ProjectBuilder" - replacement: "ProjectAgentBuilder" + original: ProjectBuilder + replacement: ProjectAgentBuilder - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java - original: "ProjectLocationBuilder" - replacement: "ProjectLocationAgentBuilder" + original: ProjectLocationBuilder + replacement: ProjectLocationAgentBuilder - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java - original: "return ofProjectName" - replacement: "return ofProjectAgentName" + original: return ofProjectName + replacement: return ofProjectAgentName - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java - original: "return ofProjectLocationName" - replacement: "return ofProjectLocationAgentName" + original: return ofProjectLocationName + replacement: return ofProjectLocationAgentName - path: google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/EnvironmentsClientTest.java - original: "ofProjectName" - replacement: "ofProjectAgentName" + original: ofProjectName + replacement: ofProjectAgentName - path: google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/EntityTypesClientTest.java - original: "ofProjectName" - replacement: "ofProjectAgentName" + original: ofProjectName + replacement: ofProjectAgentName - path: google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/IntentsClientTest.java - original: "ofProjectName" - replacement: "ofProjectAgentName" + original: ofProjectName + replacement: ofProjectAgentName - path: google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/VersionsClientTest.java - original: "ofProjectName" - replacement: "ofProjectAgentName" + original: ofProjectName + replacement: ofProjectAgentName + method_operations: + - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java + action: duplicate + func_name: public static AgentName ofProjectName(String project) + new_name: ofProjectAgentName + - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java + action: deprecate + func_name: public static AgentName ofProjectAgentName(String project) + deprecation_message: 'Please use {@link #ofProjectName()} instead' + - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java + action: duplicate + func_name: public static AgentName ofProjectLocationName(String project, String location) + new_name: ofProjectLocationAgentName + - path: proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java + action: deprecate + func_name: public static AgentName ofProjectLocationAgentName(String project, String location) + deprecation_message: 'Please use {@link #ofProjectLocationName()} instead' java: api_description_override: is an end-to-end, build-once deploy-everywhere development suite for creating conversational interfaces for websites, mobile applications, popular messaging platforms, and IoT devices. You can use it to build interfaces (such as chatbots and conversational IVR) that enable natural and rich interactions between your users and your business. Dialogflow Enterprise Edition users have access to Google Cloud Support and a service level agreement (SLA) for production deployments. issue_tracker_override: https://issuetracker.google.com/savedsearches/5300385 @@ -1674,22 +1688,22 @@ libraries: method_operations: - path: proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/InspectTemplateName.java action: delete - func_name: "public static List parseList(List formattedStrings)" + func_name: public static List parseList(List formattedStrings) - path: proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/InspectTemplateName.java action: delete - func_name: "public static List toStringList(List<@Nullable InspectTemplateName> values)" + func_name: public static List toStringList(List<@Nullable InspectTemplateName> values) - path: proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DeidentifyTemplateName.java action: delete - func_name: "public static List parseList(List formattedStrings)" + func_name: public static List parseList(List formattedStrings) - path: proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DeidentifyTemplateName.java action: delete - func_name: "public static List toStringList(List<@Nullable DeidentifyTemplateName> values)" + func_name: public static List toStringList(List<@Nullable DeidentifyTemplateName> values) - path: proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeName.java action: delete - func_name: "public static List parseList(List formattedStrings)" + func_name: public static List parseList(List formattedStrings) - path: proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeName.java action: delete - func_name: "public static List toStringList(List<@Nullable StoredInfoTypeName> values)" + func_name: public static List toStringList(List<@Nullable StoredInfoTypeName> values) java: api_description_override: provides programmatic access to a powerful detection engine for personally identifiable information and other privacy-sensitive data in unstructured data streams, like text blocks and images. issue_tracker_override: https://issuetracker.google.com/savedsearches/5548083 @@ -1765,7 +1779,7 @@ libraries: postprocess: replace_regex: - path: google-cloud-errorreporting/src/main/java/com/google/devtools/clouderrorreporting/v1beta1/ErrorGroupServiceClient.java - pattern: "(\\s+public ErrorGroupServiceStub getStub\\(\\) \\{\\n\\s+return stub;\\n\\s+\\})" + pattern: (\s+public ErrorGroupServiceStub getStub\(\) \{\n\s+return stub;\n\s+\}) replacement: | $1 @@ -1793,7 +1807,7 @@ libraries: */ @Deprecated public final ErrorGroup getGroup(GroupName groupName) { - + GetGroupRequest request = GetGroupRequest.newBuilder() .setGroupName(groupName == null ? null : groupName.toString()) @@ -1907,15 +1921,22 @@ libraries: - proto-google-cloud-firestore-v1/src/main/proto/firestore/BUILD.bazel - proto-google-cloud-firestore-v1/src/main/proto/firestore/bundle.proto postprocess: - remove_file: - - google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/Version.java replace: - path: google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java - original: "Version.VERSION" - replacement: "FirestoreAdminVersion.VERSION" + original: Version.VERSION + replacement: FirestoreAdminVersion.VERSION - path: .repo-metadata.json - original: " \"recommended_package\": \"com.google.cloud.firestore\"\n}" - replacement: " \"recommended_package\": \"com.google.cloud.firestore\",\n \"library_path_overrides\": {\n \"FirestoreAdminClient\": \"google-cloud-firestore-admin\"\n }\n}\n" + original: |2- + "recommended_package": "com.google.cloud.firestore" + } + replacement: |2 + "recommended_package": "com.google.cloud.firestore", + "library_path_overrides": { + "FirestoreAdminClient": "google-cloud-firestore-admin" + } + } + remove_file: + - google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/Version.java java: api_id_override: firestore.googleapis.com api_description_override: is a fully-managed NoSQL document database for mobile, web, and server development from Firebase and Google Cloud Platform. It's backed by a multi-region replicated database that ensures once data is committed, it's durable even in the face of unexpected disasters. Not only that, but despite being a distributed database, it's also strongly consistent and offers seamless integration with other Firebase and Google Cloud Platform products, including Google Cloud Functions. @@ -2091,8 +2112,8 @@ libraries: replacement: ' return null;' replace_regex: - path: src/main/java/io/grafeas/v1/stub/GrafeasStubSettings.java - pattern: '\s+\*.*default service address.*\n\s+\*.*' - replacement: '' + pattern: \s+\*.*default service address.*\n\s+\*.* + replacement: "" java: alternate_headers: license-header.txt api_description_override: n/a @@ -2375,6 +2396,19 @@ libraries: name_pretty_override: Merchant Order Tracking API product_documentation_override: https://developers.google.com/merchant/api - name: kms + version: 2.98.0-SNAPSHOT + apis: + - path: google/cloud/kms/v1 + java: + additional_protos: + - path: google/cloud/location/locations.proto + - path: google/iam/v1/iam_policy.proto + keep: + - google-cloud-kms/src/test/java/com/google/cloud/kms/it/ITKmsTest.java + - proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyPathName.java + - proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyName.java + - proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyNames.java + - proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/UntypedKeyName.java postprocess: replace: - path: proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyName.java @@ -2581,19 +2615,6 @@ libraries: .build(); return testIamPermissions(request); } - version: 2.98.0-SNAPSHOT - apis: - - path: google/cloud/kms/v1 - java: - additional_protos: - - path: google/cloud/location/locations.proto - - path: google/iam/v1/iam_policy.proto - keep: - - google-cloud-kms/src/test/java/com/google/cloud/kms/it/ITKmsTest.java - - proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyPathName.java - - proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyName.java - - proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyNames.java - - proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/UntypedKeyName.java java: api_description_override: a cloud-hosted key management service that lets you manage cryptographic keys for your cloud services the same way you do on-premises. You can generate, use, rotate, and destroy AES256, RSA 2048, RSA 3072, RSA 4096, EC P256, and EC P384 cryptographic keys. Cloud KMS is integrated with Cloud IAM and Cloud Audit Logging so that you can manage permissions on individual keys and monitor how these are used. Use Cloud KMS to protect secrets and other sensitive data that you need to store in Google Cloud Platform. issue_tracker_override: https://issuetracker.google.com/savedsearches/5264932 @@ -2662,6 +2683,11 @@ libraries: product_documentation_override: https://cloud.google.com/location-finder/docs/overview rpc_documentation: https://cloud.google.com/locationfinder/docs/reference/rest - name: logging + version: 3.36.0-SNAPSHOT + apis: + - path: google/logging/v2 + java: + samples: false postprocess: replace: - path: google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigClientTest.java @@ -2809,11 +2835,6 @@ libraries: .build() .toString(); } - version: 3.36.0-SNAPSHOT - apis: - - path: google/logging/v2 - java: - samples: false java: api_id_override: logging.googleapis.com api_description_override: allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud and Amazon Web Services. Using the BindPlane service, you can also collect this data from over 150 common application components, on-premises systems, and hybrid cloud systems. BindPlane is included with your Google Cloud project at no additional cost. @@ -3106,6 +3127,11 @@ libraries: name_pretty_override: Model Armor API product_documentation_override: https://cloud.google.com/security-command-center/docs/model-armor-overview - name: monitoring + version: 3.96.0-SNAPSHOT + apis: + - path: google/monitoring/v3 + keep: + - google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/ITVPCServiceControlTest.java postprocess: replace: - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java @@ -3144,24 +3170,19 @@ libraries: - path: google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java original: FolderName replacement: ResourceName - version: 3.96.0-SNAPSHOT - apis: - - path: google/monitoring/v3 - keep: - - google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/ITVPCServiceControlTest.java java: api_description_override: collects metrics, events, and metadata from Google Cloud, Amazon Web Services (AWS), hosted uptime probes, and application instrumentation. Using the BindPlane service, you can also collect this data from over 150 common application components, on-premise systems, and hybrid cloud systems. Stackdriver ingests that data and generates insights via dashboards, charts, and alerts. BindPlane is included with your Google Cloud project at no additional cost. issue_tracker_override: https://issuetracker.google.com/savedsearches/559785 name_pretty_override: Stackdriver Monitoring product_documentation_override: https://cloud.google.com/monitoring/docs - name: monitoring-dashboards + version: 2.97.0-SNAPSHOT + apis: + - path: google/monitoring/dashboard/v1 postprocess: remove_file: - proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/DrilldownsProto.java - proto-google-cloud-monitoring-dashboard-v1/src/main/java/com/google/monitoring/dashboard/v1/ServiceMonitoringProto.java - version: 2.97.0-SNAPSHOT - apis: - - path: google/monitoring/dashboard/v1 java: api_id_override: monitoring.googleapis.com api_description_override: are one way for you to view and analyze metric data. The Cloud Console provides predefined dashboards that require no setup or configuration. You can also define custom dashboards. With custom dashboards, you have complete control over the charts that are displayed and their configuration. @@ -3191,6 +3212,18 @@ libraries: name_pretty_override: NetApp API product_documentation_override: https://cloud.google.com/netapp/volumes/docs/discover/overview - name: network-management + version: 1.96.0-SNAPSHOT + apis: + - path: google/cloud/networkmanagement/v1 + java: + additional_protos: + - path: google/cloud/location/locations.proto + - path: google/iam/v1/iam_policy.proto + - path: google/cloud/networkmanagement/v1beta1 + java: + additional_protos: + - path: google/cloud/location/locations.proto + - path: google/iam/v1/iam_policy.proto postprocess: replace: - path: google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/OrganizationVpcFlowLogsServiceClientHttpJsonTest.java @@ -3429,18 +3462,6 @@ libraries: @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") @Test public void testIamPermissionsTest() throws Exception { - version: 1.96.0-SNAPSHOT - apis: - - path: google/cloud/networkmanagement/v1 - java: - additional_protos: - - path: google/cloud/location/locations.proto - - path: google/iam/v1/iam_policy.proto - - path: google/cloud/networkmanagement/v1beta1 - java: - additional_protos: - - path: google/cloud/location/locations.proto - - path: google/iam/v1/iam_policy.proto java: api_description_override: provides a collection of network performance monitoring and diagnostic capabilities. name_pretty_override: Network Management API @@ -3599,9 +3620,6 @@ libraries: - proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/ProjectName.java - proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/SshPublicKeyName.java postprocess: - copy_file: - - src: proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/common/UserName.java - dst: proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/UserName.java replace: - path: proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/UserName.java original: package com.google.cloud.oslogin.common; @@ -3651,6 +3669,9 @@ libraries: - path: google-cloud-os-login/src/test/java/com/google/cloud/oslogin/v1/OsLoginServiceClientHttpJsonTest.java original: import com.google.cloud.oslogin.common.ProjectName; replacement: import com.google.cloud.oslogin.v1.ProjectName; + copy_file: + - src: proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/common/UserName.java + dst: proto-google-cloud-os-login-v1/src/main/java/com/google/cloud/oslogin/v1/UserName.java java: api_description_override: manages OS login configuration for Directory API users. issue_tracker_override: https://issuetracker.google.com/savedsearches/559755 @@ -3763,6 +3784,63 @@ libraries: product_documentation_override: https://cloud.google.com/certificate-manager/docs/public-ca rpc_documentation: https://cloud.google.com/certificate-manager/docs/reference/public-ca/rpc - name: pubsub + version: 1.153.0-SNAPSHOT + apis: + - path: google/pubsub/v1 + java: + additional_protos: + - path: google/iam/v1/iam_policy.proto + samples: false + keep: + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumer.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerImpl.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerWithResponse.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerWithResponseImpl.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckRequestData.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckResponse.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/LoggingUtil.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/MessageDispatcher.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/MessageReceiver.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/MessageReceiverWithAckResponse.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/ModackRequestData.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/OpenCensusUtil.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/OpenTelemetryPubsubTracer.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/PublisherInterface.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/PubsubMessageWrapper.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SequentialExecutorService.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/StatusUtil.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/StreamingSubscriberConnection.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Subscriber.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriberInterface.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriberShutdownSettings.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriberStats.java + - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Waiter.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/it/ITPubSubTest.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/CustomArgumentMatchers.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/FakeClock.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/FakePublisherServiceImpl.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/FakeScheduledExecutorService.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/FakeSubscriberServiceImpl.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MessageDataMatcher.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MessageDispatcherTest.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/OpenCensusUtilTest.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/OpenTelemetryTest.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SequentialExecutorServiceTest.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/StatusUtilTest.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/StreamingSubscriberConnectionTest.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriberShutdownSettingsTest.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriberTest.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminSmokeTest.java + - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/WaiterTest.java + - google-cloud-pubsub/src/test/resources/META-INF/native-image/com.google.cloud/google-cloud-pubsub/native-image.properties + - proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeletedTopic.java + - proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ProjectSnapshotName.java + - proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ProjectSubscriptionName.java + - proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ProjectTopicName.java + - proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicNames.java + - proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UntypedTopicName.java postprocess: replace: - path: google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java @@ -4855,63 +4933,6 @@ libraries: .build(); return testIamPermissions(request); } - version: 1.153.0-SNAPSHOT - apis: - - path: google/pubsub/v1 - java: - additional_protos: - - path: google/iam/v1/iam_policy.proto - samples: false - keep: - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumer.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerImpl.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerWithResponse.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckReplyConsumerWithResponseImpl.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckRequestData.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/AckResponse.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/LoggingUtil.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/MessageDispatcher.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/MessageReceiver.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/MessageReceiverWithAckResponse.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/ModackRequestData.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/OpenCensusUtil.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/OpenTelemetryPubsubTracer.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/PublisherInterface.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/PubsubMessageWrapper.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SequentialExecutorService.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/StatusUtil.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/StreamingSubscriberConnection.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Subscriber.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriberInterface.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriberShutdownSettings.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriberStats.java - - google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Waiter.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/it/ITPubSubTest.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/CustomArgumentMatchers.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/FakeClock.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/FakePublisherServiceImpl.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/FakeScheduledExecutorService.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/FakeSubscriberServiceImpl.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MessageDataMatcher.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MessageDispatcherTest.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/OpenCensusUtilTest.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/OpenTelemetryTest.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SequentialExecutorServiceTest.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/StatusUtilTest.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/StreamingSubscriberConnectionTest.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriberShutdownSettingsTest.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriberTest.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminSmokeTest.java - - google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/WaiterTest.java - - google-cloud-pubsub/src/test/resources/META-INF/native-image/com.google.cloud/google-cloud-pubsub/native-image.properties - - proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeletedTopic.java - - proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ProjectSnapshotName.java - - proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ProjectSubscriptionName.java - - proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ProjectTopicName.java - - proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicNames.java - - proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UntypedTopicName.java java: api_id_override: pubsub.googleapis.com api_reference: https://cloud.google.com/pubsub/ @@ -5592,6 +5613,25 @@ libraries: name_pretty_override: Talent Solution product_documentation_override: https://cloud.google.com/solutions/talent-solution/ - name: tasks + version: 2.95.0-SNAPSHOT + apis: + - path: google/cloud/tasks/v2 + java: + additional_protos: + - path: google/cloud/location/locations.proto + - path: google/cloud/tasks/v2beta3 + java: + additional_protos: + - path: google/cloud/location/locations.proto + - path: google/cloud/tasks/v2beta2 + java: + additional_protos: + - path: google/cloud/location/locations.proto + keep: + - google-cloud-tasks/src/test/java/com/google/cloud/tasks/v2beta3/CloudTasksSmokeTest.java + - proto-google-cloud-tasks-v2/src/main/java/com/google/cloud/tasks/v2/ProjectName.java + - proto-google-cloud-tasks-v2beta2/src/main/java/com/google/cloud/tasks/v2beta2/ProjectName.java + - proto-google-cloud-tasks-v2beta3/src/main/java/com/google/cloud/tasks/v2beta3/ProjectName.java postprocess: replace_regex: - path: google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2/CloudTasksClient.java @@ -5678,25 +5718,6 @@ libraries: QueueName queue, List permissions) { return testIamPermissions((ResourceName) queue, permissions); } - version: 2.95.0-SNAPSHOT - apis: - - path: google/cloud/tasks/v2 - java: - additional_protos: - - path: google/cloud/location/locations.proto - - path: google/cloud/tasks/v2beta3 - java: - additional_protos: - - path: google/cloud/location/locations.proto - - path: google/cloud/tasks/v2beta2 - java: - additional_protos: - - path: google/cloud/location/locations.proto - keep: - - google-cloud-tasks/src/test/java/com/google/cloud/tasks/v2beta3/CloudTasksSmokeTest.java - - proto-google-cloud-tasks-v2/src/main/java/com/google/cloud/tasks/v2/ProjectName.java - - proto-google-cloud-tasks-v2beta2/src/main/java/com/google/cloud/tasks/v2beta2/ProjectName.java - - proto-google-cloud-tasks-v2beta3/src/main/java/com/google/cloud/tasks/v2beta3/ProjectName.java java: api_description_override: a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. codeowner_team: '@googleapis/aap-dpes' From 32ac4c83be516fead6d001e36da7ae0451f65e47 Mon Sep 17 00:00:00 2001 From: Sophia Yang <171981480+yangyzs@users.noreply.github.com> Date: Tue, 21 Jul 2026 09:47:52 -0400 Subject: [PATCH 3/3] chore(storage): exclude storage from owlbot modernization --- java-storage/README.md | 21 ++++++++++++++++----- java-storage/owlbot.py | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 java-storage/owlbot.py diff --git a/java-storage/README.md b/java-storage/README.md index e248bb63f57a..765b9e9ac930 100644 --- a/java-storage/README.md +++ b/java-storage/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.83.0 + 26.78.0 pom import @@ -31,7 +31,12 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud google-cloud-storage + + com.google.cloud + google-cloud-storage-control + + ``` If you are using Maven without the BOM, add this to your dependencies: @@ -41,8 +46,14 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-storage - 2.70.0 + 2.64.0 + + + com.google.cloud + google-cloud-storage-control + 2.64.0 + ``` If you are using Gradle 5.x or later, add this to your dependencies: @@ -52,7 +63,6 @@ implementation platform('com.google.cloud:libraries-bom:26.83.0') implementation 'com.google.cloud:google-cloud-storage' ``` - If you are using Gradle without BOM, add this to your dependencies: ```Groovy @@ -78,7 +88,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Storage [API enabled][enable-api]. -You will need to [enable billing][enable-billing] to use Google Cloud Storage. + [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -436,6 +446,7 @@ the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` and on [google-cloud-java][g-c-j]. ## Versioning + This library follows [Semantic Versioning](http://semver.org/), but does update [Storage interface](src/main/java/com.google.cloud.storage/Storage.java) to introduce new methods which can break your implementations if you implement this interface for testing purposes. @@ -475,7 +486,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE -[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing + [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=storage.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/java-storage/owlbot.py b/java-storage/owlbot.py new file mode 100644 index 000000000000..b912766a8f43 --- /dev/null +++ b/java-storage/owlbot.py @@ -0,0 +1,41 @@ +# Copyright 2026 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 +# +# https://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. + +import synthtool as s +from synthtool.languages import java + +'This script is used to synthesize generated parts of this library.' +import os + +for library in s.get_staging_dirs(): + # put any special-case replacements here + if os.path.exists('owl-bot-staging/v2/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/gapic_metadata.json'): + os.remove('owl-bot-staging/v2/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/gapic_metadata.json') + s.move(library) +s.remove_staging_dirs() +java.common_templates( + monorepo=True, + excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +])