From 8db6707459b74abf9637c8e2544bddb302672bcf Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 21 Feb 2023 09:19:59 -0800 Subject: [PATCH 1/3] feat: introduce AdvisoryNotifications --- AdvisoryNotifications/.OwlBot.yaml | 4 + AdvisoryNotifications/.gitattributes | 8 + .../.github/pull_request_template.md | 24 +++ AdvisoryNotifications/.repo-metadata.json | 7 + AdvisoryNotifications/CONTRIBUTING.md | 10 + AdvisoryNotifications/LICENSE | 202 ++++++++++++++++++ AdvisoryNotifications/README.md | 45 ++++ AdvisoryNotifications/VERSION | 1 + AdvisoryNotifications/composer.json | 29 +++ AdvisoryNotifications/owlbot.py | 82 +++++++ AdvisoryNotifications/phpunit.xml.dist | 16 ++ composer.json | 9 +- 12 files changed, 434 insertions(+), 3 deletions(-) create mode 100644 AdvisoryNotifications/.OwlBot.yaml create mode 100644 AdvisoryNotifications/.gitattributes create mode 100644 AdvisoryNotifications/.github/pull_request_template.md create mode 100644 AdvisoryNotifications/.repo-metadata.json create mode 100644 AdvisoryNotifications/CONTRIBUTING.md create mode 100644 AdvisoryNotifications/LICENSE create mode 100644 AdvisoryNotifications/README.md create mode 100644 AdvisoryNotifications/VERSION create mode 100644 AdvisoryNotifications/composer.json create mode 100644 AdvisoryNotifications/owlbot.py create mode 100644 AdvisoryNotifications/phpunit.xml.dist diff --git a/AdvisoryNotifications/.OwlBot.yaml b/AdvisoryNotifications/.OwlBot.yaml new file mode 100644 index 000000000000..12bb548fdc48 --- /dev/null +++ b/AdvisoryNotifications/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: google/cloud/advisorynotifications/v1/.*-php/(.*) + dest: /owl-bot-staging/AdvisoryNotifications/v1/$1 +api-name: AdvisoryNotifications \ No newline at end of file diff --git a/AdvisoryNotifications/.gitattributes b/AdvisoryNotifications/.gitattributes new file mode 100644 index 000000000000..9a8480242644 --- /dev/null +++ b/AdvisoryNotifications/.gitattributes @@ -0,0 +1,8 @@ +/*.xml.dist export-ignore +/tests export-ignore +/.github export-ignore +/samples export-ignore +/.repo-metadata.json export-ignore +/.OwlBot.yaml export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore diff --git a/AdvisoryNotifications/.github/pull_request_template.md b/AdvisoryNotifications/.github/pull_request_template.md new file mode 100644 index 000000000000..606149f49082 --- /dev/null +++ b/AdvisoryNotifications/.github/pull_request_template.md @@ -0,0 +1,24 @@ +**PLEASE READ THIS ENTIRE MESSAGE** + +Hello, and thank you for your contribution! Please note that this repository is +a read-only split of `googleapis/google-cloud-php`. As such, we are +unable to accept pull requests to this repository. + +We welcome your pull request and would be happy to consider it for inclusion in +our library if you follow these steps: + +* Clone the parent client library repository: + +```sh +$ git clone git@github.com:googleapis/google-cloud-php.git +``` + +* Move your changes into the correct location in that library. Library code +belongs in `{clientBase}/src`, and tests in `{clientBase}/tests`. + +* Push the changes in a new branch to a fork, and open a new pull request +[here](https://github.com/googleapis/google-cloud-php). + +Thanks again, and we look forward to seeing your proposed change! + +The Google Cloud PHP team diff --git a/AdvisoryNotifications/.repo-metadata.json b/AdvisoryNotifications/.repo-metadata.json new file mode 100644 index 000000000000..4c81b06b99b0 --- /dev/null +++ b/AdvisoryNotifications/.repo-metadata.json @@ -0,0 +1,7 @@ +{ + "distribution_name": "google/cloud-advisorynotifications", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-advisorynotifications/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "advisorynotifications" +} \ No newline at end of file diff --git a/AdvisoryNotifications/CONTRIBUTING.md b/AdvisoryNotifications/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/AdvisoryNotifications/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/AdvisoryNotifications/LICENSE b/AdvisoryNotifications/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/AdvisoryNotifications/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/AdvisoryNotifications/README.md b/AdvisoryNotifications/README.md new file mode 100644 index 000000000000..6e5fda0e94c9 --- /dev/null +++ b/AdvisoryNotifications/README.md @@ -0,0 +1,45 @@ +# Google Cloud Advisory Notifications for PHP + +> Idiomatic PHP client for [Google Cloud Advisory Notifications](https://cloud.google.com/advisory-notifications/docs). + +[![Latest Stable Version](https://poser.pugx.org/google/cloud-advisorynotifications/v/stable)](https://packagist.org/packages/google/cloud-advisorynotifications) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-advisorynotifications.svg)](https://packagist.org/packages/google/cloud-advisorynotifications) + +* [API documentation](https://cloud.google.com/php/docs/reference/cloud-advisorynotifications/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/cloud-advisorynotifications +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](samples/) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://cloud.google.com/advisory-notifications/docs/apis). diff --git a/AdvisoryNotifications/VERSION b/AdvisoryNotifications/VERSION new file mode 100644 index 000000000000..77d6f4ca2371 --- /dev/null +++ b/AdvisoryNotifications/VERSION @@ -0,0 +1 @@ +0.0.0 diff --git a/AdvisoryNotifications/composer.json b/AdvisoryNotifications/composer.json new file mode 100644 index 000000000000..72c0ac44f590 --- /dev/null +++ b/AdvisoryNotifications/composer.json @@ -0,0 +1,29 @@ +{ + "name": "google/cloud-advisorynotifications", + "description": "Google Cloud Advisory Notifications Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Cloud\\AdvisoryNotifications\\": "src", + "GPBMetadata\\Google\\Cloud\\Advisorynotifications\\": "metadata" + } + }, + "extra": { + "component": { + "id": "cloud-advisorynotifications", + "path": "AdvisoryNotifications", + "target": "https://github.com/googleapis/google-cloud-php-advisorynotifications" + } + }, + "require": { + "google/gax": "^1.19.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8|^5.0|^8.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/AdvisoryNotifications/owlbot.py b/AdvisoryNotifications/owlbot.py new file mode 100644 index 000000000000..04acfc924ce4 --- /dev/null +++ b/AdvisoryNotifications/owlbot.py @@ -0,0 +1,82 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This script is used to synthesize generated parts of this library.""" + +import logging +from pathlib import Path +import subprocess + +import synthtool as s +from synthtool.languages import php +from synthtool import _tracked_paths + +logging.basicConfig(level=logging.DEBUG) + +src = Path(f"../{php.STAGING_DIR}/AdvisoryNotifications").resolve() +dest = Path().resolve() + +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) + +php.owlbot_main( + src=src, + dest=dest, + copy_excludes=[ + src / "**/[A-Z]*_*.php", + src / "**/*GrpcClient.php" + ] +) + +# remove class_alias code +s.replace( + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +### [START] protoc backwards compatibility fixes + +# roll back to private properties. +s.replace( + "src/**/V*/**/*.php", + r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", + r"""Generated from protobuf field \1 + */ + private $""") + +# Replace "Unwrapped" with "Value" for method names. +s.replace( + "src/**/V*/**/*.php", + r"public function ([s|g]\w{3,})Unwrapped", + r"public function \1Value" +) + +### [END] protoc backwards compatibility fixes + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Gapic/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=80']) diff --git a/AdvisoryNotifications/phpunit.xml.dist b/AdvisoryNotifications/phpunit.xml.dist new file mode 100644 index 000000000000..1cd1724e1a95 --- /dev/null +++ b/AdvisoryNotifications/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + tests/Unit + + + + + src + + src/V[!a-zA-Z]* + + + + diff --git a/composer.json b/composer.json index 11f38b62ca50..9502a2be138e 100644 --- a/composer.json +++ b/composer.json @@ -79,6 +79,7 @@ "google/analytics-admin": "0.9.0", "google/analytics-data": "0.9.4", "google/cloud-access-approval": "1.0.3", + "google/cloud-advisorynotifications": "main", "google/cloud-ai-platform": "0.12.0", "google/cloud-api-gateway": "1.0.3", "google/cloud-api-keys": "0.1.4", @@ -236,6 +237,7 @@ "GPBMetadata\\Google\\Apps\\Script\\Type\\": "GSuiteAddOns/external/metadata", "GPBMetadata\\Google\\Bigtable\\": "Bigtable/metadata", "GPBMetadata\\Google\\Cloud\\Accessapproval\\": "AccessApproval/metadata", + "GPBMetadata\\Google\\Cloud\\Advisorynotifications": "AdvisoryNotifications/metadata", "GPBMetadata\\Google\\Cloud\\Aiplatform\\": "AiPlatform/metadata", "GPBMetadata\\Google\\Cloud\\Apigateway\\": "ApiGateway/metadata", "GPBMetadata\\Google\\Cloud\\Apigeeconnect\\": "ApigeeConnect/metadata", @@ -266,8 +268,8 @@ "GPBMetadata\\Google\\Cloud\\Clouddms\\": "Dms/metadata", "GPBMetadata\\Google\\Cloud\\Compute\\": "Compute/metadata", "GPBMetadata\\Google\\Cloud\\Contactcenterinsights\\": "ContactCenterInsights/metadata", - "GPBMetadata\\Google\\Cloud\\Datacatalog\\Lineage\\": "DataCatalogLineage/metadata", "GPBMetadata\\Google\\Cloud\\Datacatalog\\": "DataCatalog/metadata", + "GPBMetadata\\Google\\Cloud\\Datacatalog\\Lineage\\": "DataCatalogLineage/metadata", "GPBMetadata\\Google\\Cloud\\Dataform\\": "Dataform/metadata", "GPBMetadata\\Google\\Cloud\\Datafusion\\": "DataFusion/metadata", "GPBMetadata\\Google\\Cloud\\Datalabeling\\": "DataLabeling/metadata", @@ -381,6 +383,7 @@ ], "Google\\Cloud\\AIPlatform\\": "AiPlatform/src", "Google\\Cloud\\AccessApproval\\": "AccessApproval/src", + "Google\\Cloud\\AdvisoryNotifications": "AdvisoryNotifications/src", "Google\\Cloud\\ApiGateway\\": "ApiGateway/src", "Google\\Cloud\\ApiKeys\\": "ApiKeys/src", "Google\\Cloud\\ApigeeConnect\\": "ApigeeConnect/src", @@ -420,9 +423,9 @@ "Google\\Cloud\\Container\\": "Container/src", "Google\\Cloud\\Core\\": "Core/src", "Google\\Cloud\\DataCatalog\\": "DataCatalog/src", + "Google\\Cloud\\DataCatalog\\Lineage\\": "DataCatalogLineage/src", "Google\\Cloud\\DataFusion\\": "DataFusion/src", "Google\\Cloud\\DataLabeling\\": "DataLabeling/src", - "Google\\Cloud\\DataCatalog\\Lineage\\": "DataCatalogLineage/src", "Google\\Cloud\\Dataflow\\": "Dataflow/src", "Google\\Cloud\\Dataform\\": "Dataform/src", "Google\\Cloud\\Dataplex\\": "Dataplex/src", @@ -605,4 +608,4 @@ ] } } -} +} \ No newline at end of file From a38db7a1793f0929536a86c7630da7b0b854976c Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 21 Feb 2023 17:42:19 +0000 Subject: [PATCH 2/3] updates from owlbot --- AdvisoryNotifications/.OwlBot.yaml | 4 +- AdvisoryNotifications/metadata/V1/Service.php | Bin 0 -> 3867 bytes .../get_notification.php | 72 +++ .../list_notifications.php | 72 +++ .../V1/AdvisoryNotificationsServiceClient.php | 34 ++ AdvisoryNotifications/src/V1/Attachment.php | 109 +++++ AdvisoryNotifications/src/V1/Csv.php | 106 ++++ AdvisoryNotifications/src/V1/Csv/CsvRow.php | 72 +++ ...dvisoryNotificationsServiceGapicClient.php | 451 ++++++++++++++++++ .../src/V1/GetNotificationRequest.php | 125 +++++ .../src/V1/ListNotificationsRequest.php | 247 ++++++++++ .../src/V1/ListNotificationsResponse.php | 139 ++++++ .../src/V1/LocalizationState.php | 73 +++ AdvisoryNotifications/src/V1/Message.php | 199 ++++++++ AdvisoryNotifications/src/V1/Message/Body.php | 78 +++ AdvisoryNotifications/src/V1/Notification.php | 198 ++++++++ .../src/V1/NotificationView.php | 63 +++ AdvisoryNotifications/src/V1/Subject.php | 77 +++ AdvisoryNotifications/src/V1/Text.php | 135 ++++++ .../src/V1/gapic_metadata.json | 28 ++ ...y_notifications_service_client_config.json | 44 ++ ...otifications_service_descriptor_config.php | 18 + ...tifications_service_rest_client_config.php | 31 ++ ...AdvisoryNotificationsServiceClientTest.php | 192 ++++++++ composer.json | 8 +- 25 files changed, 2569 insertions(+), 6 deletions(-) create mode 100644 AdvisoryNotifications/metadata/V1/Service.php create mode 100644 AdvisoryNotifications/samples/V1/AdvisoryNotificationsServiceClient/get_notification.php create mode 100644 AdvisoryNotifications/samples/V1/AdvisoryNotificationsServiceClient/list_notifications.php create mode 100644 AdvisoryNotifications/src/V1/AdvisoryNotificationsServiceClient.php create mode 100644 AdvisoryNotifications/src/V1/Attachment.php create mode 100644 AdvisoryNotifications/src/V1/Csv.php create mode 100644 AdvisoryNotifications/src/V1/Csv/CsvRow.php create mode 100644 AdvisoryNotifications/src/V1/Gapic/AdvisoryNotificationsServiceGapicClient.php create mode 100644 AdvisoryNotifications/src/V1/GetNotificationRequest.php create mode 100644 AdvisoryNotifications/src/V1/ListNotificationsRequest.php create mode 100644 AdvisoryNotifications/src/V1/ListNotificationsResponse.php create mode 100644 AdvisoryNotifications/src/V1/LocalizationState.php create mode 100644 AdvisoryNotifications/src/V1/Message.php create mode 100644 AdvisoryNotifications/src/V1/Message/Body.php create mode 100644 AdvisoryNotifications/src/V1/Notification.php create mode 100644 AdvisoryNotifications/src/V1/NotificationView.php create mode 100644 AdvisoryNotifications/src/V1/Subject.php create mode 100644 AdvisoryNotifications/src/V1/Text.php create mode 100644 AdvisoryNotifications/src/V1/gapic_metadata.json create mode 100644 AdvisoryNotifications/src/V1/resources/advisory_notifications_service_client_config.json create mode 100644 AdvisoryNotifications/src/V1/resources/advisory_notifications_service_descriptor_config.php create mode 100644 AdvisoryNotifications/src/V1/resources/advisory_notifications_service_rest_client_config.php create mode 100644 AdvisoryNotifications/tests/Unit/V1/AdvisoryNotificationsServiceClientTest.php diff --git a/AdvisoryNotifications/.OwlBot.yaml b/AdvisoryNotifications/.OwlBot.yaml index 12bb548fdc48..7a9cb54b2396 100644 --- a/AdvisoryNotifications/.OwlBot.yaml +++ b/AdvisoryNotifications/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: google/cloud/advisorynotifications/v1/.*-php/(.*) + - source: /google/cloud/advisorynotifications/v1/.*-php/(.*) dest: /owl-bot-staging/AdvisoryNotifications/v1/$1 -api-name: AdvisoryNotifications \ No newline at end of file +api-name: AdvisoryNotifications diff --git a/AdvisoryNotifications/metadata/V1/Service.php b/AdvisoryNotifications/metadata/V1/Service.php new file mode 100644 index 0000000000000000000000000000000000000000..f1c3dceca8a6ddc4c19efd67301c4a360703fd01 GIT binary patch literal 3867 zcmbtXOK;mo5RM+UGAW+mwVoQ@O zcO}I!bZJra2edz+*Y;2J(o@h=d&?y`^pu}a^w3>C6iSu@+BIN+B4=i2zWHW$=F_`Y z&w}@a5;m}{P}~+;`vUD@!Lm(is-`Zq`kfB81=ZZMG#%TbAQZNR>ULcy7RvQCrb^7d ztzt>&nr2tWX;nA-?X=P!XvDPl4U=jeO;xC78YDf)qzSeMnu`Ya-s*$E?-?4IQm+P956j^EtCX#CWe z0iA4V4cTDmyU0t@>zH1fI7%_EYuKR2)7jFn-p=8kGSE!>c&ZPvN1@P8j2b#HSMlqXivSSbP)VGO6#WI ztq%OhQF^kC9Rz=llHW%lUdK-;ItL5bXj1m*fqMbYavM(Tao=-{7f~IM_ulcL$r}M? z=tWXzv$y=f-^?bl;u>}g>~Q^L0T%qE+=lqrjiv1SAx-iilD|b^!Ox5g@s`=%ccNL! zZiF=BX^T0gind@$p;S?OdyMadaf~x06Vj4A)`UuWXU>uHH2^O;B z_y0f;0|Xqu4KbAryy9998F-!yK0k%tg5|bGEM3`ezOLBZJjD4WnH)lliE+~Pu+qjh zVQGpnaur~ae{b66@VIz0dm{UPXbuyXVBURlSxs$?)wgp%@>K*@D;lA}q9PCRH+|NM zQ5ohf#b&v7OCWdqr5yc7-asd))AO)sv9{7A?B;gxn?ne|c}2~yvEdZVA}T_Bpy8p@ zH_m2135jsf`CX=t-i9-}Vs!ibMAdBL)j3|O$)6%{X-2TbV)G0}_u)*i7q|$8uauw@ z=pvjmSOGQz0lM9S1x?vSuDd{R=FcUcz=aZ?$bg@KQn0=I@Smhj&IV-tKCA@YcCcH6 zci2Q&-YVzidU?Cr+$|TsXg;d$)QWlbvRGI-g%)8hC-0Q=D-m=W;#-d@m6hoF&k;C( zsE?r}T&Zm5R-#CN z%QL>`w;$9h#X9plmi;9Tm;DJe7&q~zPV|DuFkKDkZb%v)()7}pxOZ{`E;o~E4u{A6?k1B#3yjI1v!< zh;IsK>dsytJ(r!iC-LPo`D&P<;ZIrYQECw>ogNN{UcBRpLg~|v0PG<&TweB48{@3WWlCxKd&R!+X zWVN`PdFIPCyajB$fd#Wc8f*o76-~J&CCRZVNi&T~5)+kMaC4?-)5!9Mz}GO8nIvn7 gIjuGCOp6=W$AkR`?j{vjypCMD97%UM8o>zQKeh29fB*mh literal 0 HcmV?d00001 diff --git a/AdvisoryNotifications/samples/V1/AdvisoryNotificationsServiceClient/get_notification.php b/AdvisoryNotifications/samples/V1/AdvisoryNotificationsServiceClient/get_notification.php new file mode 100644 index 000000000000..8d1dfd85f763 --- /dev/null +++ b/AdvisoryNotifications/samples/V1/AdvisoryNotificationsServiceClient/get_notification.php @@ -0,0 +1,72 @@ +getNotification($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = AdvisoryNotificationsServiceClient::notificationName( + '[ORGANIZATION]', + '[LOCATION]', + '[NOTIFICATION]' + ); + + get_notification_sample($formattedName); +} +// [END advisorynotifications_v1_generated_AdvisoryNotificationsService_GetNotification_sync] diff --git a/AdvisoryNotifications/samples/V1/AdvisoryNotificationsServiceClient/list_notifications.php b/AdvisoryNotifications/samples/V1/AdvisoryNotificationsServiceClient/list_notifications.php new file mode 100644 index 000000000000..936633c69498 --- /dev/null +++ b/AdvisoryNotifications/samples/V1/AdvisoryNotificationsServiceClient/list_notifications.php @@ -0,0 +1,72 @@ +listNotifications($formattedParent); + + /** @var Notification $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = AdvisoryNotificationsServiceClient::locationName('[ORGANIZATION]', '[LOCATION]'); + + list_notifications_sample($formattedParent); +} +// [END advisorynotifications_v1_generated_AdvisoryNotificationsService_ListNotifications_sync] diff --git a/AdvisoryNotifications/src/V1/AdvisoryNotificationsServiceClient.php b/AdvisoryNotifications/src/V1/AdvisoryNotificationsServiceClient.php new file mode 100644 index 000000000000..8fee207f5688 --- /dev/null +++ b/AdvisoryNotifications/src/V1/AdvisoryNotificationsServiceClient.php @@ -0,0 +1,34 @@ +google.cloud.advisorynotifications.v1.Attachment + */ +class Attachment extends \Google\Protobuf\Internal\Message +{ + /** + * The title of the attachment. + * + * Generated from protobuf field string display_name = 1; + */ + private $display_name = ''; + protected $data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AdvisoryNotifications\V1\Csv $csv + * A CSV file attachment. Max size is 10 MB. + * @type string $display_name + * The title of the attachment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Advisorynotifications\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * A CSV file attachment. Max size is 10 MB. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Csv csv = 2; + * @return \Google\Cloud\AdvisoryNotifications\V1\Csv|null + */ + public function getCsv() + { + return $this->readOneof(2); + } + + public function hasCsv() + { + return $this->hasOneof(2); + } + + /** + * A CSV file attachment. Max size is 10 MB. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Csv csv = 2; + * @param \Google\Cloud\AdvisoryNotifications\V1\Csv $var + * @return $this + */ + public function setCsv($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AdvisoryNotifications\V1\Csv::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The title of the attachment. + * + * Generated from protobuf field string display_name = 1; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The title of the attachment. + * + * Generated from protobuf field string display_name = 1; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * @return string + */ + public function getData() + { + return $this->whichOneof("data"); + } + +} + diff --git a/AdvisoryNotifications/src/V1/Csv.php b/AdvisoryNotifications/src/V1/Csv.php new file mode 100644 index 000000000000..3389ab8c5cf5 --- /dev/null +++ b/AdvisoryNotifications/src/V1/Csv.php @@ -0,0 +1,106 @@ +google.cloud.advisorynotifications.v1.Csv + */ +class Csv extends \Google\Protobuf\Internal\Message +{ + /** + * The list of headers for data columns in a CSV file. + * + * Generated from protobuf field repeated string headers = 1; + */ + private $headers; + /** + * The list of data rows in a CSV file, as string arrays rather than as a + * single comma-separated string. + * + * Generated from protobuf field repeated .google.cloud.advisorynotifications.v1.Csv.CsvRow data_rows = 2; + */ + private $data_rows; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $headers + * The list of headers for data columns in a CSV file. + * @type array<\Google\Cloud\AdvisoryNotifications\V1\Csv\CsvRow>|\Google\Protobuf\Internal\RepeatedField $data_rows + * The list of data rows in a CSV file, as string arrays rather than as a + * single comma-separated string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Advisorynotifications\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of headers for data columns in a CSV file. + * + * Generated from protobuf field repeated string headers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * The list of headers for data columns in a CSV file. + * + * Generated from protobuf field repeated string headers = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->headers = $arr; + + return $this; + } + + /** + * The list of data rows in a CSV file, as string arrays rather than as a + * single comma-separated string. + * + * Generated from protobuf field repeated .google.cloud.advisorynotifications.v1.Csv.CsvRow data_rows = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataRows() + { + return $this->data_rows; + } + + /** + * The list of data rows in a CSV file, as string arrays rather than as a + * single comma-separated string. + * + * Generated from protobuf field repeated .google.cloud.advisorynotifications.v1.Csv.CsvRow data_rows = 2; + * @param array<\Google\Cloud\AdvisoryNotifications\V1\Csv\CsvRow>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataRows($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AdvisoryNotifications\V1\Csv\CsvRow::class); + $this->data_rows = $arr; + + return $this; + } + +} + diff --git a/AdvisoryNotifications/src/V1/Csv/CsvRow.php b/AdvisoryNotifications/src/V1/Csv/CsvRow.php new file mode 100644 index 000000000000..b952d7222629 --- /dev/null +++ b/AdvisoryNotifications/src/V1/Csv/CsvRow.php @@ -0,0 +1,72 @@ +google.cloud.advisorynotifications.v1.Csv.CsvRow + */ +class CsvRow extends \Google\Protobuf\Internal\Message +{ + /** + * The data entries in a CSV file row, as a string array rather than a + * single comma-separated string. + * + * Generated from protobuf field repeated string entries = 1; + */ + private $entries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $entries + * The data entries in a CSV file row, as a string array rather than a + * single comma-separated string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Advisorynotifications\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The data entries in a CSV file row, as a string array rather than a + * single comma-separated string. + * + * Generated from protobuf field repeated string entries = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntries() + { + return $this->entries; + } + + /** + * The data entries in a CSV file row, as a string array rather than a + * single comma-separated string. + * + * Generated from protobuf field repeated string entries = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->entries = $arr; + + return $this; + } + +} + + diff --git a/AdvisoryNotifications/src/V1/Gapic/AdvisoryNotificationsServiceGapicClient.php b/AdvisoryNotifications/src/V1/Gapic/AdvisoryNotificationsServiceGapicClient.php new file mode 100644 index 000000000000..b47a570a68bd --- /dev/null +++ b/AdvisoryNotifications/src/V1/Gapic/AdvisoryNotificationsServiceGapicClient.php @@ -0,0 +1,451 @@ +notificationName('[ORGANIZATION]', '[LOCATION]', '[NOTIFICATION]'); + * $response = $advisoryNotificationsServiceClient->getNotification($formattedName); + * } finally { + * $advisoryNotificationsServiceClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + */ +class AdvisoryNotificationsServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.advisorynotifications.v1.AdvisoryNotificationsService'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'advisorynotifications.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $locationNameTemplate; + + private static $notificationNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => + self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => + __DIR__ . + '/../resources/advisory_notifications_service_client_config.json', + 'descriptorsConfigPath' => + __DIR__ . + '/../resources/advisory_notifications_service_descriptor_config.php', + 'gcpApiConfigPath' => + __DIR__ . + '/../resources/advisory_notifications_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . + '/../resources/advisory_notifications_service_rest_client_config.php', + ], + ], + ]; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate( + 'organizations/{organization}/locations/{location}' + ); + } + + return self::$locationNameTemplate; + } + + private static function getNotificationNameTemplate() + { + if (self::$notificationNameTemplate == null) { + self::$notificationNameTemplate = new PathTemplate( + 'organizations/{organization}/locations/{location}/notifications/{notification}' + ); + } + + return self::$notificationNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'location' => self::getLocationNameTemplate(), + 'notification' => self::getNotificationNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $organization + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName($organization, $location) + { + return self::getLocationNameTemplate()->render([ + 'organization' => $organization, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a notification + * resource. + * + * @param string $organization + * @param string $location + * @param string $notification + * + * @return string The formatted notification resource. + */ + public static function notificationName( + $organization, + $location, + $notification + ) { + return self::getNotificationNameTemplate()->render([ + 'organization' => $organization, + 'location' => $location, + 'notification' => $notification, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - location: organizations/{organization}/locations/{location} + * - notification: organizations/{organization}/locations/{location}/notifications/{notification} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException( + "Template name $template does not exist" + ); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException( + "Input did not match any known format. Input: $formattedName" + ); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'advisorynotifications.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Gets a notification. + * + * Sample code: + * ``` + * $advisoryNotificationsServiceClient = new AdvisoryNotificationsServiceClient(); + * try { + * $formattedName = $advisoryNotificationsServiceClient->notificationName('[ORGANIZATION]', '[LOCATION]', '[NOTIFICATION]'); + * $response = $advisoryNotificationsServiceClient->getNotification($formattedName); + * } finally { + * $advisoryNotificationsServiceClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the notification to retrieve. + * Format: + * organizations/{organization}/locations/{location}/notifications/{notification}. + * @param array $optionalArgs { + * Optional. + * + * @type string $languageCode + * ISO code for requested localization language. If unset, will be + * interpereted as "en". If the requested language is valid, but not supported + * for this notification, English will be returned with an "Not applicable" + * LocalizationState. If the ISO code is invalid (i.e. not a real language), + * this RPC will throw an error. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\AdvisoryNotifications\V1\Notification + * + * @throws ApiException if the remote call fails + */ + public function getNotification($name, array $optionalArgs = []) + { + $request = new GetNotificationRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetNotification', + Notification::class, + $optionalArgs, + $request + )->wait(); + } + + /** + * Lists notifications under a given parent. + * + * Sample code: + * ``` + * $advisoryNotificationsServiceClient = new AdvisoryNotificationsServiceClient(); + * try { + * $formattedParent = $advisoryNotificationsServiceClient->locationName('[ORGANIZATION]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $advisoryNotificationsServiceClient->listNotifications($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $advisoryNotificationsServiceClient->listNotifications($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $advisoryNotificationsServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent, which owns this collection of notifications. + * Must be of the form "organizations/{organization}/locations/{location}". + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type int $view + * Specifies which parts of the notification resource should be returned + * in the response. + * For allowed values, use constants defined on {@see \Google\Cloud\AdvisoryNotifications\V1\NotificationView} + * @type string $languageCode + * ISO code for requested localization language. If unset, will be + * interpereted as "en". If the requested language is valid, but not supported + * for this notification, English will be returned with an "Not applicable" + * LocalizationState. If the ISO code is invalid (i.e. not a real language), + * this RPC will throw an error. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listNotifications($parent, array $optionalArgs = []) + { + $request = new ListNotificationsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['view'])) { + $request->setView($optionalArgs['view']); + } + + if (isset($optionalArgs['languageCode'])) { + $request->setLanguageCode($optionalArgs['languageCode']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListNotifications', + $optionalArgs, + ListNotificationsResponse::class, + $request + ); + } +} diff --git a/AdvisoryNotifications/src/V1/GetNotificationRequest.php b/AdvisoryNotifications/src/V1/GetNotificationRequest.php new file mode 100644 index 000000000000..815cc03262c1 --- /dev/null +++ b/AdvisoryNotifications/src/V1/GetNotificationRequest.php @@ -0,0 +1,125 @@ +google.cloud.advisorynotifications.v1.GetNotificationRequest + */ +class GetNotificationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the notification to retrieve. + * Format: + * organizations/{organization}/locations/{location}/notifications/{notification}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + /** + * ISO code for requested localization language. If unset, will be + * interpereted as "en". If the requested language is valid, but not supported + * for this notification, English will be returned with an "Not applicable" + * LocalizationState. If the ISO code is invalid (i.e. not a real language), + * this RPC will throw an error. + * + * Generated from protobuf field string language_code = 5; + */ + private $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the notification to retrieve. + * Format: + * organizations/{organization}/locations/{location}/notifications/{notification}. + * @type string $language_code + * ISO code for requested localization language. If unset, will be + * interpereted as "en". If the requested language is valid, but not supported + * for this notification, English will be returned with an "Not applicable" + * LocalizationState. If the ISO code is invalid (i.e. not a real language), + * this RPC will throw an error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Advisorynotifications\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the notification to retrieve. + * Format: + * organizations/{organization}/locations/{location}/notifications/{notification}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the notification to retrieve. + * Format: + * organizations/{organization}/locations/{location}/notifications/{notification}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * ISO code for requested localization language. If unset, will be + * interpereted as "en". If the requested language is valid, but not supported + * for this notification, English will be returned with an "Not applicable" + * LocalizationState. If the ISO code is invalid (i.e. not a real language), + * this RPC will throw an error. + * + * Generated from protobuf field string language_code = 5; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * ISO code for requested localization language. If unset, will be + * interpereted as "en". If the requested language is valid, but not supported + * for this notification, English will be returned with an "Not applicable" + * LocalizationState. If the ISO code is invalid (i.e. not a real language), + * this RPC will throw an error. + * + * Generated from protobuf field string language_code = 5; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/AdvisoryNotifications/src/V1/ListNotificationsRequest.php b/AdvisoryNotifications/src/V1/ListNotificationsRequest.php new file mode 100644 index 000000000000..a3f55d3dcb84 --- /dev/null +++ b/AdvisoryNotifications/src/V1/ListNotificationsRequest.php @@ -0,0 +1,247 @@ +google.cloud.advisorynotifications.v1.ListNotificationsRequest + */ +class ListNotificationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of notifications. + * Must be of the form "organizations/{organization}/locations/{location}". + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * The maximum number of notifications to return. The service may return + * fewer than this value. If unspecified or equal to 0, at most 50 + * notifications will be returned. The maximum value is 50; values above 50 + * will be coerced to 50. + * + * Generated from protobuf field int32 page_size = 2; + */ + private $page_size = 0; + /** + * A page token returned from a previous request. + * When paginating, all other parameters provided in the request + * must match the call that returned the page token. + * + * Generated from protobuf field string page_token = 3; + */ + private $page_token = ''; + /** + * Specifies which parts of the notification resource should be returned + * in the response. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.NotificationView view = 4; + */ + private $view = 0; + /** + * ISO code for requested localization language. If unset, will be + * interpereted as "en". If the requested language is valid, but not supported + * for this notification, English will be returned with an "Not applicable" + * LocalizationState. If the ISO code is invalid (i.e. not a real language), + * this RPC will throw an error. + * + * Generated from protobuf field string language_code = 5; + */ + private $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of notifications. + * Must be of the form "organizations/{organization}/locations/{location}". + * @type int $page_size + * The maximum number of notifications to return. The service may return + * fewer than this value. If unspecified or equal to 0, at most 50 + * notifications will be returned. The maximum value is 50; values above 50 + * will be coerced to 50. + * @type string $page_token + * A page token returned from a previous request. + * When paginating, all other parameters provided in the request + * must match the call that returned the page token. + * @type int $view + * Specifies which parts of the notification resource should be returned + * in the response. + * @type string $language_code + * ISO code for requested localization language. If unset, will be + * interpereted as "en". If the requested language is valid, but not supported + * for this notification, English will be returned with an "Not applicable" + * LocalizationState. If the ISO code is invalid (i.e. not a real language), + * this RPC will throw an error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Advisorynotifications\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of notifications. + * Must be of the form "organizations/{organization}/locations/{location}". + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of notifications. + * Must be of the form "organizations/{organization}/locations/{location}". + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of notifications to return. The service may return + * fewer than this value. If unspecified or equal to 0, at most 50 + * notifications will be returned. The maximum value is 50; values above 50 + * will be coerced to 50. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of notifications to return. The service may return + * fewer than this value. If unspecified or equal to 0, at most 50 + * notifications will be returned. The maximum value is 50; values above 50 + * will be coerced to 50. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token returned from a previous request. + * When paginating, all other parameters provided in the request + * must match the call that returned the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token returned from a previous request. + * When paginating, all other parameters provided in the request + * must match the call that returned the page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Specifies which parts of the notification resource should be returned + * in the response. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.NotificationView view = 4; + * @return int + */ + public function getView() + { + return $this->view; + } + + /** + * Specifies which parts of the notification resource should be returned + * in the response. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.NotificationView view = 4; + * @param int $var + * @return $this + */ + public function setView($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AdvisoryNotifications\V1\NotificationView::class); + $this->view = $var; + + return $this; + } + + /** + * ISO code for requested localization language. If unset, will be + * interpereted as "en". If the requested language is valid, but not supported + * for this notification, English will be returned with an "Not applicable" + * LocalizationState. If the ISO code is invalid (i.e. not a real language), + * this RPC will throw an error. + * + * Generated from protobuf field string language_code = 5; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * ISO code for requested localization language. If unset, will be + * interpereted as "en". If the requested language is valid, but not supported + * for this notification, English will be returned with an "Not applicable" + * LocalizationState. If the ISO code is invalid (i.e. not a real language), + * this RPC will throw an error. + * + * Generated from protobuf field string language_code = 5; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/AdvisoryNotifications/src/V1/ListNotificationsResponse.php b/AdvisoryNotifications/src/V1/ListNotificationsResponse.php new file mode 100644 index 000000000000..dc1669c7fd8f --- /dev/null +++ b/AdvisoryNotifications/src/V1/ListNotificationsResponse.php @@ -0,0 +1,139 @@ +google.cloud.advisorynotifications.v1.ListNotificationsResponse + */ +class ListNotificationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of notifications under a given parent. + * + * Generated from protobuf field repeated .google.cloud.advisorynotifications.v1.Notification notifications = 1; + */ + private $notifications; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + private $next_page_token = ''; + /** + * Estimation of a total number of notifications. + * + * Generated from protobuf field int32 total_size = 3; + */ + private $total_size = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AdvisoryNotifications\V1\Notification>|\Google\Protobuf\Internal\RepeatedField $notifications + * List of notifications under a given parent. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type int $total_size + * Estimation of a total number of notifications. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Advisorynotifications\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * List of notifications under a given parent. + * + * Generated from protobuf field repeated .google.cloud.advisorynotifications.v1.Notification notifications = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNotifications() + { + return $this->notifications; + } + + /** + * List of notifications under a given parent. + * + * Generated from protobuf field repeated .google.cloud.advisorynotifications.v1.Notification notifications = 1; + * @param array<\Google\Cloud\AdvisoryNotifications\V1\Notification>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNotifications($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AdvisoryNotifications\V1\Notification::class); + $this->notifications = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Estimation of a total number of notifications. + * + * Generated from protobuf field int32 total_size = 3; + * @return int + */ + public function getTotalSize() + { + return $this->total_size; + } + + /** + * Estimation of a total number of notifications. + * + * Generated from protobuf field int32 total_size = 3; + * @param int $var + * @return $this + */ + public function setTotalSize($var) + { + GPBUtil::checkInt32($var); + $this->total_size = $var; + + return $this; + } + +} + diff --git a/AdvisoryNotifications/src/V1/LocalizationState.php b/AdvisoryNotifications/src/V1/LocalizationState.php new file mode 100644 index 000000000000..c4423106e08f --- /dev/null +++ b/AdvisoryNotifications/src/V1/LocalizationState.php @@ -0,0 +1,73 @@ +google.cloud.advisorynotifications.v1.LocalizationState + */ +class LocalizationState +{ + /** + * Not used. + * + * Generated from protobuf enum LOCALIZATION_STATE_UNSPECIFIED = 0; + */ + const LOCALIZATION_STATE_UNSPECIFIED = 0; + /** + * Localization is not applicable for requested language. This can happen + * when: + * - The requested language was not supported by Advisory Notifications at the + * time of localization (including notifications created before the + * localization feature was launched). + * - The requested language is English, so only the English text is returned. + * + * Generated from protobuf enum LOCALIZATION_STATE_NOT_APPLICABLE = 1; + */ + const LOCALIZATION_STATE_NOT_APPLICABLE = 1; + /** + * Localization for requested language is in progress, and not ready yet. + * + * Generated from protobuf enum LOCALIZATION_STATE_PENDING = 2; + */ + const LOCALIZATION_STATE_PENDING = 2; + /** + * Localization for requested language is completed. + * + * Generated from protobuf enum LOCALIZATION_STATE_COMPLETED = 3; + */ + const LOCALIZATION_STATE_COMPLETED = 3; + + private static $valueToName = [ + self::LOCALIZATION_STATE_UNSPECIFIED => 'LOCALIZATION_STATE_UNSPECIFIED', + self::LOCALIZATION_STATE_NOT_APPLICABLE => 'LOCALIZATION_STATE_NOT_APPLICABLE', + self::LOCALIZATION_STATE_PENDING => 'LOCALIZATION_STATE_PENDING', + self::LOCALIZATION_STATE_COMPLETED => 'LOCALIZATION_STATE_COMPLETED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/AdvisoryNotifications/src/V1/Message.php b/AdvisoryNotifications/src/V1/Message.php new file mode 100644 index 000000000000..c575defe4ba1 --- /dev/null +++ b/AdvisoryNotifications/src/V1/Message.php @@ -0,0 +1,199 @@ +google.cloud.advisorynotifications.v1.Message + */ +class Message extends \Google\Protobuf\Internal\Message +{ + /** + * The message content. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Message.Body body = 1; + */ + private $body = null; + /** + * The attachments to download. + * + * Generated from protobuf field repeated .google.cloud.advisorynotifications.v1.Attachment attachments = 2; + */ + private $attachments; + /** + * The Message creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + private $create_time = null; + /** + * Time when Message was localized + * + * Generated from protobuf field .google.protobuf.Timestamp localization_time = 4; + */ + private $localization_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AdvisoryNotifications\V1\Message\Body $body + * The message content. + * @type array<\Google\Cloud\AdvisoryNotifications\V1\Attachment>|\Google\Protobuf\Internal\RepeatedField $attachments + * The attachments to download. + * @type \Google\Protobuf\Timestamp $create_time + * The Message creation timestamp. + * @type \Google\Protobuf\Timestamp $localization_time + * Time when Message was localized + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Advisorynotifications\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The message content. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Message.Body body = 1; + * @return \Google\Cloud\AdvisoryNotifications\V1\Message\Body|null + */ + public function getBody() + { + return $this->body; + } + + public function hasBody() + { + return isset($this->body); + } + + public function clearBody() + { + unset($this->body); + } + + /** + * The message content. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Message.Body body = 1; + * @param \Google\Cloud\AdvisoryNotifications\V1\Message\Body $var + * @return $this + */ + public function setBody($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AdvisoryNotifications\V1\Message\Body::class); + $this->body = $var; + + return $this; + } + + /** + * The attachments to download. + * + * Generated from protobuf field repeated .google.cloud.advisorynotifications.v1.Attachment attachments = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttachments() + { + return $this->attachments; + } + + /** + * The attachments to download. + * + * Generated from protobuf field repeated .google.cloud.advisorynotifications.v1.Attachment attachments = 2; + * @param array<\Google\Cloud\AdvisoryNotifications\V1\Attachment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttachments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AdvisoryNotifications\V1\Attachment::class); + $this->attachments = $arr; + + return $this; + } + + /** + * The Message creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The Message creation timestamp. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Time when Message was localized + * + * Generated from protobuf field .google.protobuf.Timestamp localization_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLocalizationTime() + { + return $this->localization_time; + } + + public function hasLocalizationTime() + { + return isset($this->localization_time); + } + + public function clearLocalizationTime() + { + unset($this->localization_time); + } + + /** + * Time when Message was localized + * + * Generated from protobuf field .google.protobuf.Timestamp localization_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLocalizationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->localization_time = $var; + + return $this; + } + +} + diff --git a/AdvisoryNotifications/src/V1/Message/Body.php b/AdvisoryNotifications/src/V1/Message/Body.php new file mode 100644 index 000000000000..a5251c9918ba --- /dev/null +++ b/AdvisoryNotifications/src/V1/Message/Body.php @@ -0,0 +1,78 @@ +google.cloud.advisorynotifications.v1.Message.Body + */ +class Body extends \Google\Protobuf\Internal\Message +{ + /** + * The text content of the message body. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Text text = 1; + */ + private $text = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AdvisoryNotifications\V1\Text $text + * The text content of the message body. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Advisorynotifications\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The text content of the message body. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Text text = 1; + * @return \Google\Cloud\AdvisoryNotifications\V1\Text|null + */ + public function getText() + { + return $this->text; + } + + public function hasText() + { + return isset($this->text); + } + + public function clearText() + { + unset($this->text); + } + + /** + * The text content of the message body. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Text text = 1; + * @param \Google\Cloud\AdvisoryNotifications\V1\Text $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AdvisoryNotifications\V1\Text::class); + $this->text = $var; + + return $this; + } + +} + + diff --git a/AdvisoryNotifications/src/V1/Notification.php b/AdvisoryNotifications/src/V1/Notification.php new file mode 100644 index 000000000000..821bcbe1d0e9 --- /dev/null +++ b/AdvisoryNotifications/src/V1/Notification.php @@ -0,0 +1,198 @@ +google.cloud.advisorynotifications.v1.Notification + */ +class Notification extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the notification. + * Format: + * organizations/{organization}/locations/{location}/notifications/{notification}. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + /** + * The subject line of the notification. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Subject subject = 2; + */ + private $subject = null; + /** + * A list of messages in the notification. + * + * Generated from protobuf field repeated .google.cloud.advisorynotifications.v1.Message messages = 3; + */ + private $messages; + /** + * Output only. Time the notification was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $create_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the notification. + * Format: + * organizations/{organization}/locations/{location}/notifications/{notification}. + * @type \Google\Cloud\AdvisoryNotifications\V1\Subject $subject + * The subject line of the notification. + * @type array<\Google\Cloud\AdvisoryNotifications\V1\Message>|\Google\Protobuf\Internal\RepeatedField $messages + * A list of messages in the notification. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time the notification was created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Advisorynotifications\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the notification. + * Format: + * organizations/{organization}/locations/{location}/notifications/{notification}. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the notification. + * Format: + * organizations/{organization}/locations/{location}/notifications/{notification}. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The subject line of the notification. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Subject subject = 2; + * @return \Google\Cloud\AdvisoryNotifications\V1\Subject|null + */ + public function getSubject() + { + return $this->subject; + } + + public function hasSubject() + { + return isset($this->subject); + } + + public function clearSubject() + { + unset($this->subject); + } + + /** + * The subject line of the notification. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Subject subject = 2; + * @param \Google\Cloud\AdvisoryNotifications\V1\Subject $var + * @return $this + */ + public function setSubject($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AdvisoryNotifications\V1\Subject::class); + $this->subject = $var; + + return $this; + } + + /** + * A list of messages in the notification. + * + * Generated from protobuf field repeated .google.cloud.advisorynotifications.v1.Message messages = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMessages() + { + return $this->messages; + } + + /** + * A list of messages in the notification. + * + * Generated from protobuf field repeated .google.cloud.advisorynotifications.v1.Message messages = 3; + * @param array<\Google\Cloud\AdvisoryNotifications\V1\Message>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMessages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AdvisoryNotifications\V1\Message::class); + $this->messages = $arr; + + return $this; + } + + /** + * Output only. Time the notification was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Time the notification was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + +} + diff --git a/AdvisoryNotifications/src/V1/NotificationView.php b/AdvisoryNotifications/src/V1/NotificationView.php new file mode 100644 index 000000000000..32fceaafe375 --- /dev/null +++ b/AdvisoryNotifications/src/V1/NotificationView.php @@ -0,0 +1,63 @@ +google.cloud.advisorynotifications.v1.NotificationView + */ +class NotificationView +{ + /** + * Not specified, equivalent to BASIC. + * + * Generated from protobuf enum NOTIFICATION_VIEW_UNSPECIFIED = 0; + */ + const NOTIFICATION_VIEW_UNSPECIFIED = 0; + /** + * Server responses only include title, creation time and Notification ID. + * Note: for internal use responses also include the last update time, + * the latest message text and whether notification has attachments. + * + * Generated from protobuf enum BASIC = 1; + */ + const BASIC = 1; + /** + * Include everything. + * + * Generated from protobuf enum FULL = 2; + */ + const FULL = 2; + + private static $valueToName = [ + self::NOTIFICATION_VIEW_UNSPECIFIED => 'NOTIFICATION_VIEW_UNSPECIFIED', + self::BASIC => 'BASIC', + self::FULL => 'FULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/AdvisoryNotifications/src/V1/Subject.php b/AdvisoryNotifications/src/V1/Subject.php new file mode 100644 index 000000000000..56cfd7cb1b7b --- /dev/null +++ b/AdvisoryNotifications/src/V1/Subject.php @@ -0,0 +1,77 @@ +google.cloud.advisorynotifications.v1.Subject + */ +class Subject extends \Google\Protobuf\Internal\Message +{ + /** + * The text content. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Text text = 1; + */ + private $text = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\AdvisoryNotifications\V1\Text $text + * The text content. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Advisorynotifications\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The text content. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Text text = 1; + * @return \Google\Cloud\AdvisoryNotifications\V1\Text|null + */ + public function getText() + { + return $this->text; + } + + public function hasText() + { + return isset($this->text); + } + + public function clearText() + { + unset($this->text); + } + + /** + * The text content. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.Text text = 1; + * @param \Google\Cloud\AdvisoryNotifications\V1\Text $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AdvisoryNotifications\V1\Text::class); + $this->text = $var; + + return $this; + } + +} + diff --git a/AdvisoryNotifications/src/V1/Text.php b/AdvisoryNotifications/src/V1/Text.php new file mode 100644 index 000000000000..77c9a3d35bd3 --- /dev/null +++ b/AdvisoryNotifications/src/V1/Text.php @@ -0,0 +1,135 @@ +google.cloud.advisorynotifications.v1.Text + */ +class Text extends \Google\Protobuf\Internal\Message +{ + /** + * The English copy. + * + * Generated from protobuf field string en_text = 1; + */ + private $en_text = ''; + /** + * The requested localized copy (if applicable). + * + * Generated from protobuf field string localized_text = 2; + */ + private $localized_text = ''; + /** + * Status of the localization. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.LocalizationState localization_state = 3; + */ + private $localization_state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $en_text + * The English copy. + * @type string $localized_text + * The requested localized copy (if applicable). + * @type int $localization_state + * Status of the localization. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Advisorynotifications\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The English copy. + * + * Generated from protobuf field string en_text = 1; + * @return string + */ + public function getEnText() + { + return $this->en_text; + } + + /** + * The English copy. + * + * Generated from protobuf field string en_text = 1; + * @param string $var + * @return $this + */ + public function setEnText($var) + { + GPBUtil::checkString($var, True); + $this->en_text = $var; + + return $this; + } + + /** + * The requested localized copy (if applicable). + * + * Generated from protobuf field string localized_text = 2; + * @return string + */ + public function getLocalizedText() + { + return $this->localized_text; + } + + /** + * The requested localized copy (if applicable). + * + * Generated from protobuf field string localized_text = 2; + * @param string $var + * @return $this + */ + public function setLocalizedText($var) + { + GPBUtil::checkString($var, True); + $this->localized_text = $var; + + return $this; + } + + /** + * Status of the localization. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.LocalizationState localization_state = 3; + * @return int + */ + public function getLocalizationState() + { + return $this->localization_state; + } + + /** + * Status of the localization. + * + * Generated from protobuf field .google.cloud.advisorynotifications.v1.LocalizationState localization_state = 3; + * @param int $var + * @return $this + */ + public function setLocalizationState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AdvisoryNotifications\V1\LocalizationState::class); + $this->localization_state = $var; + + return $this; + } + +} + diff --git a/AdvisoryNotifications/src/V1/gapic_metadata.json b/AdvisoryNotifications/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..93abc9405f87 --- /dev/null +++ b/AdvisoryNotifications/src/V1/gapic_metadata.json @@ -0,0 +1,28 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.advisorynotifications.v1", + "libraryPackage": "Google\\Cloud\\AdvisoryNotifications\\V1", + "services": { + "AdvisoryNotificationsService": { + "clients": { + "grpc": { + "libraryClient": "AdvisoryNotificationsServiceGapicClient", + "rpcs": { + "GetNotification": { + "methods": [ + "getNotification" + ] + }, + "ListNotifications": { + "methods": [ + "listNotifications" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_client_config.json b/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_client_config.json new file mode 100644 index 000000000000..c2d18a61b95c --- /dev/null +++ b/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_client_config.json @@ -0,0 +1,44 @@ +{ + "interfaces": { + "google.cloud.advisorynotifications.v1.AdvisoryNotificationsService": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "GetNotification": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListNotifications": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_descriptor_config.php b/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_descriptor_config.php new file mode 100644 index 000000000000..cdcba49edaf0 --- /dev/null +++ b/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_descriptor_config.php @@ -0,0 +1,18 @@ + [ + 'google.cloud.advisorynotifications.v1.AdvisoryNotificationsService' => [ + 'ListNotifications' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getNotifications', + ], + ], + ], + ], +]; diff --git a/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_rest_client_config.php b/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_rest_client_config.php new file mode 100644 index 000000000000..2419459515bf --- /dev/null +++ b/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_rest_client_config.php @@ -0,0 +1,31 @@ + [ + 'google.cloud.advisorynotifications.v1.AdvisoryNotificationsService' => [ + 'GetNotification' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/notifications/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListNotifications' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/notifications', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/AdvisoryNotifications/tests/Unit/V1/AdvisoryNotificationsServiceClientTest.php b/AdvisoryNotifications/tests/Unit/V1/AdvisoryNotificationsServiceClientTest.php new file mode 100644 index 000000000000..03c50b525c25 --- /dev/null +++ b/AdvisoryNotifications/tests/Unit/V1/AdvisoryNotificationsServiceClientTest.php @@ -0,0 +1,192 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AdvisoryNotificationsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AdvisoryNotificationsServiceClient($options); + } + + /** @test */ + public function getNotificationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Notification(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->notificationName('[ORGANIZATION]', '[LOCATION]', '[NOTIFICATION]'); + $response = $gapicClient->getNotification($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.advisorynotifications.v1.AdvisoryNotificationsService/GetNotification', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNotificationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->notificationName('[ORGANIZATION]', '[LOCATION]', '[NOTIFICATION]'); + try { + $gapicClient->getNotification($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNotificationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $totalSize = 705419236; + $notificationsElement = new Notification(); + $notifications = [ + $notificationsElement, + ]; + $expectedResponse = new ListNotificationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTotalSize($totalSize); + $expectedResponse->setNotifications($notifications); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); + $response = $gapicClient->listNotifications($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getNotifications()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.advisorynotifications.v1.AdvisoryNotificationsService/ListNotifications', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNotificationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); + try { + $gapicClient->listNotifications($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/composer.json b/composer.json index 9502a2be138e..031826ba0030 100644 --- a/composer.json +++ b/composer.json @@ -79,7 +79,7 @@ "google/analytics-admin": "0.9.0", "google/analytics-data": "0.9.4", "google/cloud-access-approval": "1.0.3", - "google/cloud-advisorynotifications": "main", + "google/cloud-advisorynotifications": "0.0.0", "google/cloud-ai-platform": "0.12.0", "google/cloud-api-gateway": "1.0.3", "google/cloud-api-keys": "0.1.4", @@ -237,7 +237,7 @@ "GPBMetadata\\Google\\Apps\\Script\\Type\\": "GSuiteAddOns/external/metadata", "GPBMetadata\\Google\\Bigtable\\": "Bigtable/metadata", "GPBMetadata\\Google\\Cloud\\Accessapproval\\": "AccessApproval/metadata", - "GPBMetadata\\Google\\Cloud\\Advisorynotifications": "AdvisoryNotifications/metadata", + "GPBMetadata\\Google\\Cloud\\Advisorynotifications\\": "AdvisoryNotifications/metadata", "GPBMetadata\\Google\\Cloud\\Aiplatform\\": "AiPlatform/metadata", "GPBMetadata\\Google\\Cloud\\Apigateway\\": "ApiGateway/metadata", "GPBMetadata\\Google\\Cloud\\Apigeeconnect\\": "ApigeeConnect/metadata", @@ -383,7 +383,7 @@ ], "Google\\Cloud\\AIPlatform\\": "AiPlatform/src", "Google\\Cloud\\AccessApproval\\": "AccessApproval/src", - "Google\\Cloud\\AdvisoryNotifications": "AdvisoryNotifications/src", + "Google\\Cloud\\AdvisoryNotifications\\": "AdvisoryNotifications/src", "Google\\Cloud\\ApiGateway\\": "ApiGateway/src", "Google\\Cloud\\ApiKeys\\": "ApiKeys/src", "Google\\Cloud\\ApigeeConnect\\": "ApigeeConnect/src", @@ -608,4 +608,4 @@ ] } } -} \ No newline at end of file +} From c86dc73a2d44fc35f1b2f9a553b7a8478aa154b9 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 22 Feb 2023 10:26:30 -0800 Subject: [PATCH 3/3] add newline --- AdvisoryNotifications/.repo-metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AdvisoryNotifications/.repo-metadata.json b/AdvisoryNotifications/.repo-metadata.json index 4c81b06b99b0..01ce39a2927a 100644 --- a/AdvisoryNotifications/.repo-metadata.json +++ b/AdvisoryNotifications/.repo-metadata.json @@ -4,4 +4,4 @@ "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-advisorynotifications/latest", "library_type": "GAPIC_AUTO", "api_shortname": "advisorynotifications" -} \ No newline at end of file +}