From 6419f1f6e8d1af045be5c03ad8d8a3587854195d Mon Sep 17 00:00:00 2001 From: yash30201 <54198301+yash30201@users.noreply.github.com> Date: Thu, 16 Nov 2023 20:45:43 +0000 Subject: [PATCH 1/2] Introduce Redis Cluster --- RedisCluster/.OwlBot.yaml | 4 + RedisCluster/.gitattributes | 8 + RedisCluster/.github/pull_request_template.md | 24 + RedisCluster/.repo-metadata.json | 8 + RedisCluster/CONTRIBUTING.md | 10 + RedisCluster/LICENSE | 202 +++++ RedisCluster/README.md | 45 + RedisCluster/VERSION | 1 + RedisCluster/composer.json | 30 + .../metadata/V1/CloudRedisCluster.php | Bin 0 -> 5500 bytes RedisCluster/owlbot.py | 62 ++ RedisCluster/phpunit.xml.dist | 16 + .../create_cluster.php | 132 +++ .../delete_cluster.php | 83 ++ .../CloudRedisClusterClient/get_cluster.php | 73 ++ .../CloudRedisClusterClient/get_location.php | 57 ++ .../CloudRedisClusterClient/list_clusters.php | 86 ++ .../list_locations.php | 62 ++ .../update_cluster.php | 108 +++ RedisCluster/src/V1/AuthorizationMode.php | 61 ++ .../src/V1/Client/CloudRedisClusterClient.php | 500 ++++++++++ RedisCluster/src/V1/Cluster.php | 561 ++++++++++++ RedisCluster/src/V1/Cluster/State.php | 76 ++ RedisCluster/src/V1/Cluster/StateInfo.php | 76 ++ .../src/V1/Cluster/StateInfo/UpdateInfo.php | 122 +++ RedisCluster/src/V1/CreateClusterRequest.php | 238 +++++ RedisCluster/src/V1/DeleteClusterRequest.php | 125 +++ RedisCluster/src/V1/DiscoveryEndpoint.php | 153 ++++ RedisCluster/src/V1/GetClusterRequest.php | 91 ++ RedisCluster/src/V1/ListClustersRequest.php | 183 ++++ RedisCluster/src/V1/ListClustersResponse.php | 175 ++++ RedisCluster/src/V1/OperationMetadata.php | 307 +++++++ RedisCluster/src/V1/PscConfig.php | 73 ++ RedisCluster/src/V1/PscConnection.php | 227 +++++ RedisCluster/src/V1/TransitEncryptionMode.php | 61 ++ RedisCluster/src/V1/UpdateClusterRequest.php | 196 ++++ RedisCluster/src/V1/gapic_metadata.json | 53 ++ .../cloud_redis_cluster_client_config.json | 67 ++ .../cloud_redis_cluster_descriptor_config.php | 136 +++ ...cloud_redis_cluster_rest_client_config.php | 143 +++ .../V1/Client/CloudRedisClusterClientTest.php | 858 ++++++++++++++++++ composer.json | 7 +- 42 files changed, 5498 insertions(+), 2 deletions(-) create mode 100644 RedisCluster/.OwlBot.yaml create mode 100644 RedisCluster/.gitattributes create mode 100644 RedisCluster/.github/pull_request_template.md create mode 100644 RedisCluster/.repo-metadata.json create mode 100644 RedisCluster/CONTRIBUTING.md create mode 100644 RedisCluster/LICENSE create mode 100644 RedisCluster/README.md create mode 100644 RedisCluster/VERSION create mode 100644 RedisCluster/composer.json create mode 100644 RedisCluster/metadata/V1/CloudRedisCluster.php create mode 100644 RedisCluster/owlbot.py create mode 100644 RedisCluster/phpunit.xml.dist create mode 100644 RedisCluster/samples/V1/CloudRedisClusterClient/create_cluster.php create mode 100644 RedisCluster/samples/V1/CloudRedisClusterClient/delete_cluster.php create mode 100644 RedisCluster/samples/V1/CloudRedisClusterClient/get_cluster.php create mode 100644 RedisCluster/samples/V1/CloudRedisClusterClient/get_location.php create mode 100644 RedisCluster/samples/V1/CloudRedisClusterClient/list_clusters.php create mode 100644 RedisCluster/samples/V1/CloudRedisClusterClient/list_locations.php create mode 100644 RedisCluster/samples/V1/CloudRedisClusterClient/update_cluster.php create mode 100644 RedisCluster/src/V1/AuthorizationMode.php create mode 100644 RedisCluster/src/V1/Client/CloudRedisClusterClient.php create mode 100644 RedisCluster/src/V1/Cluster.php create mode 100644 RedisCluster/src/V1/Cluster/State.php create mode 100644 RedisCluster/src/V1/Cluster/StateInfo.php create mode 100644 RedisCluster/src/V1/Cluster/StateInfo/UpdateInfo.php create mode 100644 RedisCluster/src/V1/CreateClusterRequest.php create mode 100644 RedisCluster/src/V1/DeleteClusterRequest.php create mode 100644 RedisCluster/src/V1/DiscoveryEndpoint.php create mode 100644 RedisCluster/src/V1/GetClusterRequest.php create mode 100644 RedisCluster/src/V1/ListClustersRequest.php create mode 100644 RedisCluster/src/V1/ListClustersResponse.php create mode 100644 RedisCluster/src/V1/OperationMetadata.php create mode 100644 RedisCluster/src/V1/PscConfig.php create mode 100644 RedisCluster/src/V1/PscConnection.php create mode 100644 RedisCluster/src/V1/TransitEncryptionMode.php create mode 100644 RedisCluster/src/V1/UpdateClusterRequest.php create mode 100644 RedisCluster/src/V1/gapic_metadata.json create mode 100644 RedisCluster/src/V1/resources/cloud_redis_cluster_client_config.json create mode 100644 RedisCluster/src/V1/resources/cloud_redis_cluster_descriptor_config.php create mode 100644 RedisCluster/src/V1/resources/cloud_redis_cluster_rest_client_config.php create mode 100644 RedisCluster/tests/Unit/V1/Client/CloudRedisClusterClientTest.php diff --git a/RedisCluster/.OwlBot.yaml b/RedisCluster/.OwlBot.yaml new file mode 100644 index 000000000000..ce0cab323e33 --- /dev/null +++ b/RedisCluster/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/cloud/redis/cluster/(v1)/.*-php/(.*) + dest: /owl-bot-staging/RedisCluster/$1/$2 +api-name: RedisCluster diff --git a/RedisCluster/.gitattributes b/RedisCluster/.gitattributes new file mode 100644 index 000000000000..8119e7fcc1b2 --- /dev/null +++ b/RedisCluster/.gitattributes @@ -0,0 +1,8 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/.repo-metadata.json export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/RedisCluster/.github/pull_request_template.md b/RedisCluster/.github/pull_request_template.md new file mode 100644 index 000000000000..9192bb940722 --- /dev/null +++ b/RedisCluster/.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 `RedisCluster/src`, and tests in `RedisCluster/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/RedisCluster/.repo-metadata.json b/RedisCluster/.repo-metadata.json new file mode 100644 index 000000000000..b40ef061be66 --- /dev/null +++ b/RedisCluster/.repo-metadata.json @@ -0,0 +1,8 @@ +{ + "language": "php", + "distribution_name": "google/cloud-redis-cluster", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-redis-cluster/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "redis" +} diff --git a/RedisCluster/CONTRIBUTING.md b/RedisCluster/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/RedisCluster/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/RedisCluster/LICENSE b/RedisCluster/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/RedisCluster/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/RedisCluster/README.md b/RedisCluster/README.md new file mode 100644 index 000000000000..ef19da5b9994 --- /dev/null +++ b/RedisCluster/README.md @@ -0,0 +1,45 @@ +# Google Cloud Redis Cluster for PHP + +> Idiomatic PHP client for [Google Cloud Redis Cluster](https://cloud.google.com/memorystore/docs/cluster). + +[![Latest Stable Version](https://poser.pugx.org/google/cloud-redis-cluster/v/stable)](https://packagist.org/packages/google/cloud-redis-cluster) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-redis-cluster.svg)](https://packagist.org/packages/google/cloud-redis-cluster) + +* [API documentation](https://cloud.google.com/php/docs/reference/cloud-redis-cluster/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-redis-cluster +``` + +> 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](https://github.com/googleapis/google-cloud-php-redis-cluster/tree/main/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/memorystore/docs/cluster). diff --git a/RedisCluster/VERSION b/RedisCluster/VERSION new file mode 100644 index 000000000000..77d6f4ca2371 --- /dev/null +++ b/RedisCluster/VERSION @@ -0,0 +1 @@ +0.0.0 diff --git a/RedisCluster/composer.json b/RedisCluster/composer.json new file mode 100644 index 000000000000..015948280e2c --- /dev/null +++ b/RedisCluster/composer.json @@ -0,0 +1,30 @@ +{ + "name": "google/cloud-redis-cluster", + "description": "Google Cloud Redis Cluster Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Cloud\\Redis\\Cluster\\": "src", + "GPBMetadata\\Google\\Cloud\\Redis\\Cluster\\": "metadata" + } + }, + "extra": { + "component": { + "id": "cloud-redis-cluster", + "path": "RedisCluster", + "target": "googleapis/google-cloud-php-redis-cluster" + } + }, + "require": { + "php": ">=7.4", + "google/gax": "^1.25.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.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/RedisCluster/metadata/V1/CloudRedisCluster.php b/RedisCluster/metadata/V1/CloudRedisCluster.php new file mode 100644 index 0000000000000000000000000000000000000000..b3e9a631d3e2b4fc2391033dc13a6fc748c7e94d GIT binary patch literal 5500 zcmb_gOLH4p6^`Wib(GlFwVf!QNz#^6#Bn(i)}(4c9y7Eau|@fXtfY#Rn66gqTJDM5 z-E_BNoM4z@#fB9tHf;C-v!Ph=3$mdKW|hrA6|4LNR-F6jR?Cu+9q`7jd(S!dJil}9 z{p@q+$bltglUmf(ecDtSr;2|>700!G+pyb8qjPvjUB$4E9kWf{jG~nGl-<3WQZ7|$ zi^%HP9oL|FrDfZ#Hq9DsyVK0Nv}t99>N&bWmCgOa z4)yh>?(6kUF0Ni=;_6i<4!^m$`t!AQ0HdvYp2D~JuH1w-px~d=X|zp4@qFFKe-BJg zGcD6M^|tvMZQM`}^|nV*NJe78fRrz?s}{f=v` zbG?~>v+%1vzX^0nHOx!%jdf`bwymnSZtfr@~_78)THfZfgb6vOxwL0Yn94G zy0ntpw$*YwmStM4`kuqm_i9Flu~V(n%j+6)p})(=j{hO7+)X>W_woadt(jOYzJBZs z=H&_c_y?v;N441uv+pU^?{b(gEPEcppVIK@2No{5D;P7p;xoLo@tc=u=GEH5Z7ElG zOssyEOQPTx?ngEbS;A-ynK6>!PK3afX(6|kI`>Y+t{v1EY7c9=KZk@`lk0gJ% zMOg^tW&mN~rqJ#f10^W})k6wDh=w3Y|0M=!T=!9e2lFN0en~B^ z`DFT+FxPvq=OAEF@;#W4CVJ?&k;~hNUYoY)&wVX&6n7n&g+#}~5E(~$qfPPr5j6Y{ z7`JB*HlFiwdxF$_U1Mp$gO|uH1bzq!`wXOU!&emv{Yp9ZfF zjg^kf+kStBD98LcLVgINtW8p$rc=4q!2g4xC&=^60pk%8W?-a)X+FxFDOT>oO_w@2 zCFq)Acd#%gaBr0D#kQ{fCKe+<2BLTTBil7!^9t3D?IuknkZLOT-60yNQN|tQ<8sLh zxb3^T<(a-lEyF!^Sj!S}Z*aL!hRCf6?sCZ7m3;@sS&?b2M(So@$;eiWS#lQ=-jVJ$ zrJ+;7c6=+&whNGOJOekaL$l?jrg@z$57A`bGm4ynSr#W%n8gvzuwPO46m4rdHnt!y zHN#~M^HwR~EK5cap&!At)XSoLCi7BBE^k=;g>I5b$f^MF48l3^&`uHbKw@YRWg3e# zsvsX1weUU$lRUH75*i)=1eeUvJ&{`<;=De|838^_;?}i=uVMh*1#%yVue&%%YSAdN zlSW0RF2bB7=*?(Wk)u2X3iB|l^$RK7hWTK*hqW*U*O@)(8jNyV$vh+vYHF>lJ=;Cl zFBdCME9KJ6HF5(ciq*1OtL$#h#1Ie0)MBmjygUEzd0VFsq~su8K}0>A`sL0BDyDYy}J zWO@-M!(=9NFm6%*#CBgsI&Jz_knGD*MyfZPIH0iB6v7H(o@2Yd=yf9ZRBU)*eM!i> zQhAM}e;b3FJy}ieK~f5pdCt0cM30De9GHbFAH(#a?VcbO;MA8z79tM z!8YCX3P;fNS8+&&Gk0)jBj>k-BiA+Pm9zu0$JPh>8 z7m(~jd2$El)n~OWZD+4^zEW-h>26ij9gY3Mn(0|DRSwj`Hda=A<@Yg|9|-rP{t%XG zRdx5EQq#)2#p+M?Yn8p-L1#Vypgn1;q3w~yRf!$_DD=ur#nBtRqu7D!&xz*iklN& z(=vDuCx1m7d*;)jHug|o(#9`E7*<5OT+%ifhPUb}%%4}CzXXth7JZ8r^;`*uTGT^* zNsC@{i#|%-9cd;!U7w{Ukh9K}m8Ux<* NIHh=ZJA*TT{{XnP4a@)l literal 0 HcmV?d00001 diff --git a/RedisCluster/owlbot.py b/RedisCluster/owlbot.py new file mode 100644 index 000000000000..afc7918ee020 --- /dev/null +++ b/RedisCluster/owlbot.py @@ -0,0 +1,62 @@ +# 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}/RedisCluster").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", + ] +) + +# 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", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/BaseClient/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=80']) diff --git a/RedisCluster/phpunit.xml.dist b/RedisCluster/phpunit.xml.dist new file mode 100644 index 000000000000..2d6650afb035 --- /dev/null +++ b/RedisCluster/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + tests/Unit + + + + + src + + src/V[!a-zA-Z]* + + + + diff --git a/RedisCluster/samples/V1/CloudRedisClusterClient/create_cluster.php b/RedisCluster/samples/V1/CloudRedisClusterClient/create_cluster.php new file mode 100644 index 000000000000..af1f4d39a101 --- /dev/null +++ b/RedisCluster/samples/V1/CloudRedisClusterClient/create_cluster.php @@ -0,0 +1,132 @@ +setNetwork($clusterPscConfigsNetwork); + $clusterPscConfigs = [$pscConfig,]; + $cluster = (new Cluster()) + ->setName($clusterName) + ->setShardCount($clusterShardCount) + ->setPscConfigs($clusterPscConfigs); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClusterClient->createCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = CloudRedisClusterClient::locationName('[PROJECT]', '[LOCATION]'); + $clusterId = '[CLUSTER_ID]'; + $clusterName = '[NAME]'; + $clusterShardCount = 0; + $clusterPscConfigsNetwork = '[NETWORK]'; + + create_cluster_sample( + $formattedParent, + $clusterId, + $clusterName, + $clusterShardCount, + $clusterPscConfigsNetwork + ); +} +// [END redis_v1_generated_CloudRedisCluster_CreateCluster_sync] diff --git a/RedisCluster/samples/V1/CloudRedisClusterClient/delete_cluster.php b/RedisCluster/samples/V1/CloudRedisClusterClient/delete_cluster.php new file mode 100644 index 000000000000..6a56f5c812e3 --- /dev/null +++ b/RedisCluster/samples/V1/CloudRedisClusterClient/delete_cluster.php @@ -0,0 +1,83 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClusterClient->deleteCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = CloudRedisClusterClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + delete_cluster_sample($formattedName); +} +// [END redis_v1_generated_CloudRedisCluster_DeleteCluster_sync] diff --git a/RedisCluster/samples/V1/CloudRedisClusterClient/get_cluster.php b/RedisCluster/samples/V1/CloudRedisClusterClient/get_cluster.php new file mode 100644 index 000000000000..66208c761346 --- /dev/null +++ b/RedisCluster/samples/V1/CloudRedisClusterClient/get_cluster.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Cluster $response */ + $response = $cloudRedisClusterClient->getCluster($request); + 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 = CloudRedisClusterClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + + get_cluster_sample($formattedName); +} +// [END redis_v1_generated_CloudRedisCluster_GetCluster_sync] diff --git a/RedisCluster/samples/V1/CloudRedisClusterClient/get_location.php b/RedisCluster/samples/V1/CloudRedisClusterClient/get_location.php new file mode 100644 index 000000000000..49d2abe2ac00 --- /dev/null +++ b/RedisCluster/samples/V1/CloudRedisClusterClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END redis_v1_generated_CloudRedisCluster_GetLocation_sync] diff --git a/RedisCluster/samples/V1/CloudRedisClusterClient/list_clusters.php b/RedisCluster/samples/V1/CloudRedisClusterClient/list_clusters.php new file mode 100644 index 000000000000..77ad6ac17a23 --- /dev/null +++ b/RedisCluster/samples/V1/CloudRedisClusterClient/list_clusters.php @@ -0,0 +1,86 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $cloudRedisClusterClient->listClusters($request); + + /** @var Cluster $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 = CloudRedisClusterClient::locationName('[PROJECT]', '[LOCATION]'); + + list_clusters_sample($formattedParent); +} +// [END redis_v1_generated_CloudRedisCluster_ListClusters_sync] diff --git a/RedisCluster/samples/V1/CloudRedisClusterClient/list_locations.php b/RedisCluster/samples/V1/CloudRedisClusterClient/list_locations.php new file mode 100644 index 000000000000..2ddbc1fadd5c --- /dev/null +++ b/RedisCluster/samples/V1/CloudRedisClusterClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $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()); + } +} +// [END redis_v1_generated_CloudRedisCluster_ListLocations_sync] diff --git a/RedisCluster/samples/V1/CloudRedisClusterClient/update_cluster.php b/RedisCluster/samples/V1/CloudRedisClusterClient/update_cluster.php new file mode 100644 index 000000000000..d9aeb9014bd5 --- /dev/null +++ b/RedisCluster/samples/V1/CloudRedisClusterClient/update_cluster.php @@ -0,0 +1,108 @@ +setNetwork($clusterPscConfigsNetwork); + $clusterPscConfigs = [$pscConfig,]; + $cluster = (new Cluster()) + ->setName($clusterName) + ->setShardCount($clusterShardCount) + ->setPscConfigs($clusterPscConfigs); + $request = (new UpdateClusterRequest()) + ->setUpdateMask($updateMask) + ->setCluster($cluster); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudRedisClusterClient->updateCluster($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Cluster $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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 +{ + $clusterName = '[NAME]'; + $clusterShardCount = 0; + $clusterPscConfigsNetwork = '[NETWORK]'; + + update_cluster_sample($clusterName, $clusterShardCount, $clusterPscConfigsNetwork); +} +// [END redis_v1_generated_CloudRedisCluster_UpdateCluster_sync] diff --git a/RedisCluster/src/V1/AuthorizationMode.php b/RedisCluster/src/V1/AuthorizationMode.php new file mode 100644 index 000000000000..ff6184311f1f --- /dev/null +++ b/RedisCluster/src/V1/AuthorizationMode.php @@ -0,0 +1,61 @@ +google.cloud.redis.cluster.v1.AuthorizationMode + */ +class AuthorizationMode +{ + /** + * Not set. + * + * Generated from protobuf enum AUTH_MODE_UNSPECIFIED = 0; + */ + const AUTH_MODE_UNSPECIFIED = 0; + /** + * IAM basic authorization mode + * + * Generated from protobuf enum AUTH_MODE_IAM_AUTH = 1; + */ + const AUTH_MODE_IAM_AUTH = 1; + /** + * Authorization disabled mode + * + * Generated from protobuf enum AUTH_MODE_DISABLED = 2; + */ + const AUTH_MODE_DISABLED = 2; + + private static $valueToName = [ + self::AUTH_MODE_UNSPECIFIED => 'AUTH_MODE_UNSPECIFIED', + self::AUTH_MODE_IAM_AUTH => 'AUTH_MODE_IAM_AUTH', + self::AUTH_MODE_DISABLED => 'AUTH_MODE_DISABLED', + ]; + + 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/RedisCluster/src/V1/Client/CloudRedisClusterClient.php b/RedisCluster/src/V1/Client/CloudRedisClusterClient.php new file mode 100644 index 000000000000..0f62fec3d963 --- /dev/null +++ b/RedisCluster/src/V1/Client/CloudRedisClusterClient.php @@ -0,0 +1,500 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/cloud_redis_cluster_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_redis_cluster_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_redis_cluster_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/cloud_redis_cluster_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Formats a string containing the fully-qualified path to represent a cluster + * resource. + * + * @param string $project + * @param string $location + * @param string $cluster + * + * @return string The formatted cluster resource. + */ + public static function clusterName(string $project, string $location, string $cluster): string + { + return self::getPathTemplate('cluster')->render([ + 'project' => $project, + 'location' => $location, + 'cluster' => $cluster, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - cluster: projects/{project}/locations/{location}/clusters/{cluster} + * - location: projects/{project}/locations/{location} + * + * 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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * 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 'redis.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); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a Redis cluster based on the specified properties. + * The creation is executed asynchronously and callers may check the returned + * operation to track its progress. Once the operation is completed the Redis + * cluster will be fully functional. The completed longrunning.Operation will + * contain the new cluster object in the response field. + * + * The returned operation is automatically deleted after a few hours, so there + * is no need to call DeleteOperation. + * + * The async variant is {@see CloudRedisClusterClient::createClusterAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/create_cluster.php + * + * @param CreateClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createCluster(CreateClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateCluster', $request, $callOptions)->wait(); + } + + /** + * Deletes a specific Redis cluster. Cluster stops serving and data is + * deleted. + * + * The async variant is {@see CloudRedisClusterClient::deleteClusterAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/delete_cluster.php + * + * @param DeleteClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteCluster(DeleteClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteCluster', $request, $callOptions)->wait(); + } + + /** + * Gets the details of a specific Redis cluster. + * + * The async variant is {@see CloudRedisClusterClient::getClusterAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/get_cluster.php + * + * @param GetClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @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 Cluster + * + * @throws ApiException Thrown if the API call fails. + */ + public function getCluster(GetClusterRequest $request, array $callOptions = []): Cluster + { + return $this->startApiCall('GetCluster', $request, $callOptions)->wait(); + } + + /** + * Lists all Redis clusters owned by a project in either the specified + * location (region) or all locations. + * + * The location should have the following format: + * + * * `projects/{project_id}/locations/{location_id}` + * + * If `location_id` is specified as `-` (wildcard), then all regions + * available to the project are queried, and the results are aggregated. + * + * The async variant is {@see CloudRedisClusterClient::listClustersAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/list_clusters.php + * + * @param ListClustersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listClusters(ListClustersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListClusters', $request, $callOptions); + } + + /** + * Updates the metadata and configuration of a specific Redis cluster. + * + * Completed longrunning.Operation will contain the new cluster object + * in the response field. The returned operation is automatically deleted + * after a few hours, so there is no need to call DeleteOperation. + * + * The async variant is {@see CloudRedisClusterClient::updateClusterAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/update_cluster.php + * + * @param UpdateClusterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateCluster(UpdateClusterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateCluster', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see CloudRedisClusterClient::getLocationAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @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 Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see CloudRedisClusterClient::listLocationsAsync()} . + * + * @example samples/V1/CloudRedisClusterClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/RedisCluster/src/V1/Cluster.php b/RedisCluster/src/V1/Cluster.php new file mode 100644 index 000000000000..717d2175cd9b --- /dev/null +++ b/RedisCluster/src/V1/Cluster.php @@ -0,0 +1,561 @@ +google.cloud.redis.cluster.v1.Cluster + */ +class Cluster extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Unique name of the resource in this scope including project and + * location using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. The timestamp associated with the cluster creation request. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The current state of this cluster. + * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. System assigned, unique identifier for the cluster. + * + * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Optional. The number of replica nodes per shard. + * + * Generated from protobuf field optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $replica_count = null; + /** + * Optional. The authorization mode of the Redis cluster. + * If not provided, auth feature is disabled for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $authorization_mode = 0; + /** + * Optional. The in-transit encryption for the Redis cluster. + * If not provided, encryption is disabled for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $transit_encryption_mode = 0; + /** + * Output only. Redis memory size in GB for the entire cluster. + * + * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $size_gb = null; + /** + * Required. Number of shards for the Redis cluster. + * + * Generated from protobuf field optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $shard_count = null; + /** + * Required. Each PscConfig configures the consumer network where IPs will + * be designated to the cluster for client access through Private Service + * Connect Automation. Currently, only one PscConfig is supported. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + */ + private $psc_configs; + /** + * Output only. Endpoints created on each given network, for Redis clients to + * connect to the cluster. Currently only one discovery endpoint is supported. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $discovery_endpoints; + /** + * Output only. PSC connections for discovery of the cluster topology and + * accessing the cluster. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $psc_connections; + /** + * Output only. Additional information about the current state of the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Unique name of the resource in this scope including project and + * location using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp associated with the cluster creation request. + * @type int $state + * Output only. The current state of this cluster. + * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + * @type string $uid + * Output only. System assigned, unique identifier for the cluster. + * @type int $replica_count + * Optional. The number of replica nodes per shard. + * @type int $authorization_mode + * Optional. The authorization mode of the Redis cluster. + * If not provided, auth feature is disabled for the cluster. + * @type int $transit_encryption_mode + * Optional. The in-transit encryption for the Redis cluster. + * If not provided, encryption is disabled for the cluster. + * @type int $size_gb + * Output only. Redis memory size in GB for the entire cluster. + * @type int $shard_count + * Required. Number of shards for the Redis cluster. + * @type array<\Google\Cloud\Redis\Cluster\V1\PscConfig>|\Google\Protobuf\Internal\RepeatedField $psc_configs + * Required. Each PscConfig configures the consumer network where IPs will + * be designated to the cluster for client access through Private Service + * Connect Automation. Currently, only one PscConfig is supported. + * @type array<\Google\Cloud\Redis\Cluster\V1\DiscoveryEndpoint>|\Google\Protobuf\Internal\RepeatedField $discovery_endpoints + * Output only. Endpoints created on each given network, for Redis clients to + * connect to the cluster. Currently only one discovery endpoint is supported. + * @type array<\Google\Cloud\Redis\Cluster\V1\PscConnection>|\Google\Protobuf\Internal\RepeatedField $psc_connections + * Output only. PSC connections for discovery of the cluster topology and + * accessing the cluster. + * @type \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo $state_info + * Output only. Additional information about the current state of the cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Unique name of the resource in this scope including project and + * location using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Unique name of the resource in this scope including project and + * location using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The timestamp associated with the cluster creation request. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.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. The timestamp associated with the cluster creation request. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.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; + } + + /** + * Output only. The current state of this cluster. + * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of this cluster. + * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\Cluster\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. System assigned, unique identifier for the cluster. + * + * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. System assigned, unique identifier for the cluster. + * + * Generated from protobuf field string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Optional. The number of replica nodes per shard. + * + * Generated from protobuf field optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getReplicaCount() + { + return isset($this->replica_count) ? $this->replica_count : 0; + } + + public function hasReplicaCount() + { + return isset($this->replica_count); + } + + public function clearReplicaCount() + { + unset($this->replica_count); + } + + /** + * Optional. The number of replica nodes per shard. + * + * Generated from protobuf field optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setReplicaCount($var) + { + GPBUtil::checkInt32($var); + $this->replica_count = $var; + + return $this; + } + + /** + * Optional. The authorization mode of the Redis cluster. + * If not provided, auth feature is disabled for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAuthorizationMode() + { + return $this->authorization_mode; + } + + /** + * Optional. The authorization mode of the Redis cluster. + * If not provided, auth feature is disabled for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAuthorizationMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\AuthorizationMode::class); + $this->authorization_mode = $var; + + return $this; + } + + /** + * Optional. The in-transit encryption for the Redis cluster. + * If not provided, encryption is disabled for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getTransitEncryptionMode() + { + return $this->transit_encryption_mode; + } + + /** + * Optional. The in-transit encryption for the Redis cluster. + * If not provided, encryption is disabled for the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTransitEncryptionMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Redis\Cluster\V1\TransitEncryptionMode::class); + $this->transit_encryption_mode = $var; + + return $this; + } + + /** + * Output only. Redis memory size in GB for the entire cluster. + * + * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSizeGb() + { + return isset($this->size_gb) ? $this->size_gb : 0; + } + + public function hasSizeGb() + { + return isset($this->size_gb); + } + + public function clearSizeGb() + { + unset($this->size_gb); + } + + /** + * Output only. Redis memory size in GB for the entire cluster. + * + * Generated from protobuf field optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt32($var); + $this->size_gb = $var; + + return $this; + } + + /** + * Required. Number of shards for the Redis cluster. + * + * Generated from protobuf field optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getShardCount() + { + return isset($this->shard_count) ? $this->shard_count : 0; + } + + public function hasShardCount() + { + return isset($this->shard_count); + } + + public function clearShardCount() + { + unset($this->shard_count); + } + + /** + * Required. Number of shards for the Redis cluster. + * + * Generated from protobuf field optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setShardCount($var) + { + GPBUtil::checkInt32($var); + $this->shard_count = $var; + + return $this; + } + + /** + * Required. Each PscConfig configures the consumer network where IPs will + * be designated to the cluster for client access through Private Service + * Connect Automation. Currently, only one PscConfig is supported. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPscConfigs() + { + return $this->psc_configs; + } + + /** + * Required. Each PscConfig configures the consumer network where IPs will + * be designated to the cluster for client access through Private Service + * Connect Automation. Currently, only one PscConfig is supported. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Redis\Cluster\V1\PscConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPscConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\PscConfig::class); + $this->psc_configs = $arr; + + return $this; + } + + /** + * Output only. Endpoints created on each given network, for Redis clients to + * connect to the cluster. Currently only one discovery endpoint is supported. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDiscoveryEndpoints() + { + return $this->discovery_endpoints; + } + + /** + * Output only. Endpoints created on each given network, for Redis clients to + * connect to the cluster. Currently only one discovery endpoint is supported. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Redis\Cluster\V1\DiscoveryEndpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDiscoveryEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\DiscoveryEndpoint::class); + $this->discovery_endpoints = $arr; + + return $this; + } + + /** + * Output only. PSC connections for discovery of the cluster topology and + * accessing the cluster. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPscConnections() + { + return $this->psc_connections; + } + + /** + * Output only. PSC connections for discovery of the cluster topology and + * accessing the cluster. + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Redis\Cluster\V1\PscConnection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPscConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\PscConnection::class); + $this->psc_connections = $arr; + + return $this; + } + + /** + * Output only. Additional information about the current state of the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo|null + */ + public function getStateInfo() + { + return $this->state_info; + } + + public function hasStateInfo() + { + return isset($this->state_info); + } + + public function clearStateInfo() + { + unset($this->state_info); + } + + /** + * Output only. Additional information about the current state of the cluster. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo $var + * @return $this + */ + public function setStateInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo::class); + $this->state_info = $var; + + return $this; + } + +} + diff --git a/RedisCluster/src/V1/Cluster/State.php b/RedisCluster/src/V1/Cluster/State.php new file mode 100644 index 000000000000..6adb96300741 --- /dev/null +++ b/RedisCluster/src/V1/Cluster/State.php @@ -0,0 +1,76 @@ +google.cloud.redis.cluster.v1.Cluster.State + */ +class State +{ + /** + * Not set. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Redis cluster is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * Redis cluster has been created and is fully usable. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * Redis cluster configuration is being updated. + * + * Generated from protobuf enum UPDATING = 3; + */ + const UPDATING = 3; + /** + * Redis cluster is being deleted. + * + * Generated from protobuf enum DELETING = 4; + */ + const DELETING = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::UPDATING => 'UPDATING', + self::DELETING => 'DELETING', + ]; + + 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/RedisCluster/src/V1/Cluster/StateInfo.php b/RedisCluster/src/V1/Cluster/StateInfo.php new file mode 100644 index 000000000000..ad326e2f25a1 --- /dev/null +++ b/RedisCluster/src/V1/Cluster/StateInfo.php @@ -0,0 +1,76 @@ +google.cloud.redis.cluster.v1.Cluster.StateInfo + */ +class StateInfo extends \Google\Protobuf\Internal\Message +{ + protected $info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo $update_info + * Describes ongoing update on the cluster when cluster state is UPDATING. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Describes ongoing update on the cluster when cluster state is UPDATING. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + * @return \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo|null + */ + public function getUpdateInfo() + { + return $this->readOneof(1); + } + + public function hasUpdateInfo() + { + return $this->hasOneof(1); + } + + /** + * Describes ongoing update on the cluster when cluster state is UPDATING. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + * @param \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo $var + * @return $this + */ + public function setUpdateInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster\StateInfo\UpdateInfo::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getInfo() + { + return $this->whichOneof("info"); + } + +} + + diff --git a/RedisCluster/src/V1/Cluster/StateInfo/UpdateInfo.php b/RedisCluster/src/V1/Cluster/StateInfo/UpdateInfo.php new file mode 100644 index 000000000000..d774481d5efd --- /dev/null +++ b/RedisCluster/src/V1/Cluster/StateInfo/UpdateInfo.php @@ -0,0 +1,122 @@ +google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + */ +class UpdateInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Target number of shards for redis cluster + * + * Generated from protobuf field optional int32 target_shard_count = 1; + */ + protected $target_shard_count = null; + /** + * Target number of replica nodes per shard. + * + * Generated from protobuf field optional int32 target_replica_count = 2; + */ + protected $target_replica_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $target_shard_count + * Target number of shards for redis cluster + * @type int $target_replica_count + * Target number of replica nodes per shard. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Target number of shards for redis cluster + * + * Generated from protobuf field optional int32 target_shard_count = 1; + * @return int + */ + public function getTargetShardCount() + { + return isset($this->target_shard_count) ? $this->target_shard_count : 0; + } + + public function hasTargetShardCount() + { + return isset($this->target_shard_count); + } + + public function clearTargetShardCount() + { + unset($this->target_shard_count); + } + + /** + * Target number of shards for redis cluster + * + * Generated from protobuf field optional int32 target_shard_count = 1; + * @param int $var + * @return $this + */ + public function setTargetShardCount($var) + { + GPBUtil::checkInt32($var); + $this->target_shard_count = $var; + + return $this; + } + + /** + * Target number of replica nodes per shard. + * + * Generated from protobuf field optional int32 target_replica_count = 2; + * @return int + */ + public function getTargetReplicaCount() + { + return isset($this->target_replica_count) ? $this->target_replica_count : 0; + } + + public function hasTargetReplicaCount() + { + return isset($this->target_replica_count); + } + + public function clearTargetReplicaCount() + { + unset($this->target_replica_count); + } + + /** + * Target number of replica nodes per shard. + * + * Generated from protobuf field optional int32 target_replica_count = 2; + * @param int $var + * @return $this + */ + public function setTargetReplicaCount($var) + { + GPBUtil::checkInt32($var); + $this->target_replica_count = $var; + + return $this; + } + +} + + diff --git a/RedisCluster/src/V1/CreateClusterRequest.php b/RedisCluster/src/V1/CreateClusterRequest.php new file mode 100644 index 000000000000..a4ec433911f9 --- /dev/null +++ b/RedisCluster/src/V1/CreateClusterRequest.php @@ -0,0 +1,238 @@ +google.cloud.redis.cluster.v1.CreateClusterRequest + */ +class CreateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The logical name of the Redis cluster in the customer project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster_id = ''; + /** + * Required. The cluster that is to be created. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = null; + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 4; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClusterClient::locationName()} for help formatting this field. + * @param \Google\Cloud\Redis\Cluster\V1\Cluster $cluster Required. The cluster that is to be created. + * @param string $clusterId Required. The logical name of the Redis cluster in the customer project + * with the following restrictions: + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * @return \Google\Cloud\Redis\Cluster\V1\CreateClusterRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Redis\Cluster\V1\Cluster $cluster, string $clusterId): self + { + return (new self()) + ->setParent($parent) + ->setCluster($cluster) + ->setClusterId($clusterId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * @type string $cluster_id + * Required. The logical name of the Redis cluster in the customer project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * @type \Google\Cloud\Redis\Cluster\V1\Cluster $cluster + * Required. The cluster that is to be created. + * @type string $request_id + * Idempotent request UUID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * 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 resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * 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; + } + + /** + * Required. The logical name of the Redis cluster in the customer project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getClusterId() + { + return $this->cluster_id; + } + + /** + * Required. The logical name of the Redis cluster in the customer project + * with the following restrictions: + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * + * Generated from protobuf field string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setClusterId($var) + { + GPBUtil::checkString($var, True); + $this->cluster_id = $var; + + return $this; + } + + /** + * Required. The cluster that is to be created. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Redis\Cluster\V1\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. The cluster that is to be created. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Redis\Cluster\V1\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster::class); + $this->cluster = $var; + + return $this; + } + + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 4; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 4; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/RedisCluster/src/V1/DeleteClusterRequest.php b/RedisCluster/src/V1/DeleteClusterRequest.php new file mode 100644 index 000000000000..c8eb432dad73 --- /dev/null +++ b/RedisCluster/src/V1/DeleteClusterRequest.php @@ -0,0 +1,125 @@ +google.cloud.redis.cluster.v1.DeleteClusterRequest + */ +class DeleteClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 2; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClusterClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\Redis\Cluster\V1\DeleteClusterRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * @type string $request_id + * Idempotent request UUID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * + * 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. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * + * 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; + } + + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 2; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 2; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/RedisCluster/src/V1/DiscoveryEndpoint.php b/RedisCluster/src/V1/DiscoveryEndpoint.php new file mode 100644 index 000000000000..fc450c18b9c3 --- /dev/null +++ b/RedisCluster/src/V1/DiscoveryEndpoint.php @@ -0,0 +1,153 @@ +google.cloud.redis.cluster.v1.DiscoveryEndpoint + */ +class DiscoveryEndpoint extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Address of the exposed Redis endpoint used by clients to + * connect to the service. The address could be either IP or hostname. + * + * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $address = ''; + /** + * Output only. The port number of the exposed Redis endpoint. + * + * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $port = 0; + /** + * Output only. Customer configuration for where the endpoint is created and + * accessed from. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $psc_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * Output only. Address of the exposed Redis endpoint used by clients to + * connect to the service. The address could be either IP or hostname. + * @type int $port + * Output only. The port number of the exposed Redis endpoint. + * @type \Google\Cloud\Redis\Cluster\V1\PscConfig $psc_config + * Output only. Customer configuration for where the endpoint is created and + * accessed from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Address of the exposed Redis endpoint used by clients to + * connect to the service. The address could be either IP or hostname. + * + * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Output only. Address of the exposed Redis endpoint used by clients to + * connect to the service. The address could be either IP or hostname. + * + * Generated from protobuf field string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * Output only. The port number of the exposed Redis endpoint. + * + * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getPort() + { + return $this->port; + } + + /** + * Output only. The port number of the exposed Redis endpoint. + * + * Generated from protobuf field int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Output only. Customer configuration for where the endpoint is created and + * accessed from. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Redis\Cluster\V1\PscConfig|null + */ + public function getPscConfig() + { + return $this->psc_config; + } + + public function hasPscConfig() + { + return isset($this->psc_config); + } + + public function clearPscConfig() + { + unset($this->psc_config); + } + + /** + * Output only. Customer configuration for where the endpoint is created and + * accessed from. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Redis\Cluster\V1\PscConfig $var + * @return $this + */ + public function setPscConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\PscConfig::class); + $this->psc_config = $var; + + return $this; + } + +} + diff --git a/RedisCluster/src/V1/GetClusterRequest.php b/RedisCluster/src/V1/GetClusterRequest.php new file mode 100644 index 000000000000..e457cb50362a --- /dev/null +++ b/RedisCluster/src/V1/GetClusterRequest.php @@ -0,0 +1,91 @@ +google.cloud.redis.cluster.v1.GetClusterRequest + */ +class GetClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClusterClient::clusterName()} for help formatting this field. + * + * @return \Google\Cloud\Redis\Cluster\V1\GetClusterRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * + * 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. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + * where `location_id` refers to a GCP region. + * + * 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; + } + +} + diff --git a/RedisCluster/src/V1/ListClustersRequest.php b/RedisCluster/src/V1/ListClustersRequest.php new file mode 100644 index 000000000000..7d993d799de4 --- /dev/null +++ b/RedisCluster/src/V1/ListClustersRequest.php @@ -0,0 +1,183 @@ +google.cloud.redis.cluster.v1.ListClustersRequest + */ +class ListClustersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] + * to determine if there are more clusters left to be queried. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The `next_page_token` value returned from a previous + * [ListClusters][CloudRedis.ListClusters] request, if any. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. Please see + * {@see CloudRedisClusterClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Redis\Cluster\V1\ListClustersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * @type int $page_size + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] + * to determine if there are more clusters left to be queried. + * @type string $page_token + * The `next_page_token` value returned from a previous + * [ListClusters][CloudRedis.ListClusters] request, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * 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 resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` + * where `location_id` refers to a GCP region. + * + * 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 items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] + * to determine if there are more clusters left to be queried. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return. + * If not specified, a default value of 1000 will be used by the service. + * Regardless of the page_size value, the response may include a partial list + * and a caller should only rely on response's + * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] + * to determine if there are more clusters left to be queried. + * + * 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; + } + + /** + * The `next_page_token` value returned from a previous + * [ListClusters][CloudRedis.ListClusters] request, if any. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The `next_page_token` value returned from a previous + * [ListClusters][CloudRedis.ListClusters] request, if any. + * + * 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; + } + +} + diff --git a/RedisCluster/src/V1/ListClustersResponse.php b/RedisCluster/src/V1/ListClustersResponse.php new file mode 100644 index 000000000000..efc059d380c2 --- /dev/null +++ b/RedisCluster/src/V1/ListClustersResponse.php @@ -0,0 +1,175 @@ +google.cloud.redis.cluster.v1.ListClustersResponse + */ +class ListClustersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of Redis clusters in the project in the specified location, + * or across all locations. + * If the `location_id` in the parent field of the request is "-", all regions + * available to the project are queried, and the results aggregated. + * If in such an aggregated query a location is unavailable, a placeholder + * Redis entry is included in the response with the `name` field set to a + * value of the form + * `projects/{project_id}/locations/{location_id}/clusters/`- and the + * `status` field set to ERROR and `status_message` field set to "location not + * available for ListClusters". + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + private $clusters; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Redis\Cluster\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $clusters + * A list of Redis clusters in the project in the specified location, + * or across all locations. + * If the `location_id` in the parent field of the request is "-", all regions + * available to the project are queried, and the results aggregated. + * If in such an aggregated query a location is unavailable, a placeholder + * Redis entry is included in the response with the `name` field set to a + * value of the form + * `projects/{project_id}/locations/{location_id}/clusters/`- and the + * `status` field set to ERROR and `status_message` field set to "location not + * available for ListClusters". + * @type string $next_page_token + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * A list of Redis clusters in the project in the specified location, + * or across all locations. + * If the `location_id` in the parent field of the request is "-", all regions + * available to the project are queried, and the results aggregated. + * If in such an aggregated query a location is unavailable, a placeholder + * Redis entry is included in the response with the `name` field set to a + * value of the form + * `projects/{project_id}/locations/{location_id}/clusters/`- and the + * `status` field set to ERROR and `status_message` field set to "location not + * available for ListClusters". + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClusters() + { + return $this->clusters; + } + + /** + * A list of Redis clusters in the project in the specified location, + * or across all locations. + * If the `location_id` in the parent field of the request is "-", all regions + * available to the project are queried, and the results aggregated. + * If in such an aggregated query a location is unavailable, a placeholder + * Redis entry is included in the response with the `name` field set to a + * value of the form + * `projects/{project_id}/locations/{location_id}/clusters/`- and the + * `status` field set to ERROR and `status_message` field set to "location not + * available for ListClusters". + * + * Generated from protobuf field repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + * @param array<\Google\Cloud\Redis\Cluster\V1\Cluster>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClusters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\Cluster\V1\Cluster::class); + $this->clusters = $arr; + + return $this; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + * + * 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; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/RedisCluster/src/V1/OperationMetadata.php b/RedisCluster/src/V1/OperationMetadata.php new file mode 100644 index 000000000000..9abe7ef897ee --- /dev/null +++ b/RedisCluster/src/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.redis.cluster.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.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. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.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; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/RedisCluster/src/V1/PscConfig.php b/RedisCluster/src/V1/PscConfig.php new file mode 100644 index 000000000000..ee2fe513f106 --- /dev/null +++ b/RedisCluster/src/V1/PscConfig.php @@ -0,0 +1,73 @@ +google.cloud.redis.cluster.v1.PscConfig + */ +class PscConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The network where the IP address of the discovery endpoint will + * be reserved, in the form of + * projects/{network_project}/global/networks/{network_id}. + * + * Generated from protobuf field string network = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Required. The network where the IP address of the discovery endpoint will + * be reserved, in the form of + * projects/{network_project}/global/networks/{network_id}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. The network where the IP address of the discovery endpoint will + * be reserved, in the form of + * projects/{network_project}/global/networks/{network_id}. + * + * Generated from protobuf field string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Required. The network where the IP address of the discovery endpoint will + * be reserved, in the form of + * projects/{network_project}/global/networks/{network_id}. + * + * Generated from protobuf field string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + +} + diff --git a/RedisCluster/src/V1/PscConnection.php b/RedisCluster/src/V1/PscConnection.php new file mode 100644 index 000000000000..318d11f69361 --- /dev/null +++ b/RedisCluster/src/V1/PscConnection.php @@ -0,0 +1,227 @@ +google.cloud.redis.cluster.v1.PscConnection + */ +class PscConnection extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The PSC connection id of the forwarding rule connected to the + * service attachment. + * + * Generated from protobuf field string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $psc_connection_id = ''; + /** + * Output only. The IP allocated on the consumer network for the PSC + * forwarding rule. + * + * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $address = ''; + /** + * Output only. The URI of the consumer side forwarding rule. + * Example: + * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. + * + * Generated from protobuf field string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $forwarding_rule = ''; + /** + * Output only. The consumer project_id where the forwarding rule is created + * from. + * + * Generated from protobuf field string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $project_id = ''; + /** + * The consumer network where the IP address resides, in the form of + * projects/{project_id}/global/networks/{network_id}. + * + * Generated from protobuf field string network = 5; + */ + protected $network = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $psc_connection_id + * Output only. The PSC connection id of the forwarding rule connected to the + * service attachment. + * @type string $address + * Output only. The IP allocated on the consumer network for the PSC + * forwarding rule. + * @type string $forwarding_rule + * Output only. The URI of the consumer side forwarding rule. + * Example: + * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. + * @type string $project_id + * Output only. The consumer project_id where the forwarding rule is created + * from. + * @type string $network + * The consumer network where the IP address resides, in the form of + * projects/{project_id}/global/networks/{network_id}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The PSC connection id of the forwarding rule connected to the + * service attachment. + * + * Generated from protobuf field string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPscConnectionId() + { + return $this->psc_connection_id; + } + + /** + * Output only. The PSC connection id of the forwarding rule connected to the + * service attachment. + * + * Generated from protobuf field string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPscConnectionId($var) + { + GPBUtil::checkString($var, True); + $this->psc_connection_id = $var; + + return $this; + } + + /** + * Output only. The IP allocated on the consumer network for the PSC + * forwarding rule. + * + * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Output only. The IP allocated on the consumer network for the PSC + * forwarding rule. + * + * Generated from protobuf field string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * Output only. The URI of the consumer side forwarding rule. + * Example: + * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. + * + * Generated from protobuf field string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getForwardingRule() + { + return $this->forwarding_rule; + } + + /** + * Output only. The URI of the consumer side forwarding rule. + * Example: + * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. + * + * Generated from protobuf field string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->forwarding_rule = $var; + + return $this; + } + + /** + * Output only. The consumer project_id where the forwarding rule is created + * from. + * + * Generated from protobuf field string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Output only. The consumer project_id where the forwarding rule is created + * from. + * + * Generated from protobuf field string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The consumer network where the IP address resides, in the form of + * projects/{project_id}/global/networks/{network_id}. + * + * Generated from protobuf field string network = 5; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * The consumer network where the IP address resides, in the form of + * projects/{project_id}/global/networks/{network_id}. + * + * Generated from protobuf field string network = 5; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + +} + diff --git a/RedisCluster/src/V1/TransitEncryptionMode.php b/RedisCluster/src/V1/TransitEncryptionMode.php new file mode 100644 index 000000000000..70baeb4693b6 --- /dev/null +++ b/RedisCluster/src/V1/TransitEncryptionMode.php @@ -0,0 +1,61 @@ +google.cloud.redis.cluster.v1.TransitEncryptionMode + */ +class TransitEncryptionMode +{ + /** + * In-transit encryption not set. + * + * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + */ + const TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + /** + * In-transit encryption disabled. + * + * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_DISABLED = 1; + */ + const TRANSIT_ENCRYPTION_MODE_DISABLED = 1; + /** + * Use server managed encryption for in-transit encryption. + * + * Generated from protobuf enum TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; + */ + const TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; + + private static $valueToName = [ + self::TRANSIT_ENCRYPTION_MODE_UNSPECIFIED => 'TRANSIT_ENCRYPTION_MODE_UNSPECIFIED', + self::TRANSIT_ENCRYPTION_MODE_DISABLED => 'TRANSIT_ENCRYPTION_MODE_DISABLED', + self::TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION => 'TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION', + ]; + + 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/RedisCluster/src/V1/UpdateClusterRequest.php b/RedisCluster/src/V1/UpdateClusterRequest.php new file mode 100644 index 000000000000..0f67d0fe41e9 --- /dev/null +++ b/RedisCluster/src/V1/UpdateClusterRequest.php @@ -0,0 +1,196 @@ +google.cloud.redis.cluster.v1.UpdateClusterRequest + */ +class UpdateClusterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: + * * `size_gb` + * * `replica_count` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. Update description. + * Only fields specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = null; + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 3; + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\Redis\Cluster\V1\Cluster $cluster Required. Update description. + * Only fields specified in update_mask are updated. + * @param \Google\Protobuf\FieldMask $updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: + * + * * `size_gb` + * * `replica_count` + * + * @return \Google\Cloud\Redis\Cluster\V1\UpdateClusterRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Redis\Cluster\V1\Cluster $cluster, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setCluster($cluster) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: + * * `size_gb` + * * `replica_count` + * @type \Google\Cloud\Redis\Cluster\V1\Cluster $cluster + * Required. Update description. + * Only fields specified in update_mask are updated. + * @type string $request_id + * Idempotent request UUID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce(); + parent::__construct($data); + } + + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: + * * `size_gb` + * * `replica_count` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these + * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: + * * `size_gb` + * * `replica_count` + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. Update description. + * Only fields specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Redis\Cluster\V1\Cluster|null + */ + public function getCluster() + { + return $this->cluster; + } + + public function hasCluster() + { + return isset($this->cluster); + } + + public function clearCluster() + { + unset($this->cluster); + } + + /** + * Required. Update description. + * Only fields specified in update_mask are updated. + * + * Generated from protobuf field .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Redis\Cluster\V1\Cluster $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster::class); + $this->cluster = $var; + + return $this; + } + + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 3; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Idempotent request UUID. + * + * Generated from protobuf field string request_id = 3; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/RedisCluster/src/V1/gapic_metadata.json b/RedisCluster/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..441f3d1baf21 --- /dev/null +++ b/RedisCluster/src/V1/gapic_metadata.json @@ -0,0 +1,53 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.redis.cluster.v1", + "libraryPackage": "Google\\Cloud\\Redis\\Cluster\\V1", + "services": { + "CloudRedisCluster": { + "clients": { + "grpc": { + "libraryClient": "CloudRedisClusterGapicClient", + "rpcs": { + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "ListClusters": { + "methods": [ + "listClusters" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/RedisCluster/src/V1/resources/cloud_redis_cluster_client_config.json b/RedisCluster/src/V1/resources/cloud_redis_cluster_client_config.json new file mode 100644 index 000000000000..574207f2c4ac --- /dev/null +++ b/RedisCluster/src/V1/resources/cloud_redis_cluster_client_config.json @@ -0,0 +1,67 @@ +{ + "interfaces": { + "google.cloud.redis.cluster.v1.CloudRedisCluster": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [] + }, + "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 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateCluster": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteCluster": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetCluster": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListClusters": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateCluster": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/RedisCluster/src/V1/resources/cloud_redis_cluster_descriptor_config.php b/RedisCluster/src/V1/resources/cloud_redis_cluster_descriptor_config.php new file mode 100644 index 000000000000..a52d9fcb9920 --- /dev/null +++ b/RedisCluster/src/V1/resources/cloud_redis_cluster_descriptor_config.php @@ -0,0 +1,136 @@ + [ + 'google.cloud.redis.cluster.v1.CloudRedisCluster' => [ + 'CreateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Redis\Cluster\V1\Cluster', + 'metadataReturnType' => '\Google\Protobuf\Any', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Protobuf\Any', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateCluster' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Redis\Cluster\V1\Cluster', + 'metadataReturnType' => '\Google\Protobuf\Any', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'cluster.name', + 'fieldAccessors' => [ + 'getCluster', + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Redis\Cluster\V1\Cluster', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListClusters' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getClusters', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Redis\Cluster\V1\ListClustersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'cluster' => 'projects/{project}/locations/{location}/clusters/{cluster}', + 'location' => 'projects/{project}/locations/{location}', + ], + ], + ], +]; diff --git a/RedisCluster/src/V1/resources/cloud_redis_cluster_rest_client_config.php b/RedisCluster/src/V1/resources/cloud_redis_cluster_rest_client_config.php new file mode 100644 index 000000000000..ac5087079537 --- /dev/null +++ b/RedisCluster/src/V1/resources/cloud_redis_cluster_rest_client_config.php @@ -0,0 +1,143 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.redis.cluster.v1.CloudRedisCluster' => [ + 'CreateCluster' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', + 'body' => 'cluster', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'cluster_id', + ], + ], + 'DeleteCluster' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetCluster' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/clusters/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListClusters' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/clusters', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateCluster' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{cluster.name=projects/*/locations/*/clusters/*}', + 'body' => 'cluster', + 'placeholders' => [ + 'cluster.name' => [ + 'getters' => [ + 'getCluster', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/RedisCluster/tests/Unit/V1/Client/CloudRedisClusterClientTest.php b/RedisCluster/tests/Unit/V1/Client/CloudRedisClusterClientTest.php new file mode 100644 index 000000000000..a91699595389 --- /dev/null +++ b/RedisCluster/tests/Unit/V1/Client/CloudRedisClusterClientTest.php @@ -0,0 +1,858 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return CloudRedisClusterClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CloudRedisClusterClient($options); + } + + /** @test */ + public function createClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $replicaCount = 564075208; + $sizeGb = 2105542105; + $shardCount = 495377042; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setSizeGb($sizeGb); + $expectedResponse->setShardCount($shardCount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterShardCount = 1450084715; + $cluster->setShardCount($clusterShardCount); + $clusterPscConfigs = []; + $cluster->setPscConfigs($clusterPscConfigs); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/CreateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterShardCount = 1450084715; + $cluster->setShardCount($clusterShardCount); + $clusterPscConfigs = []; + $cluster->setPscConfigs($clusterPscConfigs); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new DeleteClusterRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/DeleteCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new DeleteClusterRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteClusterTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getClusterTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $replicaCount = 564075208; + $sizeGb = 2105542105; + $shardCount = 495377042; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setSizeGb($sizeGb); + $expectedResponse->setShardCount($shardCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterRequest()) + ->setName($formattedName); + $response = $gapicClient->getCluster($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/GetCluster', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getClusterExceptionTest() + { + $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->clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]'); + $request = (new GetClusterRequest()) + ->setName($formattedName); + try { + $gapicClient->getCluster($request); + // 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 listClustersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $clustersElement = new Cluster(); + $clusters = [ + $clustersElement, + ]; + $expectedResponse = new ListClustersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setClusters($clusters); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListClustersRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listClusters($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getClusters()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/ListClusters', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listClustersExceptionTest() + { + $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('[PROJECT]', '[LOCATION]'); + $request = (new ListClustersRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listClusters($request); + // 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 updateClusterTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $replicaCount = 564075208; + $sizeGb = 2105542105; + $shardCount = 495377042; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setSizeGb($sizeGb); + $expectedResponse->setShardCount($shardCount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterShardCount = 1450084715; + $cluster->setShardCount($clusterShardCount); + $clusterPscConfigs = []; + $cluster->setPscConfigs($clusterPscConfigs); + $request = (new UpdateClusterRequest()) + ->setUpdateMask($updateMask) + ->setCluster($cluster); + $response = $gapicClient->updateCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/UpdateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateClusterExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterShardCount = 1450084715; + $cluster->setShardCount($clusterShardCount); + $clusterPscConfigs = []; + $cluster->setPscConfigs($clusterPscConfigs); + $request = (new UpdateClusterRequest()) + ->setUpdateMask($updateMask) + ->setCluster($cluster); + $response = $gapicClient->updateCluster($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateClusterTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $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); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // 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 listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $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); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // 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 createClusterAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createClusterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $replicaCount = 564075208; + $sizeGb = 2105542105; + $shardCount = 495377042; + $expectedResponse = new Cluster(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setReplicaCount($replicaCount); + $expectedResponse->setSizeGb($sizeGb); + $expectedResponse->setShardCount($shardCount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createClusterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $clusterId = 'clusterId240280960'; + $cluster = new Cluster(); + $clusterName = 'clusterName-1141738587'; + $cluster->setName($clusterName); + $clusterShardCount = 1450084715; + $cluster->setShardCount($clusterShardCount); + $clusterPscConfigs = []; + $cluster->setPscConfigs($clusterPscConfigs); + $request = (new CreateClusterRequest()) + ->setParent($formattedParent) + ->setClusterId($clusterId) + ->setCluster($cluster); + $response = $gapicClient->createClusterAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.redis.cluster.v1.CloudRedisCluster/CreateCluster', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getClusterId(); + $this->assertProtobufEquals($clusterId, $actualValue); + $actualValue = $actualApiRequestObject->getCluster(); + $this->assertProtobufEquals($cluster, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createClusterTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/composer.json b/composer.json index c4fa93630341..d0ebdbf61ce9 100644 --- a/composer.json +++ b/composer.json @@ -186,6 +186,7 @@ "google/cloud-recommendations-ai": "0.6.4", "google/cloud-recommender": "1.9.1", "google/cloud-redis": "1.8.4", + "google/cloud-redis-cluster": "0.0.0", "google/cloud-resource-manager": "0.7.2", "google/cloud-resource-settings": "1.1.3", "google/cloud-retail": "1.4.2", @@ -226,9 +227,9 @@ "google/cloud-workflows": "0.4.2", "google/grafeas": "0.8.3", "google/longrunning": "0.2.6", + "google/shopping-common-protos": "0.2.0", "google/shopping-merchant-inventories": "0.1.1", - "google/shopping-merchant-reports": "0.3.0", - "google/shopping-common-protos": "0.2.0" + "google/shopping-merchant-reports": "0.3.0" }, "suggest": { "opis/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.", @@ -341,6 +342,7 @@ "GPBMetadata\\Google\\Cloud\\Recommendationengine\\": "RecommendationEngine/metadata", "GPBMetadata\\Google\\Cloud\\Recommender\\": "Recommender/metadata", "GPBMetadata\\Google\\Cloud\\Redis\\": "Redis/metadata", + "GPBMetadata\\Google\\Cloud\\Redis\\Cluster\\": "RedisCluster/metadata", "GPBMetadata\\Google\\Cloud\\Resourcemanager\\": "ResourceManager/metadata", "GPBMetadata\\Google\\Cloud\\Resourcesettings\\": "ResourceSettings/metadata", "GPBMetadata\\Google\\Cloud\\Retail\\": "Retail/metadata", @@ -525,6 +527,7 @@ "Google\\Cloud\\RecommendationEngine\\": "RecommendationEngine/src", "Google\\Cloud\\Recommender\\": "Recommender/src", "Google\\Cloud\\Redis\\": "Redis/src", + "Google\\Cloud\\Redis\\Cluster\\": "RedisCluster/src", "Google\\Cloud\\ResourceManager\\": "ResourceManager/src", "Google\\Cloud\\ResourceSettings\\": "ResourceSettings/src", "Google\\Cloud\\Retail\\": "Retail/src", From bbf1adaf6d78b61dffc0f19671b83effb08eda6a Mon Sep 17 00:00:00 2001 From: Yash Sahu <54198301+yash30201@users.noreply.github.com> Date: Fri, 17 Nov 2023 22:49:52 +0530 Subject: [PATCH 2/2] Update documentation link Co-authored-by: Brent Shaffer --- RedisCluster/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RedisCluster/README.md b/RedisCluster/README.md index ef19da5b9994..f79bb2d6ddc0 100644 --- a/RedisCluster/README.md +++ b/RedisCluster/README.md @@ -42,4 +42,4 @@ This component is considered alpha. As such, it is still a work-in-progress and ### Next Steps -1. Understand the [official documentation](https://cloud.google.com/memorystore/docs/cluster). +1. Understand the [official documentation](https://cloud.google.com/memorystore/docs/cluster/apis).