diff --git a/Deploy/.gitattributes b/Deploy/.gitattributes new file mode 100644 index 000000000000..d43b60862bcf --- /dev/null +++ b/Deploy/.gitattributes @@ -0,0 +1,3 @@ +/*.xml.dist export-ignore +/tests export-ignore +/.github export-ignore diff --git a/Deploy/.github/pull_request_template.md b/Deploy/.github/pull_request_template.md new file mode 100644 index 000000000000..b0d405fc95e2 --- /dev/null +++ b/Deploy/.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 `Deploy/src`, and tests in `Deploy/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/Deploy/.repo-metadata.json b/Deploy/.repo-metadata.json new file mode 100644 index 000000000000..25df30e18820 --- /dev/null +++ b/Deploy/.repo-metadata.json @@ -0,0 +1,5 @@ +{ + "distribution_name": "google/cloud-deploy", + "release_level": "beta", + "client_documentation": "http://googleapis.github.io/google-cloud-php/#/docs/cloud-deploy/latest" +} diff --git a/Deploy/CODE_OF_CONDUCT.md b/Deploy/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..c3727800341a --- /dev/null +++ b/Deploy/CODE_OF_CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) \ No newline at end of file diff --git a/Deploy/CONTRIBUTING.md b/Deploy/CONTRIBUTING.md new file mode 100644 index 000000000000..f8be6dae8e22 --- /dev/null +++ b/Deploy/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/master/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/Deploy/LICENSE b/Deploy/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/Deploy/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/Deploy/README.md b/Deploy/README.md new file mode 100644 index 000000000000..422f77da7dd5 --- /dev/null +++ b/Deploy/README.md @@ -0,0 +1,45 @@ +# Google Cloud Deploy for PHP + +> Idiomatic PHP client for [Google Cloud Deploy](https://cloud.google.com/deploy). + +[![Latest Stable Version](https://poser.pugx.org/google/cloud-deploy/v/stable)](https://packagist.org/packages/google/cloud-deploy) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-deploy.svg)](https://packagist.org/packages/google/cloud-deploy) + +* [API documentation](http://googleapis.github.io/google-cloud-php/#/docs/cloud-deploy/latest/deploy/readme) + +**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 to install just this component: + +```sh +$ composer require google/cloud-deploy +``` + +Or to install the entire suite of components at once: + +```sh +$ composer require google/cloud +``` + +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/master/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Version + +This component is considered beta. As such, it should be expected to be mostly +stable and we're working towards a release candidate. We will address issues +and requests with a higher priority. + +### Next Steps + +1. Understand the [official documentation](https://cloud.google.com/deploy/docs). diff --git a/Deploy/SECURITY.md b/Deploy/SECURITY.md new file mode 100644 index 000000000000..8b58ae9c01ae --- /dev/null +++ b/Deploy/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/Deploy/VERSION b/Deploy/VERSION new file mode 100644 index 000000000000..77d6f4ca2371 --- /dev/null +++ b/Deploy/VERSION @@ -0,0 +1 @@ +0.0.0 diff --git a/Deploy/composer.json b/Deploy/composer.json new file mode 100644 index 000000000000..8e368f776aff --- /dev/null +++ b/Deploy/composer.json @@ -0,0 +1,37 @@ +{ + "name": "google/cloud-deploy", + "description": "Google Cloud Deploy Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Cloud\\Deploy\\": "src", + "GPBMetadata\\Google\\Cloud\\Deploy\\": "metadata" + } + }, + "autoload-dev": { + "psr-4": { + "Google\\Cloud\\Deploy\\Tests\\": "tests" + } + }, + "extra": { + "component": { + "id": "cloud-deploy", + "path": "Deploy", + "entry": null, + "target": "googleapis/google-cloud-php-deploy.git" + } + }, + "require": { + "google/gax": "^1.9.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8|^5.0", + "google/cloud-core": "^1.31", + "phpdocumentor/reflection": "^3.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/Deploy/metadata/V1/CloudDeploy.php b/Deploy/metadata/V1/CloudDeploy.php new file mode 100644 index 000000000000..82a11e367a55 Binary files /dev/null and b/Deploy/metadata/V1/CloudDeploy.php differ diff --git a/Deploy/phpunit-snippets.xml.dist b/Deploy/phpunit-snippets.xml.dist new file mode 100644 index 000000000000..b92fd83e3c1b --- /dev/null +++ b/Deploy/phpunit-snippets.xml.dist @@ -0,0 +1,19 @@ + + + + + tests/Snippet + + + + + src + + src/V[!a-zA-Z]* + + + + diff --git a/Deploy/phpunit-system.xml.dist b/Deploy/phpunit-system.xml.dist new file mode 100644 index 000000000000..6ad255f35f5a --- /dev/null +++ b/Deploy/phpunit-system.xml.dist @@ -0,0 +1,16 @@ + + + + + tests/System + + + + + src + + src/V[!a-zA-Z]* + + + + diff --git a/Deploy/phpunit.xml.dist b/Deploy/phpunit.xml.dist new file mode 100644 index 000000000000..1c2b8f6b56d2 --- /dev/null +++ b/Deploy/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + tests/Unit + + + + + src + + src/V[!a-zA-Z]* + + + + diff --git a/Deploy/src/V1/ApproveRolloutRequest.php b/Deploy/src/V1/ApproveRolloutRequest.php new file mode 100644 index 000000000000..d5aff8e5c3a9 --- /dev/null +++ b/Deploy/src/V1/ApproveRolloutRequest.php @@ -0,0 +1,109 @@ +google.cloud.deploy.v1.ApproveRolloutRequest + */ +class ApproveRolloutRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + /** + * Required. True = approve; false = reject + * + * Generated from protobuf field bool approved = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $approved = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + * @type bool $approved + * Required. True = approve; false = reject + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + * + * 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. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + * + * 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; + } + + /** + * Required. True = approve; false = reject + * + * Generated from protobuf field bool approved = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getApproved() + { + return $this->approved; + } + + /** + * Required. True = approve; false = reject + * + * Generated from protobuf field bool approved = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setApproved($var) + { + GPBUtil::checkBool($var); + $this->approved = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/ApproveRolloutResponse.php b/Deploy/src/V1/ApproveRolloutResponse.php new file mode 100644 index 000000000000..afac40c7146c --- /dev/null +++ b/Deploy/src/V1/ApproveRolloutResponse.php @@ -0,0 +1,33 @@ +google.cloud.deploy.v1.ApproveRolloutResponse + */ +class ApproveRolloutResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + +} + diff --git a/Deploy/src/V1/BuildArtifact.php b/Deploy/src/V1/BuildArtifact.php new file mode 100644 index 000000000000..9bccc560123b --- /dev/null +++ b/Deploy/src/V1/BuildArtifact.php @@ -0,0 +1,109 @@ +google.cloud.deploy.v1.BuildArtifact + */ +class BuildArtifact extends \Google\Protobuf\Internal\Message +{ + /** + * Image name in Skaffold configuration. + * + * Generated from protobuf field string image = 3; + */ + private $image = ''; + /** + * Image tag to use. This will generally be the full path to an image, such + * as "gcr.io/my-project/busybox:1.2.3" or + * "gcr.io/my-project/busybox@sha256:abc123". + * + * Generated from protobuf field string tag = 2; + */ + private $tag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image + * Image name in Skaffold configuration. + * @type string $tag + * Image tag to use. This will generally be the full path to an image, such + * as "gcr.io/my-project/busybox:1.2.3" or + * "gcr.io/my-project/busybox@sha256:abc123". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Image name in Skaffold configuration. + * + * Generated from protobuf field string image = 3; + * @return string + */ + public function getImage() + { + return $this->image; + } + + /** + * Image name in Skaffold configuration. + * + * Generated from protobuf field string image = 3; + * @param string $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkString($var, True); + $this->image = $var; + + return $this; + } + + /** + * Image tag to use. This will generally be the full path to an image, such + * as "gcr.io/my-project/busybox:1.2.3" or + * "gcr.io/my-project/busybox@sha256:abc123". + * + * Generated from protobuf field string tag = 2; + * @return string + */ + public function getTag() + { + return $this->tag; + } + + /** + * Image tag to use. This will generally be the full path to an image, such + * as "gcr.io/my-project/busybox:1.2.3" or + * "gcr.io/my-project/busybox@sha256:abc123". + * + * Generated from protobuf field string tag = 2; + * @param string $var + * @return $this + */ + public function setTag($var) + { + GPBUtil::checkString($var, True); + $this->tag = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/CloudDeployClient.php b/Deploy/src/V1/CloudDeployClient.php new file mode 100644 index 000000000000..1576aa5e786a --- /dev/null +++ b/Deploy/src/V1/CloudDeployClient.php @@ -0,0 +1,34 @@ +_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListDeliveryPipelines', + $argument, + ['\Google\Cloud\Deploy\V1\ListDeliveryPipelinesResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets details of a single DeliveryPipeline. + * @param \Google\Cloud\Deploy\V1\GetDeliveryPipelineRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetDeliveryPipeline(\Google\Cloud\Deploy\V1\GetDeliveryPipelineRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetDeliveryPipeline', + $argument, + ['\Google\Cloud\Deploy\V1\DeliveryPipeline', 'decode'], + $metadata, $options); + } + + /** + * Creates a new DeliveryPipeline in a given project and location. + * @param \Google\Cloud\Deploy\V1\CreateDeliveryPipelineRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateDeliveryPipeline(\Google\Cloud\Deploy\V1\CreateDeliveryPipelineRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CreateDeliveryPipeline', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Updates the parameters of a single DeliveryPipeline. + * @param \Google\Cloud\Deploy\V1\UpdateDeliveryPipelineRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateDeliveryPipeline(\Google\Cloud\Deploy\V1\UpdateDeliveryPipelineRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/UpdateDeliveryPipeline', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Deletes a single DeliveryPipeline. + * @param \Google\Cloud\Deploy\V1\DeleteDeliveryPipelineRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteDeliveryPipeline(\Google\Cloud\Deploy\V1\DeleteDeliveryPipelineRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/DeleteDeliveryPipeline', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Lists Targets in a given project and location. + * @param \Google\Cloud\Deploy\V1\ListTargetsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListTargets(\Google\Cloud\Deploy\V1\ListTargetsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListTargets', + $argument, + ['\Google\Cloud\Deploy\V1\ListTargetsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets details of a single Target. + * @param \Google\Cloud\Deploy\V1\GetTargetRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetTarget(\Google\Cloud\Deploy\V1\GetTargetRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetTarget', + $argument, + ['\Google\Cloud\Deploy\V1\Target', 'decode'], + $metadata, $options); + } + + /** + * Creates a new Target in a given project and location. + * @param \Google\Cloud\Deploy\V1\CreateTargetRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateTarget(\Google\Cloud\Deploy\V1\CreateTargetRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CreateTarget', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Updates the parameters of a single Target. + * @param \Google\Cloud\Deploy\V1\UpdateTargetRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateTarget(\Google\Cloud\Deploy\V1\UpdateTargetRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/UpdateTarget', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Deletes a single Target. + * @param \Google\Cloud\Deploy\V1\DeleteTargetRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteTarget(\Google\Cloud\Deploy\V1\DeleteTargetRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/DeleteTarget', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Lists Releases in a given project and location. + * @param \Google\Cloud\Deploy\V1\ListReleasesRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListReleases(\Google\Cloud\Deploy\V1\ListReleasesRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListReleases', + $argument, + ['\Google\Cloud\Deploy\V1\ListReleasesResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets details of a single Release. + * @param \Google\Cloud\Deploy\V1\GetReleaseRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetRelease(\Google\Cloud\Deploy\V1\GetReleaseRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetRelease', + $argument, + ['\Google\Cloud\Deploy\V1\Release', 'decode'], + $metadata, $options); + } + + /** + * Creates a new Release in a given project and location. + * @param \Google\Cloud\Deploy\V1\CreateReleaseRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateRelease(\Google\Cloud\Deploy\V1\CreateReleaseRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CreateRelease', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Approves a Rollout. + * @param \Google\Cloud\Deploy\V1\ApproveRolloutRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ApproveRollout(\Google\Cloud\Deploy\V1\ApproveRolloutRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ApproveRollout', + $argument, + ['\Google\Cloud\Deploy\V1\ApproveRolloutResponse', 'decode'], + $metadata, $options); + } + + /** + * Lists Rollouts in a given project and location. + * @param \Google\Cloud\Deploy\V1\ListRolloutsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListRollouts(\Google\Cloud\Deploy\V1\ListRolloutsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/ListRollouts', + $argument, + ['\Google\Cloud\Deploy\V1\ListRolloutsResponse', 'decode'], + $metadata, $options); + } + + /** + * Gets details of a single Rollout. + * @param \Google\Cloud\Deploy\V1\GetRolloutRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetRollout(\Google\Cloud\Deploy\V1\GetRolloutRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetRollout', + $argument, + ['\Google\Cloud\Deploy\V1\Rollout', 'decode'], + $metadata, $options); + } + + /** + * Creates a new Rollout in a given project and location. + * @param \Google\Cloud\Deploy\V1\CreateRolloutRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateRollout(\Google\Cloud\Deploy\V1\CreateRolloutRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/CreateRollout', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Gets the configuration for a location. + * @param \Google\Cloud\Deploy\V1\GetConfigRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetConfig(\Google\Cloud\Deploy\V1\GetConfigRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.deploy.v1.CloudDeploy/GetConfig', + $argument, + ['\Google\Cloud\Deploy\V1\Config', 'decode'], + $metadata, $options); + } + +} diff --git a/Deploy/src/V1/Config.php b/Deploy/src/V1/Config.php new file mode 100644 index 000000000000..e4653b170df2 --- /dev/null +++ b/Deploy/src/V1/Config.php @@ -0,0 +1,139 @@ +google.cloud.deploy.v1.Config + */ +class Config extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the configuration. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + /** + * Output only. All supported versions of Skaffold. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.SkaffoldVersion supported_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $supported_versions; + /** + * Output only. Default Skaffold version that is assigned when a Release is created without + * specifying a Skaffold version. + * + * Generated from protobuf field string default_skaffold_version = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $default_skaffold_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the configuration. + * @type \Google\Cloud\Deploy\V1\SkaffoldVersion[]|\Google\Protobuf\Internal\RepeatedField $supported_versions + * Output only. All supported versions of Skaffold. + * @type string $default_skaffold_version + * Output only. Default Skaffold version that is assigned when a Release is created without + * specifying a Skaffold version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Name of the configuration. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the configuration. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. All supported versions of Skaffold. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.SkaffoldVersion supported_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedVersions() + { + return $this->supported_versions; + } + + /** + * Output only. All supported versions of Skaffold. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.SkaffoldVersion supported_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\SkaffoldVersion[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\SkaffoldVersion::class); + $this->supported_versions = $arr; + + return $this; + } + + /** + * Output only. Default Skaffold version that is assigned when a Release is created without + * specifying a Skaffold version. + * + * Generated from protobuf field string default_skaffold_version = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDefaultSkaffoldVersion() + { + return $this->default_skaffold_version; + } + + /** + * Output only. Default Skaffold version that is assigned when a Release is created without + * specifying a Skaffold version. + * + * Generated from protobuf field string default_skaffold_version = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDefaultSkaffoldVersion($var) + { + GPBUtil::checkString($var, True); + $this->default_skaffold_version = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/CreateDeliveryPipelineRequest.php b/Deploy/src/V1/CreateDeliveryPipelineRequest.php new file mode 100644 index 000000000000..d62617b76699 --- /dev/null +++ b/Deploy/src/V1/CreateDeliveryPipelineRequest.php @@ -0,0 +1,261 @@ +google.cloud.deploy.v1.CreateDeliveryPipelineRequest + */ +class CreateDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent collection in which the `DeliveryPipeline` should be created. + * Format should be projects/{project_id}/locations/{location_name}. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. ID of the `DeliveryPipeline`. + * + * Generated from protobuf field string delivery_pipeline_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $delivery_pipeline_id = ''; + /** + * Required. The `DeliveryPipeline` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $delivery_pipeline = null; + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_id = ''; + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent collection in which the `DeliveryPipeline` should be created. + * Format should be projects/{project_id}/locations/{location_name}. + * @type string $delivery_pipeline_id + * Required. ID of the `DeliveryPipeline`. + * @type \Google\Cloud\Deploy\V1\DeliveryPipeline $delivery_pipeline + * Required. The `DeliveryPipeline` to create. + * @type string $request_id + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent collection in which the `DeliveryPipeline` should be created. + * Format should be projects/{project_id}/locations/{location_name}. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent collection in which the `DeliveryPipeline` should be created. + * Format should be projects/{project_id}/locations/{location_name}. + * + * 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. ID of the `DeliveryPipeline`. + * + * Generated from protobuf field string delivery_pipeline_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDeliveryPipelineId() + { + return $this->delivery_pipeline_id; + } + + /** + * Required. ID of the `DeliveryPipeline`. + * + * Generated from protobuf field string delivery_pipeline_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDeliveryPipelineId($var) + { + GPBUtil::checkString($var, True); + $this->delivery_pipeline_id = $var; + + return $this; + } + + /** + * Required. The `DeliveryPipeline` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Deploy\V1\DeliveryPipeline|null + */ + public function getDeliveryPipeline() + { + return $this->delivery_pipeline; + } + + public function hasDeliveryPipeline() + { + return isset($this->delivery_pipeline); + } + + public function clearDeliveryPipeline() + { + unset($this->delivery_pipeline); + } + + /** + * Required. The `DeliveryPipeline` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Deploy\V1\DeliveryPipeline $var + * @return $this + */ + public function setDeliveryPipeline($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\DeliveryPipeline::class); + $this->delivery_pipeline = $var; + + return $this; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/CreateReleaseRequest.php b/Deploy/src/V1/CreateReleaseRequest.php new file mode 100644 index 000000000000..ca3c1b492886 --- /dev/null +++ b/Deploy/src/V1/CreateReleaseRequest.php @@ -0,0 +1,265 @@ +google.cloud.deploy.v1.CreateReleaseRequest + */ +class CreateReleaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent collection in which the `Release` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. ID of the `Release`. + * + * Generated from protobuf field string release_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $release_id = ''; + /** + * Required. The `Release` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Release release = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $release = null; + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_id = ''; + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent collection in which the `Release` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @type string $release_id + * Required. ID of the `Release`. + * @type \Google\Cloud\Deploy\V1\Release $release + * Required. The `Release` to create. + * @type string $request_id + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent collection in which the `Release` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent collection in which the `Release` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * + * 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. ID of the `Release`. + * + * Generated from protobuf field string release_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getReleaseId() + { + return $this->release_id; + } + + /** + * Required. ID of the `Release`. + * + * Generated from protobuf field string release_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setReleaseId($var) + { + GPBUtil::checkString($var, True); + $this->release_id = $var; + + return $this; + } + + /** + * Required. The `Release` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Release release = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Deploy\V1\Release|null + */ + public function getRelease() + { + return $this->release; + } + + public function hasRelease() + { + return isset($this->release); + } + + public function clearRelease() + { + unset($this->release); + } + + /** + * Required. The `Release` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Release release = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Deploy\V1\Release $var + * @return $this + */ + public function setRelease($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\Release::class); + $this->release = $var; + + return $this; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/CreateRolloutRequest.php b/Deploy/src/V1/CreateRolloutRequest.php new file mode 100644 index 000000000000..53fa31dfc17b --- /dev/null +++ b/Deploy/src/V1/CreateRolloutRequest.php @@ -0,0 +1,265 @@ +google.cloud.deploy.v1.CreateRolloutRequest + */ +class CreateRolloutRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent collection in which the `Rollout` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. ID of the `Rollout`. + * + * Generated from protobuf field string rollout_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $rollout_id = ''; + /** + * Required. The `Rollout` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollout rollout = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $rollout = null; + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_id = ''; + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent collection in which the `Rollout` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * @type string $rollout_id + * Required. ID of the `Rollout`. + * @type \Google\Cloud\Deploy\V1\Rollout $rollout + * Required. The `Rollout` to create. + * @type string $request_id + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent collection in which the `Rollout` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent collection in which the `Rollout` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * + * 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. ID of the `Rollout`. + * + * Generated from protobuf field string rollout_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRolloutId() + { + return $this->rollout_id; + } + + /** + * Required. ID of the `Rollout`. + * + * Generated from protobuf field string rollout_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRolloutId($var) + { + GPBUtil::checkString($var, True); + $this->rollout_id = $var; + + return $this; + } + + /** + * Required. The `Rollout` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollout rollout = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Deploy\V1\Rollout|null + */ + public function getRollout() + { + return $this->rollout; + } + + public function hasRollout() + { + return isset($this->rollout); + } + + public function clearRollout() + { + unset($this->rollout); + } + + /** + * Required. The `Rollout` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollout rollout = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Deploy\V1\Rollout $var + * @return $this + */ + public function setRollout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\Rollout::class); + $this->rollout = $var; + + return $this; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/CreateTargetRequest.php b/Deploy/src/V1/CreateTargetRequest.php new file mode 100644 index 000000000000..de7429a774bd --- /dev/null +++ b/Deploy/src/V1/CreateTargetRequest.php @@ -0,0 +1,265 @@ +google.cloud.deploy.v1.CreateTargetRequest + */ +class CreateTargetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent collection in which the `Target` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. ID of the `Target`. + * + * Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $target_id = ''; + /** + * Required. The `Target` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Target target = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $target = null; + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_id = ''; + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent collection in which the `Target` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}. + * @type string $target_id + * Required. ID of the `Target`. + * @type \Google\Cloud\Deploy\V1\Target $target + * Required. The `Target` to create. + * @type string $request_id + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent collection in which the `Target` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent collection in which the `Target` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}. + * + * 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. ID of the `Target`. + * + * Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetId() + { + return $this->target_id; + } + + /** + * Required. ID of the `Target`. + * + * Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetId($var) + { + GPBUtil::checkString($var, True); + $this->target_id = $var; + + return $this; + } + + /** + * Required. The `Target` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Target target = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Deploy\V1\Target|null + */ + public function getTarget() + { + return $this->target; + } + + public function hasTarget() + { + return isset($this->target); + } + + public function clearTarget() + { + unset($this->target); + } + + /** + * Required. The `Target` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Target target = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Deploy\V1\Target $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\Target::class); + $this->target = $var; + + return $this; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/DefaultPool.php b/Deploy/src/V1/DefaultPool.php new file mode 100644 index 000000000000..829c6ae738fc --- /dev/null +++ b/Deploy/src/V1/DefaultPool.php @@ -0,0 +1,121 @@ +google.cloud.deploy.v1.DefaultPool + */ +class DefaultPool extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Google service account to use for execution. If unspecified, + * the project execution service account + * (-compute@developer.gserviceaccount.com) will be used. + * + * Generated from protobuf field string service_account = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $service_account = ''; + /** + * Optional. Cloud Storage location where execution outputs should be stored. This can + * either be a bucket ("gs://my-bucket") or a path within a bucket + * ("gs://my-bucket/my-dir"). + * If unspecified, a default bucket located in the same region will be used. + * + * Generated from protobuf field string artifact_storage = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $artifact_storage = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_account + * Optional. Google service account to use for execution. If unspecified, + * the project execution service account + * (-compute@developer.gserviceaccount.com) will be used. + * @type string $artifact_storage + * Optional. Cloud Storage location where execution outputs should be stored. This can + * either be a bucket ("gs://my-bucket") or a path within a bucket + * ("gs://my-bucket/my-dir"). + * If unspecified, a default bucket located in the same region will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Google service account to use for execution. If unspecified, + * the project execution service account + * (-compute@developer.gserviceaccount.com) will be used. + * + * Generated from protobuf field string service_account = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. Google service account to use for execution. If unspecified, + * the project execution service account + * (-compute@developer.gserviceaccount.com) will be used. + * + * Generated from protobuf field string service_account = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Optional. Cloud Storage location where execution outputs should be stored. This can + * either be a bucket ("gs://my-bucket") or a path within a bucket + * ("gs://my-bucket/my-dir"). + * If unspecified, a default bucket located in the same region will be used. + * + * Generated from protobuf field string artifact_storage = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getArtifactStorage() + { + return $this->artifact_storage; + } + + /** + * Optional. Cloud Storage location where execution outputs should be stored. This can + * either be a bucket ("gs://my-bucket") or a path within a bucket + * ("gs://my-bucket/my-dir"). + * If unspecified, a default bucket located in the same region will be used. + * + * Generated from protobuf field string artifact_storage = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setArtifactStorage($var) + { + GPBUtil::checkString($var, True); + $this->artifact_storage = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/DeleteDeliveryPipelineRequest.php b/Deploy/src/V1/DeleteDeliveryPipelineRequest.php new file mode 100644 index 000000000000..ad1542d0dbbb --- /dev/null +++ b/Deploy/src/V1/DeleteDeliveryPipelineRequest.php @@ -0,0 +1,305 @@ +google.cloud.deploy.v1.DeleteDeliveryPipelineRequest + */ +class DeleteDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the `DeliveryPipeline` to delete. Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_id = ''; + /** + * Optional. If set to true, then deleting an already deleted or non-existing + * `DeliveryPipeline` will succeed. + * + * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $allow_missing = false; + /** + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $validate_only = false; + /** + * Optional. If set to true, all child resources under this pipeline will also be + * deleted. Otherwise, the request will only work if the pipeline has + * no child resources. + * + * Generated from protobuf field bool force = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $force = false; + /** + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the `DeliveryPipeline` to delete. Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @type string $request_id + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $allow_missing + * Optional. If set to true, then deleting an already deleted or non-existing + * `DeliveryPipeline` will succeed. + * @type bool $validate_only + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * @type bool $force + * Optional. If set to true, all child resources under this pipeline will also be + * deleted. Otherwise, the request will only work if the pipeline has + * no child resources. + * @type string $etag + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the `DeliveryPipeline` to delete. Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * + * 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. The name of the `DeliveryPipeline` to delete. Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * + * 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; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set to true, then deleting an already deleted or non-existing + * `DeliveryPipeline` will succeed. + * + * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, then deleting an already deleted or non-existing + * `DeliveryPipeline` will succeed. + * + * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + + /** + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. If set to true, all child resources under this pipeline will also be + * deleted. Otherwise, the request will only work if the pipeline has + * no child resources. + * + * Generated from protobuf field bool force = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. If set to true, all child resources under this pipeline will also be + * deleted. Otherwise, the request will only work if the pipeline has + * no child resources. + * + * Generated from protobuf field bool force = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + + /** + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/DeleteTargetRequest.php b/Deploy/src/V1/DeleteTargetRequest.php new file mode 100644 index 000000000000..7373155f60ce --- /dev/null +++ b/Deploy/src/V1/DeleteTargetRequest.php @@ -0,0 +1,263 @@ +google.cloud.deploy.v1.DeleteTargetRequest + */ +class DeleteTargetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the `Target` to delete. Format should be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_id = ''; + /** + * Optional. If set to true, then deleting an already deleted or non-existing + * DeliveryPipeline will succeed. + * + * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $allow_missing = false; + /** + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $validate_only = false; + /** + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the `Target` to delete. Format should be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * @type string $request_id + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $allow_missing + * Optional. If set to true, then deleting an already deleted or non-existing + * DeliveryPipeline will succeed. + * @type bool $validate_only + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * @type string $etag + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the `Target` to delete. Format should be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * + * 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. The name of the `Target` to delete. Format should be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * + * 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; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set to true, then deleting an already deleted or non-existing + * DeliveryPipeline will succeed. + * + * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, then deleting an already deleted or non-existing + * DeliveryPipeline will succeed. + * + * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + + /** + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/DeliveryPipeline.php b/Deploy/src/V1/DeliveryPipeline.php new file mode 100644 index 000000000000..f14f7aef67a7 --- /dev/null +++ b/Deploy/src/V1/DeliveryPipeline.php @@ -0,0 +1,460 @@ +google.cloud.deploy.v1.DeliveryPipeline + */ +class DeliveryPipeline extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the `DeliveryPipeline`. Format is projects/{project}/ + * locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $name = ''; + /** + * Output only. Unique identifier of the `DeliveryPipeline`. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $uid = ''; + /** + * Description of the `DeliveryPipeline`. Max length is 255 characters. + * + * Generated from protobuf field string description = 3; + */ + private $description = ''; + /** + * User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 4; + */ + private $annotations; + /** + * Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * + * Generated from protobuf field map labels = 5; + */ + private $labels; + /** + * Output only. Time at which the pipeline was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $create_time = null; + /** + * Output only. Most recent time at which the pipeline was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $update_time = null; + /** + * Output only. Information around the state of the Delivery Pipeline. + * + * Generated from protobuf field .google.cloud.deploy.v1.PipelineCondition condition = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $condition = null; + /** + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 10; + */ + private $etag = ''; + protected $pipeline; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. Name of the `DeliveryPipeline`. Format is projects/{project}/ + * locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}. + * @type string $uid + * Output only. Unique identifier of the `DeliveryPipeline`. + * @type string $description + * Description of the `DeliveryPipeline`. Max length is 255 characters. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time at which the pipeline was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Most recent time at which the pipeline was updated. + * @type \Google\Cloud\Deploy\V1\SerialPipeline $serial_pipeline + * SerialPipeline defines a sequential set of stages for a + * `DeliveryPipeline`. + * @type \Google\Cloud\Deploy\V1\PipelineCondition $condition + * Output only. Information around the state of the Delivery Pipeline. + * @type string $etag + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the `DeliveryPipeline`. Format is projects/{project}/ + * locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. Name of the `DeliveryPipeline`. Format is projects/{project}/ + * locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Unique identifier of the `DeliveryPipeline`. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Unique identifier of the `DeliveryPipeline`. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Description of the `DeliveryPipeline`. Max length is 255 characters. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Description of the `DeliveryPipeline`. Max length is 255 characters. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * + * Generated from protobuf field map labels = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * + * Generated from protobuf field map labels = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. Time at which the pipeline was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Time at which the pipeline was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.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. Most recent time at which the pipeline was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Most recent time at which the pipeline was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * SerialPipeline defines a sequential set of stages for a + * `DeliveryPipeline`. + * + * Generated from protobuf field .google.cloud.deploy.v1.SerialPipeline serial_pipeline = 8; + * @return \Google\Cloud\Deploy\V1\SerialPipeline|null + */ + public function getSerialPipeline() + { + return $this->readOneof(8); + } + + public function hasSerialPipeline() + { + return $this->hasOneof(8); + } + + /** + * SerialPipeline defines a sequential set of stages for a + * `DeliveryPipeline`. + * + * Generated from protobuf field .google.cloud.deploy.v1.SerialPipeline serial_pipeline = 8; + * @param \Google\Cloud\Deploy\V1\SerialPipeline $var + * @return $this + */ + public function setSerialPipeline($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\SerialPipeline::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Output only. Information around the state of the Delivery Pipeline. + * + * Generated from protobuf field .google.cloud.deploy.v1.PipelineCondition condition = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Deploy\V1\PipelineCondition|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * Output only. Information around the state of the Delivery Pipeline. + * + * Generated from protobuf field .google.cloud.deploy.v1.PipelineCondition condition = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\PipelineCondition $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\PipelineCondition::class); + $this->condition = $var; + + return $this; + } + + /** + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 10; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 10; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * @return string + */ + public function getPipeline() + { + return $this->whichOneof("pipeline"); + } + +} + diff --git a/Deploy/src/V1/ExecutionConfig.php b/Deploy/src/V1/ExecutionConfig.php new file mode 100644 index 000000000000..4382a23554f6 --- /dev/null +++ b/Deploy/src/V1/ExecutionConfig.php @@ -0,0 +1,142 @@ +google.cloud.deploy.v1.ExecutionConfig + */ +class ExecutionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Usages when this configuration should be applied. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage usages = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $usages; + protected $execution_environment; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int[]|\Google\Protobuf\Internal\RepeatedField $usages + * Required. Usages when this configuration should be applied. + * @type \Google\Cloud\Deploy\V1\DefaultPool $default_pool + * Optional. Use default Cloud Build pool. + * @type \Google\Cloud\Deploy\V1\PrivatePool $private_pool + * Optional. Use private Cloud Build pool. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Usages when this configuration should be applied. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage usages = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUsages() + { + return $this->usages; + } + + /** + * Required. Usages when this configuration should be applied. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage usages = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUsages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Deploy\V1\ExecutionConfig\ExecutionEnvironmentUsage::class); + $this->usages = $arr; + + return $this; + } + + /** + * Optional. Use default Cloud Build pool. + * + * Generated from protobuf field .google.cloud.deploy.v1.DefaultPool default_pool = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Deploy\V1\DefaultPool|null + */ + public function getDefaultPool() + { + return $this->readOneof(2); + } + + public function hasDefaultPool() + { + return $this->hasOneof(2); + } + + /** + * Optional. Use default Cloud Build pool. + * + * Generated from protobuf field .google.cloud.deploy.v1.DefaultPool default_pool = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Deploy\V1\DefaultPool $var + * @return $this + */ + public function setDefaultPool($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\DefaultPool::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. Use private Cloud Build pool. + * + * Generated from protobuf field .google.cloud.deploy.v1.PrivatePool private_pool = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Deploy\V1\PrivatePool|null + */ + public function getPrivatePool() + { + return $this->readOneof(3); + } + + public function hasPrivatePool() + { + return $this->hasOneof(3); + } + + /** + * Optional. Use private Cloud Build pool. + * + * Generated from protobuf field .google.cloud.deploy.v1.PrivatePool private_pool = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Deploy\V1\PrivatePool $var + * @return $this + */ + public function setPrivatePool($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\PrivatePool::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getExecutionEnvironment() + { + return $this->whichOneof("execution_environment"); + } + +} + diff --git a/Deploy/src/V1/ExecutionConfig/ExecutionEnvironmentUsage.php b/Deploy/src/V1/ExecutionConfig/ExecutionEnvironmentUsage.php new file mode 100644 index 000000000000..5e45a67146d7 --- /dev/null +++ b/Deploy/src/V1/ExecutionConfig/ExecutionEnvironmentUsage.php @@ -0,0 +1,62 @@ +google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage + */ +class ExecutionEnvironmentUsage +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED = 0; + */ + const EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED = 0; + /** + * Use for rendering. + * + * Generated from protobuf enum RENDER = 1; + */ + const RENDER = 1; + /** + * Use for deploying and deployment hooks. + * + * Generated from protobuf enum DEPLOY = 2; + */ + const DEPLOY = 2; + + private static $valueToName = [ + self::EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED => 'EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED', + self::RENDER => 'RENDER', + self::DEPLOY => 'DEPLOY', + ]; + + 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/Deploy/src/V1/Gapic/CloudDeployGapicClient.php b/Deploy/src/V1/Gapic/CloudDeployGapicClient.php new file mode 100644 index 000000000000..02d8c4eadf4a --- /dev/null +++ b/Deploy/src/V1/Gapic/CloudDeployGapicClient.php @@ -0,0 +1,2136 @@ +rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + * $approved = false; + * $response = $cloudDeployClient->approveRollout($formattedName, $approved); + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + */ +class CloudDeployGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.cloud.deploy.v1.CloudDeploy'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'clouddeploy.googleapis.com'; + + /** + * The default port of the service. + */ + const DEFAULT_SERVICE_PORT = 443; + + /** + * The name of the code generator, to be included in the agent header. + */ + const CODEGEN_NAME = 'gapic'; + + /** + * The default scopes required by the service. + */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $buildNameTemplate; + + private static $configNameTemplate; + + private static $deliveryPipelineNameTemplate; + + private static $locationNameTemplate; + + private static $releaseNameTemplate; + + private static $rolloutNameTemplate; + + private static $targetNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => + self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => + __DIR__ . '/../resources/cloud_deploy_client_config.json', + 'descriptorsConfigPath' => + __DIR__ . '/../resources/cloud_deploy_descriptor_config.php', + 'gcpApiConfigPath' => + __DIR__ . '/../resources/cloud_deploy_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . + '/../resources/cloud_deploy_rest_client_config.php', + ], + ], + ]; + } + + private static function getBuildNameTemplate() + { + if (self::$buildNameTemplate == null) { + self::$buildNameTemplate = new PathTemplate( + 'projects/{project}/locations/{location}/builds/{build}' + ); + } + + return self::$buildNameTemplate; + } + + private static function getConfigNameTemplate() + { + if (self::$configNameTemplate == null) { + self::$configNameTemplate = new PathTemplate( + 'projects/{project}/locations/{location}/config' + ); + } + + return self::$configNameTemplate; + } + + private static function getDeliveryPipelineNameTemplate() + { + if (self::$deliveryPipelineNameTemplate == null) { + self::$deliveryPipelineNameTemplate = new PathTemplate( + 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}' + ); + } + + return self::$deliveryPipelineNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate( + 'projects/{project}/locations/{location}' + ); + } + + return self::$locationNameTemplate; + } + + private static function getReleaseNameTemplate() + { + if (self::$releaseNameTemplate == null) { + self::$releaseNameTemplate = new PathTemplate( + 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}' + ); + } + + return self::$releaseNameTemplate; + } + + private static function getRolloutNameTemplate() + { + if (self::$rolloutNameTemplate == null) { + self::$rolloutNameTemplate = new PathTemplate( + 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}' + ); + } + + return self::$rolloutNameTemplate; + } + + private static function getTargetNameTemplate() + { + if (self::$targetNameTemplate == null) { + self::$targetNameTemplate = new PathTemplate( + 'projects/{project}/locations/{location}/targets/{target}' + ); + } + + return self::$targetNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'build' => self::getBuildNameTemplate(), + 'config' => self::getConfigNameTemplate(), + 'deliveryPipeline' => self::getDeliveryPipelineNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'release' => self::getReleaseNameTemplate(), + 'rollout' => self::getRolloutNameTemplate(), + 'target' => self::getTargetNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a build + * resource. + * + * @param string $project + * @param string $location + * @param string $build + * + * @return string The formatted build resource. + */ + public static function buildName($project, $location, $build) + { + return self::getBuildNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'build' => $build, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a config + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted config resource. + */ + public static function configName($project, $location) + { + return self::getConfigNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * delivery_pipeline resource. + * + * @param string $project + * @param string $location + * @param string $deliveryPipeline + * + * @return string The formatted delivery_pipeline resource. + */ + public static function deliveryPipelineName( + $project, + $location, + $deliveryPipeline + ) { + return self::getDeliveryPipelineNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'delivery_pipeline' => $deliveryPipeline, + ]); + } + + /** + * 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($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a release + * resource. + * + * @param string $project + * @param string $location + * @param string $deliveryPipeline + * @param string $release + * + * @return string The formatted release resource. + */ + public static function releaseName( + $project, + $location, + $deliveryPipeline, + $release + ) { + return self::getReleaseNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'delivery_pipeline' => $deliveryPipeline, + 'release' => $release, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a rollout + * resource. + * + * @param string $project + * @param string $location + * @param string $deliveryPipeline + * @param string $release + * @param string $rollout + * + * @return string The formatted rollout resource. + */ + public static function rolloutName( + $project, + $location, + $deliveryPipeline, + $release, + $rollout + ) { + return self::getRolloutNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'delivery_pipeline' => $deliveryPipeline, + 'release' => $release, + 'rollout' => $rollout, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a target + * resource. + * + * @param string $project + * @param string $location + * @param string $target + * + * @return string The formatted target resource. + */ + public static function targetName($project, $location, $target) + { + return self::getTargetNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'target' => $target, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - build: projects/{project}/locations/{location}/builds/{build} + * - config: projects/{project}/locations/{location}/config + * - deliveryPipeline: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline} + * - location: projects/{project}/locations/{location} + * - release: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release} + * - rollout: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout} + * - target: projects/{project}/locations/{location}/targets/{target} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException( + "Template name $template does not exist" + ); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException( + "Input did not match any known format. Input: $formattedName" + ); + } + + /** + * 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; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $serviceAddress + * **Deprecated**. This option will be removed in a future major release. Please + * utilize the `$apiEndpoint` option instead. + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'clouddeploy.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 + * $serviceAddress 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); + } + + /** + * Approves a Rollout. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedName = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + * $approved = false; + * $response = $cloudDeployClient->approveRollout($formattedName, $approved); + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the Rollout. Format is + * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/{rollout}. + * @param bool $approved Required. True = approve; false = reject + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Deploy\V1\ApproveRolloutResponse + * + * @throws ApiException if the remote call fails + */ + public function approveRollout($name, $approved, array $optionalArgs = []) + { + $request = new ApproveRolloutRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setApproved($approved); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'ApproveRollout', + ApproveRolloutResponse::class, + $optionalArgs, + $request + )->wait(); + } + + /** + * Creates a new DeliveryPipeline in a given project and location. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]'); + * $deliveryPipelineId = 'delivery_pipeline_id'; + * $deliveryPipeline = new DeliveryPipeline(); + * $operationResponse = $cloudDeployClient->createDeliveryPipeline($formattedParent, $deliveryPipelineId, $deliveryPipeline); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $cloudDeployClient->createDeliveryPipeline($formattedParent, $deliveryPipelineId, $deliveryPipeline); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createDeliveryPipeline'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent collection in which the `DeliveryPipeline` should be created. + * Format should be projects/{project_id}/locations/{location_name}. + * @param string $deliveryPipelineId Required. ID of the `DeliveryPipeline`. + * @param DeliveryPipeline $deliveryPipeline Required. The `DeliveryPipeline` to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validateOnly + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createDeliveryPipeline( + $parent, + $deliveryPipelineId, + $deliveryPipeline, + array $optionalArgs = [] + ) { + $request = new CreateDeliveryPipelineRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setDeliveryPipelineId($deliveryPipelineId); + $request->setDeliveryPipeline($deliveryPipeline); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'CreateDeliveryPipeline', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + + /** + * Creates a new Release in a given project and location. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + * $releaseId = 'release_id'; + * $release = new Release(); + * $operationResponse = $cloudDeployClient->createRelease($formattedParent, $releaseId, $release); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $cloudDeployClient->createRelease($formattedParent, $releaseId, $release); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createRelease'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent collection in which the `Release` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @param string $releaseId Required. ID of the `Release`. + * @param Release $release Required. The `Release` to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validateOnly + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createRelease( + $parent, + $releaseId, + $release, + array $optionalArgs = [] + ) { + $request = new CreateReleaseRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setReleaseId($releaseId); + $request->setRelease($release); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'CreateRelease', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + + /** + * Creates a new Rollout in a given project and location. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedParent = $cloudDeployClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); + * $rolloutId = 'rollout_id'; + * $rollout = new Rollout(); + * $operationResponse = $cloudDeployClient->createRollout($formattedParent, $rolloutId, $rollout); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $cloudDeployClient->createRollout($formattedParent, $rolloutId, $rollout); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createRollout'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent collection in which the `Rollout` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * @param string $rolloutId Required. ID of the `Rollout`. + * @param Rollout $rollout Required. The `Rollout` to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validateOnly + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createRollout( + $parent, + $rolloutId, + $rollout, + array $optionalArgs = [] + ) { + $request = new CreateRolloutRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setRolloutId($rolloutId); + $request->setRollout($rollout); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'CreateRollout', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + + /** + * Creates a new Target in a given project and location. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]'); + * $targetId = 'target_id'; + * $target = new Target(); + * $operationResponse = $cloudDeployClient->createTarget($formattedParent, $targetId, $target); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $cloudDeployClient->createTarget($formattedParent, $targetId, $target); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createTarget'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent collection in which the `Target` should be created. + * Format should be + * projects/{project_id}/locations/{location_name}. + * @param string $targetId Required. ID of the `Target`. + * @param Target $target Required. The `Target` to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validateOnly + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createTarget( + $parent, + $targetId, + $target, + array $optionalArgs = [] + ) { + $request = new CreateTargetRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setTargetId($targetId); + $request->setTarget($target); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'CreateTarget', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + + /** + * Deletes a single DeliveryPipeline. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedName = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + * $operationResponse = $cloudDeployClient->deleteDeliveryPipeline($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $cloudDeployClient->deleteDeliveryPipeline($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteDeliveryPipeline'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the `DeliveryPipeline` to delete. Format should be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $allowMissing + * Optional. If set to true, then deleting an already deleted or non-existing + * `DeliveryPipeline` will succeed. + * @type bool $validateOnly + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * @type bool $force + * Optional. If set to true, all child resources under this pipeline will also be + * deleted. Otherwise, the request will only work if the pipeline has + * no child resources. + * @type string $etag + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteDeliveryPipeline($name, array $optionalArgs = []) + { + $request = new DeleteDeliveryPipelineRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['force'])) { + $request->setForce($optionalArgs['force']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'DeleteDeliveryPipeline', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + + /** + * Deletes a single Target. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedName = $cloudDeployClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); + * $operationResponse = $cloudDeployClient->deleteTarget($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $cloudDeployClient->deleteTarget($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteTarget'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the `Target` to delete. Format should be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $allowMissing + * Optional. If set to true, then deleting an already deleted or non-existing + * DeliveryPipeline will succeed. + * @type bool $validateOnly + * Optional. If set, validate the request and preview the review, but do not actually + * post it. + * @type string $etag + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteTarget($name, array $optionalArgs = []) + { + $request = new DeleteTargetRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'DeleteTarget', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + + /** + * Gets the configuration for a location. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedName = $cloudDeployClient->configName('[PROJECT]', '[LOCATION]'); + * $response = $cloudDeployClient->getConfig($formattedName); + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $name Required. Name of requested configuration. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Deploy\V1\Config + * + * @throws ApiException if the remote call fails + */ + public function getConfig($name, array $optionalArgs = []) + { + $request = new GetConfigRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetConfig', + Config::class, + $optionalArgs, + $request + )->wait(); + } + + /** + * Gets details of a single DeliveryPipeline. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedName = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + * $response = $cloudDeployClient->getDeliveryPipeline($formattedName); + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the `DeliveryPipeline`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Deploy\V1\DeliveryPipeline + * + * @throws ApiException if the remote call fails + */ + public function getDeliveryPipeline($name, array $optionalArgs = []) + { + $request = new GetDeliveryPipelineRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetDeliveryPipeline', + DeliveryPipeline::class, + $optionalArgs, + $request + )->wait(); + } + + /** + * Gets details of a single Release. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedName = $cloudDeployClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); + * $response = $cloudDeployClient->getRelease($formattedName); + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the `Release`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Deploy\V1\Release + * + * @throws ApiException if the remote call fails + */ + public function getRelease($name, array $optionalArgs = []) + { + $request = new GetReleaseRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetRelease', + Release::class, + $optionalArgs, + $request + )->wait(); + } + + /** + * Gets details of a single Rollout. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedName = $cloudDeployClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + * $response = $cloudDeployClient->getRollout($formattedName); + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the `Rollout`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Deploy\V1\Rollout + * + * @throws ApiException if the remote call fails + */ + public function getRollout($name, array $optionalArgs = []) + { + $request = new GetRolloutRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetRollout', + Rollout::class, + $optionalArgs, + $request + )->wait(); + } + + /** + * Gets details of a single Target. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedName = $cloudDeployClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); + * $response = $cloudDeployClient->getTarget($formattedName); + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the `Target`. Format must be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Deploy\V1\Target + * + * @throws ApiException if the remote call fails + */ + public function getTarget($name, array $optionalArgs = []) + { + $request = new GetTargetRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'GetTarget', + Target::class, + $optionalArgs, + $request + )->wait(); + } + + /** + * Lists DeliveryPipelines in a given project and location. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $cloudDeployClient->listDeliveryPipelines($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudDeployClient->listDeliveryPipelines($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * @type string $orderBy + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listDeliveryPipelines($parent, array $optionalArgs = []) + { + $request = new ListDeliveryPipelinesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListDeliveryPipelines', + $optionalArgs, + ListDeliveryPipelinesResponse::class, + $request + ); + } + + /** + * Lists Releases in a given project and location. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + * // Iterate over pages of elements + * $pagedResponse = $cloudDeployClient->listReleases($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudDeployClient->listReleases($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $parent Required. The `DeliveryPipeline` which owns this collection of `Release` objects. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * @type string $orderBy + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listReleases($parent, array $optionalArgs = []) + { + $request = new ListReleasesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListReleases', + $optionalArgs, + ListReleasesResponse::class, + $request + ); + } + + /** + * Lists Rollouts in a given project and location. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedParent = $cloudDeployClient->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); + * // Iterate over pages of elements + * $pagedResponse = $cloudDeployClient->listRollouts($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudDeployClient->listRollouts($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $parent Required. The `Release` which owns this collection of `Rollout` objects. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * @type string $orderBy + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listRollouts($parent, array $optionalArgs = []) + { + $request = new ListRolloutsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListRollouts', + $optionalArgs, + ListRolloutsResponse::class, + $request + ); + } + + /** + * Lists Targets in a given project and location. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedParent = $cloudDeployClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $cloudDeployClient->listTargets($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudDeployClient->listTargets($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $filter + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * @type string $orderBy + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listTargets($parent, array $optionalArgs = []) + { + $request = new ListTargetsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListTargets', + $optionalArgs, + ListTargetsResponse::class, + $request + ); + } + + /** + * Updates the parameters of a single DeliveryPipeline. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $updateMask = new FieldMask(); + * $deliveryPipeline = new DeliveryPipeline(); + * $operationResponse = $cloudDeployClient->updateDeliveryPipeline($updateMask, $deliveryPipeline); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $cloudDeployClient->updateDeliveryPipeline($updateMask, $deliveryPipeline); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'updateDeliveryPipeline'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * `DeliveryPipeline` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param DeliveryPipeline $deliveryPipeline Required. The `DeliveryPipeline` to update. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $allowMissing + * Optional. If set to true, updating a `DeliveryPipeline` that does not exist will + * result in the creation of a new `DeliveryPipeline`. + * @type bool $validateOnly + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateDeliveryPipeline( + $updateMask, + $deliveryPipeline, + array $optionalArgs = [] + ) { + $request = new UpdateDeliveryPipelineRequest(); + $requestParamHeaders = []; + $request->setUpdateMask($updateMask); + $request->setDeliveryPipeline($deliveryPipeline); + $requestParamHeaders[ + 'delivery_pipeline.name' + ] = $deliveryPipeline->getName(); + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'UpdateDeliveryPipeline', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + + /** + * Updates the parameters of a single Target. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $updateMask = new FieldMask(); + * $target = new Target(); + * $operationResponse = $cloudDeployClient->updateTarget($updateMask, $target); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $cloudDeployClient->updateTarget($updateMask, $target); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'updateTarget'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * Target resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param Target $target Required. The `Target` to update. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $allowMissing + * Optional. If set to true, updating a `Target` that does not exist will + * result in the creation of a new `Target`. + * @type bool $validateOnly + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateTarget($updateMask, $target, array $optionalArgs = []) + { + $request = new UpdateTargetRequest(); + $requestParamHeaders = []; + $request->setUpdateMask($updateMask); + $request->setTarget($target); + $requestParamHeaders['target.name'] = $target->getName(); + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'UpdateTarget', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } +} diff --git a/Deploy/src/V1/GetConfigRequest.php b/Deploy/src/V1/GetConfigRequest.php new file mode 100644 index 000000000000..b537f964636c --- /dev/null +++ b/Deploy/src/V1/GetConfigRequest.php @@ -0,0 +1,67 @@ +google.cloud.deploy.v1.GetConfigRequest + */ +class GetConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of requested configuration. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of requested configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of requested configuration. + * + * 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. Name of requested configuration. + * + * 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/Deploy/src/V1/GetDeliveryPipelineRequest.php b/Deploy/src/V1/GetDeliveryPipelineRequest.php new file mode 100644 index 000000000000..c6e7a834d357 --- /dev/null +++ b/Deploy/src/V1/GetDeliveryPipelineRequest.php @@ -0,0 +1,71 @@ +google.cloud.deploy.v1.GetDeliveryPipelineRequest + */ +class GetDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the `DeliveryPipeline`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the `DeliveryPipeline`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the `DeliveryPipeline`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * + * 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. Name of the `DeliveryPipeline`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * + * 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/Deploy/src/V1/GetReleaseRequest.php b/Deploy/src/V1/GetReleaseRequest.php new file mode 100644 index 000000000000..676443445832 --- /dev/null +++ b/Deploy/src/V1/GetReleaseRequest.php @@ -0,0 +1,71 @@ +google.cloud.deploy.v1.GetReleaseRequest + */ +class GetReleaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the `Release`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the `Release`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the `Release`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * + * 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. Name of the `Release`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * + * 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/Deploy/src/V1/GetRolloutRequest.php b/Deploy/src/V1/GetRolloutRequest.php new file mode 100644 index 000000000000..135d8db5e1bf --- /dev/null +++ b/Deploy/src/V1/GetRolloutRequest.php @@ -0,0 +1,71 @@ +google.cloud.deploy.v1.GetRolloutRequest + */ +class GetRolloutRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the `Rollout`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the `Rollout`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the `Rollout`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * + * 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. Name of the `Rollout`. Format must be + * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * + * 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/Deploy/src/V1/GetTargetRequest.php b/Deploy/src/V1/GetTargetRequest.php new file mode 100644 index 000000000000..eb8866909e73 --- /dev/null +++ b/Deploy/src/V1/GetTargetRequest.php @@ -0,0 +1,71 @@ +google.cloud.deploy.v1.GetTargetRequest + */ +class GetTargetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the `Target`. Format must be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the `Target`. Format must be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the `Target`. Format must be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * + * 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. Name of the `Target`. Format must be + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * + * 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/Deploy/src/V1/GkeCluster.php b/Deploy/src/V1/GkeCluster.php new file mode 100644 index 000000000000..ae0c2bff5b34 --- /dev/null +++ b/Deploy/src/V1/GkeCluster.php @@ -0,0 +1,71 @@ +google.cloud.deploy.v1.GkeCluster + */ +class GkeCluster extends \Google\Protobuf\Internal\Message +{ + /** + * Information specifying a GKE Cluster. Format is + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}. + * + * Generated from protobuf field string cluster = 1 [(.google.api.resource_reference) = { + */ + private $cluster = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cluster + * Information specifying a GKE Cluster. Format is + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Information specifying a GKE Cluster. Format is + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}. + * + * Generated from protobuf field string cluster = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getCluster() + { + return $this->cluster; + } + + /** + * Information specifying a GKE Cluster. Format is + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}. + * + * Generated from protobuf field string cluster = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkString($var, True); + $this->cluster = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/ListDeliveryPipelinesRequest.php b/Deploy/src/V1/ListDeliveryPipelinesRequest.php new file mode 100644 index 000000000000..72fe7a7890bf --- /dev/null +++ b/Deploy/src/V1/ListDeliveryPipelinesRequest.php @@ -0,0 +1,235 @@ +google.cloud.deploy.v1.ListDeliveryPipelinesRequest + */ +class ListDeliveryPipelinesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * + * Generated from protobuf field int32 page_size = 2; + */ + private $page_size = 0; + /** + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + private $page_token = ''; + /** + * Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * + * Generated from protobuf field string filter = 4; + */ + private $filter = ''; + /** + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * + * Generated from protobuf field string order_by = 5; + */ + private $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + * @type int $page_size + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * @type string $page_token + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * @type string $filter + * Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * @type string $order_by + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of pipelines. Format must be + * projects/{project_id}/locations/{location_name}. + * + * 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 pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of pipelines to return. The service may return + * fewer than this value. If unspecified, at most 50 pipelines will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, received from a previous `ListDeliveryPipelines` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Field to sort by. See https://google.aip.dev/132#ordering for more details. + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/ListDeliveryPipelinesResponse.php b/Deploy/src/V1/ListDeliveryPipelinesResponse.php new file mode 100644 index 000000000000..5dad159b4fc9 --- /dev/null +++ b/Deploy/src/V1/ListDeliveryPipelinesResponse.php @@ -0,0 +1,139 @@ +google.cloud.deploy.v1.ListDeliveryPipelinesResponse + */ +class ListDeliveryPipelinesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `DeliveryPipeline` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.DeliveryPipeline delivery_pipelines = 1; + */ + private $delivery_pipelines; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + private $next_page_token = ''; + /** + * 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 \Google\Cloud\Deploy\V1\DeliveryPipeline[]|\Google\Protobuf\Internal\RepeatedField $delivery_pipelines + * The `DeliveryPipeline` objects. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * The `DeliveryPipeline` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.DeliveryPipeline delivery_pipelines = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDeliveryPipelines() + { + return $this->delivery_pipelines; + } + + /** + * The `DeliveryPipeline` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.DeliveryPipeline delivery_pipelines = 1; + * @param \Google\Cloud\Deploy\V1\DeliveryPipeline[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDeliveryPipelines($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\DeliveryPipeline::class); + $this->delivery_pipelines = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * 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 string[]|\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/Deploy/src/V1/ListReleasesRequest.php b/Deploy/src/V1/ListReleasesRequest.php new file mode 100644 index 000000000000..29585f948294 --- /dev/null +++ b/Deploy/src/V1/ListReleasesRequest.php @@ -0,0 +1,227 @@ +google.cloud.deploy.v1.ListReleasesRequest + */ +class ListReleasesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `DeliveryPipeline` which owns this collection of `Release` objects. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Optional. The maximum number of `Release` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Release` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_size = 0; + /** + * Optional. A page token, received from a previous `ListReleases` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_token = ''; + /** + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $filter = ''; + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The `DeliveryPipeline` which owns this collection of `Release` objects. + * @type int $page_size + * Optional. The maximum number of `Release` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Release` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListReleases` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * @type string $filter + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * @type string $order_by + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `DeliveryPipeline` which owns this collection of `Release` objects. + * + * 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 `DeliveryPipeline` which owns this collection of `Release` objects. + * + * 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; + } + + /** + * Optional. The maximum number of `Release` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Release` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `Release` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Release` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListReleases` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListReleases` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/ListReleasesResponse.php b/Deploy/src/V1/ListReleasesResponse.php new file mode 100644 index 000000000000..27e1f7718af0 --- /dev/null +++ b/Deploy/src/V1/ListReleasesResponse.php @@ -0,0 +1,139 @@ +google.cloud.deploy.v1.ListReleasesResponse + */ +class ListReleasesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Release` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Release releases = 1; + */ + private $releases; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + private $next_page_token = ''; + /** + * 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 \Google\Cloud\Deploy\V1\Release[]|\Google\Protobuf\Internal\RepeatedField $releases + * The `Release` objects. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * The `Release` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Release releases = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReleases() + { + return $this->releases; + } + + /** + * The `Release` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Release releases = 1; + * @param \Google\Cloud\Deploy\V1\Release[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReleases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\Release::class); + $this->releases = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * 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 string[]|\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/Deploy/src/V1/ListRolloutsRequest.php b/Deploy/src/V1/ListRolloutsRequest.php new file mode 100644 index 000000000000..e61788db8f83 --- /dev/null +++ b/Deploy/src/V1/ListRolloutsRequest.php @@ -0,0 +1,227 @@ +google.cloud.deploy.v1.ListRolloutsRequest + */ +class ListRolloutsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `Release` which owns this collection of `Rollout` objects. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Optional. The maximum number of `Rollout` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Rollout` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_size = 0; + /** + * Optional. A page token, received from a previous `ListRollouts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_token = ''; + /** + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $filter = ''; + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The `Release` which owns this collection of `Rollout` objects. + * @type int $page_size + * Optional. The maximum number of `Rollout` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Rollout` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListRollouts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * @type string $filter + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * @type string $order_by + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `Release` which owns this collection of `Rollout` objects. + * + * 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 `Release` which owns this collection of `Rollout` objects. + * + * 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; + } + + /** + * Optional. The maximum number of `Rollout` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Rollout` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `Rollout` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Rollout` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListRollouts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListRollouts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/ListRolloutsResponse.php b/Deploy/src/V1/ListRolloutsResponse.php new file mode 100644 index 000000000000..e3d4ff5850ae --- /dev/null +++ b/Deploy/src/V1/ListRolloutsResponse.php @@ -0,0 +1,139 @@ +google.cloud.deploy.v1.ListRolloutsResponse + */ +class ListRolloutsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Rollout` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Rollout rollouts = 1; + */ + private $rollouts; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + private $next_page_token = ''; + /** + * 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 \Google\Cloud\Deploy\V1\Rollout[]|\Google\Protobuf\Internal\RepeatedField $rollouts + * The `Rollout` objects. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * The `Rollout` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Rollout rollouts = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRollouts() + { + return $this->rollouts; + } + + /** + * The `Rollout` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Rollout rollouts = 1; + * @param \Google\Cloud\Deploy\V1\Rollout[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRollouts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\Rollout::class); + $this->rollouts = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * 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 string[]|\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/Deploy/src/V1/ListTargetsRequest.php b/Deploy/src/V1/ListTargetsRequest.php new file mode 100644 index 000000000000..212371defba7 --- /dev/null +++ b/Deploy/src/V1/ListTargetsRequest.php @@ -0,0 +1,231 @@ +google.cloud.deploy.v1.ListTargetsRequest + */ +class ListTargetsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Optional. The maximum number of `Target` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Target` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_size = 0; + /** + * Optional. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $page_token = ''; + /** + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $filter = ''; + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + * @type int $page_size + * Optional. The maximum number of `Target` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Target` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * @type string $filter + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * @type string $order_by + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of targets. Format must be + * projects/{project_id}/locations/{location_name}. + * + * 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; + } + + /** + * Optional. The maximum number of `Target` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Target` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of `Target` objects to return. The service may return + * fewer than this value. If unspecified, at most 50 `Target` objects will be + * returned. The maximum value is 1000; values above 1000 will be set to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filter builds to be returned. See https://google.aip.dev/160 for more + * details. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/ListTargetsResponse.php b/Deploy/src/V1/ListTargetsResponse.php new file mode 100644 index 000000000000..cd4291d2ee8f --- /dev/null +++ b/Deploy/src/V1/ListTargetsResponse.php @@ -0,0 +1,139 @@ +google.cloud.deploy.v1.ListTargetsResponse + */ +class ListTargetsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Target` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Target targets = 1; + */ + private $targets; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + private $next_page_token = ''; + /** + * 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 \Google\Cloud\Deploy\V1\Target[]|\Google\Protobuf\Internal\RepeatedField $targets + * The `Target` objects. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * The `Target` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Target targets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargets() + { + return $this->targets; + } + + /** + * The `Target` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Target targets = 1; + * @param \Google\Cloud\Deploy\V1\Target[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\Target::class); + $this->targets = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * 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 string[]|\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/Deploy/src/V1/OperationMetadata.php b/Deploy/src/V1/OperationMetadata.php new file mode 100644 index 000000000000..cf1cb8101123 --- /dev/null +++ b/Deploy/src/V1/OperationMetadata.php @@ -0,0 +1,303 @@ +google.cloud.deploy.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]; + */ + private $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]; + */ + private $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]; + */ + private $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $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]; + */ + private $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]; + */ + private $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]; + */ + private $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\Deploy\V1\CloudDeploy::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/Deploy/src/V1/PipelineCondition.php b/Deploy/src/V1/PipelineCondition.php new file mode 100644 index 000000000000..dc802beef5e9 --- /dev/null +++ b/Deploy/src/V1/PipelineCondition.php @@ -0,0 +1,121 @@ +google.cloud.deploy.v1.PipelineCondition + */ +class PipelineCondition extends \Google\Protobuf\Internal\Message +{ + /** + * Details around the Pipeline's overall status. + * + * Generated from protobuf field .google.cloud.deploy.v1.PipelineReadyCondition pipeline_ready_condition = 1; + */ + private $pipeline_ready_condition = null; + /** + * Detalis around targets enumerated in the pipeline. + * + * Generated from protobuf field .google.cloud.deploy.v1.TargetsPresentCondition targets_present_condition = 3; + */ + private $targets_present_condition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Deploy\V1\PipelineReadyCondition $pipeline_ready_condition + * Details around the Pipeline's overall status. + * @type \Google\Cloud\Deploy\V1\TargetsPresentCondition $targets_present_condition + * Detalis around targets enumerated in the pipeline. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Details around the Pipeline's overall status. + * + * Generated from protobuf field .google.cloud.deploy.v1.PipelineReadyCondition pipeline_ready_condition = 1; + * @return \Google\Cloud\Deploy\V1\PipelineReadyCondition|null + */ + public function getPipelineReadyCondition() + { + return $this->pipeline_ready_condition; + } + + public function hasPipelineReadyCondition() + { + return isset($this->pipeline_ready_condition); + } + + public function clearPipelineReadyCondition() + { + unset($this->pipeline_ready_condition); + } + + /** + * Details around the Pipeline's overall status. + * + * Generated from protobuf field .google.cloud.deploy.v1.PipelineReadyCondition pipeline_ready_condition = 1; + * @param \Google\Cloud\Deploy\V1\PipelineReadyCondition $var + * @return $this + */ + public function setPipelineReadyCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\PipelineReadyCondition::class); + $this->pipeline_ready_condition = $var; + + return $this; + } + + /** + * Detalis around targets enumerated in the pipeline. + * + * Generated from protobuf field .google.cloud.deploy.v1.TargetsPresentCondition targets_present_condition = 3; + * @return \Google\Cloud\Deploy\V1\TargetsPresentCondition|null + */ + public function getTargetsPresentCondition() + { + return $this->targets_present_condition; + } + + public function hasTargetsPresentCondition() + { + return isset($this->targets_present_condition); + } + + public function clearTargetsPresentCondition() + { + unset($this->targets_present_condition); + } + + /** + * Detalis around targets enumerated in the pipeline. + * + * Generated from protobuf field .google.cloud.deploy.v1.TargetsPresentCondition targets_present_condition = 3; + * @param \Google\Cloud\Deploy\V1\TargetsPresentCondition $var + * @return $this + */ + public function setTargetsPresentCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\TargetsPresentCondition::class); + $this->targets_present_condition = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/PipelineReadyCondition.php b/Deploy/src/V1/PipelineReadyCondition.php new file mode 100644 index 000000000000..bd5afe48fa9f --- /dev/null +++ b/Deploy/src/V1/PipelineReadyCondition.php @@ -0,0 +1,124 @@ +google.cloud.deploy.v1.PipelineReadyCondition + */ +class PipelineReadyCondition extends \Google\Protobuf\Internal\Message +{ + /** + * True if the Pipeline is in a valid state. Otherwise at least one condition + * in `PipelineCondition` is in an invalid state. Iterate over those + * conditions and see which condition(s) has status = false to find out what + * is wrong with the Pipeline. + * + * Generated from protobuf field bool status = 3; + */ + private $status = false; + /** + * Last time the condition was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + */ + private $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $status + * True if the Pipeline is in a valid state. Otherwise at least one condition + * in `PipelineCondition` is in an invalid state. Iterate over those + * conditions and see which condition(s) has status = false to find out what + * is wrong with the Pipeline. + * @type \Google\Protobuf\Timestamp $update_time + * Last time the condition was updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * True if the Pipeline is in a valid state. Otherwise at least one condition + * in `PipelineCondition` is in an invalid state. Iterate over those + * conditions and see which condition(s) has status = false to find out what + * is wrong with the Pipeline. + * + * Generated from protobuf field bool status = 3; + * @return bool + */ + public function getStatus() + { + return $this->status; + } + + /** + * True if the Pipeline is in a valid state. Otherwise at least one condition + * in `PipelineCondition` is in an invalid state. Iterate over those + * conditions and see which condition(s) has status = false to find out what + * is wrong with the Pipeline. + * + * Generated from protobuf field bool status = 3; + * @param bool $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkBool($var); + $this->status = $var; + + return $this; + } + + /** + * Last time the condition was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Last time the condition was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/PrivatePool.php b/Deploy/src/V1/PrivatePool.php new file mode 100644 index 000000000000..e09ea165590b --- /dev/null +++ b/Deploy/src/V1/PrivatePool.php @@ -0,0 +1,159 @@ +google.cloud.deploy.v1.PrivatePool + */ +class PrivatePool extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Resource name of the Cloud Build worker pool to use. The format is + * `projects/{project}/locations/{location}/workerPools/{pool}`. + * + * Generated from protobuf field string worker_pool = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $worker_pool = ''; + /** + * Optional. Google service account to use for execution. If unspecified, + * the project execution service account + * (-compute@developer.gserviceaccount.com) will be used. + * + * Generated from protobuf field string service_account = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $service_account = ''; + /** + * Optional. Cloud Storage location where execution outputs should be stored. This can + * either be a bucket ("gs://my-bucket") or a path within a bucket + * ("gs://my-bucket/my-dir"). + * If unspecified, a default bucket located in the same region will be used. + * + * Generated from protobuf field string artifact_storage = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $artifact_storage = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $worker_pool + * Required. Resource name of the Cloud Build worker pool to use. The format is + * `projects/{project}/locations/{location}/workerPools/{pool}`. + * @type string $service_account + * Optional. Google service account to use for execution. If unspecified, + * the project execution service account + * (-compute@developer.gserviceaccount.com) will be used. + * @type string $artifact_storage + * Optional. Cloud Storage location where execution outputs should be stored. This can + * either be a bucket ("gs://my-bucket") or a path within a bucket + * ("gs://my-bucket/my-dir"). + * If unspecified, a default bucket located in the same region will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Resource name of the Cloud Build worker pool to use. The format is + * `projects/{project}/locations/{location}/workerPools/{pool}`. + * + * Generated from protobuf field string worker_pool = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getWorkerPool() + { + return $this->worker_pool; + } + + /** + * Required. Resource name of the Cloud Build worker pool to use. The format is + * `projects/{project}/locations/{location}/workerPools/{pool}`. + * + * Generated from protobuf field string worker_pool = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setWorkerPool($var) + { + GPBUtil::checkString($var, True); + $this->worker_pool = $var; + + return $this; + } + + /** + * Optional. Google service account to use for execution. If unspecified, + * the project execution service account + * (-compute@developer.gserviceaccount.com) will be used. + * + * Generated from protobuf field string service_account = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. Google service account to use for execution. If unspecified, + * the project execution service account + * (-compute@developer.gserviceaccount.com) will be used. + * + * Generated from protobuf field string service_account = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Optional. Cloud Storage location where execution outputs should be stored. This can + * either be a bucket ("gs://my-bucket") or a path within a bucket + * ("gs://my-bucket/my-dir"). + * If unspecified, a default bucket located in the same region will be used. + * + * Generated from protobuf field string artifact_storage = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getArtifactStorage() + { + return $this->artifact_storage; + } + + /** + * Optional. Cloud Storage location where execution outputs should be stored. This can + * either be a bucket ("gs://my-bucket") or a path within a bucket + * ("gs://my-bucket/my-dir"). + * If unspecified, a default bucket located in the same region will be used. + * + * Generated from protobuf field string artifact_storage = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setArtifactStorage($var) + { + GPBUtil::checkString($var, True); + $this->artifact_storage = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/Release.php b/Deploy/src/V1/Release.php new file mode 100644 index 000000000000..930219516c9f --- /dev/null +++ b/Deploy/src/V1/Release.php @@ -0,0 +1,751 @@ +google.cloud.deploy.v1.Release + */ +class Release extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the `Release`. Format is projects/{project}/ + * locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/[a-z][a-z0-9\-]{0,62}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $name = ''; + /** + * Output only. Unique identifier of the `Release`. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $uid = ''; + /** + * Description of the `Release`. Max length is 255 characters. + * + * Generated from protobuf field string description = 3; + */ + private $description = ''; + /** + * User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 4; + */ + private $annotations; + /** + * Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * + * Generated from protobuf field map labels = 5; + */ + private $labels; + /** + * Output only. Time at which the `Release` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $create_time = null; + /** + * Output only. Time at which the render began. + * + * Generated from protobuf field .google.protobuf.Timestamp render_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $render_start_time = null; + /** + * Output only. Time at which the render completed. + * + * Generated from protobuf field .google.protobuf.Timestamp render_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $render_end_time = null; + /** + * Cloud Storage URI of tar.gz archive containing Skaffold configuration. + * + * Generated from protobuf field string skaffold_config_uri = 17; + */ + private $skaffold_config_uri = ''; + /** + * Filepath of the Skaffold config inside of the config URI. + * + * Generated from protobuf field string skaffold_config_path = 9; + */ + private $skaffold_config_path = ''; + /** + * List of artifacts to pass through to Skaffold command. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.BuildArtifact build_artifacts = 10; + */ + private $build_artifacts; + /** + * Output only. Snapshot of the parent pipeline taken at release creation time. + * + * Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline_snapshot = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $delivery_pipeline_snapshot = null; + /** + * Output only. Snapshot of the parent pipeline's targets taken at release creation time. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Target target_snapshots = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $target_snapshots; + /** + * Output only. Current state of the render operation. + * + * Generated from protobuf field .google.cloud.deploy.v1.Release.RenderState render_state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $render_state = 0; + /** + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 16; + */ + private $etag = ''; + /** + * The Skaffold version to use when operating on this release, such as + * "1.20.0". Not all versions are valid; Google Cloud Deploy supports a + * specific set of versions. + * If unset, the most recent supported Skaffold version will be used. + * + * Generated from protobuf field string skaffold_version = 19; + */ + private $skaffold_version = ''; + /** + * Output only. Map from target ID to the target artifacts created + * during the render operation. + * + * Generated from protobuf field map target_artifacts = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $target_artifacts; + /** + * Output only. Map from target ID to details of the render operation for that target. + * + * Generated from protobuf field map target_renders = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $target_renders; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. Name of the `Release`. Format is projects/{project}/ + * locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/[a-z][a-z0-9\-]{0,62}. + * @type string $uid + * Output only. Unique identifier of the `Release`. + * @type string $description + * Description of the `Release`. Max length is 255 characters. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time at which the `Release` was created. + * @type \Google\Protobuf\Timestamp $render_start_time + * Output only. Time at which the render began. + * @type \Google\Protobuf\Timestamp $render_end_time + * Output only. Time at which the render completed. + * @type string $skaffold_config_uri + * Cloud Storage URI of tar.gz archive containing Skaffold configuration. + * @type string $skaffold_config_path + * Filepath of the Skaffold config inside of the config URI. + * @type \Google\Cloud\Deploy\V1\BuildArtifact[]|\Google\Protobuf\Internal\RepeatedField $build_artifacts + * List of artifacts to pass through to Skaffold command. + * @type \Google\Cloud\Deploy\V1\DeliveryPipeline $delivery_pipeline_snapshot + * Output only. Snapshot of the parent pipeline taken at release creation time. + * @type \Google\Cloud\Deploy\V1\Target[]|\Google\Protobuf\Internal\RepeatedField $target_snapshots + * Output only. Snapshot of the parent pipeline's targets taken at release creation time. + * @type int $render_state + * Output only. Current state of the render operation. + * @type string $etag + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @type string $skaffold_version + * The Skaffold version to use when operating on this release, such as + * "1.20.0". Not all versions are valid; Google Cloud Deploy supports a + * specific set of versions. + * If unset, the most recent supported Skaffold version will be used. + * @type array|\Google\Protobuf\Internal\MapField $target_artifacts + * Output only. Map from target ID to the target artifacts created + * during the render operation. + * @type array|\Google\Protobuf\Internal\MapField $target_renders + * Output only. Map from target ID to details of the render operation for that target. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the `Release`. Format is projects/{project}/ + * locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/[a-z][a-z0-9\-]{0,62}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. Name of the `Release`. Format is projects/{project}/ + * locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/[a-z][a-z0-9\-]{0,62}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Unique identifier of the `Release`. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Unique identifier of the `Release`. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Description of the `Release`. Max length is 255 characters. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Description of the `Release`. Max length is 255 characters. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * + * Generated from protobuf field map labels = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * + * Generated from protobuf field map labels = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. Time at which the `Release` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Time at which the `Release` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.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. Time at which the render began. + * + * Generated from protobuf field .google.protobuf.Timestamp render_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRenderStartTime() + { + return $this->render_start_time; + } + + public function hasRenderStartTime() + { + return isset($this->render_start_time); + } + + public function clearRenderStartTime() + { + unset($this->render_start_time); + } + + /** + * Output only. Time at which the render began. + * + * Generated from protobuf field .google.protobuf.Timestamp render_start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRenderStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->render_start_time = $var; + + return $this; + } + + /** + * Output only. Time at which the render completed. + * + * Generated from protobuf field .google.protobuf.Timestamp render_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getRenderEndTime() + { + return $this->render_end_time; + } + + public function hasRenderEndTime() + { + return isset($this->render_end_time); + } + + public function clearRenderEndTime() + { + unset($this->render_end_time); + } + + /** + * Output only. Time at which the render completed. + * + * Generated from protobuf field .google.protobuf.Timestamp render_end_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setRenderEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->render_end_time = $var; + + return $this; + } + + /** + * Cloud Storage URI of tar.gz archive containing Skaffold configuration. + * + * Generated from protobuf field string skaffold_config_uri = 17; + * @return string + */ + public function getSkaffoldConfigUri() + { + return $this->skaffold_config_uri; + } + + /** + * Cloud Storage URI of tar.gz archive containing Skaffold configuration. + * + * Generated from protobuf field string skaffold_config_uri = 17; + * @param string $var + * @return $this + */ + public function setSkaffoldConfigUri($var) + { + GPBUtil::checkString($var, True); + $this->skaffold_config_uri = $var; + + return $this; + } + + /** + * Filepath of the Skaffold config inside of the config URI. + * + * Generated from protobuf field string skaffold_config_path = 9; + * @return string + */ + public function getSkaffoldConfigPath() + { + return $this->skaffold_config_path; + } + + /** + * Filepath of the Skaffold config inside of the config URI. + * + * Generated from protobuf field string skaffold_config_path = 9; + * @param string $var + * @return $this + */ + public function setSkaffoldConfigPath($var) + { + GPBUtil::checkString($var, True); + $this->skaffold_config_path = $var; + + return $this; + } + + /** + * List of artifacts to pass through to Skaffold command. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.BuildArtifact build_artifacts = 10; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBuildArtifacts() + { + return $this->build_artifacts; + } + + /** + * List of artifacts to pass through to Skaffold command. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.BuildArtifact build_artifacts = 10; + * @param \Google\Cloud\Deploy\V1\BuildArtifact[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBuildArtifacts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\BuildArtifact::class); + $this->build_artifacts = $arr; + + return $this; + } + + /** + * Output only. Snapshot of the parent pipeline taken at release creation time. + * + * Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline_snapshot = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Deploy\V1\DeliveryPipeline|null + */ + public function getDeliveryPipelineSnapshot() + { + return $this->delivery_pipeline_snapshot; + } + + public function hasDeliveryPipelineSnapshot() + { + return isset($this->delivery_pipeline_snapshot); + } + + public function clearDeliveryPipelineSnapshot() + { + unset($this->delivery_pipeline_snapshot); + } + + /** + * Output only. Snapshot of the parent pipeline taken at release creation time. + * + * Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline_snapshot = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\DeliveryPipeline $var + * @return $this + */ + public function setDeliveryPipelineSnapshot($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\DeliveryPipeline::class); + $this->delivery_pipeline_snapshot = $var; + + return $this; + } + + /** + * Output only. Snapshot of the parent pipeline's targets taken at release creation time. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Target target_snapshots = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetSnapshots() + { + return $this->target_snapshots; + } + + /** + * Output only. Snapshot of the parent pipeline's targets taken at release creation time. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Target target_snapshots = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\Target[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetSnapshots($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\Target::class); + $this->target_snapshots = $arr; + + return $this; + } + + /** + * Output only. Current state of the render operation. + * + * Generated from protobuf field .google.cloud.deploy.v1.Release.RenderState render_state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRenderState() + { + return $this->render_state; + } + + /** + * Output only. Current state of the render operation. + * + * Generated from protobuf field .google.cloud.deploy.v1.Release.RenderState render_state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRenderState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\Release\RenderState::class); + $this->render_state = $var; + + return $this; + } + + /** + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 16; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 16; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * The Skaffold version to use when operating on this release, such as + * "1.20.0". Not all versions are valid; Google Cloud Deploy supports a + * specific set of versions. + * If unset, the most recent supported Skaffold version will be used. + * + * Generated from protobuf field string skaffold_version = 19; + * @return string + */ + public function getSkaffoldVersion() + { + return $this->skaffold_version; + } + + /** + * The Skaffold version to use when operating on this release, such as + * "1.20.0". Not all versions are valid; Google Cloud Deploy supports a + * specific set of versions. + * If unset, the most recent supported Skaffold version will be used. + * + * Generated from protobuf field string skaffold_version = 19; + * @param string $var + * @return $this + */ + public function setSkaffoldVersion($var) + { + GPBUtil::checkString($var, True); + $this->skaffold_version = $var; + + return $this; + } + + /** + * Output only. Map from target ID to the target artifacts created + * during the render operation. + * + * Generated from protobuf field map target_artifacts = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTargetArtifacts() + { + return $this->target_artifacts; + } + + /** + * Output only. Map from target ID to the target artifacts created + * during the render operation. + * + * Generated from protobuf field map target_artifacts = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTargetArtifacts($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\TargetArtifact::class); + $this->target_artifacts = $arr; + + return $this; + } + + /** + * Output only. Map from target ID to details of the render operation for that target. + * + * Generated from protobuf field map target_renders = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTargetRenders() + { + return $this->target_renders; + } + + /** + * Output only. Map from target ID to details of the render operation for that target. + * + * Generated from protobuf field map target_renders = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTargetRenders($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\Release\TargetRender::class); + $this->target_renders = $arr; + + return $this; + } + +} + diff --git a/Deploy/src/V1/Release/RenderState.php b/Deploy/src/V1/Release/RenderState.php new file mode 100644 index 000000000000..d3576697abfc --- /dev/null +++ b/Deploy/src/V1/Release/RenderState.php @@ -0,0 +1,69 @@ +google.cloud.deploy.v1.Release.RenderState + */ +class RenderState +{ + /** + * The render state is unspecified. + * + * Generated from protobuf enum RENDER_STATE_UNSPECIFIED = 0; + */ + const RENDER_STATE_UNSPECIFIED = 0; + /** + * All rendering operations have completed successfully. + * + * Generated from protobuf enum SUCCEEDED = 1; + */ + const SUCCEEDED = 1; + /** + * All rendering operations have completed, and one or more have failed. + * + * Generated from protobuf enum FAILED = 2; + */ + const FAILED = 2; + /** + * Rendering has started and is not complete. + * + * Generated from protobuf enum IN_PROGRESS = 3; + */ + const IN_PROGRESS = 3; + + private static $valueToName = [ + self::RENDER_STATE_UNSPECIFIED => 'RENDER_STATE_UNSPECIFIED', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::IN_PROGRESS => 'IN_PROGRESS', + ]; + + 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/Deploy/src/V1/Release/TargetRender.php b/Deploy/src/V1/Release/TargetRender.php new file mode 100644 index 000000000000..ff132c28c862 --- /dev/null +++ b/Deploy/src/V1/Release/TargetRender.php @@ -0,0 +1,110 @@ +google.cloud.deploy.v1.Release.TargetRender + */ +class TargetRender extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource name of the Cloud Build `Build` object that is used to + * render the manifest for this target. Format is + * `projects/{project}/locations/{location}/builds/{build}`. + * + * Generated from protobuf field string rendering_build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + private $rendering_build = ''; + /** + * Output only. Current state of the render operation for this Target. + * + * Generated from protobuf field .google.cloud.deploy.v1.Release.TargetRender.TargetRenderState rendering_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $rendering_state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $rendering_build + * Output only. The resource name of the Cloud Build `Build` object that is used to + * render the manifest for this target. Format is + * `projects/{project}/locations/{location}/builds/{build}`. + * @type int $rendering_state + * Output only. Current state of the render operation for this Target. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The resource name of the Cloud Build `Build` object that is used to + * render the manifest for this target. Format is + * `projects/{project}/locations/{location}/builds/{build}`. + * + * Generated from protobuf field string rendering_build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getRenderingBuild() + { + return $this->rendering_build; + } + + /** + * Output only. The resource name of the Cloud Build `Build` object that is used to + * render the manifest for this target. Format is + * `projects/{project}/locations/{location}/builds/{build}`. + * + * Generated from protobuf field string rendering_build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setRenderingBuild($var) + { + GPBUtil::checkString($var, True); + $this->rendering_build = $var; + + return $this; + } + + /** + * Output only. Current state of the render operation for this Target. + * + * Generated from protobuf field .google.cloud.deploy.v1.Release.TargetRender.TargetRenderState rendering_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getRenderingState() + { + return $this->rendering_state; + } + + /** + * Output only. Current state of the render operation for this Target. + * + * Generated from protobuf field .google.cloud.deploy.v1.Release.TargetRender.TargetRenderState rendering_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setRenderingState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\Release\TargetRender\TargetRenderState::class); + $this->rendering_state = $var; + + return $this; + } + +} + + diff --git a/Deploy/src/V1/Release/TargetRender/TargetRenderState.php b/Deploy/src/V1/Release/TargetRender/TargetRenderState.php new file mode 100644 index 000000000000..3f4840b1272f --- /dev/null +++ b/Deploy/src/V1/Release/TargetRender/TargetRenderState.php @@ -0,0 +1,71 @@ +google.cloud.deploy.v1.Release.TargetRender.TargetRenderState + */ +class TargetRenderState +{ + /** + * The render operation state is unspecified. + * + * Generated from protobuf enum TARGET_RENDER_STATE_UNSPECIFIED = 0; + */ + const TARGET_RENDER_STATE_UNSPECIFIED = 0; + /** + * The render operation has completed successfully. + * + * Generated from protobuf enum SUCCEEDED = 1; + */ + const SUCCEEDED = 1; + /** + * The render operation has failed. + * + * Generated from protobuf enum FAILED = 2; + */ + const FAILED = 2; + /** + * The render operation is in progress. + * + * Generated from protobuf enum IN_PROGRESS = 3; + */ + const IN_PROGRESS = 3; + + private static $valueToName = [ + self::TARGET_RENDER_STATE_UNSPECIFIED => 'TARGET_RENDER_STATE_UNSPECIFIED', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::IN_PROGRESS => 'IN_PROGRESS', + ]; + + 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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TargetRenderState::class, \Google\Cloud\Deploy\V1\Release_TargetRender_TargetRenderState::class); + diff --git a/Deploy/src/V1/Rollout.php b/Deploy/src/V1/Rollout.php new file mode 100644 index 000000000000..91bbfa7c3ddd --- /dev/null +++ b/Deploy/src/V1/Rollout.php @@ -0,0 +1,688 @@ +google.cloud.deploy.v1.Rollout + */ +class Rollout extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the `Rollout`. Format is projects/{project}/ + * locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $name = ''; + /** + * Output only. Unique identifier of the `Rollout`. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $uid = ''; + /** + * Description of the `Rollout` for user purposes. Max length is 255 + * characters. + * + * Generated from protobuf field string description = 3; + */ + private $description = ''; + /** + * User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 4; + */ + private $annotations; + /** + * Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * + * Generated from protobuf field map labels = 5; + */ + private $labels; + /** + * Output only. Time at which the `Rollout` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $create_time = null; + /** + * Output only. Time at which the `Rollout` was approved. + * + * Generated from protobuf field .google.protobuf.Timestamp approve_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $approve_time = null; + /** + * Output only. Time at which the `Rollout` was enqueued. + * + * Generated from protobuf field .google.protobuf.Timestamp enqueue_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $enqueue_time = null; + /** + * Output only. Time at which the `Rollout` started deploying. + * + * Generated from protobuf field .google.protobuf.Timestamp deploy_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $deploy_start_time = null; + /** + * Output only. Time at which the `Rollout` finished deploying. + * + * Generated from protobuf field .google.protobuf.Timestamp deploy_end_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $deploy_end_time = null; + /** + * Required. The ID of Target to which this `Rollout` is deploying. + * + * Generated from protobuf field string target_id = 18 [(.google.api.field_behavior) = REQUIRED]; + */ + private $target_id = ''; + /** + * Output only. Approval state of the `Rollout`. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollout.ApprovalState approval_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $approval_state = 0; + /** + * Output only. Current state of the `Rollout`. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollout.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $state = 0; + /** + * Output only. Reason the build failed. Empty if the build succeeded. + * + * Generated from protobuf field string failure_reason = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $failure_reason = ''; + /** + * Output only. The resource name of the Cloud Build `Build` object that is used to deploy + * the Rollout. Format is + * `projects/{project}/locations/{location}/builds/{build}`. + * + * Generated from protobuf field string deploying_build = 17 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + private $deploying_build = ''; + /** + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 16; + */ + private $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. Name of the `Rollout`. Format is projects/{project}/ + * locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * @type string $uid + * Output only. Unique identifier of the `Rollout`. + * @type string $description + * Description of the `Rollout` for user purposes. Max length is 255 + * characters. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time at which the `Rollout` was created. + * @type \Google\Protobuf\Timestamp $approve_time + * Output only. Time at which the `Rollout` was approved. + * @type \Google\Protobuf\Timestamp $enqueue_time + * Output only. Time at which the `Rollout` was enqueued. + * @type \Google\Protobuf\Timestamp $deploy_start_time + * Output only. Time at which the `Rollout` started deploying. + * @type \Google\Protobuf\Timestamp $deploy_end_time + * Output only. Time at which the `Rollout` finished deploying. + * @type string $target_id + * Required. The ID of Target to which this `Rollout` is deploying. + * @type int $approval_state + * Output only. Approval state of the `Rollout`. + * @type int $state + * Output only. Current state of the `Rollout`. + * @type string $failure_reason + * Output only. Reason the build failed. Empty if the build succeeded. + * @type string $deploying_build + * Output only. The resource name of the Cloud Build `Build` object that is used to deploy + * the Rollout. Format is + * `projects/{project}/locations/{location}/builds/{build}`. + * @type string $etag + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the `Rollout`. Format is projects/{project}/ + * locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. Name of the `Rollout`. Format is projects/{project}/ + * locations/{location}/deliveryPipelines/{deliveryPipeline}/ + * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Unique identifier of the `Rollout`. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Unique identifier of the `Rollout`. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Description of the `Rollout` for user purposes. Max length is 255 + * characters. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Description of the `Rollout` for user purposes. Max length is 255 + * characters. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * + * Generated from protobuf field map labels = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * + * Generated from protobuf field map labels = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. Time at which the `Rollout` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Time at which the `Rollout` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.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. Time at which the `Rollout` was approved. + * + * Generated from protobuf field .google.protobuf.Timestamp approve_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getApproveTime() + { + return $this->approve_time; + } + + public function hasApproveTime() + { + return isset($this->approve_time); + } + + public function clearApproveTime() + { + unset($this->approve_time); + } + + /** + * Output only. Time at which the `Rollout` was approved. + * + * Generated from protobuf field .google.protobuf.Timestamp approve_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setApproveTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->approve_time = $var; + + return $this; + } + + /** + * Output only. Time at which the `Rollout` was enqueued. + * + * Generated from protobuf field .google.protobuf.Timestamp enqueue_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEnqueueTime() + { + return $this->enqueue_time; + } + + public function hasEnqueueTime() + { + return isset($this->enqueue_time); + } + + public function clearEnqueueTime() + { + unset($this->enqueue_time); + } + + /** + * Output only. Time at which the `Rollout` was enqueued. + * + * Generated from protobuf field .google.protobuf.Timestamp enqueue_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEnqueueTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->enqueue_time = $var; + + return $this; + } + + /** + * Output only. Time at which the `Rollout` started deploying. + * + * Generated from protobuf field .google.protobuf.Timestamp deploy_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeployStartTime() + { + return $this->deploy_start_time; + } + + public function hasDeployStartTime() + { + return isset($this->deploy_start_time); + } + + public function clearDeployStartTime() + { + unset($this->deploy_start_time); + } + + /** + * Output only. Time at which the `Rollout` started deploying. + * + * Generated from protobuf field .google.protobuf.Timestamp deploy_start_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeployStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->deploy_start_time = $var; + + return $this; + } + + /** + * Output only. Time at which the `Rollout` finished deploying. + * + * Generated from protobuf field .google.protobuf.Timestamp deploy_end_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeployEndTime() + { + return $this->deploy_end_time; + } + + public function hasDeployEndTime() + { + return isset($this->deploy_end_time); + } + + public function clearDeployEndTime() + { + unset($this->deploy_end_time); + } + + /** + * Output only. Time at which the `Rollout` finished deploying. + * + * Generated from protobuf field .google.protobuf.Timestamp deploy_end_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeployEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->deploy_end_time = $var; + + return $this; + } + + /** + * Required. The ID of Target to which this `Rollout` is deploying. + * + * Generated from protobuf field string target_id = 18 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetId() + { + return $this->target_id; + } + + /** + * Required. The ID of Target to which this `Rollout` is deploying. + * + * Generated from protobuf field string target_id = 18 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetId($var) + { + GPBUtil::checkString($var, True); + $this->target_id = $var; + + return $this; + } + + /** + * Output only. Approval state of the `Rollout`. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollout.ApprovalState approval_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getApprovalState() + { + return $this->approval_state; + } + + /** + * Output only. Approval state of the `Rollout`. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollout.ApprovalState approval_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setApprovalState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\Rollout\ApprovalState::class); + $this->approval_state = $var; + + return $this; + } + + /** + * Output only. Current state of the `Rollout`. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollout.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current state of the `Rollout`. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollout.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\Rollout\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Reason the build failed. Empty if the build succeeded. + * + * Generated from protobuf field string failure_reason = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getFailureReason() + { + return $this->failure_reason; + } + + /** + * Output only. Reason the build failed. Empty if the build succeeded. + * + * Generated from protobuf field string failure_reason = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setFailureReason($var) + { + GPBUtil::checkString($var, True); + $this->failure_reason = $var; + + return $this; + } + + /** + * Output only. The resource name of the Cloud Build `Build` object that is used to deploy + * the Rollout. Format is + * `projects/{project}/locations/{location}/builds/{build}`. + * + * Generated from protobuf field string deploying_build = 17 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getDeployingBuild() + { + return $this->deploying_build; + } + + /** + * Output only. The resource name of the Cloud Build `Build` object that is used to deploy + * the Rollout. Format is + * `projects/{project}/locations/{location}/builds/{build}`. + * + * Generated from protobuf field string deploying_build = 17 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDeployingBuild($var) + { + GPBUtil::checkString($var, True); + $this->deploying_build = $var; + + return $this; + } + + /** + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 16; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 16; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/Rollout/ApprovalState.php b/Deploy/src/V1/Rollout/ApprovalState.php new file mode 100644 index 000000000000..909547658e31 --- /dev/null +++ b/Deploy/src/V1/Rollout/ApprovalState.php @@ -0,0 +1,76 @@ +google.cloud.deploy.v1.Rollout.ApprovalState + */ +class ApprovalState +{ + /** + * The `Rollout` has an unspecified approval state. + * + * Generated from protobuf enum APPROVAL_STATE_UNSPECIFIED = 0; + */ + const APPROVAL_STATE_UNSPECIFIED = 0; + /** + * The `Rollout` requires approval. + * + * Generated from protobuf enum NEEDS_APPROVAL = 1; + */ + const NEEDS_APPROVAL = 1; + /** + * The `Rollout` does not require approval. + * + * Generated from protobuf enum DOES_NOT_NEED_APPROVAL = 2; + */ + const DOES_NOT_NEED_APPROVAL = 2; + /** + * The `Rollout` has been approved. + * + * Generated from protobuf enum APPROVED = 3; + */ + const APPROVED = 3; + /** + * The `Rollout` has been rejected. + * + * Generated from protobuf enum REJECTED = 4; + */ + const REJECTED = 4; + + private static $valueToName = [ + self::APPROVAL_STATE_UNSPECIFIED => 'APPROVAL_STATE_UNSPECIFIED', + self::NEEDS_APPROVAL => 'NEEDS_APPROVAL', + self::DOES_NOT_NEED_APPROVAL => 'DOES_NOT_NEED_APPROVAL', + self::APPROVED => 'APPROVED', + self::REJECTED => 'REJECTED', + ]; + + 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/Deploy/src/V1/Rollout/State.php b/Deploy/src/V1/Rollout/State.php new file mode 100644 index 000000000000..ddfab46599d5 --- /dev/null +++ b/Deploy/src/V1/Rollout/State.php @@ -0,0 +1,98 @@ +google.cloud.deploy.v1.Rollout.State + */ +class State +{ + /** + * The `Rollout` has an unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The `Rollout` has completed successfully. + * + * Generated from protobuf enum SUCCEEDED = 1; + */ + const SUCCEEDED = 1; + /** + * The `Rollout` has failed. + * + * Generated from protobuf enum FAILED = 2; + */ + const FAILED = 2; + /** + * The `Rollout` is being deployed. + * + * Generated from protobuf enum IN_PROGRESS = 3; + */ + const IN_PROGRESS = 3; + /** + * The `Rollout` needs approval. + * + * Generated from protobuf enum PENDING_APPROVAL = 4; + */ + const PENDING_APPROVAL = 4; + /** + * An approver rejected the `Rollout`. + * + * Generated from protobuf enum APPROVAL_REJECTED = 5; + */ + const APPROVAL_REJECTED = 5; + /** + * The `Rollout` is waiting for an earlier Rollout(s) to complete on this + * `Target`. + * + * Generated from protobuf enum PENDING = 6; + */ + const PENDING = 6; + /** + * The `Rollout` is waiting for the `Release` to be fully rendered. + * + * Generated from protobuf enum PENDING_RELEASE = 7; + */ + const PENDING_RELEASE = 7; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::IN_PROGRESS => 'IN_PROGRESS', + self::PENDING_APPROVAL => 'PENDING_APPROVAL', + self::APPROVAL_REJECTED => 'APPROVAL_REJECTED', + self::PENDING => 'PENDING', + self::PENDING_RELEASE => 'PENDING_RELEASE', + ]; + + 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/Deploy/src/V1/SerialPipeline.php b/Deploy/src/V1/SerialPipeline.php new file mode 100644 index 000000000000..26d9a0dc9415 --- /dev/null +++ b/Deploy/src/V1/SerialPipeline.php @@ -0,0 +1,71 @@ +google.cloud.deploy.v1.SerialPipeline + */ +class SerialPipeline extends \Google\Protobuf\Internal\Message +{ + /** + * Each stage specifies configuration for a `Target`. The ordering + * of this list defines the promotion flow. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Stage stages = 1; + */ + private $stages; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Deploy\V1\Stage[]|\Google\Protobuf\Internal\RepeatedField $stages + * Each stage specifies configuration for a `Target`. The ordering + * of this list defines the promotion flow. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Each stage specifies configuration for a `Target`. The ordering + * of this list defines the promotion flow. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Stage stages = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStages() + { + return $this->stages; + } + + /** + * Each stage specifies configuration for a `Target`. The ordering + * of this list defines the promotion flow. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Stage stages = 1; + * @param \Google\Cloud\Deploy\V1\Stage[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\Stage::class); + $this->stages = $arr; + + return $this; + } + +} + diff --git a/Deploy/src/V1/SkaffoldVersion.php b/Deploy/src/V1/SkaffoldVersion.php new file mode 100644 index 000000000000..ee506b8bf267 --- /dev/null +++ b/Deploy/src/V1/SkaffoldVersion.php @@ -0,0 +1,111 @@ +google.cloud.deploy.v1.SkaffoldVersion + */ +class SkaffoldVersion extends \Google\Protobuf\Internal\Message +{ + /** + * Release version number. For example, "1.20.3". + * + * Generated from protobuf field string version = 1; + */ + private $version = ''; + /** + * Date when this version is expected to no longer be supported. + * + * Generated from protobuf field .google.type.Date support_end_date = 2; + */ + private $support_end_date = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $version + * Release version number. For example, "1.20.3". + * @type \Google\Type\Date $support_end_date + * Date when this version is expected to no longer be supported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Release version number. For example, "1.20.3". + * + * Generated from protobuf field string version = 1; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Release version number. For example, "1.20.3". + * + * Generated from protobuf field string version = 1; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Date when this version is expected to no longer be supported. + * + * Generated from protobuf field .google.type.Date support_end_date = 2; + * @return \Google\Type\Date|null + */ + public function getSupportEndDate() + { + return $this->support_end_date; + } + + public function hasSupportEndDate() + { + return isset($this->support_end_date); + } + + public function clearSupportEndDate() + { + unset($this->support_end_date); + } + + /** + * Date when this version is expected to no longer be supported. + * + * Generated from protobuf field .google.type.Date support_end_date = 2; + * @param \Google\Type\Date $var + * @return $this + */ + public function setSupportEndDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->support_end_date = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/Stage.php b/Deploy/src/V1/Stage.php new file mode 100644 index 000000000000..0c0f50fdfde9 --- /dev/null +++ b/Deploy/src/V1/Stage.php @@ -0,0 +1,125 @@ +google.cloud.deploy.v1.Stage + */ +class Stage extends \Google\Protobuf\Internal\Message +{ + /** + * The target_id to which this stage points. This field refers exclusively to + * the last segment of a target name. For example, this field would just be + * `my-target` (rather than + * `projects/project/deliveryPipelines/pipeline/targets/my-target`). The + * parent `DeliveryPipeline` of the `Target` is inferred to be the parent + * `DeliveryPipeline` of the `Release` in which this `Stage` lives. + * + * Generated from protobuf field string target_id = 1; + */ + private $target_id = ''; + /** + * Skaffold profiles to use when rendering the manifest for this stage's + * `Target`. + * + * Generated from protobuf field repeated string profiles = 2; + */ + private $profiles; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $target_id + * The target_id to which this stage points. This field refers exclusively to + * the last segment of a target name. For example, this field would just be + * `my-target` (rather than + * `projects/project/deliveryPipelines/pipeline/targets/my-target`). The + * parent `DeliveryPipeline` of the `Target` is inferred to be the parent + * `DeliveryPipeline` of the `Release` in which this `Stage` lives. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $profiles + * Skaffold profiles to use when rendering the manifest for this stage's + * `Target`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * The target_id to which this stage points. This field refers exclusively to + * the last segment of a target name. For example, this field would just be + * `my-target` (rather than + * `projects/project/deliveryPipelines/pipeline/targets/my-target`). The + * parent `DeliveryPipeline` of the `Target` is inferred to be the parent + * `DeliveryPipeline` of the `Release` in which this `Stage` lives. + * + * Generated from protobuf field string target_id = 1; + * @return string + */ + public function getTargetId() + { + return $this->target_id; + } + + /** + * The target_id to which this stage points. This field refers exclusively to + * the last segment of a target name. For example, this field would just be + * `my-target` (rather than + * `projects/project/deliveryPipelines/pipeline/targets/my-target`). The + * parent `DeliveryPipeline` of the `Target` is inferred to be the parent + * `DeliveryPipeline` of the `Release` in which this `Stage` lives. + * + * Generated from protobuf field string target_id = 1; + * @param string $var + * @return $this + */ + public function setTargetId($var) + { + GPBUtil::checkString($var, True); + $this->target_id = $var; + + return $this; + } + + /** + * Skaffold profiles to use when rendering the manifest for this stage's + * `Target`. + * + * Generated from protobuf field repeated string profiles = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProfiles() + { + return $this->profiles; + } + + /** + * Skaffold profiles to use when rendering the manifest for this stage's + * `Target`. + * + * Generated from protobuf field repeated string profiles = 2; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProfiles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->profiles = $arr; + + return $this; + } + +} + diff --git a/Deploy/src/V1/Target.php b/Deploy/src/V1/Target.php new file mode 100644 index 000000000000..3aca51550f61 --- /dev/null +++ b/Deploy/src/V1/Target.php @@ -0,0 +1,539 @@ +google.cloud.deploy.v1.Target + */ +class Target extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Name of the `Target`. Format is projects/{project}/locations/{location}/ + * deliveryPipelines/{deliveryPipeline}/targets/[a-z][a-z0-9\-]{0,62}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $name = ''; + /** + * Output only. Resource id of the `Target`. + * + * Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $target_id = ''; + /** + * Output only. Unique identifier of the `Target`. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $uid = ''; + /** + * Optional. Description of the `Target`. Max length is 255 characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $description = ''; + /** + * Optional. User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Optional. Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Whether or not the `Target` requires approval. + * + * Generated from protobuf field bool require_approval = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $require_approval = false; + /** + * Output only. Time at which the `Target` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $create_time = null; + /** + * Output only. Most recent time at which the `Target` was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $update_time = null; + /** + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $etag = ''; + /** + * Configurations for all execution that relates to this `Target`. + * Each `ExecutionEnvironmentUsage` value may only be used in a single + * configuration; using the same value multiple times is an error. + * When one or more configurations are specified, they must include the + * `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values. + * When no configurations are specified, execution will use the default + * specified in `DefaultPool`. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.ExecutionConfig execution_configs = 16; + */ + private $execution_configs; + protected $deployment_target; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Optional. Name of the `Target`. Format is projects/{project}/locations/{location}/ + * deliveryPipelines/{deliveryPipeline}/targets/[a-z][a-z0-9\-]{0,62}. + * @type string $target_id + * Output only. Resource id of the `Target`. + * @type string $uid + * Output only. Unique identifier of the `Target`. + * @type string $description + * Optional. Description of the `Target`. Max length is 255 characters. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * @type bool $require_approval + * Optional. Whether or not the `Target` requires approval. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time at which the `Target` was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Most recent time at which the `Target` was updated. + * @type \Google\Cloud\Deploy\V1\GkeCluster $gke + * Information specifying a GKE Cluster. + * @type string $etag + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @type \Google\Cloud\Deploy\V1\ExecutionConfig[]|\Google\Protobuf\Internal\RepeatedField $execution_configs + * Configurations for all execution that relates to this `Target`. + * Each `ExecutionEnvironmentUsage` value may only be used in a single + * configuration; using the same value multiple times is an error. + * When one or more configurations are specified, they must include the + * `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values. + * When no configurations are specified, execution will use the default + * specified in `DefaultPool`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Name of the `Target`. Format is projects/{project}/locations/{location}/ + * deliveryPipelines/{deliveryPipeline}/targets/[a-z][a-z0-9\-]{0,62}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Optional. Name of the `Target`. Format is projects/{project}/locations/{location}/ + * deliveryPipelines/{deliveryPipeline}/targets/[a-z][a-z0-9\-]{0,62}. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Resource id of the `Target`. + * + * Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTargetId() + { + return $this->target_id; + } + + /** + * Output only. Resource id of the `Target`. + * + * Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTargetId($var) + { + GPBUtil::checkString($var, True); + $this->target_id = $var; + + return $this; + } + + /** + * Output only. Unique identifier of the `Target`. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Unique identifier of the `Target`. + * + * Generated from protobuf field string uid = 3 [(.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. Description of the `Target`. Max length is 255 characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Description of the `Target`. Max length is 255 characters. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. User annotations. These attributes can only be set and used by the + * user, and not by Google Cloud Deploy. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Optional. Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels are attributes that can be set and used by both the + * user and by Google Cloud Deploy. Labels must meet the following + * constraints: Each resource is limited to 64 labels. Keys must conform to + * the regexp: [a-zA-Z][a-zA-Z0-9_-]{0,62} Values must conform to the regexp: + * [a-zA-Z0-9_-]{0,63} Both keys and values are additionally constrained to be + * <= 128 bytes in size. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. Whether or not the `Target` requires approval. + * + * Generated from protobuf field bool require_approval = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getRequireApproval() + { + return $this->require_approval; + } + + /** + * Optional. Whether or not the `Target` requires approval. + * + * Generated from protobuf field bool require_approval = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setRequireApproval($var) + { + GPBUtil::checkBool($var); + $this->require_approval = $var; + + return $this; + } + + /** + * Output only. Time at which the `Target` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Time at which the `Target` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.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. Most recent time at which the `Target` was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. Most recent time at which the `Target` was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Information specifying a GKE Cluster. + * + * Generated from protobuf field .google.cloud.deploy.v1.GkeCluster gke = 15; + * @return \Google\Cloud\Deploy\V1\GkeCluster|null + */ + public function getGke() + { + return $this->readOneof(15); + } + + public function hasGke() + { + return $this->hasOneof(15); + } + + /** + * Information specifying a GKE Cluster. + * + * Generated from protobuf field .google.cloud.deploy.v1.GkeCluster gke = 15; + * @param \Google\Cloud\Deploy\V1\GkeCluster $var + * @return $this + */ + public function setGke($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\GkeCluster::class); + $this->writeOneof(15, $var); + + return $this; + } + + /** + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Configurations for all execution that relates to this `Target`. + * Each `ExecutionEnvironmentUsage` value may only be used in a single + * configuration; using the same value multiple times is an error. + * When one or more configurations are specified, they must include the + * `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values. + * When no configurations are specified, execution will use the default + * specified in `DefaultPool`. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.ExecutionConfig execution_configs = 16; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExecutionConfigs() + { + return $this->execution_configs; + } + + /** + * Configurations for all execution that relates to this `Target`. + * Each `ExecutionEnvironmentUsage` value may only be used in a single + * configuration; using the same value multiple times is an error. + * When one or more configurations are specified, they must include the + * `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values. + * When no configurations are specified, execution will use the default + * specified in `DefaultPool`. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.ExecutionConfig execution_configs = 16; + * @param \Google\Cloud\Deploy\V1\ExecutionConfig[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExecutionConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\ExecutionConfig::class); + $this->execution_configs = $arr; + + return $this; + } + + /** + * @return string + */ + public function getDeploymentTarget() + { + return $this->whichOneof("deployment_target"); + } + +} + diff --git a/Deploy/src/V1/TargetArtifact.php b/Deploy/src/V1/TargetArtifact.php new file mode 100644 index 000000000000..8b5f55858e8e --- /dev/null +++ b/Deploy/src/V1/TargetArtifact.php @@ -0,0 +1,149 @@ +google.cloud.deploy.v1.TargetArtifact + */ +class TargetArtifact extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. File path of the resolved Skaffold configuration relative to the URI. + * + * Generated from protobuf field string skaffold_config_path = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $skaffold_config_path = ''; + /** + * Output only. File path of the rendered manifest relative to the URI. + * + * Generated from protobuf field string manifest_path = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $manifest_path = ''; + protected $uri; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $artifact_uri + * Output only. URI of a directory containing the artifacts. This contains + * deployment configuration used by Skaffold during a rollout, and all + * paths are relative to this location. + * @type string $skaffold_config_path + * Output only. File path of the resolved Skaffold configuration relative to the URI. + * @type string $manifest_path + * Output only. File path of the rendered manifest relative to the URI. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Output only. URI of a directory containing the artifacts. This contains + * deployment configuration used by Skaffold during a rollout, and all + * paths are relative to this location. + * + * Generated from protobuf field string artifact_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getArtifactUri() + { + return $this->readOneof(4); + } + + public function hasArtifactUri() + { + return $this->hasOneof(4); + } + + /** + * Output only. URI of a directory containing the artifacts. This contains + * deployment configuration used by Skaffold during a rollout, and all + * paths are relative to this location. + * + * Generated from protobuf field string artifact_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setArtifactUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Output only. File path of the resolved Skaffold configuration relative to the URI. + * + * Generated from protobuf field string skaffold_config_path = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSkaffoldConfigPath() + { + return $this->skaffold_config_path; + } + + /** + * Output only. File path of the resolved Skaffold configuration relative to the URI. + * + * Generated from protobuf field string skaffold_config_path = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSkaffoldConfigPath($var) + { + GPBUtil::checkString($var, True); + $this->skaffold_config_path = $var; + + return $this; + } + + /** + * Output only. File path of the rendered manifest relative to the URI. + * + * Generated from protobuf field string manifest_path = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getManifestPath() + { + return $this->manifest_path; + } + + /** + * Output only. File path of the rendered manifest relative to the URI. + * + * Generated from protobuf field string manifest_path = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setManifestPath($var) + { + GPBUtil::checkString($var, True); + $this->manifest_path = $var; + + return $this; + } + + /** + * @return string + */ + public function getUri() + { + return $this->whichOneof("uri"); + } + +} + diff --git a/Deploy/src/V1/TargetsPresentCondition.php b/Deploy/src/V1/TargetsPresentCondition.php new file mode 100644 index 000000000000..28b1fa31840b --- /dev/null +++ b/Deploy/src/V1/TargetsPresentCondition.php @@ -0,0 +1,150 @@ +google.cloud.deploy.v1.TargetsPresentCondition + */ +class TargetsPresentCondition extends \Google\Protobuf\Internal\Message +{ + /** + * True if there aren't any missing Targets. + * + * Generated from protobuf field bool status = 1; + */ + private $status = false; + /** + * The list of Target names that are missing. For example, + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * + * Generated from protobuf field repeated string missing_targets = 2 [(.google.api.resource_reference) = { + */ + private $missing_targets; + /** + * Last time the condition was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + */ + private $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $status + * True if there aren't any missing Targets. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $missing_targets + * The list of Target names that are missing. For example, + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * @type \Google\Protobuf\Timestamp $update_time + * Last time the condition was updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * True if there aren't any missing Targets. + * + * Generated from protobuf field bool status = 1; + * @return bool + */ + public function getStatus() + { + return $this->status; + } + + /** + * True if there aren't any missing Targets. + * + * Generated from protobuf field bool status = 1; + * @param bool $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkBool($var); + $this->status = $var; + + return $this; + } + + /** + * The list of Target names that are missing. For example, + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * + * Generated from protobuf field repeated string missing_targets = 2 [(.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMissingTargets() + { + return $this->missing_targets; + } + + /** + * The list of Target names that are missing. For example, + * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * + * Generated from protobuf field repeated string missing_targets = 2 [(.google.api.resource_reference) = { + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMissingTargets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->missing_targets = $arr; + + return $this; + } + + /** + * Last time the condition was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Last time the condition was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/UpdateDeliveryPipelineRequest.php b/Deploy/src/V1/UpdateDeliveryPipelineRequest.php new file mode 100644 index 000000000000..edbf766a3326 --- /dev/null +++ b/Deploy/src/V1/UpdateDeliveryPipelineRequest.php @@ -0,0 +1,287 @@ +google.cloud.deploy.v1.UpdateDeliveryPipelineRequest + */ +class UpdateDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * `DeliveryPipeline` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $update_mask = null; + /** + * Required. The `DeliveryPipeline` to update. + * + * Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $delivery_pipeline = null; + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_id = ''; + /** + * Optional. If set to true, updating a `DeliveryPipeline` that does not exist will + * result in the creation of a new `DeliveryPipeline`. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $allow_missing = false; + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * `DeliveryPipeline` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\Deploy\V1\DeliveryPipeline $delivery_pipeline + * Required. The `DeliveryPipeline` to update. + * @type string $request_id + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $allow_missing + * Optional. If set to true, updating a `DeliveryPipeline` that does not exist will + * result in the creation of a new `DeliveryPipeline`. + * @type bool $validate_only + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * `DeliveryPipeline` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * 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. Field mask is used to specify the fields to be overwritten in the + * `DeliveryPipeline` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * 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. The `DeliveryPipeline` to update. + * + * Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Deploy\V1\DeliveryPipeline|null + */ + public function getDeliveryPipeline() + { + return $this->delivery_pipeline; + } + + public function hasDeliveryPipeline() + { + return isset($this->delivery_pipeline); + } + + public function clearDeliveryPipeline() + { + unset($this->delivery_pipeline); + } + + /** + * Required. The `DeliveryPipeline` to update. + * + * Generated from protobuf field .google.cloud.deploy.v1.DeliveryPipeline delivery_pipeline = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Deploy\V1\DeliveryPipeline $var + * @return $this + */ + public function setDeliveryPipeline($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\DeliveryPipeline::class); + $this->delivery_pipeline = $var; + + return $this; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set to true, updating a `DeliveryPipeline` that does not exist will + * result in the creation of a new `DeliveryPipeline`. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, updating a `DeliveryPipeline` that does not exist will + * result in the creation of a new `DeliveryPipeline`. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/UpdateTargetRequest.php b/Deploy/src/V1/UpdateTargetRequest.php new file mode 100644 index 000000000000..999237a4ad32 --- /dev/null +++ b/Deploy/src/V1/UpdateTargetRequest.php @@ -0,0 +1,287 @@ +google.cloud.deploy.v1.UpdateTargetRequest + */ +class UpdateTargetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Target resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $update_mask = null; + /** + * Required. The `Target` to update. + * + * Generated from protobuf field .google.cloud.deploy.v1.Target target = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $target = null; + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_id = ''; + /** + * Optional. If set to true, updating a `Target` that does not exist will + * result in the creation of a new `Target`. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $allow_missing = false; + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * Target resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\Deploy\V1\Target $target + * Required. The `Target` to update. + * @type string $request_id + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $allow_missing + * Optional. If set to true, updating a `Target` that does not exist will + * result in the creation of a new `Target`. + * @type bool $validate_only + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Target resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * 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. Field mask is used to specify the fields to be overwritten in the + * Target resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * 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. The `Target` to update. + * + * Generated from protobuf field .google.cloud.deploy.v1.Target target = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Deploy\V1\Target|null + */ + public function getTarget() + { + return $this->target; + } + + public function hasTarget() + { + return isset($this->target); + } + + public function clearTarget() + { + unset($this->target); + } + + /** + * Required. The `Target` to update. + * + * Generated from protobuf field .google.cloud.deploy.v1.Target target = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Deploy\V1\Target $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\Target::class); + $this->target = $var; + + return $this; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set to true, updating a `Target` that does not exist will + * result in the creation of a new `Target`. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, updating a `Target` that does not exist will + * result in the creation of a new `Target`. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set to true, the request is validated and the user is provided with + * an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/gapic_metadata.json b/Deploy/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..291d0c02af0d --- /dev/null +++ b/Deploy/src/V1/gapic_metadata.json @@ -0,0 +1,108 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.deploy.v1", + "libraryPackage": "Google\\Cloud\\Deploy\\V1", + "services": { + "CloudDeploy": { + "clients": { + "grpc": { + "libraryClient": "CloudDeployGapicClient", + "rpcs": { + "ApproveRollout": { + "methods": [ + "approveRollout" + ] + }, + "CreateDeliveryPipeline": { + "methods": [ + "createDeliveryPipeline" + ] + }, + "CreateRelease": { + "methods": [ + "createRelease" + ] + }, + "CreateRollout": { + "methods": [ + "createRollout" + ] + }, + "CreateTarget": { + "methods": [ + "createTarget" + ] + }, + "DeleteDeliveryPipeline": { + "methods": [ + "deleteDeliveryPipeline" + ] + }, + "DeleteTarget": { + "methods": [ + "deleteTarget" + ] + }, + "GetConfig": { + "methods": [ + "getConfig" + ] + }, + "GetDeliveryPipeline": { + "methods": [ + "getDeliveryPipeline" + ] + }, + "GetRelease": { + "methods": [ + "getRelease" + ] + }, + "GetRollout": { + "methods": [ + "getRollout" + ] + }, + "GetTarget": { + "methods": [ + "getTarget" + ] + }, + "ListDeliveryPipelines": { + "methods": [ + "listDeliveryPipelines" + ] + }, + "ListReleases": { + "methods": [ + "listReleases" + ] + }, + "ListRollouts": { + "methods": [ + "listRollouts" + ] + }, + "ListTargets": { + "methods": [ + "listTargets" + ] + }, + "UpdateDeliveryPipeline": { + "methods": [ + "updateDeliveryPipeline" + ] + }, + "UpdateTarget": { + "methods": [ + "updateTarget" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/Deploy/src/V1/resources/cloud_deploy_client_config.json b/Deploy/src/V1/resources/cloud_deploy_client_config.json new file mode 100644 index 000000000000..c163931a078d --- /dev/null +++ b/Deploy/src/V1/resources/cloud_deploy_client_config.json @@ -0,0 +1,134 @@ +{ + "interfaces": { + "google.cloud.deploy.v1.CloudDeploy": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ], + "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 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "ApproveRollout": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateDeliveryPipeline": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateRelease": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateRollout": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateTarget": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteDeliveryPipeline": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteTarget": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetDeliveryPipeline": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetRelease": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetRollout": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetTarget": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListDeliveryPipelines": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListReleases": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListRollouts": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListTargets": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateDeliveryPipeline": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateTarget": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/Deploy/src/V1/resources/cloud_deploy_descriptor_config.php b/Deploy/src/V1/resources/cloud_deploy_descriptor_config.php new file mode 100644 index 000000000000..2ad7ea94b89c --- /dev/null +++ b/Deploy/src/V1/resources/cloud_deploy_descriptor_config.php @@ -0,0 +1,128 @@ + [ + 'google.cloud.deploy.v1.CloudDeploy' => [ + 'CreateDeliveryPipeline' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Deploy\V1\DeliveryPipeline', + 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateRelease' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Deploy\V1\Release', + 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateRollout' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Deploy\V1\Rollout', + 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateTarget' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Deploy\V1\Target', + 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteDeliveryPipeline' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteTarget' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateDeliveryPipeline' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Deploy\V1\DeliveryPipeline', + 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateTarget' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Deploy\V1\Target', + 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListDeliveryPipelines' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDeliveryPipelines', + ], + ], + 'ListReleases' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getReleases', + ], + ], + 'ListRollouts' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRollouts', + ], + ], + 'ListTargets' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTargets', + ], + ], + ], + ], +]; diff --git a/Deploy/src/V1/resources/cloud_deploy_rest_client_config.php b/Deploy/src/V1/resources/cloud_deploy_rest_client_config.php new file mode 100644 index 000000000000..5e18a6325371 --- /dev/null +++ b/Deploy/src/V1/resources/cloud_deploy_rest_client_config.php @@ -0,0 +1,361 @@ + [ + 'google.cloud.deploy.v1.CloudDeploy' => [ + 'ApproveRollout' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:approve', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateDeliveryPipeline' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/deliveryPipelines', + 'body' => 'delivery_pipeline', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'delivery_pipeline_id', + ], + ], + 'CreateRelease' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases', + 'body' => 'release', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'release_id', + ], + ], + 'CreateRollout' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts', + 'body' => 'rollout', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'rollout_id', + ], + ], + 'CreateTarget' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/targets', + 'body' => 'target', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'target_id', + ], + ], + 'DeleteDeliveryPipeline' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTarget' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/targets/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/config}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDeliveryPipeline' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetRelease' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetRollout' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTarget' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/targets/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListDeliveryPipelines' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/deliveryPipelines', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListReleases' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/releases', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListRollouts' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/deliveryPipelines/*/releases/*}/rollouts', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTargets' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/targets', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateDeliveryPipeline' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{delivery_pipeline.name=projects/*/locations/*/deliveryPipelines/*}', + 'body' => 'delivery_pipeline', + 'placeholders' => [ + 'delivery_pipeline.name' => [ + 'getters' => [ + 'getDeliveryPipeline', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateTarget' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{target.name=projects/*/locations/*/targets/*}', + 'body' => 'target', + 'placeholders' => [ + 'target.name' => [ + 'getters' => [ + 'getTarget', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + '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.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/deliveryPipelines/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/targets/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/deliveryPipelines/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/targets/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/deliveryPipelines/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/targets/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + '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', + ], + ], + ], + ], + ], + ], +]; diff --git a/Deploy/synth.metadata b/Deploy/synth.metadata new file mode 100644 index 000000000000..a9bbb01e872a --- /dev/null +++ b/Deploy/synth.metadata @@ -0,0 +1,37 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/google-cloud-php.git", + "sha": "cdc9092264670525404e3a36b62a787deffa19d7" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "b44c45ca32db478554a3b8e2e04d317ed2f466f4", + "internalRef": "403182344" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "d4ff3cd9a9b2567cc00ab67290eeb89992b20318" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "deploy", + "apiVersion": "V1", + "language": "php", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/Deploy/synth.py b/Deploy/synth.py new file mode 100644 index 000000000000..d3b95ac0aa66 --- /dev/null +++ b/Deploy/synth.py @@ -0,0 +1,120 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# 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 subprocess +import synthtool as s +import synthtool.gcp as gcp +import logging + +logging.basicConfig(level=logging.DEBUG) + +gapic = gcp.GAPICBazel() +common = gcp.CommonTemplates() + +library = gapic.php_library( + service='deploy', + version='V1', + bazel_target='//google/cloud/deploy/v1:google-cloud-deploy-v1-php', +) + +# copy all src including partial veneer classes +s.move(library / 'src') + +# copy proto files to src also +s.move( + sources=library / 'proto/src/Google/Cloud/Deploy', + destination='src/', + excludes=['**/*_*.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", + '') +s.move(library / 'tests/') + +# copy GPBMetadata file to metadata +s.move(library / 'proto/src/GPBMetadata/Google/Cloud/Deploy', 'metadata/') + +# document and utilize apiEndpoint instead of serviceAddress +s.replace( + "**/Gapic/*GapicClient.php", + r"'serviceAddress' =>", + r"'apiEndpoint' =>") +s.replace( + "**/Gapic/*GapicClient.php", + r"@type string \$serviceAddress\n\s+\*\s+The address", + r"""@type string $serviceAddress + * **Deprecated**. This option will be removed in a future major release. Please + * utilize the `$apiEndpoint` option instead. + * @type string $apiEndpoint + * The address""") +s.replace( + "**/Gapic/*GapicClient.php", + r"\$transportConfig, and any \$serviceAddress", + r"$transportConfig, and any `$apiEndpoint`") + +# fix year +s.replace( + '**/*Client.php', + r'Copyright \d{4}', + 'Copyright 2021') +s.replace( + 'tests/**/*Test.php', + r'Copyright \d{4}', + 'Copyright 2021') + +### [START] protoc backwards compatibility fixes + +# roll back to private properties. +s.replace( + "src/**/V*/**/*.php", + r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", + r"""Generated from protobuf field \1 + */ + private $""") + +# prevent proto messages from being marked final +s.replace( + "src/**/V*/**/*.php", + r"final class", + r"class") + +### [END] protoc backwards compatibility fixes + +# fix relative cloud.google.com links +s.replace( + "src/**/V*/**/*.php", + r"(.{0,})\]\((/.{0,})\)", + r"\1](https://cloud.google.com\2)" +) + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Gapic/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=80']) diff --git a/Deploy/tests/Unit/V1/CloudDeployClientTest.php b/Deploy/tests/Unit/V1/CloudDeployClientTest.php new file mode 100644 index 000000000000..ad131342fbff --- /dev/null +++ b/Deploy/tests/Unit/V1/CloudDeployClientTest.php @@ -0,0 +1,1881 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** + * @return CloudDeployClient + */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new CloudDeployClient($options); + } + + /** + * @test + */ + public function approveRolloutTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ApproveRolloutResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + $approved = false; + $response = $client->approveRollout($formattedName, $approved); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ApproveRollout', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getApproved(); + $this->assertProtobufEquals($approved, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function approveRolloutExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + $approved = false; + try { + $client->approveRollout($formattedName, $approved); + // If the $client 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 createDeliveryPipelineTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDeliveryPipelineTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new DeliveryPipeline(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDeliveryPipelineTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $deliveryPipelineId = 'deliveryPipelineId1972590605'; + $deliveryPipeline = new DeliveryPipeline(); + $response = $client->createDeliveryPipeline($formattedParent, $deliveryPipelineId, $deliveryPipeline); + $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.deploy.v1.CloudDeploy/CreateDeliveryPipeline', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDeliveryPipelineId(); + $this->assertProtobufEquals($deliveryPipelineId, $actualValue); + $actualValue = $actualApiRequestObject->getDeliveryPipeline(); + $this->assertProtobufEquals($deliveryPipeline, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDeliveryPipelineTest'); + $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 createDeliveryPipelineExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDeliveryPipelineTest'); + $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $deliveryPipelineId = 'deliveryPipelineId1972590605'; + $deliveryPipeline = new DeliveryPipeline(); + $response = $client->createDeliveryPipeline($formattedParent, $deliveryPipelineId, $deliveryPipeline); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDeliveryPipelineTest'); + 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 createReleaseTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createReleaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $skaffoldConfigUri = 'skaffoldConfigUri-860592176'; + $skaffoldConfigPath = 'skaffoldConfigPath-908718527'; + $etag = 'etag3123477'; + $skaffoldVersion = 'skaffoldVersion-1146663017'; + $expectedResponse = new Release(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setSkaffoldConfigUri($skaffoldConfigUri); + $expectedResponse->setSkaffoldConfigPath($skaffoldConfigPath); + $expectedResponse->setEtag($etag); + $expectedResponse->setSkaffoldVersion($skaffoldVersion); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createReleaseTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $client->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $releaseId = 'releaseId-1517127597'; + $release = new Release(); + $response = $client->createRelease($formattedParent, $releaseId, $release); + $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.deploy.v1.CloudDeploy/CreateRelease', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getReleaseId(); + $this->assertProtobufEquals($releaseId, $actualValue); + $actualValue = $actualApiRequestObject->getRelease(); + $this->assertProtobufEquals($release, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createReleaseTest'); + $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 createReleaseExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createReleaseTest'); + $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 = $client->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $releaseId = 'releaseId-1517127597'; + $release = new Release(); + $response = $client->createRelease($formattedParent, $releaseId, $release); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createReleaseTest'); + 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 createRolloutTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createRolloutTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $targetId = 'targetId-815576439'; + $failureReason = 'failureReason1743941273'; + $deployingBuild = 'deployingBuild931623626'; + $etag = 'etag3123477'; + $expectedResponse = new Rollout(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setFailureReason($failureReason); + $expectedResponse->setDeployingBuild($deployingBuild); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createRolloutTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $client->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); + $rolloutId = 'rolloutId-91142551'; + $rollout = new Rollout(); + $rolloutTargetId = 'rolloutTargetId509050717'; + $rollout->setTargetId($rolloutTargetId); + $response = $client->createRollout($formattedParent, $rolloutId, $rollout); + $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.deploy.v1.CloudDeploy/CreateRollout', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getRolloutId(); + $this->assertProtobufEquals($rolloutId, $actualValue); + $actualValue = $actualApiRequestObject->getRollout(); + $this->assertProtobufEquals($rollout, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createRolloutTest'); + $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 createRolloutExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createRolloutTest'); + $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 = $client->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); + $rolloutId = 'rolloutId-91142551'; + $rollout = new Rollout(); + $rolloutTargetId = 'rolloutTargetId509050717'; + $rollout->setTargetId($rolloutTargetId); + $response = $client->createRollout($formattedParent, $rolloutId, $rollout); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createRolloutTest'); + 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 createTargetTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTargetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $targetId2 = 'targetId2-2084907012'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $requireApproval = false; + $etag = 'etag3123477'; + $expectedResponse = new Target(); + $expectedResponse->setName($name); + $expectedResponse->setTargetId($targetId2); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setRequireApproval($requireApproval); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTargetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $targetId = 'targetId-815576439'; + $target = new Target(); + $response = $client->createTarget($formattedParent, $targetId, $target); + $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.deploy.v1.CloudDeploy/CreateTarget', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getTargetId(); + $this->assertProtobufEquals($targetId, $actualValue); + $actualValue = $actualApiRequestObject->getTarget(); + $this->assertProtobufEquals($target, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTargetTest'); + $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 createTargetExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTargetTest'); + $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $targetId = 'targetId-815576439'; + $target = new Target(); + $response = $client->createTarget($formattedParent, $targetId, $target); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTargetTest'); + 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 deleteDeliveryPipelineTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteDeliveryPipelineTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteDeliveryPipelineTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $client->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $response = $client->deleteDeliveryPipeline($formattedName); + $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.deploy.v1.CloudDeploy/DeleteDeliveryPipeline', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest'); + $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 deleteDeliveryPipelineExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteDeliveryPipelineTest'); + $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 = $client->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $response = $client->deleteDeliveryPipeline($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest'); + 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 deleteTargetTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTargetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTargetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $client->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); + $response = $client->deleteTarget($formattedName); + $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.deploy.v1.CloudDeploy/DeleteTarget', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTargetTest'); + $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 deleteTargetExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTargetTest'); + $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 = $client->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); + $response = $client->deleteTarget($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTargetTest'); + 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 getConfigTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $defaultSkaffoldVersion = 'defaultSkaffoldVersion1930298837'; + $expectedResponse = new Config(); + $expectedResponse->setName($name2); + $expectedResponse->setDefaultSkaffoldVersion($defaultSkaffoldVersion); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->configName('[PROJECT]', '[LOCATION]'); + $response = $client->getConfig($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getConfigExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->configName('[PROJECT]', '[LOCATION]'); + try { + $client->getConfig($formattedName); + // If the $client 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 getDeliveryPipelineTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new DeliveryPipeline(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $response = $client->getDeliveryPipeline($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetDeliveryPipeline', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getDeliveryPipelineExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + try { + $client->getDeliveryPipeline($formattedName); + // If the $client 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 getReleaseTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $skaffoldConfigUri = 'skaffoldConfigUri-860592176'; + $skaffoldConfigPath = 'skaffoldConfigPath-908718527'; + $etag = 'etag3123477'; + $skaffoldVersion = 'skaffoldVersion-1146663017'; + $expectedResponse = new Release(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setSkaffoldConfigUri($skaffoldConfigUri); + $expectedResponse->setSkaffoldConfigPath($skaffoldConfigPath); + $expectedResponse->setEtag($etag); + $expectedResponse->setSkaffoldVersion($skaffoldVersion); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); + $response = $client->getRelease($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetRelease', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getReleaseExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); + try { + $client->getRelease($formattedName); + // If the $client 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 getRolloutTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $targetId = 'targetId-815576439'; + $failureReason = 'failureReason1743941273'; + $deployingBuild = 'deployingBuild931623626'; + $etag = 'etag3123477'; + $expectedResponse = new Rollout(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setFailureReason($failureReason); + $expectedResponse->setDeployingBuild($deployingBuild); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + $response = $client->getRollout($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetRollout', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getRolloutExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + try { + $client->getRollout($formattedName); + // If the $client 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 getTargetTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $targetId = 'targetId-815576439'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $requireApproval = false; + $etag = 'etag3123477'; + $expectedResponse = new Target(); + $expectedResponse->setName($name2); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setRequireApproval($requireApproval); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); + $response = $client->getTarget($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetTarget', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getTargetExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); + try { + $client->getTarget($formattedName); + // If the $client 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 listDeliveryPipelinesTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $deliveryPipelinesElement = new DeliveryPipeline(); + $deliveryPipelines = [ + $deliveryPipelinesElement, + ]; + $expectedResponse = new ListDeliveryPipelinesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDeliveryPipelines($deliveryPipelines); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $response = $client->listDeliveryPipelines($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDeliveryPipelines()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListDeliveryPipelines', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listDeliveryPipelinesExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + try { + $client->listDeliveryPipelines($formattedParent); + // If the $client 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 listReleasesTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $releasesElement = new Release(); + $releases = [ + $releasesElement, + ]; + $expectedResponse = new ListReleasesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setReleases($releases); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $response = $client->listReleases($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getReleases()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListReleases', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listReleasesExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + try { + $client->listReleases($formattedParent); + // If the $client 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 listRolloutsTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $rolloutsElement = new Rollout(); + $rollouts = [ + $rolloutsElement, + ]; + $expectedResponse = new ListRolloutsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRollouts($rollouts); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); + $response = $client->listRollouts($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRollouts()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListRollouts', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listRolloutsExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->releaseName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]'); + try { + $client->listRollouts($formattedParent); + // If the $client 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 listTargetsTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $targetsElement = new Target(); + $targets = [ + $targetsElement, + ]; + $expectedResponse = new ListTargetsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTargets($targets); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $response = $client->listTargets($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTargets()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListTargets', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listTargetsExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + try { + $client->listTargets($formattedParent); + // If the $client 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 updateDeliveryPipelineTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDeliveryPipelineTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new DeliveryPipeline(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateDeliveryPipelineTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $deliveryPipeline = new DeliveryPipeline(); + $response = $client->updateDeliveryPipeline($updateMask, $deliveryPipeline); + $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.deploy.v1.CloudDeploy/UpdateDeliveryPipeline', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getDeliveryPipeline(); + $this->assertProtobufEquals($deliveryPipeline, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDeliveryPipelineTest'); + $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 updateDeliveryPipelineExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDeliveryPipelineTest'); + $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(); + $deliveryPipeline = new DeliveryPipeline(); + $response = $client->updateDeliveryPipeline($updateMask, $deliveryPipeline); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDeliveryPipelineTest'); + 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 updateTargetTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTargetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $targetId = 'targetId-815576439'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $requireApproval = false; + $etag = 'etag3123477'; + $expectedResponse = new Target(); + $expectedResponse->setName($name); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setRequireApproval($requireApproval); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateTargetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $target = new Target(); + $response = $client->updateTarget($updateMask, $target); + $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.deploy.v1.CloudDeploy/UpdateTarget', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getTarget(); + $this->assertProtobufEquals($target, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTargetTest'); + $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 updateTargetExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTargetTest'); + $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(); + $target = new Target(); + $response = $client->updateTarget($updateMask, $target); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTargetTest'); + 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()); + } +} diff --git a/composer.json b/composer.json index 903dea16ddd9..b36bdc91e9ed 100644 --- a/composer.json +++ b/composer.json @@ -108,6 +108,7 @@ "google/cloud-datastore": "1.13.0", "google/cloud-datastore-admin": "0.3.0", "google/cloud-debugger": "1.4.0", + "google/cloud-deploy": "master", "google/cloud-dialogflow": "0.23.2", "google/cloud-dlp": "1.2.0", "google/cloud-dms": "0.2.1", @@ -216,6 +217,7 @@ "GPBMetadata\\Google\\Cloud\\Datafusion\\": "DataFusion/metadata", "GPBMetadata\\Google\\Cloud\\Datalabeling\\": "DataLabeling/metadata", "GPBMetadata\\Google\\Cloud\\Dataproc\\": "Dataproc/metadata", + "GPBMetadata\\Google\\Cloud\\Deploy\\": "Deploy/metadata", "GPBMetadata\\Google\\Cloud\\Dialogflow\\": "Dialogflow/metadata", "GPBMetadata\\Google\\Cloud\\Documentai\\": "DocumentAi/metadata", "GPBMetadata\\Google\\Cloud\\Domains\\": "Domains/metadata", @@ -336,6 +338,7 @@ "Google\\Cloud\\Datastore\\": "Datastore/src", "Google\\Cloud\\Datastore\\Admin\\": "DatastoreAdmin/src", "Google\\Cloud\\Debugger\\": "Debugger/src", + "Google\\Cloud\\Deploy\\": "Deploy/src", "Google\\Cloud\\Dialogflow\\": "Dialogflow/src", "Google\\Cloud\\Dlp\\": "Dlp/src", "Google\\Cloud\\DocumentAI\\": "DocumentAi/src", @@ -452,6 +455,7 @@ "Google\\Cloud\\Datastore\\Admin\\Tests\\": "DatastoreAdmin/tests", "Google\\Cloud\\Datastore\\Tests\\": "Datastore/tests", "Google\\Cloud\\Debugger\\Tests\\": "Debugger/tests", + "Google\\Cloud\\Deploy\\Tests\\": "Deploy/tests", "Google\\Cloud\\Dev\\": "dev/src", "Google\\Cloud\\Dialogflow\\Tests\\": "Dialogflow/tests", "Google\\Cloud\\Dlp\\Tests\\": "Dlp/tests", diff --git a/docs/contents/cloud-deploy.json b/docs/contents/cloud-deploy.json new file mode 100644 index 000000000000..782be852449a --- /dev/null +++ b/docs/contents/cloud-deploy.json @@ -0,0 +1,15 @@ +{ + "title": "Deploy", + "defaultService": "deploy\/readme", + "services": [ + { + "title": "Overview", + "type": "deploy\/readme" + }, + { + "title": "CloudDeployClient (v1)", + "type": "deploy\/v1\/clouddeployclient" + } + ], + "pattern": "deploy\/\\w{1,}" +} diff --git a/docs/contents/google-cloud.json b/docs/contents/google-cloud.json index 9b163be0dfee..a81e1291e823 100644 --- a/docs/contents/google-cloud.json +++ b/docs/contents/google-cloud.json @@ -30,8 +30,8 @@ "cloud-build", "cloud-channel", "cloud-compute", - "cloud-container", "cloud-contact-center-insights", + "cloud-container", "cloud-container-analysis", "cloud-core", "cloud-data-catalog", @@ -43,6 +43,7 @@ "cloud-datastore", "cloud-datastore-admin", "cloud-debugger", + "cloud-deploy", "cloud-dialogflow", "cloud-dlp", "cloud-dms", diff --git a/docs/manifest.json b/docs/manifest.json index 05c09af2ba43..5deedb86fcb8 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1141,6 +1141,14 @@ "master" ] }, + { + "id": "cloud-deploy", + "name": "google/cloud-deploy", + "defaultService": "deploy/readme", + "versions": [ + "master" + ] + }, { "id": "cloud-dialogflow", "name": "google/cloud-dialogflow",