diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index 9677c42590a3..625e50f672f7 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -710,6 +710,14 @@ "issue_tracker": "https://github.com/googleapis/google-cloud-php/issues", "api_shortname": "gsuiteaddons" }, + "GdcHardwareManagement": { + "language": "php", + "distribution_name": "google/cloud-gdchardwaremanagement", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-gdchardwaremanagement/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "gdchardwaremanagement" + }, "GeoCommonProtos": { "distribution_name": "google/geo-common-protos", "release_level": "preview", diff --git a/ApiHub/README.md b/ApiHub/README.md index f48435aa9e52..ebfaecdf4a75 100644 --- a/ApiHub/README.md +++ b/ApiHub/README.md @@ -1,6 +1,6 @@ -# Google Cloud Api Hub for PHP +# Google Cloud API Hub for PHP -> Idiomatic PHP client for [Google Cloud Api Hub](https://cloud.google.com/apigee). +> Idiomatic PHP client for [Google Cloud API Hub](https://cloud.google.com/apigee). [![Latest Stable Version](https://poser.pugx.org/google/cloud-apihub/v/stable)](https://packagist.org/packages/google/cloud-apihub) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-apihub.svg)](https://packagist.org/packages/google/cloud-apihub) diff --git a/ApiHub/composer.json b/ApiHub/composer.json index 4732326b7446..e3a1c1748dca 100644 --- a/ApiHub/composer.json +++ b/ApiHub/composer.json @@ -1,6 +1,6 @@ { "name": "google/cloud-apihub", - "description": "Google Cloud Api Hub Client for PHP", + "description": "Google Cloud API Hub Client for PHP", "license": "Apache-2.0", "minimum-stability": "stable", "autoload": { diff --git a/ApiHub/owlbot.py b/ApiHub/owlbot.py index 8360f68c1af7..03feec3c7702 100644 --- a/ApiHub/owlbot.py +++ b/ApiHub/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/ApiHub/phpunit.xml.dist b/ApiHub/phpunit.xml.dist index d26e2f5b1075..980a3073db57 100644 --- a/ApiHub/phpunit.xml.dist +++ b/ApiHub/phpunit.xml.dist @@ -9,7 +9,7 @@ - + tests/Unit diff --git a/GdcHardwareManagement/.OwlBot.yaml b/GdcHardwareManagement/.OwlBot.yaml new file mode 100644 index 000000000000..d2727393fd2d --- /dev/null +++ b/GdcHardwareManagement/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/cloud/gdchardwaremanagement/(v1alpha)/.*-php/(.*) + dest: /owl-bot-staging/GdcHardwareManagement/$1/$2 +api-name: GdcHardwareManagement diff --git a/GdcHardwareManagement/.gitattributes b/GdcHardwareManagement/.gitattributes new file mode 100644 index 000000000000..4bf0fe6f415b --- /dev/null +++ b/GdcHardwareManagement/.gitattributes @@ -0,0 +1,7 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/GdcHardwareManagement/.github/pull_request_template.md b/GdcHardwareManagement/.github/pull_request_template.md new file mode 100644 index 000000000000..f7bfc3f7bca7 --- /dev/null +++ b/GdcHardwareManagement/.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 `GdcHardwareManagement/src`, and tests in `GdcHardwareManagement/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/GdcHardwareManagement/CONTRIBUTING.md b/GdcHardwareManagement/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/GdcHardwareManagement/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. We accept +and review pull requests against the main +[Google Cloud PHP](https://github.com/googleapis/google-cloud-php) +repository, which contains all of our client libraries. You will also need to +sign a Contributor License Agreement. For more details about how to contribute, +see the +[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) +file in the main Google Cloud PHP repository. diff --git a/GdcHardwareManagement/LICENSE b/GdcHardwareManagement/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/GdcHardwareManagement/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/GdcHardwareManagement/README.md b/GdcHardwareManagement/README.md new file mode 100644 index 000000000000..ddf1c06292da --- /dev/null +++ b/GdcHardwareManagement/README.md @@ -0,0 +1,45 @@ +# Google Cloud Gdc Hardware Management for PHP + +> Idiomatic PHP client for [Google Cloud Gdc Hardware Management](https://cloud.google.com/distributed-cloud/edge/latest). + +[![Latest Stable Version](https://poser.pugx.org/google/cloud-gdchardwaremanagement/v/stable)](https://packagist.org/packages/google/cloud-gdchardwaremanagement) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-gdchardwaremanagement.svg)](https://packagist.org/packages/google/cloud-gdchardwaremanagement) + +* [API documentation](https://cloud.google.com/php/docs/reference/cloud-gdchardwaremanagement/latest) + +**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any +support requests, bug reports, or development contributions should be directed to +that project. + +### Installation + +To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). + +Now, install this component: + +```sh +$ composer require google/cloud-gdchardwaremanagement +``` + +> Browse the complete list of [Google Cloud APIs](https://cloud.google.com/php/docs/reference) +> for PHP + +This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits +offered by gRPC (such as streaming methods) please see our +[gRPC installation guide](https://cloud.google.com/php/grpc). + +### Authentication + +Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information +on authenticating your client. Once authenticated, you'll be ready to start making requests. + +### Sample + +See the [samples directory](https://github.com/googleapis/google-cloud-php-gdchardwaremanagement/tree/main/samples) for a canonical list of samples. + +### Version + +This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates. + +### Next Steps + +1. Understand the [official documentation](https://cloud.google.com/distributed-cloud/edge/latest/docs). diff --git a/GdcHardwareManagement/VERSION b/GdcHardwareManagement/VERSION new file mode 100644 index 000000000000..77d6f4ca2371 --- /dev/null +++ b/GdcHardwareManagement/VERSION @@ -0,0 +1 @@ +0.0.0 diff --git a/GdcHardwareManagement/composer.json b/GdcHardwareManagement/composer.json new file mode 100644 index 000000000000..94a26c32dbd8 --- /dev/null +++ b/GdcHardwareManagement/composer.json @@ -0,0 +1,30 @@ +{ + "name": "google/cloud-gdchardwaremanagement", + "description": "Google Cloud Gdc Hardware Management Client for PHP", + "license": "Apache-2.0", + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "Google\\Cloud\\GdcHardwareManagement\\": "src", + "GPBMetadata\\Google\\Cloud\\Gdchardwaremanagement\\": "metadata" + } + }, + "extra": { + "component": { + "id": "cloud-gdchardwaremanagement", + "path": "GdcHardwareManagement", + "target": "googleapis/google-cloud-php-gdchardwaremanagement" + } + }, + "require": { + "php": "^8.0", + "google/gax": "^1.34.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/GdcHardwareManagement/metadata/V1Alpha/Resources.php b/GdcHardwareManagement/metadata/V1Alpha/Resources.php new file mode 100644 index 000000000000..a76dad1f11c0 Binary files /dev/null and b/GdcHardwareManagement/metadata/V1Alpha/Resources.php differ diff --git a/GdcHardwareManagement/metadata/V1Alpha/Service.php b/GdcHardwareManagement/metadata/V1Alpha/Service.php new file mode 100644 index 000000000000..adf214679767 Binary files /dev/null and b/GdcHardwareManagement/metadata/V1Alpha/Service.php differ diff --git a/GdcHardwareManagement/owlbot.py b/GdcHardwareManagement/owlbot.py new file mode 100644 index 000000000000..fd2056b79a73 --- /dev/null +++ b/GdcHardwareManagement/owlbot.py @@ -0,0 +1,56 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This script is used to synthesize generated parts of this library.""" + +import logging +from pathlib import Path +import subprocess + +import synthtool as s +from synthtool.languages import php +from synthtool import _tracked_paths + +logging.basicConfig(level=logging.DEBUG) + +src = Path(f"../{php.STAGING_DIR}/GdcHardwareManagement").resolve() +dest = Path().resolve() + +# Added so that we can pass copy_excludes in the owlbot_main() call +_tracked_paths.add(src) + +php.owlbot_main(src=src, dest=dest) + +# remove class_alias code +s.replace( + "src/V*/**/*.php", + r"^// Adding a class alias for backwards compatibility with the previous class name.$" + + "\n" + + r"^class_alias\(.*\);$" + + "\n", + '') + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/GdcHardwareManagement/phpunit.xml.dist b/GdcHardwareManagement/phpunit.xml.dist new file mode 100644 index 000000000000..548b3464b98b --- /dev/null +++ b/GdcHardwareManagement/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + src + + + src/V[!a-zA-Z]* + + + + + tests/Unit + + + diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_comment.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_comment.php new file mode 100644 index 000000000000..5036edda32d9 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_comment.php @@ -0,0 +1,90 @@ +setText($commentText); + $request = (new CreateCommentRequest()) + ->setParent($formattedParent) + ->setComment($comment); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->createComment($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Comment $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $commentText = '[TEXT]'; + + create_comment_sample($formattedParent, $commentText); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_CreateComment_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_hardware.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_hardware.php new file mode 100644 index 000000000000..f6b0a652cc79 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_hardware.php @@ -0,0 +1,136 @@ +setSku($formattedHardwareConfigSku) + ->setPowerSupply($hardwareConfigPowerSupply); + $hardware = (new Hardware()) + ->setOrder($formattedHardwareOrder) + ->setSite($formattedHardwareSite) + ->setConfig($hardwareConfig) + ->setZone($formattedHardwareZone); + $request = (new CreateHardwareRequest()) + ->setParent($formattedParent) + ->setHardware($hardware); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->createHardware($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Hardware $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::locationName('[PROJECT]', '[LOCATION]'); + $formattedHardwareOrder = GDCHardwareManagementClient::orderName( + '[PROJECT]', + '[LOCATION]', + '[ORDER]' + ); + $formattedHardwareSite = GDCHardwareManagementClient::siteName('[PROJECT]', '[LOCATION]', '[SITE]'); + $formattedHardwareConfigSku = GDCHardwareManagementClient::skuName( + '[PROJECT]', + '[LOCATION]', + '[SKU]' + ); + $hardwareConfigPowerSupply = PowerSupply::POWER_SUPPLY_UNSPECIFIED; + $formattedHardwareZone = GDCHardwareManagementClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + + create_hardware_sample( + $formattedParent, + $formattedHardwareOrder, + $formattedHardwareSite, + $formattedHardwareConfigSku, + $hardwareConfigPowerSupply, + $formattedHardwareZone + ); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_CreateHardware_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_hardware_group.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_hardware_group.php new file mode 100644 index 000000000000..3717f3e187dc --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_hardware_group.php @@ -0,0 +1,128 @@ +setSku($formattedHardwareGroupConfigSku) + ->setPowerSupply($hardwareGroupConfigPowerSupply); + $hardwareGroup = (new HardwareGroup()) + ->setHardwareCount($hardwareGroupHardwareCount) + ->setConfig($hardwareGroupConfig) + ->setSite($formattedHardwareGroupSite); + $request = (new CreateHardwareGroupRequest()) + ->setParent($formattedParent) + ->setHardwareGroup($hardwareGroup); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->createHardwareGroup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var HardwareGroup $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $hardwareGroupHardwareCount = 0; + $formattedHardwareGroupConfigSku = GDCHardwareManagementClient::skuName( + '[PROJECT]', + '[LOCATION]', + '[SKU]' + ); + $hardwareGroupConfigPowerSupply = PowerSupply::POWER_SUPPLY_UNSPECIFIED; + $formattedHardwareGroupSite = GDCHardwareManagementClient::siteName( + '[PROJECT]', + '[LOCATION]', + '[SITE]' + ); + + create_hardware_group_sample( + $formattedParent, + $hardwareGroupHardwareCount, + $formattedHardwareGroupConfigSku, + $hardwareGroupConfigPowerSupply, + $formattedHardwareGroupSite + ); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_CreateHardwareGroup_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_order.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_order.php new file mode 100644 index 000000000000..a7df213f3a62 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_order.php @@ -0,0 +1,136 @@ +setGivenName($orderOrganizationContactContactsGivenName) + ->setEmail($orderOrganizationContactContactsEmail) + ->setPhone($orderOrganizationContactContactsPhone); + $orderOrganizationContactContacts = [$contact,]; + $orderOrganizationContact = (new OrganizationContact()) + ->setAddress($orderOrganizationContactAddress) + ->setContacts($orderOrganizationContactContacts); + $orderFulfillmentTime = new Timestamp(); + $order = (new Order()) + ->setOrganizationContact($orderOrganizationContact) + ->setCustomerMotivation($orderCustomerMotivation) + ->setFulfillmentTime($orderFulfillmentTime) + ->setRegionCode($orderRegionCode) + ->setBillingId($orderBillingId); + $request = (new CreateOrderRequest()) + ->setParent($formattedParent) + ->setOrder($order); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->createOrder($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Order $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::locationName('[PROJECT]', '[LOCATION]'); + $orderOrganizationContactContactsGivenName = '[GIVEN_NAME]'; + $orderOrganizationContactContactsEmail = '[EMAIL]'; + $orderOrganizationContactContactsPhone = '[PHONE]'; + $orderCustomerMotivation = '[CUSTOMER_MOTIVATION]'; + $orderRegionCode = '[REGION_CODE]'; + $orderBillingId = '[BILLING_ID]'; + + create_order_sample( + $formattedParent, + $orderOrganizationContactContactsGivenName, + $orderOrganizationContactContactsEmail, + $orderOrganizationContactContactsPhone, + $orderCustomerMotivation, + $orderRegionCode, + $orderBillingId + ); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_CreateOrder_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_site.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_site.php new file mode 100644 index 000000000000..68cbb2dfed5a --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_site.php @@ -0,0 +1,120 @@ +setGivenName($siteOrganizationContactContactsGivenName) + ->setEmail($siteOrganizationContactContactsEmail) + ->setPhone($siteOrganizationContactContactsPhone); + $siteOrganizationContactContacts = [$contact,]; + $siteOrganizationContact = (new OrganizationContact()) + ->setAddress($siteOrganizationContactAddress) + ->setContacts($siteOrganizationContactContacts); + $site = (new Site()) + ->setOrganizationContact($siteOrganizationContact) + ->setGoogleMapsPinUri($siteGoogleMapsPinUri); + $request = (new CreateSiteRequest()) + ->setParent($formattedParent) + ->setSite($site); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->createSite($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Site $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::locationName('[PROJECT]', '[LOCATION]'); + $siteOrganizationContactContactsGivenName = '[GIVEN_NAME]'; + $siteOrganizationContactContactsEmail = '[EMAIL]'; + $siteOrganizationContactContactsPhone = '[PHONE]'; + $siteGoogleMapsPinUri = '[GOOGLE_MAPS_PIN_URI]'; + + create_site_sample( + $formattedParent, + $siteOrganizationContactContactsGivenName, + $siteOrganizationContactContactsEmail, + $siteOrganizationContactContactsPhone, + $siteGoogleMapsPinUri + ); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_CreateSite_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_zone.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_zone.php new file mode 100644 index 000000000000..30f5ad9df6b3 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/create_zone.php @@ -0,0 +1,108 @@ +setGivenName($zoneContactsGivenName) + ->setEmail($zoneContactsEmail) + ->setPhone($zoneContactsPhone); + $zoneContacts = [$contact,]; + $zone = (new Zone()) + ->setContacts($zoneContacts); + $request = (new CreateZoneRequest()) + ->setParent($formattedParent) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->createZone($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Zone $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::locationName('[PROJECT]', '[LOCATION]'); + $zoneContactsGivenName = '[GIVEN_NAME]'; + $zoneContactsEmail = '[EMAIL]'; + $zoneContactsPhone = '[PHONE]'; + + create_zone_sample( + $formattedParent, + $zoneContactsGivenName, + $zoneContactsEmail, + $zoneContactsPhone + ); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_CreateZone_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/delete_hardware.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/delete_hardware.php new file mode 100644 index 000000000000..0868e055e554 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/delete_hardware.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->deleteHardware($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::hardwareName('[PROJECT]', '[LOCATION]', '[HARDWARE]'); + + delete_hardware_sample($formattedName); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_DeleteHardware_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/delete_hardware_group.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/delete_hardware_group.php new file mode 100644 index 000000000000..104f2e6f06f3 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/delete_hardware_group.php @@ -0,0 +1,87 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->deleteHardwareGroup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::hardwareGroupName( + '[PROJECT]', + '[LOCATION]', + '[ORDER]', + '[HARDWARE_GROUP]' + ); + + delete_hardware_group_sample($formattedName); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_DeleteHardwareGroup_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/delete_order.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/delete_order.php new file mode 100644 index 000000000000..d4d910906084 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/delete_order.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->deleteOrder($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + + delete_order_sample($formattedName); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_DeleteOrder_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/delete_zone.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/delete_zone.php new file mode 100644 index 000000000000..5f51b528cd5d --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/delete_zone.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->deleteZone($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + + delete_zone_sample($formattedName); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_DeleteZone_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_change_log_entry.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_change_log_entry.php new file mode 100644 index 000000000000..0c332100551c --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_change_log_entry.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ChangeLogEntry $response */ + $response = $gDCHardwareManagementClient->getChangeLogEntry($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::changeLogEntryName( + '[PROJECT]', + '[LOCATION]', + '[ORDER]', + '[CHANGE_LOG_ENTRY]' + ); + + get_change_log_entry_sample($formattedName); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_GetChangeLogEntry_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_comment.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_comment.php new file mode 100644 index 000000000000..b00a3f3fc428 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_comment.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Comment $response */ + $response = $gDCHardwareManagementClient->getComment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::commentName( + '[PROJECT]', + '[LOCATION]', + '[ORDER]', + '[COMMENT]' + ); + + get_comment_sample($formattedName); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_GetComment_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_hardware.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_hardware.php new file mode 100644 index 000000000000..be26930c2a86 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_hardware.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Hardware $response */ + $response = $gDCHardwareManagementClient->getHardware($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::hardwareName('[PROJECT]', '[LOCATION]', '[HARDWARE]'); + + get_hardware_sample($formattedName); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_GetHardware_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_hardware_group.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_hardware_group.php new file mode 100644 index 000000000000..79e822ddfb46 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_hardware_group.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var HardwareGroup $response */ + $response = $gDCHardwareManagementClient->getHardwareGroup($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::hardwareGroupName( + '[PROJECT]', + '[LOCATION]', + '[ORDER]', + '[HARDWARE_GROUP]' + ); + + get_hardware_group_sample($formattedName); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_GetHardwareGroup_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_location.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_location.php new file mode 100644 index 000000000000..9493364510cc --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_GetLocation_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_order.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_order.php new file mode 100644 index 000000000000..a8df7871f7ce --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_order.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Order $response */ + $response = $gDCHardwareManagementClient->getOrder($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + + get_order_sample($formattedName); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_GetOrder_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_site.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_site.php new file mode 100644 index 000000000000..0cddda39e372 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_site.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Site $response */ + $response = $gDCHardwareManagementClient->getSite($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::siteName('[PROJECT]', '[LOCATION]', '[SITE]'); + + get_site_sample($formattedName); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_GetSite_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_sku.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_sku.php new file mode 100644 index 000000000000..82adee4a45f7 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_sku.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Sku $response */ + $response = $gDCHardwareManagementClient->getSku($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::skuName('[PROJECT]', '[LOCATION]', '[SKU]'); + + get_sku_sample($formattedName); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_GetSku_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_zone.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_zone.php new file mode 100644 index 000000000000..a6d8d9daf5e0 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/get_zone.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Zone $response */ + $response = $gDCHardwareManagementClient->getZone($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + + get_zone_sample($formattedName); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_GetZone_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_change_log_entries.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_change_log_entries.php new file mode 100644 index 000000000000..63eb05fe6153 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_change_log_entries.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gDCHardwareManagementClient->listChangeLogEntries($request); + + /** @var ChangeLogEntry $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + + list_change_log_entries_sample($formattedParent); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_ListChangeLogEntries_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_comments.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_comments.php new file mode 100644 index 000000000000..5b4f956f4754 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_comments.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gDCHardwareManagementClient->listComments($request); + + /** @var Comment $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + + list_comments_sample($formattedParent); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_ListComments_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_hardware.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_hardware.php new file mode 100644 index 000000000000..0388e126a2c8 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_hardware.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gDCHardwareManagementClient->listHardware($request); + + /** @var Hardware $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::locationName('[PROJECT]', '[LOCATION]'); + + list_hardware_sample($formattedParent); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_ListHardware_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_hardware_groups.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_hardware_groups.php new file mode 100644 index 000000000000..d70cf14501fa --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_hardware_groups.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gDCHardwareManagementClient->listHardwareGroups($request); + + /** @var HardwareGroup $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + + list_hardware_groups_sample($formattedParent); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_ListHardwareGroups_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_locations.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_locations.php new file mode 100644 index 000000000000..7b71cf5d781b --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_ListLocations_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_orders.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_orders.php new file mode 100644 index 000000000000..507e0fe3f74e --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_orders.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gDCHardwareManagementClient->listOrders($request); + + /** @var Order $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::locationName('[PROJECT]', '[LOCATION]'); + + list_orders_sample($formattedParent); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_ListOrders_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_sites.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_sites.php new file mode 100644 index 000000000000..d23ecca097d0 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_sites.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gDCHardwareManagementClient->listSites($request); + + /** @var Site $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::locationName('[PROJECT]', '[LOCATION]'); + + list_sites_sample($formattedParent); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_ListSites_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_skus.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_skus.php new file mode 100644 index 000000000000..3e9fd5f6da5a --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_skus.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gDCHardwareManagementClient->listSkus($request); + + /** @var Sku $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::locationName('[PROJECT]', '[LOCATION]'); + + list_skus_sample($formattedParent); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_ListSkus_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_zones.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_zones.php new file mode 100644 index 000000000000..de95793282f2 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/list_zones.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gDCHardwareManagementClient->listZones($request); + + /** @var Zone $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GDCHardwareManagementClient::locationName('[PROJECT]', '[LOCATION]'); + + list_zones_sample($formattedParent); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_ListZones_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/record_action_on_comment.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/record_action_on_comment.php new file mode 100644 index 000000000000..19b2083a2c9b --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/record_action_on_comment.php @@ -0,0 +1,85 @@ +setName($formattedName) + ->setActionType($actionType); + + // Call the API and handle any network failures. + try { + /** @var Comment $response */ + $response = $gDCHardwareManagementClient->recordActionOnComment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::commentName( + '[PROJECT]', + '[LOCATION]', + '[ORDER]', + '[COMMENT]' + ); + $actionType = ActionType::ACTION_TYPE_UNSPECIFIED; + + record_action_on_comment_sample($formattedName, $actionType); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_RecordActionOnComment_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/signal_zone_state.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/signal_zone_state.php new file mode 100644 index 000000000000..1af6d24939ae --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/signal_zone_state.php @@ -0,0 +1,88 @@ +setName($formattedName) + ->setStateSignal($stateSignal); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->signalZoneState($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Zone $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $stateSignal = StateSignal::STATE_SIGNAL_UNSPECIFIED; + + signal_zone_state_sample($formattedName, $stateSignal); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_SignalZoneState_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/submit_order.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/submit_order.php new file mode 100644 index 000000000000..9e230f1556fb --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/submit_order.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->submitOrder($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Order $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = GDCHardwareManagementClient::orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + + submit_order_sample($formattedName); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_SubmitOrder_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_hardware.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_hardware.php new file mode 100644 index 000000000000..378b19811771 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_hardware.php @@ -0,0 +1,132 @@ +setSku($formattedHardwareConfigSku) + ->setPowerSupply($hardwareConfigPowerSupply); + $hardware = (new Hardware()) + ->setOrder($formattedHardwareOrder) + ->setSite($formattedHardwareSite) + ->setConfig($hardwareConfig) + ->setZone($formattedHardwareZone); + $request = (new UpdateHardwareRequest()) + ->setUpdateMask($updateMask) + ->setHardware($hardware); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->updateHardware($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Hardware $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedHardwareOrder = GDCHardwareManagementClient::orderName( + '[PROJECT]', + '[LOCATION]', + '[ORDER]' + ); + $formattedHardwareSite = GDCHardwareManagementClient::siteName('[PROJECT]', '[LOCATION]', '[SITE]'); + $formattedHardwareConfigSku = GDCHardwareManagementClient::skuName( + '[PROJECT]', + '[LOCATION]', + '[SKU]' + ); + $hardwareConfigPowerSupply = PowerSupply::POWER_SUPPLY_UNSPECIFIED; + $formattedHardwareZone = GDCHardwareManagementClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + + update_hardware_sample( + $formattedHardwareOrder, + $formattedHardwareSite, + $formattedHardwareConfigSku, + $hardwareConfigPowerSupply, + $formattedHardwareZone + ); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_UpdateHardware_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_hardware_group.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_hardware_group.php new file mode 100644 index 000000000000..a1e5b028cfa3 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_hardware_group.php @@ -0,0 +1,124 @@ +setSku($formattedHardwareGroupConfigSku) + ->setPowerSupply($hardwareGroupConfigPowerSupply); + $hardwareGroup = (new HardwareGroup()) + ->setHardwareCount($hardwareGroupHardwareCount) + ->setConfig($hardwareGroupConfig) + ->setSite($formattedHardwareGroupSite); + $request = (new UpdateHardwareGroupRequest()) + ->setUpdateMask($updateMask) + ->setHardwareGroup($hardwareGroup); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->updateHardwareGroup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var HardwareGroup $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $hardwareGroupHardwareCount = 0; + $formattedHardwareGroupConfigSku = GDCHardwareManagementClient::skuName( + '[PROJECT]', + '[LOCATION]', + '[SKU]' + ); + $hardwareGroupConfigPowerSupply = PowerSupply::POWER_SUPPLY_UNSPECIFIED; + $formattedHardwareGroupSite = GDCHardwareManagementClient::siteName( + '[PROJECT]', + '[LOCATION]', + '[SITE]' + ); + + update_hardware_group_sample( + $hardwareGroupHardwareCount, + $formattedHardwareGroupConfigSku, + $hardwareGroupConfigPowerSupply, + $formattedHardwareGroupSite + ); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_UpdateHardwareGroup_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_order.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_order.php new file mode 100644 index 000000000000..f4b7422029e5 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_order.php @@ -0,0 +1,132 @@ +setGivenName($orderOrganizationContactContactsGivenName) + ->setEmail($orderOrganizationContactContactsEmail) + ->setPhone($orderOrganizationContactContactsPhone); + $orderOrganizationContactContacts = [$contact,]; + $orderOrganizationContact = (new OrganizationContact()) + ->setAddress($orderOrganizationContactAddress) + ->setContacts($orderOrganizationContactContacts); + $orderFulfillmentTime = new Timestamp(); + $order = (new Order()) + ->setOrganizationContact($orderOrganizationContact) + ->setCustomerMotivation($orderCustomerMotivation) + ->setFulfillmentTime($orderFulfillmentTime) + ->setRegionCode($orderRegionCode) + ->setBillingId($orderBillingId); + $request = (new UpdateOrderRequest()) + ->setUpdateMask($updateMask) + ->setOrder($order); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->updateOrder($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Order $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $orderOrganizationContactContactsGivenName = '[GIVEN_NAME]'; + $orderOrganizationContactContactsEmail = '[EMAIL]'; + $orderOrganizationContactContactsPhone = '[PHONE]'; + $orderCustomerMotivation = '[CUSTOMER_MOTIVATION]'; + $orderRegionCode = '[REGION_CODE]'; + $orderBillingId = '[BILLING_ID]'; + + update_order_sample( + $orderOrganizationContactContactsGivenName, + $orderOrganizationContactContactsEmail, + $orderOrganizationContactContactsPhone, + $orderCustomerMotivation, + $orderRegionCode, + $orderBillingId + ); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_UpdateOrder_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_site.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_site.php new file mode 100644 index 000000000000..e5e0edb05607 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_site.php @@ -0,0 +1,116 @@ +setGivenName($siteOrganizationContactContactsGivenName) + ->setEmail($siteOrganizationContactContactsEmail) + ->setPhone($siteOrganizationContactContactsPhone); + $siteOrganizationContactContacts = [$contact,]; + $siteOrganizationContact = (new OrganizationContact()) + ->setAddress($siteOrganizationContactAddress) + ->setContacts($siteOrganizationContactContacts); + $site = (new Site()) + ->setOrganizationContact($siteOrganizationContact) + ->setGoogleMapsPinUri($siteGoogleMapsPinUri); + $request = (new UpdateSiteRequest()) + ->setUpdateMask($updateMask) + ->setSite($site); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->updateSite($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Site $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $siteOrganizationContactContactsGivenName = '[GIVEN_NAME]'; + $siteOrganizationContactContactsEmail = '[EMAIL]'; + $siteOrganizationContactContactsPhone = '[PHONE]'; + $siteGoogleMapsPinUri = '[GOOGLE_MAPS_PIN_URI]'; + + update_site_sample( + $siteOrganizationContactContactsGivenName, + $siteOrganizationContactContactsEmail, + $siteOrganizationContactContactsPhone, + $siteGoogleMapsPinUri + ); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_UpdateSite_sync] diff --git a/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_zone.php b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_zone.php new file mode 100644 index 000000000000..268de52f4457 --- /dev/null +++ b/GdcHardwareManagement/samples/V1alpha/GDCHardwareManagementClient/update_zone.php @@ -0,0 +1,100 @@ +setGivenName($zoneContactsGivenName) + ->setEmail($zoneContactsEmail) + ->setPhone($zoneContactsPhone); + $zoneContacts = [$contact,]; + $zone = (new Zone()) + ->setContacts($zoneContacts); + $request = (new UpdateZoneRequest()) + ->setUpdateMask($updateMask) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gDCHardwareManagementClient->updateZone($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Zone $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $zoneContactsGivenName = '[GIVEN_NAME]'; + $zoneContactsEmail = '[EMAIL]'; + $zoneContactsPhone = '[PHONE]'; + + update_zone_sample($zoneContactsGivenName, $zoneContactsEmail, $zoneContactsPhone); +} +// [END gdchardwaremanagement_v1alpha_generated_GDCHardwareManagement_UpdateZone_sync] diff --git a/GdcHardwareManagement/src/V1alpha/ChangeLogEntry.php b/GdcHardwareManagement/src/V1alpha/ChangeLogEntry.php new file mode 100644 index 000000000000..661187529988 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ChangeLogEntry.php @@ -0,0 +1,195 @@ +google.cloud.gdchardwaremanagement.v1alpha.ChangeLogEntry + */ +class ChangeLogEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Name of this change log entry. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/changeLogEntries/{change_log_entry}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Time when this change log entry was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Optional. Labels associated with this change log entry as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. Content of this log entry. + * + * Generated from protobuf field string log = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $log = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Name of this change log entry. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/changeLogEntries/{change_log_entry}` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time when this change log entry was created. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels associated with this change log entry as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * @type string $log + * Output only. Content of this log entry. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Name of this change log entry. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/changeLogEntries/{change_log_entry}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Name of this change log entry. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/changeLogEntries/{change_log_entry}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Time when this change log entry was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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 when this change log entry was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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; + } + + /** + * Optional. Labels associated with this change log entry as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels associated with this change log entry as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 3 [(.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; + } + + /** + * Output only. Content of this log entry. + * + * Generated from protobuf field string log = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLog() + { + return $this->log; + } + + /** + * Output only. Content of this log entry. + * + * Generated from protobuf field string log = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLog($var) + { + GPBUtil::checkString($var, True); + $this->log = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/Client/GDCHardwareManagementClient.php b/GdcHardwareManagement/src/V1alpha/Client/GDCHardwareManagementClient.php new file mode 100644 index 000000000000..91a873a0411b --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Client/GDCHardwareManagementClient.php @@ -0,0 +1,1570 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/gdc_hardware_management_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/gdc_hardware_management_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/gdc_hardware_management_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/gdc_hardware_management_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + * + * @experimental + */ + 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 + * + * @experimental + */ + 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; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * change_log_entry resource. + * + * @param string $project + * @param string $location + * @param string $order + * @param string $changeLogEntry + * + * @return string The formatted change_log_entry resource. + * + * @experimental + */ + public static function changeLogEntryName( + string $project, + string $location, + string $order, + string $changeLogEntry + ): string { + return self::getPathTemplate('changeLogEntry')->render([ + 'project' => $project, + 'location' => $location, + 'order' => $order, + 'change_log_entry' => $changeLogEntry, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a comment + * resource. + * + * @param string $project + * @param string $location + * @param string $order + * @param string $comment + * + * @return string The formatted comment resource. + * + * @experimental + */ + public static function commentName(string $project, string $location, string $order, string $comment): string + { + return self::getPathTemplate('comment')->render([ + 'project' => $project, + 'location' => $location, + 'order' => $order, + 'comment' => $comment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a hardware + * resource. + * + * @param string $project + * @param string $location + * @param string $hardware + * + * @return string The formatted hardware resource. + * + * @experimental + */ + public static function hardwareName(string $project, string $location, string $hardware): string + { + return self::getPathTemplate('hardware')->render([ + 'project' => $project, + 'location' => $location, + 'hardware' => $hardware, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * hardware_group resource. + * + * @param string $project + * @param string $location + * @param string $order + * @param string $hardwareGroup + * + * @return string The formatted hardware_group resource. + * + * @experimental + */ + public static function hardwareGroupName( + string $project, + string $location, + string $order, + string $hardwareGroup + ): string { + return self::getPathTemplate('hardwareGroup')->render([ + 'project' => $project, + 'location' => $location, + 'order' => $order, + 'hardware_group' => $hardwareGroup, + ]); + } + + /** + * 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. + * + * @experimental + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a order + * resource. + * + * @param string $project + * @param string $location + * @param string $order + * + * @return string The formatted order resource. + * + * @experimental + */ + public static function orderName(string $project, string $location, string $order): string + { + return self::getPathTemplate('order')->render([ + 'project' => $project, + 'location' => $location, + 'order' => $order, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a site + * resource. + * + * @param string $project + * @param string $location + * @param string $site + * + * @return string The formatted site resource. + * + * @experimental + */ + public static function siteName(string $project, string $location, string $site): string + { + return self::getPathTemplate('site')->render([ + 'project' => $project, + 'location' => $location, + 'site' => $site, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a sku + * resource. + * + * @param string $project + * @param string $location + * @param string $sku + * + * @return string The formatted sku resource. + * + * @experimental + */ + public static function skuName(string $project, string $location, string $sku): string + { + return self::getPathTemplate('sku')->render([ + 'project' => $project, + 'location' => $location, + 'sku' => $sku, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a zone + * resource. + * + * @param string $project + * @param string $location + * @param string $zone + * + * @return string The formatted zone resource. + * + * @experimental + */ + public static function zoneName(string $project, string $location, string $zone): string + { + return self::getPathTemplate('zone')->render([ + 'project' => $project, + 'location' => $location, + 'zone' => $zone, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - changeLogEntry: projects/{project}/locations/{location}/orders/{order}/changeLogEntries/{change_log_entry} + * - comment: projects/{project}/locations/{location}/orders/{order}/comments/{comment} + * - hardware: projects/{project}/locations/{location}/hardware/{hardware} + * - hardwareGroup: projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group} + * - location: projects/{project}/locations/{location} + * - order: projects/{project}/locations/{location}/orders/{order} + * - site: projects/{project}/locations/{location}/sites/{site} + * - sku: projects/{project}/locations/{location}/skus/{sku} + * - zone: projects/{project}/locations/{location}/zones/{zone} + * + * 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. + * + * @experimental + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'gdchardwaremanagement.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new comment on an order. + * + * The async variant is {@see GDCHardwareManagementClient::createCommentAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/create_comment.php + * + * @param CreateCommentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createComment(CreateCommentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateComment', $request, $callOptions)->wait(); + } + + /** + * Creates new hardware in a given project and location. + * + * The async variant is {@see GDCHardwareManagementClient::createHardwareAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/create_hardware.php + * + * @param CreateHardwareRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createHardware(CreateHardwareRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateHardware', $request, $callOptions)->wait(); + } + + /** + * Creates a new hardware group in a given order. + * + * The async variant is + * {@see GDCHardwareManagementClient::createHardwareGroupAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/create_hardware_group.php + * + * @param CreateHardwareGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createHardwareGroup(CreateHardwareGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateHardwareGroup', $request, $callOptions)->wait(); + } + + /** + * Creates a new order in a given project and location. + * + * The async variant is {@see GDCHardwareManagementClient::createOrderAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/create_order.php + * + * @param CreateOrderRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createOrder(CreateOrderRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateOrder', $request, $callOptions)->wait(); + } + + /** + * Creates a new site in a given project and location. + * + * The async variant is {@see GDCHardwareManagementClient::createSiteAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/create_site.php + * + * @param CreateSiteRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createSite(CreateSiteRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateSite', $request, $callOptions)->wait(); + } + + /** + * Creates a new zone in a given project and location. + * + * The async variant is {@see GDCHardwareManagementClient::createZoneAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/create_zone.php + * + * @param CreateZoneRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function createZone(CreateZoneRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateZone', $request, $callOptions)->wait(); + } + + /** + * Deletes hardware. + * + * The async variant is {@see GDCHardwareManagementClient::deleteHardwareAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/delete_hardware.php + * + * @param DeleteHardwareRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteHardware(DeleteHardwareRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteHardware', $request, $callOptions)->wait(); + } + + /** + * Deletes a hardware group. + * + * The async variant is + * {@see GDCHardwareManagementClient::deleteHardwareGroupAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/delete_hardware_group.php + * + * @param DeleteHardwareGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteHardwareGroup(DeleteHardwareGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteHardwareGroup', $request, $callOptions)->wait(); + } + + /** + * Deletes an order. + * + * The async variant is {@see GDCHardwareManagementClient::deleteOrderAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/delete_order.php + * + * @param DeleteOrderRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteOrder(DeleteOrderRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteOrder', $request, $callOptions)->wait(); + } + + /** + * Deletes a zone. + * + * The async variant is {@see GDCHardwareManagementClient::deleteZoneAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/delete_zone.php + * + * @param DeleteZoneRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function deleteZone(DeleteZoneRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteZone', $request, $callOptions)->wait(); + } + + /** + * Gets details of a change to an order. + * + * The async variant is + * {@see GDCHardwareManagementClient::getChangeLogEntryAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/get_change_log_entry.php + * + * @param GetChangeLogEntryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ChangeLogEntry + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getChangeLogEntry(GetChangeLogEntryRequest $request, array $callOptions = []): ChangeLogEntry + { + return $this->startApiCall('GetChangeLogEntry', $request, $callOptions)->wait(); + } + + /** + * Gets the content of a comment. + * + * The async variant is {@see GDCHardwareManagementClient::getCommentAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/get_comment.php + * + * @param GetCommentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Comment + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getComment(GetCommentRequest $request, array $callOptions = []): Comment + { + return $this->startApiCall('GetComment', $request, $callOptions)->wait(); + } + + /** + * Gets hardware details. + * + * The async variant is {@see GDCHardwareManagementClient::getHardwareAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/get_hardware.php + * + * @param GetHardwareRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Hardware + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getHardware(GetHardwareRequest $request, array $callOptions = []): Hardware + { + return $this->startApiCall('GetHardware', $request, $callOptions)->wait(); + } + + /** + * Gets details of a hardware group. + * + * The async variant is {@see GDCHardwareManagementClient::getHardwareGroupAsync()} + * . + * + * @example samples/V1alpha/GDCHardwareManagementClient/get_hardware_group.php + * + * @param GetHardwareGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return HardwareGroup + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getHardwareGroup(GetHardwareGroupRequest $request, array $callOptions = []): HardwareGroup + { + return $this->startApiCall('GetHardwareGroup', $request, $callOptions)->wait(); + } + + /** + * Gets details of an order. + * + * The async variant is {@see GDCHardwareManagementClient::getOrderAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/get_order.php + * + * @param GetOrderRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Order + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getOrder(GetOrderRequest $request, array $callOptions = []): Order + { + return $this->startApiCall('GetOrder', $request, $callOptions)->wait(); + } + + /** + * Gets details of a site. + * + * The async variant is {@see GDCHardwareManagementClient::getSiteAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/get_site.php + * + * @param GetSiteRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Site + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getSite(GetSiteRequest $request, array $callOptions = []): Site + { + return $this->startApiCall('GetSite', $request, $callOptions)->wait(); + } + + /** + * Gets details of an SKU. + * + * The async variant is {@see GDCHardwareManagementClient::getSkuAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/get_sku.php + * + * @param GetSkuRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Sku + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getSku(GetSkuRequest $request, array $callOptions = []): Sku + { + return $this->startApiCall('GetSku', $request, $callOptions)->wait(); + } + + /** + * Gets details of a zone. + * + * The async variant is {@see GDCHardwareManagementClient::getZoneAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/get_zone.php + * + * @param GetZoneRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Zone + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getZone(GetZoneRequest $request, array $callOptions = []): Zone + { + return $this->startApiCall('GetZone', $request, $callOptions)->wait(); + } + + /** + * Lists the changes made to an order. + * + * The async variant is + * {@see GDCHardwareManagementClient::listChangeLogEntriesAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/list_change_log_entries.php + * + * @param ListChangeLogEntriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listChangeLogEntries( + ListChangeLogEntriesRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListChangeLogEntries', $request, $callOptions); + } + + /** + * Lists the comments on an order. + * + * The async variant is {@see GDCHardwareManagementClient::listCommentsAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/list_comments.php + * + * @param ListCommentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listComments(ListCommentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListComments', $request, $callOptions); + } + + /** + * Lists hardware in a given project and location. + * + * The async variant is {@see GDCHardwareManagementClient::listHardwareAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/list_hardware.php + * + * @param ListHardwareRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listHardware(ListHardwareRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListHardware', $request, $callOptions); + } + + /** + * Lists hardware groups in a given order. + * + * The async variant is + * {@see GDCHardwareManagementClient::listHardwareGroupsAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/list_hardware_groups.php + * + * @param ListHardwareGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listHardwareGroups(ListHardwareGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListHardwareGroups', $request, $callOptions); + } + + /** + * Lists orders in a given project and location. + * + * The async variant is {@see GDCHardwareManagementClient::listOrdersAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/list_orders.php + * + * @param ListOrdersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listOrders(ListOrdersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListOrders', $request, $callOptions); + } + + /** + * Lists sites in a given project and location. + * + * The async variant is {@see GDCHardwareManagementClient::listSitesAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/list_sites.php + * + * @param ListSitesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listSites(ListSitesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSites', $request, $callOptions); + } + + /** + * Lists SKUs for a given project and location. + * + * The async variant is {@see GDCHardwareManagementClient::listSkusAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/list_skus.php + * + * @param ListSkusRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listSkus(ListSkusRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSkus', $request, $callOptions); + } + + /** + * Lists zones in a given project and location. + * + * The async variant is {@see GDCHardwareManagementClient::listZonesAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/list_zones.php + * + * @param ListZonesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listZones(ListZonesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListZones', $request, $callOptions); + } + + /** + * Record Action on a Comment. If the Action specified in the request is READ, + * the viewed time in the comment is set to the time the request was received. + * If the comment is already marked as read, subsequent calls will be ignored. + * If the Action is UNREAD, the viewed time is cleared from the comment. + * + * The async variant is + * {@see GDCHardwareManagementClient::recordActionOnCommentAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/record_action_on_comment.php + * + * @param RecordActionOnCommentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Comment + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function recordActionOnComment(RecordActionOnCommentRequest $request, array $callOptions = []): Comment + { + return $this->startApiCall('RecordActionOnComment', $request, $callOptions)->wait(); + } + + /** + * Signals the state of a zone. + * + * The async variant is {@see GDCHardwareManagementClient::signalZoneStateAsync()} + * . + * + * @example samples/V1alpha/GDCHardwareManagementClient/signal_zone_state.php + * + * @param SignalZoneStateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function signalZoneState(SignalZoneStateRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SignalZoneState', $request, $callOptions)->wait(); + } + + /** + * Submits an order. + * + * The async variant is {@see GDCHardwareManagementClient::submitOrderAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/submit_order.php + * + * @param SubmitOrderRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function submitOrder(SubmitOrderRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SubmitOrder', $request, $callOptions)->wait(); + } + + /** + * Updates hardware parameters. + * + * The async variant is {@see GDCHardwareManagementClient::updateHardwareAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/update_hardware.php + * + * @param UpdateHardwareRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateHardware(UpdateHardwareRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateHardware', $request, $callOptions)->wait(); + } + + /** + * Updates the parameters of a hardware group. + * + * The async variant is + * {@see GDCHardwareManagementClient::updateHardwareGroupAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/update_hardware_group.php + * + * @param UpdateHardwareGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateHardwareGroup(UpdateHardwareGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateHardwareGroup', $request, $callOptions)->wait(); + } + + /** + * Updates the parameters of an order. + * + * The async variant is {@see GDCHardwareManagementClient::updateOrderAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/update_order.php + * + * @param UpdateOrderRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateOrder(UpdateOrderRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateOrder', $request, $callOptions)->wait(); + } + + /** + * Updates the parameters of a site. + * + * The async variant is {@see GDCHardwareManagementClient::updateSiteAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/update_site.php + * + * @param UpdateSiteRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateSite(UpdateSiteRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateSite', $request, $callOptions)->wait(); + } + + /** + * Updates the parameters of a zone. + * + * The async variant is {@see GDCHardwareManagementClient::updateZoneAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/update_zone.php + * + * @param UpdateZoneRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function updateZone(UpdateZoneRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateZone', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see GDCHardwareManagementClient::getLocationAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see GDCHardwareManagementClient::listLocationsAsync()} . + * + * @example samples/V1alpha/GDCHardwareManagementClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/GdcHardwareManagement/src/V1alpha/Comment.php b/GdcHardwareManagement/src/V1alpha/Comment.php new file mode 100644 index 000000000000..0890513de32c --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Comment.php @@ -0,0 +1,319 @@ +google.cloud.gdchardwaremanagement.v1alpha.Comment + */ +class Comment extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Name of this comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Time when this comment was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Optional. Labels associated with this comment as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. Username of the author of this comment. This is auto-populated + * from the credentials used during creation of the comment. + * + * Generated from protobuf field string author = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $author = ''; + /** + * Required. Text of this comment. The length of text must be <= 1000 + * characters. + * + * Generated from protobuf field string text = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $text = ''; + /** + * Output only. Timestamp of the first time this comment was viewed by the + * customer. If the comment wasn't viewed then this timestamp will be unset. + * + * Generated from protobuf field .google.protobuf.Timestamp customer_viewed_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $customer_viewed_time = null; + /** + * Output only. The entity the author belongs to. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Entity author_entity = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $author_entity = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Name of this comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time when this comment was created. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels associated with this comment as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * @type string $author + * Output only. Username of the author of this comment. This is auto-populated + * from the credentials used during creation of the comment. + * @type string $text + * Required. Text of this comment. The length of text must be <= 1000 + * characters. + * @type \Google\Protobuf\Timestamp $customer_viewed_time + * Output only. Timestamp of the first time this comment was viewed by the + * customer. If the comment wasn't viewed then this timestamp will be unset. + * @type int $author_entity + * Output only. The entity the author belongs to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Name of this comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Name of this comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Time when this comment was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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 when this comment was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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; + } + + /** + * Optional. Labels associated with this comment as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels associated with this comment as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 3 [(.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; + } + + /** + * Output only. Username of the author of this comment. This is auto-populated + * from the credentials used during creation of the comment. + * + * Generated from protobuf field string author = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAuthor() + { + return $this->author; + } + + /** + * Output only. Username of the author of this comment. This is auto-populated + * from the credentials used during creation of the comment. + * + * Generated from protobuf field string author = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAuthor($var) + { + GPBUtil::checkString($var, True); + $this->author = $var; + + return $this; + } + + /** + * Required. Text of this comment. The length of text must be <= 1000 + * characters. + * + * Generated from protobuf field string text = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * Required. Text of this comment. The length of text must be <= 1000 + * characters. + * + * Generated from protobuf field string text = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * Output only. Timestamp of the first time this comment was viewed by the + * customer. If the comment wasn't viewed then this timestamp will be unset. + * + * Generated from protobuf field .google.protobuf.Timestamp customer_viewed_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCustomerViewedTime() + { + return $this->customer_viewed_time; + } + + public function hasCustomerViewedTime() + { + return isset($this->customer_viewed_time); + } + + public function clearCustomerViewedTime() + { + unset($this->customer_viewed_time); + } + + /** + * Output only. Timestamp of the first time this comment was viewed by the + * customer. If the comment wasn't viewed then this timestamp will be unset. + * + * Generated from protobuf field .google.protobuf.Timestamp customer_viewed_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCustomerViewedTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->customer_viewed_time = $var; + + return $this; + } + + /** + * Output only. The entity the author belongs to. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Entity author_entity = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getAuthorEntity() + { + return $this->author_entity; + } + + /** + * Output only. The entity the author belongs to. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Entity author_entity = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setAuthorEntity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Entity::class); + $this->author_entity = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/Contact.php b/GdcHardwareManagement/src/V1alpha/Contact.php new file mode 100644 index 000000000000..00fd670d6610 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Contact.php @@ -0,0 +1,251 @@ +google.cloud.gdchardwaremanagement.v1alpha.Contact + */ +class Contact extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Given name of the contact. + * + * Generated from protobuf field string given_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $given_name = ''; + /** + * Optional. Family name of the contact. + * + * Generated from protobuf field string family_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $family_name = ''; + /** + * Required. Email of the contact. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $email = ''; + /** + * Required. Phone number of the contact. + * + * Generated from protobuf field string phone = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $phone = ''; + /** + * Optional. Time zone of the contact. + * + * Generated from protobuf field .google.type.TimeZone time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $time_zone = null; + /** + * Optional. The time periods when the contact is reachable. + * If this field is empty, the contact is reachable at all times. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.TimePeriod reachable_times = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $reachable_times; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $given_name + * Required. Given name of the contact. + * @type string $family_name + * Optional. Family name of the contact. + * @type string $email + * Required. Email of the contact. + * @type string $phone + * Required. Phone number of the contact. + * @type \Google\Type\TimeZone $time_zone + * Optional. Time zone of the contact. + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\TimePeriod>|\Google\Protobuf\Internal\RepeatedField $reachable_times + * Optional. The time periods when the contact is reachable. + * If this field is empty, the contact is reachable at all times. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. Given name of the contact. + * + * Generated from protobuf field string given_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getGivenName() + { + return $this->given_name; + } + + /** + * Required. Given name of the contact. + * + * Generated from protobuf field string given_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setGivenName($var) + { + GPBUtil::checkString($var, True); + $this->given_name = $var; + + return $this; + } + + /** + * Optional. Family name of the contact. + * + * Generated from protobuf field string family_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFamilyName() + { + return $this->family_name; + } + + /** + * Optional. Family name of the contact. + * + * Generated from protobuf field string family_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkString($var, True); + $this->family_name = $var; + + return $this; + } + + /** + * Required. Email of the contact. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getEmail() + { + return $this->email; + } + + /** + * Required. Email of the contact. + * + * Generated from protobuf field string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * Required. Phone number of the contact. + * + * Generated from protobuf field string phone = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPhone() + { + return $this->phone; + } + + /** + * Required. Phone number of the contact. + * + * Generated from protobuf field string phone = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPhone($var) + { + GPBUtil::checkString($var, True); + $this->phone = $var; + + return $this; + } + + /** + * Optional. Time zone of the contact. + * + * Generated from protobuf field .google.type.TimeZone time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Type\TimeZone|null + */ + public function getTimeZone() + { + return $this->time_zone; + } + + public function hasTimeZone() + { + return isset($this->time_zone); + } + + public function clearTimeZone() + { + unset($this->time_zone); + } + + /** + * Optional. Time zone of the contact. + * + * Generated from protobuf field .google.type.TimeZone time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Type\TimeZone $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkMessage($var, \Google\Type\TimeZone::class); + $this->time_zone = $var; + + return $this; + } + + /** + * Optional. The time periods when the contact is reachable. + * If this field is empty, the contact is reachable at all times. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.TimePeriod reachable_times = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReachableTimes() + { + return $this->reachable_times; + } + + /** + * Optional. The time periods when the contact is reachable. + * If this field is empty, the contact is reachable at all times. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.TimePeriod reachable_times = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\TimePeriod>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReachableTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\TimePeriod::class); + $this->reachable_times = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/CreateCommentRequest.php b/GdcHardwareManagement/src/V1alpha/CreateCommentRequest.php new file mode 100644 index 000000000000..316fcb361de3 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/CreateCommentRequest.php @@ -0,0 +1,237 @@ +google.cloud.gdchardwaremanagement.v1alpha.CreateCommentRequest + */ +class CreateCommentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The order to create the comment on. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. ID used to uniquely identify the Comment within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The comment.name field in the request will be ignored. + * + * Generated from protobuf field string comment_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $comment_id = ''; + /** + * Required. The comment to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Comment comment = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $comment = null; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The order to create the comment on. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * Please see {@see GDCHardwareManagementClient::orderName()} for help formatting this field. + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Comment $comment Required. The comment to create. + * @param string $commentId Optional. ID used to uniquely identify the Comment within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The comment.name field in the request will be ignored. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\CreateCommentRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GdcHardwareManagement\V1alpha\Comment $comment, string $commentId): self + { + return (new self()) + ->setParent($parent) + ->setComment($comment) + ->setCommentId($commentId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The order to create the comment on. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * @type string $comment_id + * Optional. ID used to uniquely identify the Comment within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The comment.name field in the request will be ignored. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\Comment $comment + * Required. The comment to create. + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The order to create the comment on. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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 order to create the comment on. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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. ID used to uniquely identify the Comment within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The comment.name field in the request will be ignored. + * + * Generated from protobuf field string comment_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCommentId() + { + return $this->comment_id; + } + + /** + * Optional. ID used to uniquely identify the Comment within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The comment.name field in the request will be ignored. + * + * Generated from protobuf field string comment_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCommentId($var) + { + GPBUtil::checkString($var, True); + $this->comment_id = $var; + + return $this; + } + + /** + * Required. The comment to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Comment comment = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\Comment|null + */ + public function getComment() + { + return $this->comment; + } + + public function hasComment() + { + return isset($this->comment); + } + + public function clearComment() + { + unset($this->comment); + } + + /** + * Required. The comment to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Comment comment = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Comment $var + * @return $this + */ + public function setComment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Comment::class); + $this->comment = $var; + + return $this; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * 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; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/CreateHardwareGroupRequest.php b/GdcHardwareManagement/src/V1alpha/CreateHardwareGroupRequest.php new file mode 100644 index 000000000000..10d4feb8799e --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/CreateHardwareGroupRequest.php @@ -0,0 +1,237 @@ +google.cloud.gdchardwaremanagement.v1alpha.CreateHardwareGroupRequest + */ +class CreateHardwareGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The order to create the hardware group in. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. ID used to uniquely identify the HardwareGroup within its parent + * scope. This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The hardware_group.name field in the request will be ignored. + * + * Generated from protobuf field string hardware_group_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $hardware_group_id = ''; + /** + * Required. The hardware group to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup hardware_group = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $hardware_group = null; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The order to create the hardware group in. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * Please see {@see GDCHardwareManagementClient::orderName()} for help formatting this field. + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup $hardwareGroup Required. The hardware group to create. + * @param string $hardwareGroupId Optional. ID used to uniquely identify the HardwareGroup within its parent + * scope. This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The hardware_group.name field in the request will be ignored. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\CreateHardwareGroupRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup $hardwareGroup, string $hardwareGroupId): self + { + return (new self()) + ->setParent($parent) + ->setHardwareGroup($hardwareGroup) + ->setHardwareGroupId($hardwareGroupId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The order to create the hardware group in. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * @type string $hardware_group_id + * Optional. ID used to uniquely identify the HardwareGroup within its parent + * scope. This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The hardware_group.name field in the request will be ignored. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup $hardware_group + * Required. The hardware group to create. + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The order to create the hardware group in. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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 order to create the hardware group in. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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. ID used to uniquely identify the HardwareGroup within its parent + * scope. This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The hardware_group.name field in the request will be ignored. + * + * Generated from protobuf field string hardware_group_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getHardwareGroupId() + { + return $this->hardware_group_id; + } + + /** + * Optional. ID used to uniquely identify the HardwareGroup within its parent + * scope. This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The hardware_group.name field in the request will be ignored. + * + * Generated from protobuf field string hardware_group_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setHardwareGroupId($var) + { + GPBUtil::checkString($var, True); + $this->hardware_group_id = $var; + + return $this; + } + + /** + * Required. The hardware group to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup hardware_group = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup|null + */ + public function getHardwareGroup() + { + return $this->hardware_group; + } + + public function hasHardwareGroup() + { + return isset($this->hardware_group); + } + + public function clearHardwareGroup() + { + unset($this->hardware_group); + } + + /** + * Required. The hardware group to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup hardware_group = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup $var + * @return $this + */ + public function setHardwareGroup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup::class); + $this->hardware_group = $var; + + return $this; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * 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; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/CreateHardwareRequest.php b/GdcHardwareManagement/src/V1alpha/CreateHardwareRequest.php new file mode 100644 index 000000000000..694a21a6b75c --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/CreateHardwareRequest.php @@ -0,0 +1,199 @@ +google.cloud.gdchardwaremanagement.v1alpha.CreateHardwareRequest + */ +class CreateHardwareRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location to create hardware in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. ID used to uniquely identify the Hardware within its parent + * scope. This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The hardware.name field in the request will be ignored. + * + * Generated from protobuf field string hardware_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $hardware_id = ''; + /** + * Required. The resource to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Hardware hardware = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $hardware = null; + + /** + * @param string $parent Required. The project and location to create hardware in. + * Format: `projects/{project}/locations/{location}` + * Please see {@see GDCHardwareManagementClient::locationName()} for help formatting this field. + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Hardware $hardware Required. The resource to create. + * @param string $hardwareId Optional. ID used to uniquely identify the Hardware within its parent + * scope. This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The hardware.name field in the request will be ignored. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\CreateHardwareRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GdcHardwareManagement\V1alpha\Hardware $hardware, string $hardwareId): self + { + return (new self()) + ->setParent($parent) + ->setHardware($hardware) + ->setHardwareId($hardwareId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location to create hardware in. + * Format: `projects/{project}/locations/{location}` + * @type string $hardware_id + * Optional. ID used to uniquely identify the Hardware within its parent + * scope. This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The hardware.name field in the request will be ignored. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\Hardware $hardware + * Required. The resource to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location to create hardware in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location to create hardware in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. ID used to uniquely identify the Hardware within its parent + * scope. This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The hardware.name field in the request will be ignored. + * + * Generated from protobuf field string hardware_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getHardwareId() + { + return $this->hardware_id; + } + + /** + * Optional. ID used to uniquely identify the Hardware within its parent + * scope. This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The hardware.name field in the request will be ignored. + * + * Generated from protobuf field string hardware_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setHardwareId($var) + { + GPBUtil::checkString($var, True); + $this->hardware_id = $var; + + return $this; + } + + /** + * Required. The resource to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Hardware hardware = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\Hardware|null + */ + public function getHardware() + { + return $this->hardware; + } + + public function hasHardware() + { + return isset($this->hardware); + } + + public function clearHardware() + { + unset($this->hardware); + } + + /** + * Required. The resource to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Hardware hardware = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Hardware $var + * @return $this + */ + public function setHardware($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Hardware::class); + $this->hardware = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/CreateOrderRequest.php b/GdcHardwareManagement/src/V1alpha/CreateOrderRequest.php new file mode 100644 index 000000000000..ef2ff695b537 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/CreateOrderRequest.php @@ -0,0 +1,237 @@ +google.cloud.gdchardwaremanagement.v1alpha.CreateOrderRequest + */ +class CreateOrderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location to create the order in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. ID used to uniquely identify the Order within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The order.name field in the request will be ignored. + * + * Generated from protobuf field string order_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_id = ''; + /** + * Required. The order to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Order order = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $order = null; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The project and location to create the order in. + * Format: `projects/{project}/locations/{location}` + * Please see {@see GDCHardwareManagementClient::locationName()} for help formatting this field. + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Order $order Required. The order to create. + * @param string $orderId Optional. ID used to uniquely identify the Order within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The order.name field in the request will be ignored. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\CreateOrderRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GdcHardwareManagement\V1alpha\Order $order, string $orderId): self + { + return (new self()) + ->setParent($parent) + ->setOrder($order) + ->setOrderId($orderId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location to create the order in. + * Format: `projects/{project}/locations/{location}` + * @type string $order_id + * Optional. ID used to uniquely identify the Order within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The order.name field in the request will be ignored. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\Order $order + * Required. The order to create. + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location to create the order in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location to create the order in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. ID used to uniquely identify the Order within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The order.name field in the request will be ignored. + * + * Generated from protobuf field string order_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderId() + { + return $this->order_id; + } + + /** + * Optional. ID used to uniquely identify the Order within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The order.name field in the request will be ignored. + * + * Generated from protobuf field string order_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderId($var) + { + GPBUtil::checkString($var, True); + $this->order_id = $var; + + return $this; + } + + /** + * Required. The order to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Order order = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\Order|null + */ + public function getOrder() + { + return $this->order; + } + + public function hasOrder() + { + return isset($this->order); + } + + public function clearOrder() + { + unset($this->order); + } + + /** + * Required. The order to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Order order = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Order $var + * @return $this + */ + public function setOrder($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Order::class); + $this->order = $var; + + return $this; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * 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; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/CreateSiteRequest.php b/GdcHardwareManagement/src/V1alpha/CreateSiteRequest.php new file mode 100644 index 000000000000..a6c92f34e929 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/CreateSiteRequest.php @@ -0,0 +1,237 @@ +google.cloud.gdchardwaremanagement.v1alpha.CreateSiteRequest + */ +class CreateSiteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location to create the site in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. ID used to uniquely identify the Site within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The site.name field in the request will be ignored. + * + * Generated from protobuf field string site_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $site_id = ''; + /** + * Required. The site to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Site site = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $site = null; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The project and location to create the site in. + * Format: `projects/{project}/locations/{location}` + * Please see {@see GDCHardwareManagementClient::locationName()} for help formatting this field. + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Site $site Required. The site to create. + * @param string $siteId Optional. ID used to uniquely identify the Site within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The site.name field in the request will be ignored. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\CreateSiteRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GdcHardwareManagement\V1alpha\Site $site, string $siteId): self + { + return (new self()) + ->setParent($parent) + ->setSite($site) + ->setSiteId($siteId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location to create the site in. + * Format: `projects/{project}/locations/{location}` + * @type string $site_id + * Optional. ID used to uniquely identify the Site within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The site.name field in the request will be ignored. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\Site $site + * Required. The site to create. + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location to create the site in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location to create the site in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. ID used to uniquely identify the Site within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The site.name field in the request will be ignored. + * + * Generated from protobuf field string site_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSiteId() + { + return $this->site_id; + } + + /** + * Optional. ID used to uniquely identify the Site within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The site.name field in the request will be ignored. + * + * Generated from protobuf field string site_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSiteId($var) + { + GPBUtil::checkString($var, True); + $this->site_id = $var; + + return $this; + } + + /** + * Required. The site to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Site site = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\Site|null + */ + public function getSite() + { + return $this->site; + } + + public function hasSite() + { + return isset($this->site); + } + + public function clearSite() + { + unset($this->site); + } + + /** + * Required. The site to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Site site = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Site $var + * @return $this + */ + public function setSite($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Site::class); + $this->site = $var; + + return $this; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * 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; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/CreateZoneRequest.php b/GdcHardwareManagement/src/V1alpha/CreateZoneRequest.php new file mode 100644 index 000000000000..560b97b8ff6a --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/CreateZoneRequest.php @@ -0,0 +1,237 @@ +google.cloud.gdchardwaremanagement.v1alpha.CreateZoneRequest + */ +class CreateZoneRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location to create the zone in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. ID used to uniquely identify the Zone within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The zone.name field in the request will be ignored. + * + * Generated from protobuf field string zone_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $zone_id = ''; + /** + * Required. The zone to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Zone zone = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = null; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The project and location to create the zone in. + * Format: `projects/{project}/locations/{location}` + * Please see {@see GDCHardwareManagementClient::locationName()} for help formatting this field. + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Zone $zone Required. The zone to create. + * @param string $zoneId Optional. ID used to uniquely identify the Zone within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The zone.name field in the request will be ignored. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\CreateZoneRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GdcHardwareManagement\V1alpha\Zone $zone, string $zoneId): self + { + return (new self()) + ->setParent($parent) + ->setZone($zone) + ->setZoneId($zoneId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location to create the zone in. + * Format: `projects/{project}/locations/{location}` + * @type string $zone_id + * Optional. ID used to uniquely identify the Zone within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The zone.name field in the request will be ignored. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\Zone $zone + * Required. The zone to create. + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location to create the zone in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location to create the zone in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. ID used to uniquely identify the Zone within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The zone.name field in the request will be ignored. + * + * Generated from protobuf field string zone_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getZoneId() + { + return $this->zone_id; + } + + /** + * Optional. ID used to uniquely identify the Zone within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and `-` are accepted. + * The `-` character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The zone.name field in the request will be ignored. + * + * Generated from protobuf field string zone_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setZoneId($var) + { + GPBUtil::checkString($var, True); + $this->zone_id = $var; + + return $this; + } + + /** + * Required. The zone to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Zone zone = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\Zone|null + */ + public function getZone() + { + return $this->zone; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * Required. The zone to create. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Zone zone = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Zone $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Zone::class); + $this->zone = $var; + + return $this; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/DeleteHardwareGroupRequest.php b/GdcHardwareManagement/src/V1alpha/DeleteHardwareGroupRequest.php new file mode 100644 index 000000000000..0fccdacdf757 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/DeleteHardwareGroupRequest.php @@ -0,0 +1,129 @@ +google.cloud.gdchardwaremanagement.v1alpha.DeleteHardwareGroupRequest + */ +class DeleteHardwareGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. The name of the hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * Please see {@see GDCHardwareManagementClient::hardwareGroupName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\DeleteHardwareGroupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * + * 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 hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * + * 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. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * 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; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/DeleteHardwareRequest.php b/GdcHardwareManagement/src/V1alpha/DeleteHardwareRequest.php new file mode 100644 index 000000000000..42b1ac276c59 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/DeleteHardwareRequest.php @@ -0,0 +1,124 @@ +google.cloud.gdchardwaremanagement.v1alpha.DeleteHardwareRequest + */ +class DeleteHardwareRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. The name of the hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * Please see {@see GDCHardwareManagementClient::hardwareName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\DeleteHardwareRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * + * 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 hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * + * 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. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/DeleteOrderRequest.php b/GdcHardwareManagement/src/V1alpha/DeleteOrderRequest.php new file mode 100644 index 000000000000..10fab521be73 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/DeleteOrderRequest.php @@ -0,0 +1,170 @@ +google.cloud.gdchardwaremanagement.v1alpha.DeleteOrderRequest + */ +class DeleteOrderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. An option to delete any nested resources in the Order, such as a + * HardwareGroup. If true, any nested resources for this Order will also be + * deleted. Otherwise, the request will only succeed if the Order has no + * nested resources. + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force = false; + + /** + * @param string $name Required. The name of the order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * Please see {@see GDCHardwareManagementClient::orderName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\DeleteOrderRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * @type bool $force + * Optional. An option to delete any nested resources in the Order, such as a + * HardwareGroup. If true, any nested resources for this Order will also be + * deleted. Otherwise, the request will only succeed if the Order has no + * nested resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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 order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * 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. An option to delete any nested resources in the Order, such as a + * HardwareGroup. If true, any nested resources for this Order will also be + * deleted. Otherwise, the request will only succeed if the Order has no + * nested resources. + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForce() + { + return $this->force; + } + + /** + * Optional. An option to delete any nested resources in the Order, such as a + * HardwareGroup. If true, any nested resources for this Order will also be + * deleted. Otherwise, the request will only succeed if the Order has no + * nested resources. + * + * Generated from protobuf field bool force = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForce($var) + { + GPBUtil::checkBool($var); + $this->force = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/DeleteZoneRequest.php b/GdcHardwareManagement/src/V1alpha/DeleteZoneRequest.php new file mode 100644 index 000000000000..8da4fb87b0a9 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/DeleteZoneRequest.php @@ -0,0 +1,124 @@ +google.cloud.gdchardwaremanagement.v1alpha.DeleteZoneRequest + */ +class DeleteZoneRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. The name of the zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * Please see {@see GDCHardwareManagementClient::zoneName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\DeleteZoneRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * 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 zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * 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. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/Dimensions.php b/GdcHardwareManagement/src/V1alpha/Dimensions.php new file mode 100644 index 000000000000..bc911014cc42 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Dimensions.php @@ -0,0 +1,135 @@ +google.cloud.gdchardwaremanagement.v1alpha.Dimensions + */ +class Dimensions extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Width in inches. + * + * Generated from protobuf field float width_inches = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $width_inches = 0.0; + /** + * Required. Height in inches. + * + * Generated from protobuf field float height_inches = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $height_inches = 0.0; + /** + * Required. Depth in inches. + * + * Generated from protobuf field float depth_inches = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $depth_inches = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $width_inches + * Required. Width in inches. + * @type float $height_inches + * Required. Height in inches. + * @type float $depth_inches + * Required. Depth in inches. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. Width in inches. + * + * Generated from protobuf field float width_inches = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return float + */ + public function getWidthInches() + { + return $this->width_inches; + } + + /** + * Required. Width in inches. + * + * Generated from protobuf field float width_inches = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param float $var + * @return $this + */ + public function setWidthInches($var) + { + GPBUtil::checkFloat($var); + $this->width_inches = $var; + + return $this; + } + + /** + * Required. Height in inches. + * + * Generated from protobuf field float height_inches = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return float + */ + public function getHeightInches() + { + return $this->height_inches; + } + + /** + * Required. Height in inches. + * + * Generated from protobuf field float height_inches = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param float $var + * @return $this + */ + public function setHeightInches($var) + { + GPBUtil::checkFloat($var); + $this->height_inches = $var; + + return $this; + } + + /** + * Required. Depth in inches. + * + * Generated from protobuf field float depth_inches = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return float + */ + public function getDepthInches() + { + return $this->depth_inches; + } + + /** + * Required. Depth in inches. + * + * Generated from protobuf field float depth_inches = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param float $var + * @return $this + */ + public function setDepthInches($var) + { + GPBUtil::checkFloat($var); + $this->depth_inches = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/Entity.php b/GdcHardwareManagement/src/V1alpha/Entity.php new file mode 100644 index 000000000000..dcc6997b15ec --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Entity.php @@ -0,0 +1,68 @@ +google.cloud.gdchardwaremanagement.v1alpha.Entity + */ +class Entity +{ + /** + * Entity is unspecified. + * + * Generated from protobuf enum ENTITY_UNSPECIFIED = 0; + */ + const ENTITY_UNSPECIFIED = 0; + /** + * Google. + * + * Generated from protobuf enum GOOGLE = 1; + */ + const GOOGLE = 1; + /** + * Customer. + * + * Generated from protobuf enum CUSTOMER = 2; + */ + const CUSTOMER = 2; + /** + * Vendor. + * + * Generated from protobuf enum VENDOR = 3; + */ + const VENDOR = 3; + + private static $valueToName = [ + self::ENTITY_UNSPECIFIED => 'ENTITY_UNSPECIFIED', + self::GOOGLE => 'GOOGLE', + self::CUSTOMER => 'CUSTOMER', + self::VENDOR => 'VENDOR', + ]; + + 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/GdcHardwareManagement/src/V1alpha/GetChangeLogEntryRequest.php b/GdcHardwareManagement/src/V1alpha/GetChangeLogEntryRequest.php new file mode 100644 index 000000000000..97a3f0b65b63 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/GetChangeLogEntryRequest.php @@ -0,0 +1,91 @@ +google.cloud.gdchardwaremanagement.v1alpha.GetChangeLogEntryRequest + */ +class GetChangeLogEntryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the change log entry. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/changeLogEntries/{change_log_entry}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the change log entry. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/changeLogEntries/{change_log_entry}` + * Please see {@see GDCHardwareManagementClient::changeLogEntryName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\GetChangeLogEntryRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the change log entry. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/changeLogEntries/{change_log_entry}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the change log entry. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/changeLogEntries/{change_log_entry}` + * + * 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 change log entry. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/changeLogEntries/{change_log_entry}` + * + * 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/GdcHardwareManagement/src/V1alpha/GetCommentRequest.php b/GdcHardwareManagement/src/V1alpha/GetCommentRequest.php new file mode 100644 index 000000000000..c4aaef38f849 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/GetCommentRequest.php @@ -0,0 +1,91 @@ +google.cloud.gdchardwaremanagement.v1alpha.GetCommentRequest + */ +class GetCommentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * Please see {@see GDCHardwareManagementClient::commentName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\GetCommentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * + * 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 comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * + * 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/GdcHardwareManagement/src/V1alpha/GetHardwareGroupRequest.php b/GdcHardwareManagement/src/V1alpha/GetHardwareGroupRequest.php new file mode 100644 index 000000000000..7e2d715ed42a --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/GetHardwareGroupRequest.php @@ -0,0 +1,91 @@ +google.cloud.gdchardwaremanagement.v1alpha.GetHardwareGroupRequest + */ +class GetHardwareGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * Please see {@see GDCHardwareManagementClient::hardwareGroupName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\GetHardwareGroupRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * + * 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 hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * + * 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/GdcHardwareManagement/src/V1alpha/GetHardwareRequest.php b/GdcHardwareManagement/src/V1alpha/GetHardwareRequest.php new file mode 100644 index 000000000000..2685aade84c6 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/GetHardwareRequest.php @@ -0,0 +1,86 @@ +google.cloud.gdchardwaremanagement.v1alpha.GetHardwareRequest + */ +class GetHardwareRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * Please see {@see GDCHardwareManagementClient::hardwareName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\GetHardwareRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * + * 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 hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * + * 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/GdcHardwareManagement/src/V1alpha/GetOrderRequest.php b/GdcHardwareManagement/src/V1alpha/GetOrderRequest.php new file mode 100644 index 000000000000..20ca5f80ee42 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/GetOrderRequest.php @@ -0,0 +1,81 @@ +google.cloud.gdchardwaremanagement.v1alpha.GetOrderRequest + */ +class GetOrderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see GDCHardwareManagementClient::orderName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\GetOrderRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * 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 resource + * + * 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/GdcHardwareManagement/src/V1alpha/GetSiteRequest.php b/GdcHardwareManagement/src/V1alpha/GetSiteRequest.php new file mode 100644 index 000000000000..53d3355d83d3 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/GetSiteRequest.php @@ -0,0 +1,86 @@ +google.cloud.gdchardwaremanagement.v1alpha.GetSiteRequest + */ +class GetSiteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the site. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the site. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * Please see {@see GDCHardwareManagementClient::siteName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\GetSiteRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the site. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the site. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * 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 site. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * 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/GdcHardwareManagement/src/V1alpha/GetSkuRequest.php b/GdcHardwareManagement/src/V1alpha/GetSkuRequest.php new file mode 100644 index 000000000000..86d0e2db8a3c --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/GetSkuRequest.php @@ -0,0 +1,86 @@ +google.cloud.gdchardwaremanagement.v1alpha.GetSkuRequest + */ +class GetSkuRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the SKU. + * Format: `projects/{project}/locations/{location}/skus/{sku}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the SKU. + * Format: `projects/{project}/locations/{location}/skus/{sku}` + * Please see {@see GDCHardwareManagementClient::skuName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\GetSkuRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the SKU. + * Format: `projects/{project}/locations/{location}/skus/{sku}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the SKU. + * Format: `projects/{project}/locations/{location}/skus/{sku}` + * + * 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 SKU. + * Format: `projects/{project}/locations/{location}/skus/{sku}` + * + * 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/GdcHardwareManagement/src/V1alpha/GetZoneRequest.php b/GdcHardwareManagement/src/V1alpha/GetZoneRequest.php new file mode 100644 index 000000000000..f91ddac715e7 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/GetZoneRequest.php @@ -0,0 +1,86 @@ +google.cloud.gdchardwaremanagement.v1alpha.GetZoneRequest + */ +class GetZoneRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * Please see {@see GDCHardwareManagementClient::zoneName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\GetZoneRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * 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 zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * 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/GdcHardwareManagement/src/V1alpha/Hardware.php b/GdcHardwareManagement/src/V1alpha/Hardware.php new file mode 100644 index 000000000000..a7c64907e32c --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Hardware.php @@ -0,0 +1,739 @@ +google.cloud.gdchardwaremanagement.v1alpha.Hardware + */ +class Hardware extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Name of this hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. Display name for this hardware. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Output only. Time when this hardware was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Time when this hardware was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Labels associated with this hardware as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. Name of the order that this hardware belongs to. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * Generated from protobuf field string order = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $order = ''; + /** + * Output only. Name for the hardware group that this hardware belongs to. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * + * Generated from protobuf field string hardware_group = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $hardware_group = ''; + /** + * Required. Name for the site that this hardware belongs to. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * Generated from protobuf field string site = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $site = ''; + /** + * Output only. Current state for this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Hardware.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Link to the Customer Intake Questionnaire (CIQ) sheet for this + * Hardware. + * + * Generated from protobuf field string ciq_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ciq_uri = ''; + /** + * Required. Configuration for this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareConfig config = 11 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $config = null; + /** + * Output only. Estimated installation date for this hardware. + * + * Generated from protobuf field .google.type.Date estimated_installation_date = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $estimated_installation_date = null; + /** + * Optional. Physical properties of this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo physical_info = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $physical_info = null; + /** + * Optional. Information for installation of this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareInstallationInfo installation_info = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $installation_info = null; + /** + * Required. Name for the zone that this hardware belongs to. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * Generated from protobuf field string zone = 15 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $zone = ''; + /** + * Optional. Requested installation date for this hardware. This is + * auto-populated when the order is accepted, if the hardware's HardwareGroup + * specifies this. It can also be filled in by the customer. + * + * Generated from protobuf field .google.type.Date requested_installation_date = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $requested_installation_date = null; + /** + * Output only. Actual installation date for this hardware. Filled in by + * Google. + * + * Generated from protobuf field .google.type.Date actual_installation_date = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $actual_installation_date = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Name of this hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * @type string $display_name + * Optional. Display name for this hardware. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time when this hardware was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Time when this hardware was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels associated with this hardware as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * @type string $order + * Required. Name of the order that this hardware belongs to. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * @type string $hardware_group + * Output only. Name for the hardware group that this hardware belongs to. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * @type string $site + * Required. Name for the site that this hardware belongs to. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * @type int $state + * Output only. Current state for this hardware. + * @type string $ciq_uri + * Output only. Link to the Customer Intake Questionnaire (CIQ) sheet for this + * Hardware. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareConfig $config + * Required. Configuration for this hardware. + * @type \Google\Type\Date $estimated_installation_date + * Output only. Estimated installation date for this hardware. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\HardwarePhysicalInfo $physical_info + * Optional. Physical properties of this hardware. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareInstallationInfo $installation_info + * Optional. Information for installation of this hardware. + * @type string $zone + * Required. Name for the zone that this hardware belongs to. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * @type \Google\Type\Date $requested_installation_date + * Optional. Requested installation date for this hardware. This is + * auto-populated when the order is accepted, if the hardware's HardwareGroup + * specifies this. It can also be filled in by the customer. + * @type \Google\Type\Date $actual_installation_date + * Output only. Actual installation date for this hardware. Filled in by + * Google. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Name of this hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Name of this hardware. + * Format: `projects/{project}/locations/{location}/hardware/{hardware}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Display name for this hardware. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. Display name for this hardware. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Time when this hardware was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Time when this hardware was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Time when this hardware was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.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. Time when this hardware was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.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; + } + + /** + * Optional. Labels associated with this hardware as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels associated with this hardware as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 5 [(.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; + } + + /** + * Required. Name of the order that this hardware belongs to. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * Generated from protobuf field string order = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getOrder() + { + return $this->order; + } + + /** + * Required. Name of the order that this hardware belongs to. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * Generated from protobuf field string order = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setOrder($var) + { + GPBUtil::checkString($var, True); + $this->order = $var; + + return $this; + } + + /** + * Output only. Name for the hardware group that this hardware belongs to. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * + * Generated from protobuf field string hardware_group = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getHardwareGroup() + { + return $this->hardware_group; + } + + /** + * Output only. Name for the hardware group that this hardware belongs to. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * + * Generated from protobuf field string hardware_group = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setHardwareGroup($var) + { + GPBUtil::checkString($var, True); + $this->hardware_group = $var; + + return $this; + } + + /** + * Required. Name for the site that this hardware belongs to. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * Generated from protobuf field string site = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSite() + { + return $this->site; + } + + /** + * Required. Name for the site that this hardware belongs to. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * Generated from protobuf field string site = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSite($var) + { + GPBUtil::checkString($var, True); + $this->site = $var; + + return $this; + } + + /** + * Output only. Current state for this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Hardware.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current state for this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Hardware.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Hardware\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Link to the Customer Intake Questionnaire (CIQ) sheet for this + * Hardware. + * + * Generated from protobuf field string ciq_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCiqUri() + { + return $this->ciq_uri; + } + + /** + * Output only. Link to the Customer Intake Questionnaire (CIQ) sheet for this + * Hardware. + * + * Generated from protobuf field string ciq_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCiqUri($var) + { + GPBUtil::checkString($var, True); + $this->ciq_uri = $var; + + return $this; + } + + /** + * Required. Configuration for this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareConfig config = 11 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareConfig|null + */ + public function getConfig() + { + return $this->config; + } + + public function hasConfig() + { + return isset($this->config); + } + + public function clearConfig() + { + unset($this->config); + } + + /** + * Required. Configuration for this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareConfig config = 11 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareConfig $var + * @return $this + */ + public function setConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareConfig::class); + $this->config = $var; + + return $this; + } + + /** + * Output only. Estimated installation date for this hardware. + * + * Generated from protobuf field .google.type.Date estimated_installation_date = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Type\Date|null + */ + public function getEstimatedInstallationDate() + { + return $this->estimated_installation_date; + } + + public function hasEstimatedInstallationDate() + { + return isset($this->estimated_installation_date); + } + + public function clearEstimatedInstallationDate() + { + unset($this->estimated_installation_date); + } + + /** + * Output only. Estimated installation date for this hardware. + * + * Generated from protobuf field .google.type.Date estimated_installation_date = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Type\Date $var + * @return $this + */ + public function setEstimatedInstallationDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->estimated_installation_date = $var; + + return $this; + } + + /** + * Optional. Physical properties of this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo physical_info = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\HardwarePhysicalInfo|null + */ + public function getPhysicalInfo() + { + return $this->physical_info; + } + + public function hasPhysicalInfo() + { + return isset($this->physical_info); + } + + public function clearPhysicalInfo() + { + unset($this->physical_info); + } + + /** + * Optional. Physical properties of this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo physical_info = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\HardwarePhysicalInfo $var + * @return $this + */ + public function setPhysicalInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwarePhysicalInfo::class); + $this->physical_info = $var; + + return $this; + } + + /** + * Optional. Information for installation of this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareInstallationInfo installation_info = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareInstallationInfo|null + */ + public function getInstallationInfo() + { + return $this->installation_info; + } + + public function hasInstallationInfo() + { + return isset($this->installation_info); + } + + public function clearInstallationInfo() + { + unset($this->installation_info); + } + + /** + * Optional. Information for installation of this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareInstallationInfo installation_info = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareInstallationInfo $var + * @return $this + */ + public function setInstallationInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareInstallationInfo::class); + $this->installation_info = $var; + + return $this; + } + + /** + * Required. Name for the zone that this hardware belongs to. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * Generated from protobuf field string zone = 15 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Required. Name for the zone that this hardware belongs to. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * Generated from protobuf field string zone = 15 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + + /** + * Optional. Requested installation date for this hardware. This is + * auto-populated when the order is accepted, if the hardware's HardwareGroup + * specifies this. It can also be filled in by the customer. + * + * Generated from protobuf field .google.type.Date requested_installation_date = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Type\Date|null + */ + public function getRequestedInstallationDate() + { + return $this->requested_installation_date; + } + + public function hasRequestedInstallationDate() + { + return isset($this->requested_installation_date); + } + + public function clearRequestedInstallationDate() + { + unset($this->requested_installation_date); + } + + /** + * Optional. Requested installation date for this hardware. This is + * auto-populated when the order is accepted, if the hardware's HardwareGroup + * specifies this. It can also be filled in by the customer. + * + * Generated from protobuf field .google.type.Date requested_installation_date = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Type\Date $var + * @return $this + */ + public function setRequestedInstallationDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->requested_installation_date = $var; + + return $this; + } + + /** + * Output only. Actual installation date for this hardware. Filled in by + * Google. + * + * Generated from protobuf field .google.type.Date actual_installation_date = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Type\Date|null + */ + public function getActualInstallationDate() + { + return $this->actual_installation_date; + } + + public function hasActualInstallationDate() + { + return isset($this->actual_installation_date); + } + + public function clearActualInstallationDate() + { + unset($this->actual_installation_date); + } + + /** + * Output only. Actual installation date for this hardware. Filled in by + * Google. + * + * Generated from protobuf field .google.type.Date actual_installation_date = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Type\Date $var + * @return $this + */ + public function setActualInstallationDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->actual_installation_date = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/Hardware/State.php b/GdcHardwareManagement/src/V1alpha/Hardware/State.php new file mode 100644 index 000000000000..e349069143ec --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Hardware/State.php @@ -0,0 +1,90 @@ +google.cloud.gdchardwaremanagement.v1alpha.Hardware.State + */ +class State +{ + /** + * State of the Hardware is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * More information is required from the customer to make progress. + * + * Generated from protobuf enum ADDITIONAL_INFO_NEEDED = 1; + */ + const ADDITIONAL_INFO_NEEDED = 1; + /** + * Google has initiated building hardware for this Hardware. + * + * Generated from protobuf enum BUILDING = 2; + */ + const BUILDING = 2; + /** + * The hardware has been built and is being shipped. + * + * Generated from protobuf enum SHIPPING = 3; + */ + const SHIPPING = 3; + /** + * The hardware is being installed. + * + * Generated from protobuf enum INSTALLING = 4; + */ + const INSTALLING = 4; + /** + * The hardware has been installed. + * + * Generated from protobuf enum INSTALLED = 5; + */ + const INSTALLED = 5; + /** + * An error occurred and customer intervention is required. + * + * Generated from protobuf enum FAILED = 6; + */ + const FAILED = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ADDITIONAL_INFO_NEEDED => 'ADDITIONAL_INFO_NEEDED', + self::BUILDING => 'BUILDING', + self::SHIPPING => 'SHIPPING', + self::INSTALLING => 'INSTALLING', + self::INSTALLED => 'INSTALLED', + self::FAILED => 'FAILED', + ]; + + 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/GdcHardwareManagement/src/V1alpha/HardwareConfig.php b/GdcHardwareManagement/src/V1alpha/HardwareConfig.php new file mode 100644 index 000000000000..a038b470ed52 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/HardwareConfig.php @@ -0,0 +1,147 @@ +google.cloud.gdchardwaremanagement.v1alpha.HardwareConfig + */ +class HardwareConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Reference to the SKU for this hardware. This can point to a + * specific SKU revision in the form of `resource_name@revision_id` as defined + * in [AIP-162](https://google.aip.dev/162). If no revision_id is specified, + * it refers to the latest revision. + * + * Generated from protobuf field string sku = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $sku = ''; + /** + * Required. Power supply type for this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.PowerSupply power_supply = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $power_supply = 0; + /** + * Optional. Subscription duration for the hardware in months. + * + * Generated from protobuf field int32 subscription_duration_months = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $subscription_duration_months = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $sku + * Required. Reference to the SKU for this hardware. This can point to a + * specific SKU revision in the form of `resource_name@revision_id` as defined + * in [AIP-162](https://google.aip.dev/162). If no revision_id is specified, + * it refers to the latest revision. + * @type int $power_supply + * Required. Power supply type for this hardware. + * @type int $subscription_duration_months + * Optional. Subscription duration for the hardware in months. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. Reference to the SKU for this hardware. This can point to a + * specific SKU revision in the form of `resource_name@revision_id` as defined + * in [AIP-162](https://google.aip.dev/162). If no revision_id is specified, + * it refers to the latest revision. + * + * Generated from protobuf field string sku = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSku() + { + return $this->sku; + } + + /** + * Required. Reference to the SKU for this hardware. This can point to a + * specific SKU revision in the form of `resource_name@revision_id` as defined + * in [AIP-162](https://google.aip.dev/162). If no revision_id is specified, + * it refers to the latest revision. + * + * Generated from protobuf field string sku = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSku($var) + { + GPBUtil::checkString($var, True); + $this->sku = $var; + + return $this; + } + + /** + * Required. Power supply type for this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.PowerSupply power_supply = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getPowerSupply() + { + return $this->power_supply; + } + + /** + * Required. Power supply type for this hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.PowerSupply power_supply = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setPowerSupply($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\PowerSupply::class); + $this->power_supply = $var; + + return $this; + } + + /** + * Optional. Subscription duration for the hardware in months. + * + * Generated from protobuf field int32 subscription_duration_months = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSubscriptionDurationMonths() + { + return $this->subscription_duration_months; + } + + /** + * Optional. Subscription duration for the hardware in months. + * + * Generated from protobuf field int32 subscription_duration_months = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSubscriptionDurationMonths($var) + { + GPBUtil::checkInt32($var); + $this->subscription_duration_months = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/HardwareGroup.php b/GdcHardwareManagement/src/V1alpha/HardwareGroup.php new file mode 100644 index 000000000000..7c7347b6e469 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/HardwareGroup.php @@ -0,0 +1,446 @@ +google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup + */ +class HardwareGroup extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Name of this hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Time when this hardware group was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Time when this hardware group was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Labels associated with this hardware group as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. Number of hardware in this HardwareGroup. + * + * Generated from protobuf field int32 hardware_count = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $hardware_count = 0; + /** + * Required. Configuration for hardware in this HardwareGroup. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareConfig config = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $config = null; + /** + * Required. Name of the site where the hardware in this HardwareGroup will be + * delivered. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * Generated from protobuf field string site = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $site = ''; + /** + * Output only. Current state of this HardwareGroup. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. Name of the zone that the hardware in this HardwareGroup belongs + * to. Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * Generated from protobuf field string zone = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $zone = ''; + /** + * Optional. Requested installation date for the hardware in this + * HardwareGroup. Filled in by the customer. + * + * Generated from protobuf field .google.type.Date requested_installation_date = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $requested_installation_date = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Name of this hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time when this hardware group was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Time when this hardware group was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels associated with this hardware group as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * @type int $hardware_count + * Required. Number of hardware in this HardwareGroup. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareConfig $config + * Required. Configuration for hardware in this HardwareGroup. + * @type string $site + * Required. Name of the site where the hardware in this HardwareGroup will be + * delivered. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * @type int $state + * Output only. Current state of this HardwareGroup. + * @type string $zone + * Optional. Name of the zone that the hardware in this HardwareGroup belongs + * to. Format: `projects/{project}/locations/{location}/zones/{zone}` + * @type \Google\Type\Date $requested_installation_date + * Optional. Requested installation date for the hardware in this + * HardwareGroup. Filled in by the customer. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Name of this hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Name of this hardware group. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Time when this hardware group was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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 when this hardware group was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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 when this hardware group was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.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. Time when this hardware group was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.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; + } + + /** + * Optional. Labels associated with this hardware group as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels associated with this hardware group as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 4 [(.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; + } + + /** + * Required. Number of hardware in this HardwareGroup. + * + * Generated from protobuf field int32 hardware_count = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getHardwareCount() + { + return $this->hardware_count; + } + + /** + * Required. Number of hardware in this HardwareGroup. + * + * Generated from protobuf field int32 hardware_count = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setHardwareCount($var) + { + GPBUtil::checkInt32($var); + $this->hardware_count = $var; + + return $this; + } + + /** + * Required. Configuration for hardware in this HardwareGroup. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareConfig config = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareConfig|null + */ + public function getConfig() + { + return $this->config; + } + + public function hasConfig() + { + return isset($this->config); + } + + public function clearConfig() + { + unset($this->config); + } + + /** + * Required. Configuration for hardware in this HardwareGroup. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareConfig config = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareConfig $var + * @return $this + */ + public function setConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareConfig::class); + $this->config = $var; + + return $this; + } + + /** + * Required. Name of the site where the hardware in this HardwareGroup will be + * delivered. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * Generated from protobuf field string site = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSite() + { + return $this->site; + } + + /** + * Required. Name of the site where the hardware in this HardwareGroup will be + * delivered. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * Generated from protobuf field string site = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSite($var) + { + GPBUtil::checkString($var, True); + $this->site = $var; + + return $this; + } + + /** + * Output only. Current state of this HardwareGroup. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current state of this HardwareGroup. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Name of the zone that the hardware in this HardwareGroup belongs + * to. Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * Generated from protobuf field string zone = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Optional. Name of the zone that the hardware in this HardwareGroup belongs + * to. Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * Generated from protobuf field string zone = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + + /** + * Optional. Requested installation date for the hardware in this + * HardwareGroup. Filled in by the customer. + * + * Generated from protobuf field .google.type.Date requested_installation_date = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Type\Date|null + */ + public function getRequestedInstallationDate() + { + return $this->requested_installation_date; + } + + public function hasRequestedInstallationDate() + { + return isset($this->requested_installation_date); + } + + public function clearRequestedInstallationDate() + { + unset($this->requested_installation_date); + } + + /** + * Optional. Requested installation date for the hardware in this + * HardwareGroup. Filled in by the customer. + * + * Generated from protobuf field .google.type.Date requested_installation_date = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Type\Date $var + * @return $this + */ + public function setRequestedInstallationDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->requested_installation_date = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/HardwareGroup/State.php b/GdcHardwareManagement/src/V1alpha/HardwareGroup/State.php new file mode 100644 index 000000000000..b2453ecc2077 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/HardwareGroup/State.php @@ -0,0 +1,97 @@ +google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup.State + */ +class State +{ + /** + * State of the HardwareGroup is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * More information is required from the customer to make progress. + * + * Generated from protobuf enum ADDITIONAL_INFO_NEEDED = 1; + */ + const ADDITIONAL_INFO_NEEDED = 1; + /** + * Google has initiated building hardware for this HardwareGroup. + * + * Generated from protobuf enum BUILDING = 2; + */ + const BUILDING = 2; + /** + * The hardware has been built and is being shipped. + * + * Generated from protobuf enum SHIPPING = 3; + */ + const SHIPPING = 3; + /** + * The hardware is being installed. + * + * Generated from protobuf enum INSTALLING = 4; + */ + const INSTALLING = 4; + /** + * Some hardware in the HardwareGroup have been installed. + * + * Generated from protobuf enum PARTIALLY_INSTALLED = 5; + */ + const PARTIALLY_INSTALLED = 5; + /** + * All hardware in the HardwareGroup have been installed. + * + * Generated from protobuf enum INSTALLED = 6; + */ + const INSTALLED = 6; + /** + * An error occurred and customer intervention is required. + * + * Generated from protobuf enum FAILED = 7; + */ + const FAILED = 7; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ADDITIONAL_INFO_NEEDED => 'ADDITIONAL_INFO_NEEDED', + self::BUILDING => 'BUILDING', + self::SHIPPING => 'SHIPPING', + self::INSTALLING => 'INSTALLING', + self::PARTIALLY_INSTALLED => 'PARTIALLY_INSTALLED', + self::INSTALLED => 'INSTALLED', + self::FAILED => 'FAILED', + ]; + + 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/GdcHardwareManagement/src/V1alpha/HardwareInstallationInfo.php b/GdcHardwareManagement/src/V1alpha/HardwareInstallationInfo.php new file mode 100644 index 000000000000..772b610212b3 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/HardwareInstallationInfo.php @@ -0,0 +1,261 @@ +google.cloud.gdchardwaremanagement.v1alpha.HardwareInstallationInfo + */ +class HardwareInstallationInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Location of the rack in the site e.g. Floor 2, Room 201, Row 7, + * Rack 3. + * + * Generated from protobuf field string rack_location = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $rack_location = ''; + /** + * Required. Distance from the power outlet in meters. + * + * Generated from protobuf field int32 power_distance_meters = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $power_distance_meters = 0; + /** + * Required. Distance from the network switch in meters. + * + * Generated from protobuf field int32 switch_distance_meters = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $switch_distance_meters = 0; + /** + * Required. Dimensions of the rack unit. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Dimensions rack_unit_dimensions = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rack_unit_dimensions = null; + /** + * Required. Rack space allocated for the hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.RackSpace rack_space = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rack_space = null; + /** + * Required. Type of the rack. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareInstallationInfo.RackType rack_type = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rack_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $rack_location + * Optional. Location of the rack in the site e.g. Floor 2, Room 201, Row 7, + * Rack 3. + * @type int $power_distance_meters + * Required. Distance from the power outlet in meters. + * @type int $switch_distance_meters + * Required. Distance from the network switch in meters. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\Dimensions $rack_unit_dimensions + * Required. Dimensions of the rack unit. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\RackSpace $rack_space + * Required. Rack space allocated for the hardware. + * @type int $rack_type + * Required. Type of the rack. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Location of the rack in the site e.g. Floor 2, Room 201, Row 7, + * Rack 3. + * + * Generated from protobuf field string rack_location = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRackLocation() + { + return $this->rack_location; + } + + /** + * Optional. Location of the rack in the site e.g. Floor 2, Room 201, Row 7, + * Rack 3. + * + * Generated from protobuf field string rack_location = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRackLocation($var) + { + GPBUtil::checkString($var, True); + $this->rack_location = $var; + + return $this; + } + + /** + * Required. Distance from the power outlet in meters. + * + * Generated from protobuf field int32 power_distance_meters = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getPowerDistanceMeters() + { + return $this->power_distance_meters; + } + + /** + * Required. Distance from the power outlet in meters. + * + * Generated from protobuf field int32 power_distance_meters = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setPowerDistanceMeters($var) + { + GPBUtil::checkInt32($var); + $this->power_distance_meters = $var; + + return $this; + } + + /** + * Required. Distance from the network switch in meters. + * + * Generated from protobuf field int32 switch_distance_meters = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSwitchDistanceMeters() + { + return $this->switch_distance_meters; + } + + /** + * Required. Distance from the network switch in meters. + * + * Generated from protobuf field int32 switch_distance_meters = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSwitchDistanceMeters($var) + { + GPBUtil::checkInt32($var); + $this->switch_distance_meters = $var; + + return $this; + } + + /** + * Required. Dimensions of the rack unit. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Dimensions rack_unit_dimensions = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\Dimensions|null + */ + public function getRackUnitDimensions() + { + return $this->rack_unit_dimensions; + } + + public function hasRackUnitDimensions() + { + return isset($this->rack_unit_dimensions); + } + + public function clearRackUnitDimensions() + { + unset($this->rack_unit_dimensions); + } + + /** + * Required. Dimensions of the rack unit. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Dimensions rack_unit_dimensions = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Dimensions $var + * @return $this + */ + public function setRackUnitDimensions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Dimensions::class); + $this->rack_unit_dimensions = $var; + + return $this; + } + + /** + * Required. Rack space allocated for the hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.RackSpace rack_space = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\RackSpace|null + */ + public function getRackSpace() + { + return $this->rack_space; + } + + public function hasRackSpace() + { + return isset($this->rack_space); + } + + public function clearRackSpace() + { + unset($this->rack_space); + } + + /** + * Required. Rack space allocated for the hardware. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.RackSpace rack_space = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\RackSpace $var + * @return $this + */ + public function setRackSpace($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\RackSpace::class); + $this->rack_space = $var; + + return $this; + } + + /** + * Required. Type of the rack. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareInstallationInfo.RackType rack_type = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getRackType() + { + return $this->rack_type; + } + + /** + * Required. Type of the rack. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareInstallationInfo.RackType rack_type = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setRackType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareInstallationInfo\RackType::class); + $this->rack_type = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/HardwareInstallationInfo/RackType.php b/GdcHardwareManagement/src/V1alpha/HardwareInstallationInfo/RackType.php new file mode 100644 index 000000000000..c77df46af215 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/HardwareInstallationInfo/RackType.php @@ -0,0 +1,62 @@ +google.cloud.gdchardwaremanagement.v1alpha.HardwareInstallationInfo.RackType + */ +class RackType +{ + /** + * Rack type is unspecified. + * + * Generated from protobuf enum RACK_TYPE_UNSPECIFIED = 0; + */ + const RACK_TYPE_UNSPECIFIED = 0; + /** + * Two post rack. + * + * Generated from protobuf enum TWO_POST = 1; + */ + const TWO_POST = 1; + /** + * Four post rack. + * + * Generated from protobuf enum FOUR_POST = 2; + */ + const FOUR_POST = 2; + + private static $valueToName = [ + self::RACK_TYPE_UNSPECIFIED => 'RACK_TYPE_UNSPECIFIED', + self::TWO_POST => 'TWO_POST', + self::FOUR_POST => 'FOUR_POST', + ]; + + 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/GdcHardwareManagement/src/V1alpha/HardwareLocation.php b/GdcHardwareManagement/src/V1alpha/HardwareLocation.php new file mode 100644 index 000000000000..91493be83c65 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/HardwareLocation.php @@ -0,0 +1,147 @@ +google.cloud.gdchardwaremanagement.v1alpha.HardwareLocation + */ +class HardwareLocation extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the site where the hardware are present. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * Generated from protobuf field string site = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $site = ''; + /** + * Required. Location of the rack in the site e.g. Floor 2, Room 201, Row 7, + * Rack 3. + * + * Generated from protobuf field string rack_location = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rack_location = ''; + /** + * Optional. Spaces occupied by the hardware in the rack. + * If unset, this location is assumed to be the entire rack. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.RackSpace rack_space = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $rack_space; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $site + * Required. Name of the site where the hardware are present. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * @type string $rack_location + * Required. Location of the rack in the site e.g. Floor 2, Room 201, Row 7, + * Rack 3. + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\RackSpace>|\Google\Protobuf\Internal\RepeatedField $rack_space + * Optional. Spaces occupied by the hardware in the rack. + * If unset, this location is assumed to be the entire rack. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the site where the hardware are present. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * Generated from protobuf field string site = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSite() + { + return $this->site; + } + + /** + * Required. Name of the site where the hardware are present. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * Generated from protobuf field string site = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSite($var) + { + GPBUtil::checkString($var, True); + $this->site = $var; + + return $this; + } + + /** + * Required. Location of the rack in the site e.g. Floor 2, Room 201, Row 7, + * Rack 3. + * + * Generated from protobuf field string rack_location = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRackLocation() + { + return $this->rack_location; + } + + /** + * Required. Location of the rack in the site e.g. Floor 2, Room 201, Row 7, + * Rack 3. + * + * Generated from protobuf field string rack_location = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRackLocation($var) + { + GPBUtil::checkString($var, True); + $this->rack_location = $var; + + return $this; + } + + /** + * Optional. Spaces occupied by the hardware in the rack. + * If unset, this location is assumed to be the entire rack. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.RackSpace rack_space = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRackSpace() + { + return $this->rack_space; + } + + /** + * Optional. Spaces occupied by the hardware in the rack. + * If unset, this location is assumed to be the entire rack. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.RackSpace rack_space = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\RackSpace>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRackSpace($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\RackSpace::class); + $this->rack_space = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo.php b/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo.php new file mode 100644 index 000000000000..41af20a7bb46 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo.php @@ -0,0 +1,169 @@ +google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo + */ +class HardwarePhysicalInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The power receptacle type. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.PowerReceptacleType power_receptacle = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $power_receptacle = 0; + /** + * Required. Type of the uplink network connection. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.NetworkUplinkType network_uplink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_uplink = 0; + /** + * Required. Voltage of the power supply. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.Voltage voltage = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $voltage = 0; + /** + * Required. Amperes of the power supply. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.Amperes amperes = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $amperes = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $power_receptacle + * Required. The power receptacle type. + * @type int $network_uplink + * Required. Type of the uplink network connection. + * @type int $voltage + * Required. Voltage of the power supply. + * @type int $amperes + * Required. Amperes of the power supply. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The power receptacle type. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.PowerReceptacleType power_receptacle = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getPowerReceptacle() + { + return $this->power_receptacle; + } + + /** + * Required. The power receptacle type. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.PowerReceptacleType power_receptacle = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setPowerReceptacle($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwarePhysicalInfo\PowerReceptacleType::class); + $this->power_receptacle = $var; + + return $this; + } + + /** + * Required. Type of the uplink network connection. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.NetworkUplinkType network_uplink = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getNetworkUplink() + { + return $this->network_uplink; + } + + /** + * Required. Type of the uplink network connection. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.NetworkUplinkType network_uplink = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setNetworkUplink($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwarePhysicalInfo\NetworkUplinkType::class); + $this->network_uplink = $var; + + return $this; + } + + /** + * Required. Voltage of the power supply. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.Voltage voltage = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getVoltage() + { + return $this->voltage; + } + + /** + * Required. Voltage of the power supply. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.Voltage voltage = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setVoltage($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwarePhysicalInfo\Voltage::class); + $this->voltage = $var; + + return $this; + } + + /** + * Required. Amperes of the power supply. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.Amperes amperes = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAmperes() + { + return $this->amperes; + } + + /** + * Required. Amperes of the power supply. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.Amperes amperes = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAmperes($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwarePhysicalInfo\Amperes::class); + $this->amperes = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo/Amperes.php b/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo/Amperes.php new file mode 100644 index 000000000000..b1e63c88858e --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo/Amperes.php @@ -0,0 +1,55 @@ +google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.Amperes + */ +class Amperes +{ + /** + * Amperes is unspecified. + * + * Generated from protobuf enum AMPERES_UNSPECIFIED = 0; + */ + const AMPERES_UNSPECIFIED = 0; + /** + * 15A. + * + * Generated from protobuf enum AMPERES_15 = 1; + */ + const AMPERES_15 = 1; + + private static $valueToName = [ + self::AMPERES_UNSPECIFIED => 'AMPERES_UNSPECIFIED', + self::AMPERES_15 => 'AMPERES_15', + ]; + + 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/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo/NetworkUplinkType.php b/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo/NetworkUplinkType.php new file mode 100644 index 000000000000..0a31e1a874c6 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo/NetworkUplinkType.php @@ -0,0 +1,55 @@ +google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.NetworkUplinkType + */ +class NetworkUplinkType +{ + /** + * Network uplink type is unspecified. + * + * Generated from protobuf enum NETWORK_UPLINK_TYPE_UNSPECIFIED = 0; + */ + const NETWORK_UPLINK_TYPE_UNSPECIFIED = 0; + /** + * RJ-45. + * + * Generated from protobuf enum RJ_45 = 1; + */ + const RJ_45 = 1; + + private static $valueToName = [ + self::NETWORK_UPLINK_TYPE_UNSPECIFIED => 'NETWORK_UPLINK_TYPE_UNSPECIFIED', + self::RJ_45 => 'RJ_45', + ]; + + 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/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo/PowerReceptacleType.php b/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo/PowerReceptacleType.php new file mode 100644 index 000000000000..6372daca72d6 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo/PowerReceptacleType.php @@ -0,0 +1,69 @@ +google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.PowerReceptacleType + */ +class PowerReceptacleType +{ + /** + * Facility plug type is unspecified. + * + * Generated from protobuf enum POWER_RECEPTACLE_TYPE_UNSPECIFIED = 0; + */ + const POWER_RECEPTACLE_TYPE_UNSPECIFIED = 0; + /** + * NEMA 5-15. + * + * Generated from protobuf enum NEMA_5_15 = 1; + */ + const NEMA_5_15 = 1; + /** + * C13. + * + * Generated from protobuf enum C_13 = 2; + */ + const C_13 = 2; + /** + * Standard european receptacle. + * + * Generated from protobuf enum STANDARD_EU = 3; + */ + const STANDARD_EU = 3; + + private static $valueToName = [ + self::POWER_RECEPTACLE_TYPE_UNSPECIFIED => 'POWER_RECEPTACLE_TYPE_UNSPECIFIED', + self::NEMA_5_15 => 'NEMA_5_15', + self::C_13 => 'C_13', + self::STANDARD_EU => 'STANDARD_EU', + ]; + + 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/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo/Voltage.php b/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo/Voltage.php new file mode 100644 index 000000000000..18eb096de762 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/HardwarePhysicalInfo/Voltage.php @@ -0,0 +1,62 @@ +google.cloud.gdchardwaremanagement.v1alpha.HardwarePhysicalInfo.Voltage + */ +class Voltage +{ + /** + * Voltage is unspecified. + * + * Generated from protobuf enum VOLTAGE_UNSPECIFIED = 0; + */ + const VOLTAGE_UNSPECIFIED = 0; + /** + * 120V. + * + * Generated from protobuf enum VOLTAGE_110 = 1; + */ + const VOLTAGE_110 = 1; + /** + * 220V. + * + * Generated from protobuf enum VOLTAGE_220 = 3; + */ + const VOLTAGE_220 = 3; + + private static $valueToName = [ + self::VOLTAGE_UNSPECIFIED => 'VOLTAGE_UNSPECIFIED', + self::VOLTAGE_110 => 'VOLTAGE_110', + self::VOLTAGE_220 => 'VOLTAGE_220', + ]; + + 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/GdcHardwareManagement/src/V1alpha/ListChangeLogEntriesRequest.php b/GdcHardwareManagement/src/V1alpha/ListChangeLogEntriesRequest.php new file mode 100644 index 000000000000..86e12b3933e4 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListChangeLogEntriesRequest.php @@ -0,0 +1,226 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListChangeLogEntriesRequest + */ +class ListChangeLogEntriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The order to list change log entries for. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The order to list change log entries for. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * Please see {@see GDCHardwareManagementClient::orderName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\ListChangeLogEntriesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The order to list change log entries for. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The order to list change log entries for. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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 order to list change log entries for. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * 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 token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * 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. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * 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/GdcHardwareManagement/src/V1alpha/ListChangeLogEntriesResponse.php b/GdcHardwareManagement/src/V1alpha/ListChangeLogEntriesResponse.php new file mode 100644 index 000000000000..cb80c2a25810 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListChangeLogEntriesResponse.php @@ -0,0 +1,135 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListChangeLogEntriesResponse + */ +class ListChangeLogEntriesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of change log entries. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.ChangeLogEntry change_log_entries = 1; + */ + private $change_log_entries; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\ChangeLogEntry>|\Google\Protobuf\Internal\RepeatedField $change_log_entries + * The list of change log entries. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of change log entries. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.ChangeLogEntry change_log_entries = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getChangeLogEntries() + { + return $this->change_log_entries; + } + + /** + * The list of change log entries. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.ChangeLogEntry change_log_entries = 1; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\ChangeLogEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setChangeLogEntries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\ChangeLogEntry::class); + $this->change_log_entries = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/ListCommentsRequest.php b/GdcHardwareManagement/src/V1alpha/ListCommentsRequest.php new file mode 100644 index 000000000000..f9d3401664ae --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListCommentsRequest.php @@ -0,0 +1,226 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListCommentsRequest + */ +class ListCommentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The order to list comments on. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The order to list comments on. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * Please see {@see GDCHardwareManagementClient::orderName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\ListCommentsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The order to list comments on. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The order to list comments on. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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 order to list comments on. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * 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 token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * 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. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * 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/GdcHardwareManagement/src/V1alpha/ListCommentsResponse.php b/GdcHardwareManagement/src/V1alpha/ListCommentsResponse.php new file mode 100644 index 000000000000..04e13b94c667 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListCommentsResponse.php @@ -0,0 +1,135 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListCommentsResponse + */ +class ListCommentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of comments. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Comment comments = 1; + */ + private $comments; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\Comment>|\Google\Protobuf\Internal\RepeatedField $comments + * The list of comments. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of comments. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Comment comments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getComments() + { + return $this->comments; + } + + /** + * The list of comments. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Comment comments = 1; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\Comment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setComments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\Comment::class); + $this->comments = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/ListHardwareGroupsRequest.php b/GdcHardwareManagement/src/V1alpha/ListHardwareGroupsRequest.php new file mode 100644 index 000000000000..db057eb0eddc --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListHardwareGroupsRequest.php @@ -0,0 +1,226 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListHardwareGroupsRequest + */ +class ListHardwareGroupsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The order to list hardware groups in. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The order to list hardware groups in. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * Please see {@see GDCHardwareManagementClient::orderName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\ListHardwareGroupsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The order to list hardware groups in. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The order to list hardware groups in. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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 order to list hardware groups in. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * 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 token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * 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. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * 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/GdcHardwareManagement/src/V1alpha/ListHardwareGroupsResponse.php b/GdcHardwareManagement/src/V1alpha/ListHardwareGroupsResponse.php new file mode 100644 index 000000000000..dd99159a206d --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListHardwareGroupsResponse.php @@ -0,0 +1,135 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListHardwareGroupsResponse + */ +class ListHardwareGroupsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of hardware groups. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup hardware_groups = 1; + */ + private $hardware_groups; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup>|\Google\Protobuf\Internal\RepeatedField $hardware_groups + * The list of hardware groups. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of hardware groups. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup hardware_groups = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHardwareGroups() + { + return $this->hardware_groups; + } + + /** + * The list of hardware groups. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup hardware_groups = 1; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHardwareGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup::class); + $this->hardware_groups = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/ListHardwareRequest.php b/GdcHardwareManagement/src/V1alpha/ListHardwareRequest.php new file mode 100644 index 000000000000..cef5f84a081d --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListHardwareRequest.php @@ -0,0 +1,226 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListHardwareRequest + */ +class ListHardwareRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location to list hardware in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location to list hardware in. + * Format: `projects/{project}/locations/{location}` + * Please see {@see GDCHardwareManagementClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\ListHardwareRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location to list hardware in. + * Format: `projects/{project}/locations/{location}` + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location to list hardware in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location to list hardware in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * 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 token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * 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. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * 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/GdcHardwareManagement/src/V1alpha/ListHardwareResponse.php b/GdcHardwareManagement/src/V1alpha/ListHardwareResponse.php new file mode 100644 index 000000000000..2ec34a7b924c --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListHardwareResponse.php @@ -0,0 +1,135 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListHardwareResponse + */ +class ListHardwareResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of hardware. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Hardware hardware = 1; + */ + private $hardware; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\Hardware>|\Google\Protobuf\Internal\RepeatedField $hardware + * The list of hardware. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of hardware. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Hardware hardware = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHardware() + { + return $this->hardware; + } + + /** + * The list of hardware. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Hardware hardware = 1; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\Hardware>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHardware($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\Hardware::class); + $this->hardware = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/ListOrdersRequest.php b/GdcHardwareManagement/src/V1alpha/ListOrdersRequest.php new file mode 100644 index 000000000000..1d3e1731a1af --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListOrdersRequest.php @@ -0,0 +1,226 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListOrdersRequest + */ +class ListOrdersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location to list orders in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location to list orders in. + * Format: `projects/{project}/locations/{location}` + * Please see {@see GDCHardwareManagementClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\ListOrdersRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location to list orders in. + * Format: `projects/{project}/locations/{location}` + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location to list orders in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location to list orders in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * 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 token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * 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. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * 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/GdcHardwareManagement/src/V1alpha/ListOrdersResponse.php b/GdcHardwareManagement/src/V1alpha/ListOrdersResponse.php new file mode 100644 index 000000000000..097d0e46d87f --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListOrdersResponse.php @@ -0,0 +1,135 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListOrdersResponse + */ +class ListOrdersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of orders. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Order orders = 1; + */ + private $orders; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\Order>|\Google\Protobuf\Internal\RepeatedField $orders + * The list of orders. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of orders. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Order orders = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOrders() + { + return $this->orders; + } + + /** + * The list of orders. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Order orders = 1; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\Order>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOrders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\Order::class); + $this->orders = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/ListSitesRequest.php b/GdcHardwareManagement/src/V1alpha/ListSitesRequest.php new file mode 100644 index 000000000000..1862203be010 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListSitesRequest.php @@ -0,0 +1,226 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListSitesRequest + */ +class ListSitesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location to list sites in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location to list sites in. + * Format: `projects/{project}/locations/{location}` + * Please see {@see GDCHardwareManagementClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\ListSitesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location to list sites in. + * Format: `projects/{project}/locations/{location}` + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location to list sites in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location to list sites in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * 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 token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * 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. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * 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/GdcHardwareManagement/src/V1alpha/ListSitesResponse.php b/GdcHardwareManagement/src/V1alpha/ListSitesResponse.php new file mode 100644 index 000000000000..a472405527ee --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListSitesResponse.php @@ -0,0 +1,135 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListSitesResponse + */ +class ListSitesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of sites. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Site sites = 1; + */ + private $sites; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\Site>|\Google\Protobuf\Internal\RepeatedField $sites + * The list of sites. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of sites. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Site sites = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSites() + { + return $this->sites; + } + + /** + * The list of sites. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Site sites = 1; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\Site>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSites($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\Site::class); + $this->sites = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/ListSkusRequest.php b/GdcHardwareManagement/src/V1alpha/ListSkusRequest.php new file mode 100644 index 000000000000..efded1b90472 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListSkusRequest.php @@ -0,0 +1,226 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListSkusRequest + */ +class ListSkusRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location to list SKUs in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location to list SKUs in. + * Format: `projects/{project}/locations/{location}` + * Please see {@see GDCHardwareManagementClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\ListSkusRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location to list SKUs in. + * Format: `projects/{project}/locations/{location}` + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location to list SKUs in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location to list SKUs in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * 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 token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * 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. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * 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/GdcHardwareManagement/src/V1alpha/ListSkusResponse.php b/GdcHardwareManagement/src/V1alpha/ListSkusResponse.php new file mode 100644 index 000000000000..0d00d360b12b --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListSkusResponse.php @@ -0,0 +1,135 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListSkusResponse + */ +class ListSkusResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of SKUs. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Sku skus = 1; + */ + private $skus; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\Sku>|\Google\Protobuf\Internal\RepeatedField $skus + * The list of SKUs. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of SKUs. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Sku skus = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSkus() + { + return $this->skus; + } + + /** + * The list of SKUs. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Sku skus = 1; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\Sku>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSkus($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\Sku::class); + $this->skus = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/ListZonesRequest.php b/GdcHardwareManagement/src/V1alpha/ListZonesRequest.php new file mode 100644 index 000000000000..393e7d9ea744 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListZonesRequest.php @@ -0,0 +1,226 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListZonesRequest + */ +class ListZonesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location to list zones in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The project and location to list zones in. + * Format: `projects/{project}/locations/{location}` + * Please see {@see GDCHardwareManagementClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\ListZonesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location to list zones in. + * Format: `projects/{project}/locations/{location}` + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * @type string $order_by + * Optional. Hint for how to order the results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location to list zones in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location to list zones in. + * Format: `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * 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 token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * 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. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering condition. See [AIP-160](https://google.aip.dev/160). + * + * 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. Hint for how to order the results. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results. + * + * 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/GdcHardwareManagement/src/V1alpha/ListZonesResponse.php b/GdcHardwareManagement/src/V1alpha/ListZonesResponse.php new file mode 100644 index 000000000000..0d2154485ce0 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ListZonesResponse.php @@ -0,0 +1,135 @@ +google.cloud.gdchardwaremanagement.v1alpha.ListZonesResponse + */ +class ListZonesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of zones. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Zone zones = 1; + */ + private $zones; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\Zone>|\Google\Protobuf\Internal\RepeatedField $zones + * The list of zones. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of zones. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Zone zones = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getZones() + { + return $this->zones; + } + + /** + * The list of zones. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Zone zones = 1; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\Zone>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setZones($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\Zone::class); + $this->zones = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/OperationMetadata.php b/GdcHardwareManagement/src/V1alpha/OperationMetadata.php new file mode 100644 index 000000000000..ce4839273bef --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.gdchardwaremanagement.v1alpha.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. The verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have [Operation.error][] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + * `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. 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 been cancelled successfully + * 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\Gdchardwaremanagement\V1Alpha\Service::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. 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. 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 been cancelled successfully + * 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 been cancelled successfully + * 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/GdcHardwareManagement/src/V1alpha/Order.php b/GdcHardwareManagement/src/V1alpha/Order.php new file mode 100644 index 000000000000..8d5284ac0830 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Order.php @@ -0,0 +1,679 @@ +google.cloud.gdchardwaremanagement.v1alpha.Order + */ +class Order extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Name of this order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. Display name of this order. + * + * Generated from protobuf field string display_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Output only. Time when this order was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Time when this order was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Labels associated with this order as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. State of this order. On order creation, state will be set to + * DRAFT. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Order.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Required. Customer contact information. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.OrganizationContact organization_contact = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $organization_contact = null; + /** + * Optional. Customer specified workloads of interest targeted by this order. + * This must contain <= 20 elements and the length of each element must be <= + * 50 characters. + * + * Generated from protobuf field repeated string target_workloads = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $target_workloads; + /** + * Required. Information about the customer's motivation for this order. The + * length of this field must be <= 1000 characters. + * + * Generated from protobuf field string customer_motivation = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $customer_motivation = ''; + /** + * Required. Customer specified deadline by when this order should be + * fulfilled. + * + * Generated from protobuf field .google.protobuf.Timestamp fulfillment_time = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $fulfillment_time = null; + /** + * Required. [Unicode CLDR](http://cldr.unicode.org/) region code where this + * order will be deployed. For a list of valid CLDR region codes, see the + * [Language Subtag + * Registry](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry). + * + * Generated from protobuf field string region_code = 10 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_code = ''; + /** + * Output only. Link to the order form. + * + * Generated from protobuf field string order_form_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $order_form_uri = ''; + /** + * Output only. Type of this Order. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Order.Type type = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $type = 0; + /** + * Output only. Time when the order was submitted. Is auto-populated to the + * current time when an order is submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp submit_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $submit_time = null; + /** + * Required. The Google Cloud Billing ID to be charged for this order. + * + * Generated from protobuf field string billing_id = 15 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $billing_id = ''; + /** + * Optional. Existing hardware to be removed as part of this order. + * Note: any hardware removed will be recycled unless otherwise agreed. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.HardwareLocation existing_hardware = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $existing_hardware; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Name of this order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * @type string $display_name + * Optional. Display name of this order. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time when this order was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Time when this order was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels associated with this order as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * @type int $state + * Output only. State of this order. On order creation, state will be set to + * DRAFT. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\OrganizationContact $organization_contact + * Required. Customer contact information. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_workloads + * Optional. Customer specified workloads of interest targeted by this order. + * This must contain <= 20 elements and the length of each element must be <= + * 50 characters. + * @type string $customer_motivation + * Required. Information about the customer's motivation for this order. The + * length of this field must be <= 1000 characters. + * @type \Google\Protobuf\Timestamp $fulfillment_time + * Required. Customer specified deadline by when this order should be + * fulfilled. + * @type string $region_code + * Required. [Unicode CLDR](http://cldr.unicode.org/) region code where this + * order will be deployed. For a list of valid CLDR region codes, see the + * [Language Subtag + * Registry](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry). + * @type string $order_form_uri + * Output only. Link to the order form. + * @type int $type + * Output only. Type of this Order. + * @type \Google\Protobuf\Timestamp $submit_time + * Output only. Time when the order was submitted. Is auto-populated to the + * current time when an order is submitted. + * @type string $billing_id + * Required. The Google Cloud Billing ID to be charged for this order. + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\HardwareLocation>|\Google\Protobuf\Internal\RepeatedField $existing_hardware + * Optional. Existing hardware to be removed as part of this order. + * Note: any hardware removed will be recycled unless otherwise agreed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Name of this order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Name of this order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Display name of this order. + * + * Generated from protobuf field string display_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. Display name of this order. + * + * Generated from protobuf field string display_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Time when this order was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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 when this order was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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 when this order was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.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. Time when this order was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.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; + } + + /** + * Optional. Labels associated with this order as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels associated with this order as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 4 [(.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; + } + + /** + * Output only. State of this order. On order creation, state will be set to + * DRAFT. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Order.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of this order. On order creation, state will be set to + * DRAFT. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Order.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Order\State::class); + $this->state = $var; + + return $this; + } + + /** + * Required. Customer contact information. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.OrganizationContact organization_contact = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\OrganizationContact|null + */ + public function getOrganizationContact() + { + return $this->organization_contact; + } + + public function hasOrganizationContact() + { + return isset($this->organization_contact); + } + + public function clearOrganizationContact() + { + unset($this->organization_contact); + } + + /** + * Required. Customer contact information. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.OrganizationContact organization_contact = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\OrganizationContact $var + * @return $this + */ + public function setOrganizationContact($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\OrganizationContact::class); + $this->organization_contact = $var; + + return $this; + } + + /** + * Optional. Customer specified workloads of interest targeted by this order. + * This must contain <= 20 elements and the length of each element must be <= + * 50 characters. + * + * Generated from protobuf field repeated string target_workloads = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetWorkloads() + { + return $this->target_workloads; + } + + /** + * Optional. Customer specified workloads of interest targeted by this order. + * This must contain <= 20 elements and the length of each element must be <= + * 50 characters. + * + * Generated from protobuf field repeated string target_workloads = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetWorkloads($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->target_workloads = $arr; + + return $this; + } + + /** + * Required. Information about the customer's motivation for this order. The + * length of this field must be <= 1000 characters. + * + * Generated from protobuf field string customer_motivation = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCustomerMotivation() + { + return $this->customer_motivation; + } + + /** + * Required. Information about the customer's motivation for this order. The + * length of this field must be <= 1000 characters. + * + * Generated from protobuf field string customer_motivation = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCustomerMotivation($var) + { + GPBUtil::checkString($var, True); + $this->customer_motivation = $var; + + return $this; + } + + /** + * Required. Customer specified deadline by when this order should be + * fulfilled. + * + * Generated from protobuf field .google.protobuf.Timestamp fulfillment_time = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getFulfillmentTime() + { + return $this->fulfillment_time; + } + + public function hasFulfillmentTime() + { + return isset($this->fulfillment_time); + } + + public function clearFulfillmentTime() + { + unset($this->fulfillment_time); + } + + /** + * Required. Customer specified deadline by when this order should be + * fulfilled. + * + * Generated from protobuf field .google.protobuf.Timestamp fulfillment_time = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setFulfillmentTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->fulfillment_time = $var; + + return $this; + } + + /** + * Required. [Unicode CLDR](http://cldr.unicode.org/) region code where this + * order will be deployed. For a list of valid CLDR region codes, see the + * [Language Subtag + * Registry](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry). + * + * Generated from protobuf field string region_code = 10 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * Required. [Unicode CLDR](http://cldr.unicode.org/) region code where this + * order will be deployed. For a list of valid CLDR region codes, see the + * [Language Subtag + * Registry](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry). + * + * Generated from protobuf field string region_code = 10 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * Output only. Link to the order form. + * + * Generated from protobuf field string order_form_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getOrderFormUri() + { + return $this->order_form_uri; + } + + /** + * Output only. Link to the order form. + * + * Generated from protobuf field string order_form_uri = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setOrderFormUri($var) + { + GPBUtil::checkString($var, True); + $this->order_form_uri = $var; + + return $this; + } + + /** + * Output only. Type of this Order. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Order.Type type = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Output only. Type of this Order. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Order.Type type = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Order\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Output only. Time when the order was submitted. Is auto-populated to the + * current time when an order is submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp submit_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSubmitTime() + { + return $this->submit_time; + } + + public function hasSubmitTime() + { + return isset($this->submit_time); + } + + public function clearSubmitTime() + { + unset($this->submit_time); + } + + /** + * Output only. Time when the order was submitted. Is auto-populated to the + * current time when an order is submitted. + * + * Generated from protobuf field .google.protobuf.Timestamp submit_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSubmitTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->submit_time = $var; + + return $this; + } + + /** + * Required. The Google Cloud Billing ID to be charged for this order. + * + * Generated from protobuf field string billing_id = 15 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBillingId() + { + return $this->billing_id; + } + + /** + * Required. The Google Cloud Billing ID to be charged for this order. + * + * Generated from protobuf field string billing_id = 15 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBillingId($var) + { + GPBUtil::checkString($var, True); + $this->billing_id = $var; + + return $this; + } + + /** + * Optional. Existing hardware to be removed as part of this order. + * Note: any hardware removed will be recycled unless otherwise agreed. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.HardwareLocation existing_hardware = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExistingHardware() + { + return $this->existing_hardware; + } + + /** + * Optional. Existing hardware to be removed as part of this order. + * Note: any hardware removed will be recycled unless otherwise agreed. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.HardwareLocation existing_hardware = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\HardwareLocation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExistingHardware($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareLocation::class); + $this->existing_hardware = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/Order/State.php b/GdcHardwareManagement/src/V1alpha/Order/State.php new file mode 100644 index 000000000000..4b74170c8d06 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Order/State.php @@ -0,0 +1,135 @@ +google.cloud.gdchardwaremanagement.v1alpha.Order.State + */ +class State +{ + /** + * State of the order is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Order is being drafted by the customer and has not been submitted yet. + * + * Generated from protobuf enum DRAFT = 1; + */ + const DRAFT = 1; + /** + * Order has been submitted to Google. + * + * Generated from protobuf enum SUBMITTED = 2; + */ + const SUBMITTED = 2; + /** + * All information required from the customer for fulfillment of the order + * is complete. + * + * Generated from protobuf enum INFO_COMPLETE = 12; + */ + const INFO_COMPLETE = 12; + /** + * Order has been accepted by Google. + * + * Generated from protobuf enum ACCEPTED = 3; + */ + const ACCEPTED = 3; + /** + * Order needs more information from the customer. + * + * Generated from protobuf enum ADDITIONAL_INFO_NEEDED = 4; + */ + const ADDITIONAL_INFO_NEEDED = 4; + /** + * Google has initiated building hardware for the order. + * + * Generated from protobuf enum BUILDING = 5; + */ + const BUILDING = 5; + /** + * The hardware has been built and is being shipped. + * + * Generated from protobuf enum SHIPPING = 6; + */ + const SHIPPING = 6; + /** + * The hardware is being installed. + * + * Generated from protobuf enum INSTALLING = 7; + */ + const INSTALLING = 7; + /** + * An error occurred in processing the order and customer intervention is + * required. + * + * Generated from protobuf enum FAILED = 8; + */ + const FAILED = 8; + /** + * Order has been partially completed i.e., some hardware have been + * delivered and installed. + * + * Generated from protobuf enum PARTIALLY_COMPLETED = 9; + */ + const PARTIALLY_COMPLETED = 9; + /** + * Order has been completed. + * + * Generated from protobuf enum COMPLETED = 10; + */ + const COMPLETED = 10; + /** + * Order has been cancelled. + * + * Generated from protobuf enum CANCELLED = 11; + */ + const CANCELLED = 11; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::DRAFT => 'DRAFT', + self::SUBMITTED => 'SUBMITTED', + self::INFO_COMPLETE => 'INFO_COMPLETE', + self::ACCEPTED => 'ACCEPTED', + self::ADDITIONAL_INFO_NEEDED => 'ADDITIONAL_INFO_NEEDED', + self::BUILDING => 'BUILDING', + self::SHIPPING => 'SHIPPING', + self::INSTALLING => 'INSTALLING', + self::FAILED => 'FAILED', + self::PARTIALLY_COMPLETED => 'PARTIALLY_COMPLETED', + self::COMPLETED => 'COMPLETED', + self::CANCELLED => 'CANCELLED', + ]; + + 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/GdcHardwareManagement/src/V1alpha/Order/Type.php b/GdcHardwareManagement/src/V1alpha/Order/Type.php new file mode 100644 index 000000000000..cb306ac6f908 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Order/Type.php @@ -0,0 +1,62 @@ +google.cloud.gdchardwaremanagement.v1alpha.Order.Type + */ +class Type +{ + /** + * Type of the order is unspecified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Paid by the customer. + * + * Generated from protobuf enum PAID = 1; + */ + const PAID = 1; + /** + * Proof of concept for the customer. + * + * Generated from protobuf enum POC = 2; + */ + const POC = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::PAID => 'PAID', + self::POC => 'POC', + ]; + + 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/GdcHardwareManagement/src/V1alpha/OrganizationContact.php b/GdcHardwareManagement/src/V1alpha/OrganizationContact.php new file mode 100644 index 000000000000..76e0a42ce5c8 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/OrganizationContact.php @@ -0,0 +1,183 @@ +google.cloud.gdchardwaremanagement.v1alpha.OrganizationContact + */ +class OrganizationContact extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The organization's address. + * + * Generated from protobuf field .google.type.PostalAddress address = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $address = null; + /** + * Optional. The organization's email. + * + * Generated from protobuf field string email = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $email = ''; + /** + * Optional. The organization's phone number. + * + * Generated from protobuf field string phone = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $phone = ''; + /** + * Required. The individual points of contact in the organization at this + * location. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Contact contacts = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $contacts; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\PostalAddress $address + * Required. The organization's address. + * @type string $email + * Optional. The organization's email. + * @type string $phone + * Optional. The organization's phone number. + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\Contact>|\Google\Protobuf\Internal\RepeatedField $contacts + * Required. The individual points of contact in the organization at this + * location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The organization's address. + * + * Generated from protobuf field .google.type.PostalAddress address = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Type\PostalAddress|null + */ + public function getAddress() + { + return $this->address; + } + + public function hasAddress() + { + return isset($this->address); + } + + public function clearAddress() + { + unset($this->address); + } + + /** + * Required. The organization's address. + * + * Generated from protobuf field .google.type.PostalAddress address = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Type\PostalAddress $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkMessage($var, \Google\Type\PostalAddress::class); + $this->address = $var; + + return $this; + } + + /** + * Optional. The organization's email. + * + * Generated from protobuf field string email = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEmail() + { + return $this->email; + } + + /** + * Optional. The organization's email. + * + * Generated from protobuf field string email = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * Optional. The organization's phone number. + * + * Generated from protobuf field string phone = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPhone() + { + return $this->phone; + } + + /** + * Optional. The organization's phone number. + * + * Generated from protobuf field string phone = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPhone($var) + { + GPBUtil::checkString($var, True); + $this->phone = $var; + + return $this; + } + + /** + * Required. The individual points of contact in the organization at this + * location. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Contact contacts = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContacts() + { + return $this->contacts; + } + + /** + * Required. The individual points of contact in the organization at this + * location. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Contact contacts = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\Contact>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContacts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\Contact::class); + $this->contacts = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/PowerSupply.php b/GdcHardwareManagement/src/V1alpha/PowerSupply.php new file mode 100644 index 000000000000..f3bae89a2fc9 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/PowerSupply.php @@ -0,0 +1,61 @@ +google.cloud.gdchardwaremanagement.v1alpha.PowerSupply + */ +class PowerSupply +{ + /** + * Power supply is unspecified. + * + * Generated from protobuf enum POWER_SUPPLY_UNSPECIFIED = 0; + */ + const POWER_SUPPLY_UNSPECIFIED = 0; + /** + * AC power supply. + * + * Generated from protobuf enum POWER_SUPPLY_AC = 1; + */ + const POWER_SUPPLY_AC = 1; + /** + * DC power supply. + * + * Generated from protobuf enum POWER_SUPPLY_DC = 2; + */ + const POWER_SUPPLY_DC = 2; + + private static $valueToName = [ + self::POWER_SUPPLY_UNSPECIFIED => 'POWER_SUPPLY_UNSPECIFIED', + self::POWER_SUPPLY_AC => 'POWER_SUPPLY_AC', + self::POWER_SUPPLY_DC => 'POWER_SUPPLY_DC', + ]; + + 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/GdcHardwareManagement/src/V1alpha/RackSpace.php b/GdcHardwareManagement/src/V1alpha/RackSpace.php new file mode 100644 index 000000000000..579a6640ad0c --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/RackSpace.php @@ -0,0 +1,101 @@ +google.cloud.gdchardwaremanagement.v1alpha.RackSpace + */ +class RackSpace extends \Google\Protobuf\Internal\Message +{ + /** + * Required. First rack unit of the rack space (inclusive). + * + * Generated from protobuf field int32 start_rack_unit = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $start_rack_unit = 0; + /** + * Required. Last rack unit of the rack space (inclusive). + * + * Generated from protobuf field int32 end_rack_unit = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $end_rack_unit = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $start_rack_unit + * Required. First rack unit of the rack space (inclusive). + * @type int $end_rack_unit + * Required. Last rack unit of the rack space (inclusive). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. First rack unit of the rack space (inclusive). + * + * Generated from protobuf field int32 start_rack_unit = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getStartRackUnit() + { + return $this->start_rack_unit; + } + + /** + * Required. First rack unit of the rack space (inclusive). + * + * Generated from protobuf field int32 start_rack_unit = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setStartRackUnit($var) + { + GPBUtil::checkInt32($var); + $this->start_rack_unit = $var; + + return $this; + } + + /** + * Required. Last rack unit of the rack space (inclusive). + * + * Generated from protobuf field int32 end_rack_unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getEndRackUnit() + { + return $this->end_rack_unit; + } + + /** + * Required. Last rack unit of the rack space (inclusive). + * + * Generated from protobuf field int32 end_rack_unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setEndRackUnit($var) + { + GPBUtil::checkInt32($var); + $this->end_rack_unit = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/RecordActionOnCommentRequest.php b/GdcHardwareManagement/src/V1alpha/RecordActionOnCommentRequest.php new file mode 100644 index 000000000000..5709d8bcce33 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/RecordActionOnCommentRequest.php @@ -0,0 +1,128 @@ +google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest + */ +class RecordActionOnCommentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. The action type of the recorded action. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType action_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $action_type = 0; + + /** + * @param string $name Required. The name of the comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * Please see {@see GDCHardwareManagementClient::commentName()} for help formatting this field. + * @param int $actionType Required. The action type of the recorded action. + * For allowed values, use constants defined on {@see \Google\Cloud\GdcHardwareManagement\V1alpha\RecordActionOnCommentRequest\ActionType} + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\RecordActionOnCommentRequest + * + * @experimental + */ + public static function build(string $name, int $actionType): self + { + return (new self()) + ->setName($name) + ->setActionType($actionType); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * @type int $action_type + * Required. The action type of the recorded action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * + * 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 comment. + * Format: + * `projects/{project}/locations/{location}/orders/{order}/comments/{comment}` + * + * 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. The action type of the recorded action. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType action_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getActionType() + { + return $this->action_type; + } + + /** + * Required. The action type of the recorded action. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType action_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setActionType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\RecordActionOnCommentRequest\ActionType::class); + $this->action_type = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/RecordActionOnCommentRequest/ActionType.php b/GdcHardwareManagement/src/V1alpha/RecordActionOnCommentRequest/ActionType.php new file mode 100644 index 000000000000..2b987c9356dc --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/RecordActionOnCommentRequest/ActionType.php @@ -0,0 +1,62 @@ +google.cloud.gdchardwaremanagement.v1alpha.RecordActionOnCommentRequest.ActionType + */ +class ActionType +{ + /** + * Action is unspecified. + * + * Generated from protobuf enum ACTION_TYPE_UNSPECIFIED = 0; + */ + const ACTION_TYPE_UNSPECIFIED = 0; + /** + * Mark comment as read. + * + * Generated from protobuf enum READ = 1; + */ + const READ = 1; + /** + * Mark comment as unread. + * + * Generated from protobuf enum UNREAD = 2; + */ + const UNREAD = 2; + + private static $valueToName = [ + self::ACTION_TYPE_UNSPECIFIED => 'ACTION_TYPE_UNSPECIFIED', + self::READ => 'READ', + self::UNREAD => 'UNREAD', + ]; + + 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/GdcHardwareManagement/src/V1alpha/SignalZoneStateRequest.php b/GdcHardwareManagement/src/V1alpha/SignalZoneStateRequest.php new file mode 100644 index 000000000000..91eb1e184082 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/SignalZoneStateRequest.php @@ -0,0 +1,161 @@ +google.cloud.gdchardwaremanagement.v1alpha.SignalZoneStateRequest + */ +class SignalZoneStateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Required. The state signal to send for this zone. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.SignalZoneStateRequest.StateSignal state_signal = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $state_signal = 0; + + /** + * @param string $name Required. The name of the zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * Please see {@see GDCHardwareManagementClient::zoneName()} for help formatting this field. + * @param int $stateSignal Required. The state signal to send for this zone. + * For allowed values, use constants defined on {@see \Google\Cloud\GdcHardwareManagement\V1alpha\SignalZoneStateRequest\StateSignal} + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\SignalZoneStateRequest + * + * @experimental + */ + public static function build(string $name, int $stateSignal): self + { + return (new self()) + ->setName($name) + ->setStateSignal($stateSignal); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * @type int $state_signal + * Required. The state signal to send for this zone. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * 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 zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * 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. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Required. The state signal to send for this zone. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.SignalZoneStateRequest.StateSignal state_signal = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getStateSignal() + { + return $this->state_signal; + } + + /** + * Required. The state signal to send for this zone. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.SignalZoneStateRequest.StateSignal state_signal = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setStateSignal($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\SignalZoneStateRequest\StateSignal::class); + $this->state_signal = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/SignalZoneStateRequest/StateSignal.php b/GdcHardwareManagement/src/V1alpha/SignalZoneStateRequest/StateSignal.php new file mode 100644 index 000000000000..a7e262d22fca --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/SignalZoneStateRequest/StateSignal.php @@ -0,0 +1,69 @@ +google.cloud.gdchardwaremanagement.v1alpha.SignalZoneStateRequest.StateSignal + */ +class StateSignal +{ + /** + * State signal of the zone is unspecified. + * + * Generated from protobuf enum STATE_SIGNAL_UNSPECIFIED = 0; + */ + const STATE_SIGNAL_UNSPECIFIED = 0; + /** + * The Zone is ready for site turnup. + * + * Generated from protobuf enum FACTORY_TURNUP_CHECKS_PASSED = 1; + */ + const FACTORY_TURNUP_CHECKS_PASSED = 1; + /** + * The Zone is ready for site turnup. Deprecated, but not deleted. + * + * Generated from protobuf enum READY_FOR_SITE_TURNUP = 1 [deprecated = true]; + */ + const READY_FOR_SITE_TURNUP = 1; + /** + * The Zone failed in factory turnup checks. + * + * Generated from protobuf enum FACTORY_TURNUP_CHECKS_FAILED = 2; + */ + const FACTORY_TURNUP_CHECKS_FAILED = 2; + + private static $valueToName = [ + self::STATE_SIGNAL_UNSPECIFIED => 'STATE_SIGNAL_UNSPECIFIED', + self::FACTORY_TURNUP_CHECKS_PASSED => 'FACTORY_TURNUP_CHECKS_PASSED', + self::READY_FOR_SITE_TURNUP => 'READY_FOR_SITE_TURNUP', + self::FACTORY_TURNUP_CHECKS_FAILED => 'FACTORY_TURNUP_CHECKS_FAILED', + ]; + + 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/GdcHardwareManagement/src/V1alpha/Site.php b/GdcHardwareManagement/src/V1alpha/Site.php new file mode 100644 index 000000000000..9043acd505c9 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Site.php @@ -0,0 +1,501 @@ +google.cloud.gdchardwaremanagement.v1alpha.Site + */ +class Site extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Name of the site. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Optional. Display name of this Site. + * + * Generated from protobuf field string display_name = 24 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Optional. Description of this Site. + * + * Generated from protobuf field string description = 25 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Output only. Time when this site was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Time when this site was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Labels associated with this site as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. Contact information for this site. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.OrganizationContact organization_contact = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $organization_contact = null; + /** + * Required. A URL to the Google Maps address location of the site. + * An example value is `https://goo.gl/maps/xxxxxxxxx`. + * + * Generated from protobuf field string google_maps_pin_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $google_maps_pin_uri = ''; + /** + * Optional. The time periods when the site is accessible. + * If this field is empty, the site is accessible at all times. + * This field is used by Google to schedule the initial installation as well + * as any later hardware maintenance. You may update this at any time. For + * example, if the initial installation is requested during off-hours but + * maintenance should be performed during regular business hours, you should + * update the access times after initial installation is complete. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.TimePeriod access_times = 26 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $access_times; + /** + * Optional. Any additional notes for this Site. Please include information + * about: + * - security or access restrictions + * - any regulations affecting the technicians visiting the site + * - any special process or approval required to move the equipment + * - whether a representative will be available during site visits + * + * Generated from protobuf field string notes = 27 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $notes = ''; + /** + * Optional. Customer defined identifier for this Site. This can be used to + * identify the site in the customer's own systems. + * + * Generated from protobuf field string customer_site_id = 28 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $customer_site_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Name of the site. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * @type string $display_name + * Optional. Display name of this Site. + * @type string $description + * Optional. Description of this Site. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time when this site was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Time when this site was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels associated with this site as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\OrganizationContact $organization_contact + * Required. Contact information for this site. + * @type string $google_maps_pin_uri + * Required. A URL to the Google Maps address location of the site. + * An example value is `https://goo.gl/maps/xxxxxxxxx`. + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\TimePeriod>|\Google\Protobuf\Internal\RepeatedField $access_times + * Optional. The time periods when the site is accessible. + * If this field is empty, the site is accessible at all times. + * This field is used by Google to schedule the initial installation as well + * as any later hardware maintenance. You may update this at any time. For + * example, if the initial installation is requested during off-hours but + * maintenance should be performed during regular business hours, you should + * update the access times after initial installation is complete. + * @type string $notes + * Optional. Any additional notes for this Site. Please include information + * about: + * - security or access restrictions + * - any regulations affecting the technicians visiting the site + * - any special process or approval required to move the equipment + * - whether a representative will be available during site visits + * @type string $customer_site_id + * Optional. Customer defined identifier for this Site. This can be used to + * identify the site in the customer's own systems. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Name of the site. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Name of the site. + * Format: `projects/{project}/locations/{location}/sites/{site}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. Display name of this Site. + * + * Generated from protobuf field string display_name = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. Display name of this Site. + * + * Generated from protobuf field string display_name = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Optional. Description of this Site. + * + * Generated from protobuf field string description = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Description of this Site. + * + * Generated from protobuf field string description = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Time when this site was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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 when this site was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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 when this site was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.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. Time when this site was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.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; + } + + /** + * Optional. Labels associated with this site as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels associated with this site as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 4 [(.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; + } + + /** + * Required. Contact information for this site. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.OrganizationContact organization_contact = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\OrganizationContact|null + */ + public function getOrganizationContact() + { + return $this->organization_contact; + } + + public function hasOrganizationContact() + { + return isset($this->organization_contact); + } + + public function clearOrganizationContact() + { + unset($this->organization_contact); + } + + /** + * Required. Contact information for this site. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.OrganizationContact organization_contact = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\OrganizationContact $var + * @return $this + */ + public function setOrganizationContact($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\OrganizationContact::class); + $this->organization_contact = $var; + + return $this; + } + + /** + * Required. A URL to the Google Maps address location of the site. + * An example value is `https://goo.gl/maps/xxxxxxxxx`. + * + * Generated from protobuf field string google_maps_pin_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getGoogleMapsPinUri() + { + return $this->google_maps_pin_uri; + } + + /** + * Required. A URL to the Google Maps address location of the site. + * An example value is `https://goo.gl/maps/xxxxxxxxx`. + * + * Generated from protobuf field string google_maps_pin_uri = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setGoogleMapsPinUri($var) + { + GPBUtil::checkString($var, True); + $this->google_maps_pin_uri = $var; + + return $this; + } + + /** + * Optional. The time periods when the site is accessible. + * If this field is empty, the site is accessible at all times. + * This field is used by Google to schedule the initial installation as well + * as any later hardware maintenance. You may update this at any time. For + * example, if the initial installation is requested during off-hours but + * maintenance should be performed during regular business hours, you should + * update the access times after initial installation is complete. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.TimePeriod access_times = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccessTimes() + { + return $this->access_times; + } + + /** + * Optional. The time periods when the site is accessible. + * If this field is empty, the site is accessible at all times. + * This field is used by Google to schedule the initial installation as well + * as any later hardware maintenance. You may update this at any time. For + * example, if the initial installation is requested during off-hours but + * maintenance should be performed during regular business hours, you should + * update the access times after initial installation is complete. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.TimePeriod access_times = 26 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\TimePeriod>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccessTimes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\TimePeriod::class); + $this->access_times = $arr; + + return $this; + } + + /** + * Optional. Any additional notes for this Site. Please include information + * about: + * - security or access restrictions + * - any regulations affecting the technicians visiting the site + * - any special process or approval required to move the equipment + * - whether a representative will be available during site visits + * + * Generated from protobuf field string notes = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNotes() + { + return $this->notes; + } + + /** + * Optional. Any additional notes for this Site. Please include information + * about: + * - security or access restrictions + * - any regulations affecting the technicians visiting the site + * - any special process or approval required to move the equipment + * - whether a representative will be available during site visits + * + * Generated from protobuf field string notes = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNotes($var) + { + GPBUtil::checkString($var, True); + $this->notes = $var; + + return $this; + } + + /** + * Optional. Customer defined identifier for this Site. This can be used to + * identify the site in the customer's own systems. + * + * Generated from protobuf field string customer_site_id = 28 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCustomerSiteId() + { + return $this->customer_site_id; + } + + /** + * Optional. Customer defined identifier for this Site. This can be used to + * identify the site in the customer's own systems. + * + * Generated from protobuf field string customer_site_id = 28 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCustomerSiteId($var) + { + GPBUtil::checkString($var, True); + $this->customer_site_id = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/Sku.php b/GdcHardwareManagement/src/V1alpha/Sku.php new file mode 100644 index 000000000000..525baf50d7b1 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Sku.php @@ -0,0 +1,457 @@ +google.cloud.gdchardwaremanagement.v1alpha.Sku + */ +class Sku extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Name of this SKU. + * Format: `projects/{project}/locations/{location}/skus/{sku}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Display name of this SKU. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $display_name = ''; + /** + * Output only. Time when this SKU was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Time when this SKU was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. Configuration for this SKU. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.SkuConfig config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $config = null; + /** + * Output only. Available instances of this SKU. This field should be used for + * checking availability of a SKU. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.SkuInstance instances = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $instances; + /** + * Output only. Description of this SKU. + * + * Generated from protobuf field string description = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $description = ''; + /** + * Output only. The SKU revision ID. + * A new revision is created whenever `config` is updated. The format is an + * 8-character hexadecimal string. + * + * Generated from protobuf field string revision_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $revision_id = ''; + /** + * Output only. Flag to indicate whether or not this revision is active. Only + * an active revision can be used in a new Order. + * + * Generated from protobuf field bool is_active = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $is_active = false; + /** + * Output only. Type of this SKU. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Sku.Type type = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $type = 0; + /** + * Output only. The vCPU count associated with this SKU. + * + * Generated from protobuf field int32 vcpu_count = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $vcpu_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Name of this SKU. + * Format: `projects/{project}/locations/{location}/skus/{sku}` + * @type string $display_name + * Output only. Display name of this SKU. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time when this SKU was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Time when this SKU was last updated. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\SkuConfig $config + * Output only. Configuration for this SKU. + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\SkuInstance>|\Google\Protobuf\Internal\RepeatedField $instances + * Output only. Available instances of this SKU. This field should be used for + * checking availability of a SKU. + * @type string $description + * Output only. Description of this SKU. + * @type string $revision_id + * Output only. The SKU revision ID. + * A new revision is created whenever `config` is updated. The format is an + * 8-character hexadecimal string. + * @type bool $is_active + * Output only. Flag to indicate whether or not this revision is active. Only + * an active revision can be used in a new Order. + * @type int $type + * Output only. Type of this SKU. + * @type int $vcpu_count + * Output only. The vCPU count associated with this SKU. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Name of this SKU. + * Format: `projects/{project}/locations/{location}/skus/{sku}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Name of this SKU. + * Format: `projects/{project}/locations/{location}/skus/{sku}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Display name of this SKU. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Output only. Display name of this SKU. + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Time when this SKU was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. Time when this SKU was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. Time when this SKU was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.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. Time when this SKU was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.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; + } + + /** + * Output only. Configuration for this SKU. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.SkuConfig config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\SkuConfig|null + */ + public function getConfig() + { + return $this->config; + } + + public function hasConfig() + { + return isset($this->config); + } + + public function clearConfig() + { + unset($this->config); + } + + /** + * Output only. Configuration for this SKU. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.SkuConfig config = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\SkuConfig $var + * @return $this + */ + public function setConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\SkuConfig::class); + $this->config = $var; + + return $this; + } + + /** + * Output only. Available instances of this SKU. This field should be used for + * checking availability of a SKU. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.SkuInstance instances = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * Output only. Available instances of this SKU. This field should be used for + * checking availability of a SKU. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.SkuInstance instances = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\SkuInstance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\SkuInstance::class); + $this->instances = $arr; + + return $this; + } + + /** + * Output only. Description of this SKU. + * + * Generated from protobuf field string description = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Output only. Description of this SKU. + * + * Generated from protobuf field string description = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. The SKU revision ID. + * A new revision is created whenever `config` is updated. The format is an + * 8-character hexadecimal string. + * + * Generated from protobuf field string revision_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRevisionId() + { + return $this->revision_id; + } + + /** + * Output only. The SKU revision ID. + * A new revision is created whenever `config` is updated. The format is an + * 8-character hexadecimal string. + * + * Generated from protobuf field string revision_id = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->revision_id = $var; + + return $this; + } + + /** + * Output only. Flag to indicate whether or not this revision is active. Only + * an active revision can be used in a new Order. + * + * Generated from protobuf field bool is_active = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getIsActive() + { + return $this->is_active; + } + + /** + * Output only. Flag to indicate whether or not this revision is active. Only + * an active revision can be used in a new Order. + * + * Generated from protobuf field bool is_active = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setIsActive($var) + { + GPBUtil::checkBool($var); + $this->is_active = $var; + + return $this; + } + + /** + * Output only. Type of this SKU. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Sku.Type type = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Output only. Type of this SKU. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Sku.Type type = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Sku\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Output only. The vCPU count associated with this SKU. + * + * Generated from protobuf field int32 vcpu_count = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getVcpuCount() + { + return $this->vcpu_count; + } + + /** + * Output only. The vCPU count associated with this SKU. + * + * Generated from protobuf field int32 vcpu_count = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setVcpuCount($var) + { + GPBUtil::checkInt32($var); + $this->vcpu_count = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/Sku/Type.php b/GdcHardwareManagement/src/V1alpha/Sku/Type.php new file mode 100644 index 000000000000..da4f07bfa210 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Sku/Type.php @@ -0,0 +1,62 @@ +google.cloud.gdchardwaremanagement.v1alpha.Sku.Type + */ +class Type +{ + /** + * Type of the SKU is unspecified. This is not an allowed value. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Rack SKU. + * + * Generated from protobuf enum RACK = 1; + */ + const RACK = 1; + /** + * Server SKU. + * + * Generated from protobuf enum SERVER = 2; + */ + const SERVER = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::RACK => 'RACK', + self::SERVER => 'SERVER', + ]; + + 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/GdcHardwareManagement/src/V1alpha/SkuConfig.php b/GdcHardwareManagement/src/V1alpha/SkuConfig.php new file mode 100644 index 000000000000..cf8ceb60ebf3 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/SkuConfig.php @@ -0,0 +1,169 @@ +google.cloud.gdchardwaremanagement.v1alpha.SkuConfig + */ +class SkuConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Information about CPU configuration. + * + * Generated from protobuf field string cpu = 1; + */ + protected $cpu = ''; + /** + * Information about GPU configuration. + * + * Generated from protobuf field string gpu = 2; + */ + protected $gpu = ''; + /** + * Information about RAM configuration. + * + * Generated from protobuf field string ram = 3; + */ + protected $ram = ''; + /** + * Information about storage configuration. + * + * Generated from protobuf field string storage = 4; + */ + protected $storage = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cpu + * Information about CPU configuration. + * @type string $gpu + * Information about GPU configuration. + * @type string $ram + * Information about RAM configuration. + * @type string $storage + * Information about storage configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Information about CPU configuration. + * + * Generated from protobuf field string cpu = 1; + * @return string + */ + public function getCpu() + { + return $this->cpu; + } + + /** + * Information about CPU configuration. + * + * Generated from protobuf field string cpu = 1; + * @param string $var + * @return $this + */ + public function setCpu($var) + { + GPBUtil::checkString($var, True); + $this->cpu = $var; + + return $this; + } + + /** + * Information about GPU configuration. + * + * Generated from protobuf field string gpu = 2; + * @return string + */ + public function getGpu() + { + return $this->gpu; + } + + /** + * Information about GPU configuration. + * + * Generated from protobuf field string gpu = 2; + * @param string $var + * @return $this + */ + public function setGpu($var) + { + GPBUtil::checkString($var, True); + $this->gpu = $var; + + return $this; + } + + /** + * Information about RAM configuration. + * + * Generated from protobuf field string ram = 3; + * @return string + */ + public function getRam() + { + return $this->ram; + } + + /** + * Information about RAM configuration. + * + * Generated from protobuf field string ram = 3; + * @param string $var + * @return $this + */ + public function setRam($var) + { + GPBUtil::checkString($var, True); + $this->ram = $var; + + return $this; + } + + /** + * Information about storage configuration. + * + * Generated from protobuf field string storage = 4; + * @return string + */ + public function getStorage() + { + return $this->storage; + } + + /** + * Information about storage configuration. + * + * Generated from protobuf field string storage = 4; + * @param string $var + * @return $this + */ + public function setStorage($var) + { + GPBUtil::checkString($var, True); + $this->storage = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/SkuInstance.php b/GdcHardwareManagement/src/V1alpha/SkuInstance.php new file mode 100644 index 000000000000..8f72060dc6a2 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/SkuInstance.php @@ -0,0 +1,223 @@ +google.cloud.gdchardwaremanagement.v1alpha.SkuInstance + */ +class SkuInstance extends \Google\Protobuf\Internal\Message +{ + /** + * The [Unicode CLDR](https://cldr.unicode.org) region code where this + * instance is available. + * + * Generated from protobuf field string region_code = 1; + */ + protected $region_code = ''; + /** + * Power supply type for this instance. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.PowerSupply power_supply = 2; + */ + protected $power_supply = 0; + /** + * Reference to the corresponding SKU in the Cloud Billing API. + * The estimated price information can be retrieved using that API. + * Format: `services/{service}/skus/{sku}` + * + * Generated from protobuf field string billing_sku = 3; + */ + protected $billing_sku = ''; + /** + * Reference to the corresponding SKU per vCPU in the Cloud Billing API. + * The estimated price information can be retrieved using that API. + * Format: `services/{service}/skus/{sku}` + * + * Generated from protobuf field string billing_sku_per_vcpu = 4; + */ + protected $billing_sku_per_vcpu = ''; + /** + * Subscription duration for the hardware in months. + * + * Generated from protobuf field int32 subscription_duration_months = 5; + */ + protected $subscription_duration_months = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $region_code + * The [Unicode CLDR](https://cldr.unicode.org) region code where this + * instance is available. + * @type int $power_supply + * Power supply type for this instance. + * @type string $billing_sku + * Reference to the corresponding SKU in the Cloud Billing API. + * The estimated price information can be retrieved using that API. + * Format: `services/{service}/skus/{sku}` + * @type string $billing_sku_per_vcpu + * Reference to the corresponding SKU per vCPU in the Cloud Billing API. + * The estimated price information can be retrieved using that API. + * Format: `services/{service}/skus/{sku}` + * @type int $subscription_duration_months + * Subscription duration for the hardware in months. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The [Unicode CLDR](https://cldr.unicode.org) region code where this + * instance is available. + * + * Generated from protobuf field string region_code = 1; + * @return string + */ + public function getRegionCode() + { + return $this->region_code; + } + + /** + * The [Unicode CLDR](https://cldr.unicode.org) region code where this + * instance is available. + * + * Generated from protobuf field string region_code = 1; + * @param string $var + * @return $this + */ + public function setRegionCode($var) + { + GPBUtil::checkString($var, True); + $this->region_code = $var; + + return $this; + } + + /** + * Power supply type for this instance. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.PowerSupply power_supply = 2; + * @return int + */ + public function getPowerSupply() + { + return $this->power_supply; + } + + /** + * Power supply type for this instance. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.PowerSupply power_supply = 2; + * @param int $var + * @return $this + */ + public function setPowerSupply($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\PowerSupply::class); + $this->power_supply = $var; + + return $this; + } + + /** + * Reference to the corresponding SKU in the Cloud Billing API. + * The estimated price information can be retrieved using that API. + * Format: `services/{service}/skus/{sku}` + * + * Generated from protobuf field string billing_sku = 3; + * @return string + */ + public function getBillingSku() + { + return $this->billing_sku; + } + + /** + * Reference to the corresponding SKU in the Cloud Billing API. + * The estimated price information can be retrieved using that API. + * Format: `services/{service}/skus/{sku}` + * + * Generated from protobuf field string billing_sku = 3; + * @param string $var + * @return $this + */ + public function setBillingSku($var) + { + GPBUtil::checkString($var, True); + $this->billing_sku = $var; + + return $this; + } + + /** + * Reference to the corresponding SKU per vCPU in the Cloud Billing API. + * The estimated price information can be retrieved using that API. + * Format: `services/{service}/skus/{sku}` + * + * Generated from protobuf field string billing_sku_per_vcpu = 4; + * @return string + */ + public function getBillingSkuPerVcpu() + { + return $this->billing_sku_per_vcpu; + } + + /** + * Reference to the corresponding SKU per vCPU in the Cloud Billing API. + * The estimated price information can be retrieved using that API. + * Format: `services/{service}/skus/{sku}` + * + * Generated from protobuf field string billing_sku_per_vcpu = 4; + * @param string $var + * @return $this + */ + public function setBillingSkuPerVcpu($var) + { + GPBUtil::checkString($var, True); + $this->billing_sku_per_vcpu = $var; + + return $this; + } + + /** + * Subscription duration for the hardware in months. + * + * Generated from protobuf field int32 subscription_duration_months = 5; + * @return int + */ + public function getSubscriptionDurationMonths() + { + return $this->subscription_duration_months; + } + + /** + * Subscription duration for the hardware in months. + * + * Generated from protobuf field int32 subscription_duration_months = 5; + * @param int $var + * @return $this + */ + public function setSubscriptionDurationMonths($var) + { + GPBUtil::checkInt32($var); + $this->subscription_duration_months = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/SubmitOrderRequest.php b/GdcHardwareManagement/src/V1alpha/SubmitOrderRequest.php new file mode 100644 index 000000000000..f99dad3b7003 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/SubmitOrderRequest.php @@ -0,0 +1,162 @@ +google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest + */ +class SubmitOrderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + /** + * Optional. Type of this request. If unset, the request type is assumed to be + * `INFO_PENDING`. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $type = 0; + + /** + * @param string $name Required. The name of the order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * Please see {@see GDCHardwareManagementClient::orderName()} for help formatting this field. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\SubmitOrderRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * @type int $type + * Optional. Type of this request. If unset, the request type is assumed to be + * `INFO_PENDING`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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 order. + * Format: `projects/{project}/locations/{location}/orders/{order}` + * + * 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. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * 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. Type of this request. If unset, the request type is assumed to be + * `INFO_PENDING`. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Optional. Type of this request. If unset, the request type is assumed to be + * `INFO_PENDING`. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\SubmitOrderRequest\Type::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/SubmitOrderRequest/Type.php b/GdcHardwareManagement/src/V1alpha/SubmitOrderRequest/Type.php new file mode 100644 index 000000000000..7c82048e6275 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/SubmitOrderRequest/Type.php @@ -0,0 +1,74 @@ +google.cloud.gdchardwaremanagement.v1alpha.SubmitOrderRequest.Type + */ +class Type +{ + /** + * Request type is unspecified. This should not be used. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * Use this request type to submit your order and initiate conversation with + * Google. After this submission, you will not be able to modify the number + * or SKU of your ordered hardware. Please note that this order will not be + * ready for fulfillment yet until you provide more information, such as + * zone network configuration, hardware physical and installation + * information, etc. + * If you are submitting an order for a SKU type of RACK, please use this + * request type, as additional information will be required outside of the + * API. + * + * Generated from protobuf enum INFO_PENDING = 1; + */ + const INFO_PENDING = 1; + /** + * Use this request type if and when you are ready to submit your order for + * fulfillment. In addition to the information required for `INFO_PENDING`, + * the order must contain all required information, such as zone network + * configuration, hardware physical and installation information, etc. + * Further changes to any order information will no longer be allowed. + * + * Generated from protobuf enum INFO_COMPLETE = 2; + */ + const INFO_COMPLETE = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::INFO_PENDING => 'INFO_PENDING', + self::INFO_COMPLETE => 'INFO_COMPLETE', + ]; + + 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/GdcHardwareManagement/src/V1alpha/Subnet.php b/GdcHardwareManagement/src/V1alpha/Subnet.php new file mode 100644 index 000000000000..3509088458be --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Subnet.php @@ -0,0 +1,101 @@ +google.cloud.gdchardwaremanagement.v1alpha.Subnet + */ +class Subnet extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Address range for this subnet in CIDR notation. + * + * Generated from protobuf field string address_range = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + */ + protected $address_range = ''; + /** + * Required. Default gateway for this subnet. + * + * Generated from protobuf field string default_gateway_ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + */ + protected $default_gateway_ip_address = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address_range + * Required. Address range for this subnet in CIDR notation. + * @type string $default_gateway_ip_address + * Required. Default gateway for this subnet. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. Address range for this subnet in CIDR notation. + * + * Generated from protobuf field string address_range = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + * @return string + */ + public function getAddressRange() + { + return $this->address_range; + } + + /** + * Required. Address range for this subnet in CIDR notation. + * + * Generated from protobuf field string address_range = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setAddressRange($var) + { + GPBUtil::checkString($var, True); + $this->address_range = $var; + + return $this; + } + + /** + * Required. Default gateway for this subnet. + * + * Generated from protobuf field string default_gateway_ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + * @return string + */ + public function getDefaultGatewayIpAddress() + { + return $this->default_gateway_ip_address; + } + + /** + * Required. Default gateway for this subnet. + * + * Generated from protobuf field string default_gateway_ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setDefaultGatewayIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->default_gateway_ip_address = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/SubscriptionConfig.php b/GdcHardwareManagement/src/V1alpha/SubscriptionConfig.php new file mode 100644 index 000000000000..f8702d21d411 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/SubscriptionConfig.php @@ -0,0 +1,139 @@ +google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig + */ +class SubscriptionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique identifier of the subscription. + * + * Generated from protobuf field string subscription_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $subscription_id = ''; + /** + * Output only. The Google Cloud Billing ID that the subscription is created + * under. + * + * Generated from protobuf field string billing_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $billing_id = ''; + /** + * Output only. The current state of the subscription. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.SubscriptionState state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $subscription_id + * Output only. The unique identifier of the subscription. + * @type string $billing_id + * Output only. The Google Cloud Billing ID that the subscription is created + * under. + * @type int $state + * Output only. The current state of the subscription. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique identifier of the subscription. + * + * Generated from protobuf field string subscription_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSubscriptionId() + { + return $this->subscription_id; + } + + /** + * Output only. The unique identifier of the subscription. + * + * Generated from protobuf field string subscription_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSubscriptionId($var) + { + GPBUtil::checkString($var, True); + $this->subscription_id = $var; + + return $this; + } + + /** + * Output only. The Google Cloud Billing ID that the subscription is created + * under. + * + * Generated from protobuf field string billing_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getBillingId() + { + return $this->billing_id; + } + + /** + * Output only. The Google Cloud Billing ID that the subscription is created + * under. + * + * Generated from protobuf field string billing_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setBillingId($var) + { + GPBUtil::checkString($var, True); + $this->billing_id = $var; + + return $this; + } + + /** + * Output only. The current state of the subscription. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.SubscriptionState state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the subscription. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.SubscriptionState state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\SubscriptionConfig\SubscriptionState::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/SubscriptionConfig/SubscriptionState.php b/GdcHardwareManagement/src/V1alpha/SubscriptionConfig/SubscriptionState.php new file mode 100644 index 000000000000..e316250c80ff --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/SubscriptionConfig/SubscriptionState.php @@ -0,0 +1,86 @@ +google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig.SubscriptionState + */ +class SubscriptionState +{ + /** + * State is unspecified. + * + * Generated from protobuf enum SUBSCRIPTION_STATE_UNSPECIFIED = 0; + */ + const SUBSCRIPTION_STATE_UNSPECIFIED = 0; + /** + * Active state means that the subscription has been created successfully + * and billing is happening. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * Inactive means that the subscription has been created successfully, but + * billing has not started yet. + * + * Generated from protobuf enum INACTIVE = 2; + */ + const INACTIVE = 2; + /** + * The subscription is in an erroneous state. + * + * Generated from protobuf enum ERROR = 3; + */ + const ERROR = 3; + /** + * The subscription state failed to be retrieved. This may be a transient + * issue. The user should retry the request. + * + * Generated from protobuf enum FAILED_TO_RETRIEVE = 4; + */ + const FAILED_TO_RETRIEVE = 4; + /** + * The subscription has been completed, because it has reached the end date. + * + * Generated from protobuf enum COMPLETED = 5; + */ + const COMPLETED = 5; + + private static $valueToName = [ + self::SUBSCRIPTION_STATE_UNSPECIFIED => 'SUBSCRIPTION_STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::INACTIVE => 'INACTIVE', + self::ERROR => 'ERROR', + self::FAILED_TO_RETRIEVE => 'FAILED_TO_RETRIEVE', + self::COMPLETED => 'COMPLETED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/GdcHardwareManagement/src/V1alpha/TimePeriod.php b/GdcHardwareManagement/src/V1alpha/TimePeriod.php new file mode 100644 index 000000000000..663dd25bd74c --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/TimePeriod.php @@ -0,0 +1,155 @@ +google.cloud.gdchardwaremanagement.v1alpha.TimePeriod + */ +class TimePeriod extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The start of the time period. + * + * Generated from protobuf field .google.type.TimeOfDay start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $start_time = null; + /** + * Required. The end of the time period. + * + * Generated from protobuf field .google.type.TimeOfDay end_time = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $end_time = null; + /** + * Required. The days of the week that the time period is active. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $days; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\TimeOfDay $start_time + * Required. The start of the time period. + * @type \Google\Type\TimeOfDay $end_time + * Required. The end of the time period. + * @type array|\Google\Protobuf\Internal\RepeatedField $days + * Required. The days of the week that the time period is active. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The start of the time period. + * + * Generated from protobuf field .google.type.TimeOfDay start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Type\TimeOfDay|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Required. The start of the time period. + * + * Generated from protobuf field .google.type.TimeOfDay start_time = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Type\TimeOfDay $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Type\TimeOfDay::class); + $this->start_time = $var; + + return $this; + } + + /** + * Required. The end of the time period. + * + * Generated from protobuf field .google.type.TimeOfDay end_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Type\TimeOfDay|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Required. The end of the time period. + * + * Generated from protobuf field .google.type.TimeOfDay end_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Type\TimeOfDay $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Type\TimeOfDay::class); + $this->end_time = $var; + + return $this; + } + + /** + * Required. The days of the week that the time period is active. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDays() + { + return $this->days; + } + + /** + * Required. The days of the week that the time period is active. + * + * Generated from protobuf field repeated .google.type.DayOfWeek days = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDays($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Type\DayOfWeek::class); + $this->days = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/UpdateHardwareGroupRequest.php b/GdcHardwareManagement/src/V1alpha/UpdateHardwareGroupRequest.php new file mode 100644 index 000000000000..7cf44f34cfb1 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/UpdateHardwareGroupRequest.php @@ -0,0 +1,194 @@ +google.cloud.gdchardwaremanagement.v1alpha.UpdateHardwareGroupRequest + */ +class UpdateHardwareGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A mask to specify the fields in the HardwareGroup to overwrite + * with this update. The fields specified in the update_mask are relative to + * the hardware group, not the full request. A field will be overwritten if it + * is in the mask. If you don't provide a mask then all fields will be + * overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The hardware group to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup hardware_group = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $hardware_group = null; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup $hardwareGroup Required. The hardware group to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. A mask to specify the fields in the HardwareGroup to overwrite + * with this update. The fields specified in the update_mask are relative to + * the hardware group, not the full request. A field will be overwritten if it + * is in the mask. If you don't provide a mask then all fields will be + * overwritten. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\UpdateHardwareGroupRequest + * + * @experimental + */ + public static function build(\Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup $hardwareGroup, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setHardwareGroup($hardwareGroup) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. A mask to specify the fields in the HardwareGroup to overwrite + * with this update. The fields specified in the update_mask are relative to + * the hardware group, not the full request. A field will be overwritten if it + * is in the mask. If you don't provide a mask then all fields will be + * overwritten. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup $hardware_group + * Required. The hardware group to update. + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. A mask to specify the fields in the HardwareGroup to overwrite + * with this update. The fields specified in the update_mask are relative to + * the hardware group, not the full request. A field will be overwritten if it + * is in the mask. If you don't 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. A mask to specify the fields in the HardwareGroup to overwrite + * with this update. The fields specified in the update_mask are relative to + * the hardware group, not the full request. A field will be overwritten if it + * is in the mask. If you don't 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 hardware group to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup hardware_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup|null + */ + public function getHardwareGroup() + { + return $this->hardware_group; + } + + public function hasHardwareGroup() + { + return isset($this->hardware_group); + } + + public function clearHardwareGroup() + { + unset($this->hardware_group); + } + + /** + * Required. The hardware group to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.HardwareGroup hardware_group = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup $var + * @return $this + */ + public function setHardwareGroup($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup::class); + $this->hardware_group = $var; + + return $this; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * 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; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/UpdateHardwareRequest.php b/GdcHardwareManagement/src/V1alpha/UpdateHardwareRequest.php new file mode 100644 index 000000000000..cfbebcea912e --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/UpdateHardwareRequest.php @@ -0,0 +1,189 @@ +google.cloud.gdchardwaremanagement.v1alpha.UpdateHardwareRequest + */ +class UpdateHardwareRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A mask to specify the fields in the Hardware to overwrite with + * this update. The fields specified in the update_mask are relative to the + * hardware, not the full request. A field will be overwritten if it is in the + * mask. If you don't provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The hardware to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Hardware hardware = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $hardware = null; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Hardware $hardware Required. The hardware to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. A mask to specify the fields in the Hardware to overwrite with + * this update. The fields specified in the update_mask are relative to the + * hardware, not the full request. A field will be overwritten if it is in the + * mask. If you don't provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\UpdateHardwareRequest + * + * @experimental + */ + public static function build(\Google\Cloud\GdcHardwareManagement\V1alpha\Hardware $hardware, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setHardware($hardware) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. A mask to specify the fields in the Hardware to overwrite with + * this update. The fields specified in the update_mask are relative to the + * hardware, not the full request. A field will be overwritten if it is in the + * mask. If you don't provide a mask then all fields will be overwritten. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\Hardware $hardware + * Required. The hardware to update. + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. A mask to specify the fields in the Hardware to overwrite with + * this update. The fields specified in the update_mask are relative to the + * hardware, not the full request. A field will be overwritten if it is in the + * mask. If you don't 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. A mask to specify the fields in the Hardware to overwrite with + * this update. The fields specified in the update_mask are relative to the + * hardware, not the full request. A field will be overwritten if it is in the + * mask. If you don't 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 hardware to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Hardware hardware = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\Hardware|null + */ + public function getHardware() + { + return $this->hardware; + } + + public function hasHardware() + { + return isset($this->hardware); + } + + public function clearHardware() + { + unset($this->hardware); + } + + /** + * Required. The hardware to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Hardware hardware = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Hardware $var + * @return $this + */ + public function setHardware($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Hardware::class); + $this->hardware = $var; + + return $this; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * 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; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/UpdateOrderRequest.php b/GdcHardwareManagement/src/V1alpha/UpdateOrderRequest.php new file mode 100644 index 000000000000..013cf4839a67 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/UpdateOrderRequest.php @@ -0,0 +1,189 @@ +google.cloud.gdchardwaremanagement.v1alpha.UpdateOrderRequest + */ +class UpdateOrderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A mask to specify the fields in the Order to overwrite with this + * update. The fields specified in the update_mask are relative to the order, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The order to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Order order = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $order = null; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Order $order Required. The order to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. A mask to specify the fields in the Order to overwrite with this + * update. The fields specified in the update_mask are relative to the order, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\UpdateOrderRequest + * + * @experimental + */ + public static function build(\Google\Cloud\GdcHardwareManagement\V1alpha\Order $order, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setOrder($order) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. A mask to specify the fields in the Order to overwrite with this + * update. The fields specified in the update_mask are relative to the order, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't provide a mask then all fields will be overwritten. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\Order $order + * Required. The order to update. + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. A mask to specify the fields in the Order to overwrite with this + * update. The fields specified in the update_mask are relative to the order, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't 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. A mask to specify the fields in the Order to overwrite with this + * update. The fields specified in the update_mask are relative to the order, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't 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 order to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Order order = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\Order|null + */ + public function getOrder() + { + return $this->order; + } + + public function hasOrder() + { + return isset($this->order); + } + + public function clearOrder() + { + unset($this->order); + } + + /** + * Required. The order to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Order order = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Order $var + * @return $this + */ + public function setOrder($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Order::class); + $this->order = $var; + + return $this; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * 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; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/UpdateSiteRequest.php b/GdcHardwareManagement/src/V1alpha/UpdateSiteRequest.php new file mode 100644 index 000000000000..658d780f2260 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/UpdateSiteRequest.php @@ -0,0 +1,189 @@ +google.cloud.gdchardwaremanagement.v1alpha.UpdateSiteRequest + */ +class UpdateSiteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A mask to specify the fields in the Site to overwrite with this + * update. The fields specified in the update_mask are relative to the site, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The site to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Site site = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $site = null; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Site $site Required. The site to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. A mask to specify the fields in the Site to overwrite with this + * update. The fields specified in the update_mask are relative to the site, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\UpdateSiteRequest + * + * @experimental + */ + public static function build(\Google\Cloud\GdcHardwareManagement\V1alpha\Site $site, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setSite($site) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. A mask to specify the fields in the Site to overwrite with this + * update. The fields specified in the update_mask are relative to the site, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't provide a mask then all fields will be overwritten. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\Site $site + * Required. The site to update. + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. A mask to specify the fields in the Site to overwrite with this + * update. The fields specified in the update_mask are relative to the site, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't 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. A mask to specify the fields in the Site to overwrite with this + * update. The fields specified in the update_mask are relative to the site, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't 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 site to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Site site = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\Site|null + */ + public function getSite() + { + return $this->site; + } + + public function hasSite() + { + return isset($this->site); + } + + public function clearSite() + { + unset($this->site); + } + + /** + * Required. The site to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Site site = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Site $var + * @return $this + */ + public function setSite($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Site::class); + $this->site = $var; + + return $this; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * 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; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/UpdateZoneRequest.php b/GdcHardwareManagement/src/V1alpha/UpdateZoneRequest.php new file mode 100644 index 000000000000..2f4eea5e57ea --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/UpdateZoneRequest.php @@ -0,0 +1,189 @@ +google.cloud.gdchardwaremanagement.v1alpha.UpdateZoneRequest + */ +class UpdateZoneRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A mask to specify the fields in the Zone to overwrite with this + * update. The fields specified in the update_mask are relative to the zone, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The zone to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Zone zone = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = null; + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Zone $zone Required. The zone to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. A mask to specify the fields in the Zone to overwrite with this + * update. The fields specified in the update_mask are relative to the zone, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\UpdateZoneRequest + * + * @experimental + */ + public static function build(\Google\Cloud\GdcHardwareManagement\V1alpha\Zone $zone, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setZone($zone) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. A mask to specify the fields in the Zone to overwrite with this + * update. The fields specified in the update_mask are relative to the zone, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't provide a mask then all fields will be overwritten. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\Zone $zone + * Required. The zone to update. + * @type string $request_id + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. A mask to specify the fields in the Zone to overwrite with this + * update. The fields specified in the update_mask are relative to the zone, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't 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. A mask to specify the fields in the Zone to overwrite with this + * update. The fields specified in the update_mask are relative to the zone, + * not the full request. A field will be overwritten if it is in the mask. If + * you don't 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 zone to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Zone zone = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\Zone|null + */ + public function getZone() + { + return $this->zone; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * Required. The zone to update. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Zone zone = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Zone $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Zone::class); + $this->zone = $var; + + return $this; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional unique identifier for this request. See + * [AIP-155](https://google.aip.dev/155). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/Zone.php b/GdcHardwareManagement/src/V1alpha/Zone.php new file mode 100644 index 000000000000..e6fd285eb28b --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Zone.php @@ -0,0 +1,453 @@ +google.cloud.gdchardwaremanagement.v1alpha.Zone + */ +class Zone extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Name of this zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Time when this zone was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Time when this zone was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Labels associated with this zone as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Human friendly display name of this zone. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Output only. Current state for this zone. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Zone.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Required. The points of contact. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Contact contacts = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + private $contacts; + /** + * Output only. Link to the Customer Intake Questionnaire (CIQ) sheet for this + * zone. + * + * Generated from protobuf field string ciq_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $ciq_uri = ''; + /** + * Optional. Networking configuration for this zone. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.ZoneNetworkConfig network_config = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network_config = null; + /** + * Output only. Globally unique identifier generated for this Edge Zone. + * + * Generated from protobuf field string globally_unique_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $globally_unique_id = ''; + /** + * Output only. Subscription configurations for this zone. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig subscription_configs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $subscription_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Name of this zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time when this zone was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Time when this zone was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels associated with this zone as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * @type string $display_name + * Optional. Human friendly display name of this zone. + * @type int $state + * Output only. Current state for this zone. + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\Contact>|\Google\Protobuf\Internal\RepeatedField $contacts + * Required. The points of contact. + * @type string $ciq_uri + * Output only. Link to the Customer Intake Questionnaire (CIQ) sheet for this + * zone. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\ZoneNetworkConfig $network_config + * Optional. Networking configuration for this zone. + * @type string $globally_unique_id + * Output only. Globally unique identifier generated for this Edge Zone. + * @type array<\Google\Cloud\GdcHardwareManagement\V1alpha\SubscriptionConfig>|\Google\Protobuf\Internal\RepeatedField $subscription_configs + * Output only. Subscription configurations for this zone. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Name of this zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Name of this zone. + * Format: `projects/{project}/locations/{location}/zones/{zone}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Time when this zone was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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 when this zone was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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 when this zone was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.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. Time when this zone was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.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; + } + + /** + * Optional. Labels associated with this zone as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels associated with this zone as key value pairs. + * For more information about labels, see [Create and manage + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + * + * Generated from protobuf field map labels = 4 [(.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. Human friendly display name of this zone. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. Human friendly display name of this zone. + * + * Generated from protobuf field string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. Current state for this zone. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Zone.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current state for this zone. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Zone.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Zone\State::class); + $this->state = $var; + + return $this; + } + + /** + * Required. The points of contact. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Contact contacts = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContacts() + { + return $this->contacts; + } + + /** + * Required. The points of contact. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.Contact contacts = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\Contact>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContacts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\Contact::class); + $this->contacts = $arr; + + return $this; + } + + /** + * Output only. Link to the Customer Intake Questionnaire (CIQ) sheet for this + * zone. + * + * Generated from protobuf field string ciq_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCiqUri() + { + return $this->ciq_uri; + } + + /** + * Output only. Link to the Customer Intake Questionnaire (CIQ) sheet for this + * zone. + * + * Generated from protobuf field string ciq_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCiqUri($var) + { + GPBUtil::checkString($var, True); + $this->ciq_uri = $var; + + return $this; + } + + /** + * Optional. Networking configuration for this zone. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.ZoneNetworkConfig network_config = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\ZoneNetworkConfig|null + */ + public function getNetworkConfig() + { + return $this->network_config; + } + + public function hasNetworkConfig() + { + return isset($this->network_config); + } + + public function clearNetworkConfig() + { + unset($this->network_config); + } + + /** + * Optional. Networking configuration for this zone. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.ZoneNetworkConfig network_config = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\ZoneNetworkConfig $var + * @return $this + */ + public function setNetworkConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\ZoneNetworkConfig::class); + $this->network_config = $var; + + return $this; + } + + /** + * Output only. Globally unique identifier generated for this Edge Zone. + * + * Generated from protobuf field string globally_unique_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getGloballyUniqueId() + { + return $this->globally_unique_id; + } + + /** + * Output only. Globally unique identifier generated for this Edge Zone. + * + * Generated from protobuf field string globally_unique_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setGloballyUniqueId($var) + { + GPBUtil::checkString($var, True); + $this->globally_unique_id = $var; + + return $this; + } + + /** + * Output only. Subscription configurations for this zone. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig subscription_configs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubscriptionConfigs() + { + return $this->subscription_configs; + } + + /** + * Output only. Subscription configurations for this zone. + * + * Generated from protobuf field repeated .google.cloud.gdchardwaremanagement.v1alpha.SubscriptionConfig subscription_configs = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\GdcHardwareManagement\V1alpha\SubscriptionConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubscriptionConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GdcHardwareManagement\V1alpha\SubscriptionConfig::class); + $this->subscription_configs = $arr; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/Zone/State.php b/GdcHardwareManagement/src/V1alpha/Zone/State.php new file mode 100644 index 000000000000..6ee652935bf1 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/Zone/State.php @@ -0,0 +1,97 @@ +google.cloud.gdchardwaremanagement.v1alpha.Zone.State + */ +class State +{ + /** + * State of the Zone is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * More information is required from the customer to make progress. + * + * Generated from protobuf enum ADDITIONAL_INFO_NEEDED = 1; + */ + const ADDITIONAL_INFO_NEEDED = 1; + /** + * Google is preparing the Zone. + * + * Generated from protobuf enum PREPARING = 2; + */ + const PREPARING = 2; + /** + * Factory turnup has succeeded. + * + * Generated from protobuf enum READY_FOR_CUSTOMER_FACTORY_TURNUP_CHECKS = 5; + */ + const READY_FOR_CUSTOMER_FACTORY_TURNUP_CHECKS = 5; + /** + * The Zone is ready for site turnup. + * + * Generated from protobuf enum READY_FOR_SITE_TURNUP = 6; + */ + const READY_FOR_SITE_TURNUP = 6; + /** + * The Zone failed in factory turnup checks. + * + * Generated from protobuf enum CUSTOMER_FACTORY_TURNUP_CHECKS_FAILED = 7; + */ + const CUSTOMER_FACTORY_TURNUP_CHECKS_FAILED = 7; + /** + * The Zone is available to use. + * + * Generated from protobuf enum ACTIVE = 3; + */ + const ACTIVE = 3; + /** + * The Zone has been cancelled. + * + * Generated from protobuf enum CANCELLED = 4; + */ + const CANCELLED = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ADDITIONAL_INFO_NEEDED => 'ADDITIONAL_INFO_NEEDED', + self::PREPARING => 'PREPARING', + self::READY_FOR_CUSTOMER_FACTORY_TURNUP_CHECKS => 'READY_FOR_CUSTOMER_FACTORY_TURNUP_CHECKS', + self::READY_FOR_SITE_TURNUP => 'READY_FOR_SITE_TURNUP', + self::CUSTOMER_FACTORY_TURNUP_CHECKS_FAILED => 'CUSTOMER_FACTORY_TURNUP_CHECKS_FAILED', + self::ACTIVE => 'ACTIVE', + self::CANCELLED => 'CANCELLED', + ]; + + 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/GdcHardwareManagement/src/V1alpha/ZoneNetworkConfig.php b/GdcHardwareManagement/src/V1alpha/ZoneNetworkConfig.php new file mode 100644 index 000000000000..bea0bec7f738 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/ZoneNetworkConfig.php @@ -0,0 +1,279 @@ +google.cloud.gdchardwaremanagement.v1alpha.ZoneNetworkConfig + */ +class ZoneNetworkConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. An IPv4 address block for machine management. + * Should be a private RFC1918 or public CIDR block large enough to allocate + * at least one address per machine in the Zone. + * Should be in `management_ipv4_subnet`, and disjoint with other address + * ranges. + * + * Generated from protobuf field string machine_mgmt_ipv4_range = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + */ + protected $machine_mgmt_ipv4_range = ''; + /** + * Required. An IPv4 address block for kubernetes nodes. + * Should be a private RFC1918 or public CIDR block large enough to allocate + * at least one address per machine in the Zone. + * Should be in `kubernetes_ipv4_subnet`, and disjoint with other address + * ranges. + * + * Generated from protobuf field string kubernetes_node_ipv4_range = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + */ + protected $kubernetes_node_ipv4_range = ''; + /** + * Required. An IPv4 address block for kubernetes control plane. + * Should be a private RFC1918 or public CIDR block large enough to allocate + * at least one address per cluster in the Zone. + * Should be in `kubernetes_ipv4_subnet`, and disjoint with other address + * ranges. + * + * Generated from protobuf field string kubernetes_control_plane_ipv4_range = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + */ + protected $kubernetes_control_plane_ipv4_range = ''; + /** + * Required. An IPv4 subnet for the management network. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Subnet management_ipv4_subnet = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $management_ipv4_subnet = null; + /** + * Optional. An IPv4 subnet for the kubernetes network. + * If unspecified, the kubernetes subnet will be the same as the management + * subnet. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Subnet kubernetes_ipv4_subnet = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $kubernetes_ipv4_subnet = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $machine_mgmt_ipv4_range + * Required. An IPv4 address block for machine management. + * Should be a private RFC1918 or public CIDR block large enough to allocate + * at least one address per machine in the Zone. + * Should be in `management_ipv4_subnet`, and disjoint with other address + * ranges. + * @type string $kubernetes_node_ipv4_range + * Required. An IPv4 address block for kubernetes nodes. + * Should be a private RFC1918 or public CIDR block large enough to allocate + * at least one address per machine in the Zone. + * Should be in `kubernetes_ipv4_subnet`, and disjoint with other address + * ranges. + * @type string $kubernetes_control_plane_ipv4_range + * Required. An IPv4 address block for kubernetes control plane. + * Should be a private RFC1918 or public CIDR block large enough to allocate + * at least one address per cluster in the Zone. + * Should be in `kubernetes_ipv4_subnet`, and disjoint with other address + * ranges. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\Subnet $management_ipv4_subnet + * Required. An IPv4 subnet for the management network. + * @type \Google\Cloud\GdcHardwareManagement\V1alpha\Subnet $kubernetes_ipv4_subnet + * Optional. An IPv4 subnet for the kubernetes network. + * If unspecified, the kubernetes subnet will be the same as the management + * subnet. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gdchardwaremanagement\V1Alpha\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. An IPv4 address block for machine management. + * Should be a private RFC1918 or public CIDR block large enough to allocate + * at least one address per machine in the Zone. + * Should be in `management_ipv4_subnet`, and disjoint with other address + * ranges. + * + * Generated from protobuf field string machine_mgmt_ipv4_range = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + * @return string + */ + public function getMachineMgmtIpv4Range() + { + return $this->machine_mgmt_ipv4_range; + } + + /** + * Required. An IPv4 address block for machine management. + * Should be a private RFC1918 or public CIDR block large enough to allocate + * at least one address per machine in the Zone. + * Should be in `management_ipv4_subnet`, and disjoint with other address + * ranges. + * + * Generated from protobuf field string machine_mgmt_ipv4_range = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setMachineMgmtIpv4Range($var) + { + GPBUtil::checkString($var, True); + $this->machine_mgmt_ipv4_range = $var; + + return $this; + } + + /** + * Required. An IPv4 address block for kubernetes nodes. + * Should be a private RFC1918 or public CIDR block large enough to allocate + * at least one address per machine in the Zone. + * Should be in `kubernetes_ipv4_subnet`, and disjoint with other address + * ranges. + * + * Generated from protobuf field string kubernetes_node_ipv4_range = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + * @return string + */ + public function getKubernetesNodeIpv4Range() + { + return $this->kubernetes_node_ipv4_range; + } + + /** + * Required. An IPv4 address block for kubernetes nodes. + * Should be a private RFC1918 or public CIDR block large enough to allocate + * at least one address per machine in the Zone. + * Should be in `kubernetes_ipv4_subnet`, and disjoint with other address + * ranges. + * + * Generated from protobuf field string kubernetes_node_ipv4_range = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setKubernetesNodeIpv4Range($var) + { + GPBUtil::checkString($var, True); + $this->kubernetes_node_ipv4_range = $var; + + return $this; + } + + /** + * Required. An IPv4 address block for kubernetes control plane. + * Should be a private RFC1918 or public CIDR block large enough to allocate + * at least one address per cluster in the Zone. + * Should be in `kubernetes_ipv4_subnet`, and disjoint with other address + * ranges. + * + * Generated from protobuf field string kubernetes_control_plane_ipv4_range = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + * @return string + */ + public function getKubernetesControlPlaneIpv4Range() + { + return $this->kubernetes_control_plane_ipv4_range; + } + + /** + * Required. An IPv4 address block for kubernetes control plane. + * Should be a private RFC1918 or public CIDR block large enough to allocate + * at least one address per cluster in the Zone. + * Should be in `kubernetes_ipv4_subnet`, and disjoint with other address + * ranges. + * + * Generated from protobuf field string kubernetes_control_plane_ipv4_range = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setKubernetesControlPlaneIpv4Range($var) + { + GPBUtil::checkString($var, True); + $this->kubernetes_control_plane_ipv4_range = $var; + + return $this; + } + + /** + * Required. An IPv4 subnet for the management network. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Subnet management_ipv4_subnet = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\Subnet|null + */ + public function getManagementIpv4Subnet() + { + return $this->management_ipv4_subnet; + } + + public function hasManagementIpv4Subnet() + { + return isset($this->management_ipv4_subnet); + } + + public function clearManagementIpv4Subnet() + { + unset($this->management_ipv4_subnet); + } + + /** + * Required. An IPv4 subnet for the management network. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Subnet management_ipv4_subnet = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Subnet $var + * @return $this + */ + public function setManagementIpv4Subnet($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Subnet::class); + $this->management_ipv4_subnet = $var; + + return $this; + } + + /** + * Optional. An IPv4 subnet for the kubernetes network. + * If unspecified, the kubernetes subnet will be the same as the management + * subnet. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Subnet kubernetes_ipv4_subnet = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GdcHardwareManagement\V1alpha\Subnet|null + */ + public function getKubernetesIpv4Subnet() + { + return $this->kubernetes_ipv4_subnet; + } + + public function hasKubernetesIpv4Subnet() + { + return isset($this->kubernetes_ipv4_subnet); + } + + public function clearKubernetesIpv4Subnet() + { + unset($this->kubernetes_ipv4_subnet); + } + + /** + * Optional. An IPv4 subnet for the kubernetes network. + * If unspecified, the kubernetes subnet will be the same as the management + * subnet. + * + * Generated from protobuf field .google.cloud.gdchardwaremanagement.v1alpha.Subnet kubernetes_ipv4_subnet = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GdcHardwareManagement\V1alpha\Subnet $var + * @return $this + */ + public function setKubernetesIpv4Subnet($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GdcHardwareManagement\V1alpha\Subnet::class); + $this->kubernetes_ipv4_subnet = $var; + + return $this; + } + +} + diff --git a/GdcHardwareManagement/src/V1alpha/gapic_metadata.json b/GdcHardwareManagement/src/V1alpha/gapic_metadata.json new file mode 100644 index 000000000000..6cc4700d5160 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/gapic_metadata.json @@ -0,0 +1,198 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.gdchardwaremanagement.v1alpha", + "libraryPackage": "Google\\Cloud\\GdcHardwareManagement\\V1alpha", + "services": { + "GDCHardwareManagement": { + "clients": { + "grpc": { + "libraryClient": "GDCHardwareManagementGapicClient", + "rpcs": { + "CreateComment": { + "methods": [ + "createComment" + ] + }, + "CreateHardware": { + "methods": [ + "createHardware" + ] + }, + "CreateHardwareGroup": { + "methods": [ + "createHardwareGroup" + ] + }, + "CreateOrder": { + "methods": [ + "createOrder" + ] + }, + "CreateSite": { + "methods": [ + "createSite" + ] + }, + "CreateZone": { + "methods": [ + "createZone" + ] + }, + "DeleteHardware": { + "methods": [ + "deleteHardware" + ] + }, + "DeleteHardwareGroup": { + "methods": [ + "deleteHardwareGroup" + ] + }, + "DeleteOrder": { + "methods": [ + "deleteOrder" + ] + }, + "DeleteZone": { + "methods": [ + "deleteZone" + ] + }, + "GetChangeLogEntry": { + "methods": [ + "getChangeLogEntry" + ] + }, + "GetComment": { + "methods": [ + "getComment" + ] + }, + "GetHardware": { + "methods": [ + "getHardware" + ] + }, + "GetHardwareGroup": { + "methods": [ + "getHardwareGroup" + ] + }, + "GetOrder": { + "methods": [ + "getOrder" + ] + }, + "GetSite": { + "methods": [ + "getSite" + ] + }, + "GetSku": { + "methods": [ + "getSku" + ] + }, + "GetZone": { + "methods": [ + "getZone" + ] + }, + "ListChangeLogEntries": { + "methods": [ + "listChangeLogEntries" + ] + }, + "ListComments": { + "methods": [ + "listComments" + ] + }, + "ListHardware": { + "methods": [ + "listHardware" + ] + }, + "ListHardwareGroups": { + "methods": [ + "listHardwareGroups" + ] + }, + "ListOrders": { + "methods": [ + "listOrders" + ] + }, + "ListSites": { + "methods": [ + "listSites" + ] + }, + "ListSkus": { + "methods": [ + "listSkus" + ] + }, + "ListZones": { + "methods": [ + "listZones" + ] + }, + "RecordActionOnComment": { + "methods": [ + "recordActionOnComment" + ] + }, + "SignalZoneState": { + "methods": [ + "signalZoneState" + ] + }, + "SubmitOrder": { + "methods": [ + "submitOrder" + ] + }, + "UpdateHardware": { + "methods": [ + "updateHardware" + ] + }, + "UpdateHardwareGroup": { + "methods": [ + "updateHardwareGroup" + ] + }, + "UpdateOrder": { + "methods": [ + "updateOrder" + ] + }, + "UpdateSite": { + "methods": [ + "updateSite" + ] + }, + "UpdateZone": { + "methods": [ + "updateZone" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/GdcHardwareManagement/src/V1alpha/resources/gdc_hardware_management_client_config.json b/GdcHardwareManagement/src/V1alpha/resources/gdc_hardware_management_client_config.json new file mode 100644 index 000000000000..a3ddd0fe9987 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/resources/gdc_hardware_management_client_config.json @@ -0,0 +1,224 @@ +{ + "interfaces": { + "google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement": { + "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": 10000, + "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": { + "CreateComment": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateHardware": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateHardwareGroup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateOrder": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateSite": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateZone": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteHardware": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteHardwareGroup": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteOrder": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteZone": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetChangeLogEntry": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetComment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetHardware": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetHardwareGroup": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetOrder": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetSite": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetSku": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetZone": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListChangeLogEntries": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListComments": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListHardware": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListHardwareGroups": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListOrders": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSites": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSkus": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListZones": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "RecordActionOnComment": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SignalZoneState": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SubmitOrder": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateHardware": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateHardwareGroup": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateOrder": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateSite": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateZone": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/GdcHardwareManagement/src/V1alpha/resources/gdc_hardware_management_descriptor_config.php b/GdcHardwareManagement/src/V1alpha/resources/gdc_hardware_management_descriptor_config.php new file mode 100644 index 000000000000..db78c3f6f1b7 --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/resources/gdc_hardware_management_descriptor_config.php @@ -0,0 +1,669 @@ + [ + 'google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement' => [ + 'CreateComment' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\Comment', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateHardware' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\Hardware', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateHardwareGroup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateOrder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\Order', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSite' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\Site', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateZone' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\Zone', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteHardware' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteHardwareGroup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOrder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteZone' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'SignalZoneState' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\Zone', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'SubmitOrder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\Order', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateHardware' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\Hardware', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'hardware.name', + 'fieldAccessors' => [ + 'getHardware', + 'getName', + ], + ], + ], + ], + 'UpdateHardwareGroup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'hardware_group.name', + 'fieldAccessors' => [ + 'getHardwareGroup', + 'getName', + ], + ], + ], + ], + 'UpdateOrder' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\Order', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'order.name', + 'fieldAccessors' => [ + 'getOrder', + 'getName', + ], + ], + ], + ], + 'UpdateSite' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\Site', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'site.name', + 'fieldAccessors' => [ + 'getSite', + 'getName', + ], + ], + ], + ], + 'UpdateZone' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\Zone', + 'metadataReturnType' => '\Google\Cloud\GdcHardwareManagement\V1alpha\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'zone.name', + 'fieldAccessors' => [ + 'getZone', + 'getName', + ], + ], + ], + ], + 'GetChangeLogEntry' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\ChangeLogEntry', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetComment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\Comment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetHardware' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\Hardware', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetHardwareGroup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\HardwareGroup', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetOrder' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\Order', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSite' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\Site', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSku' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\Sku', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetZone' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\Zone', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListChangeLogEntries' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getChangeLogEntries', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\ListChangeLogEntriesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListComments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getComments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\ListCommentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListHardware' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getHardware', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\ListHardwareResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListHardwareGroups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getHardwareGroups', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\ListHardwareGroupsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListOrders' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getOrders', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\ListOrdersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListSites' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSites', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\ListSitesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListSkus' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSkus', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\ListSkusResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListZones' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getZones', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\ListZonesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RecordActionOnComment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GdcHardwareManagement\V1alpha\Comment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'changeLogEntry' => 'projects/{project}/locations/{location}/orders/{order}/changeLogEntries/{change_log_entry}', + 'comment' => 'projects/{project}/locations/{location}/orders/{order}/comments/{comment}', + 'hardware' => 'projects/{project}/locations/{location}/hardware/{hardware}', + 'hardwareGroup' => 'projects/{project}/locations/{location}/orders/{order}/hardwareGroups/{hardware_group}', + 'location' => 'projects/{project}/locations/{location}', + 'order' => 'projects/{project}/locations/{location}/orders/{order}', + 'site' => 'projects/{project}/locations/{location}/sites/{site}', + 'sku' => 'projects/{project}/locations/{location}/skus/{sku}', + 'zone' => 'projects/{project}/locations/{location}/zones/{zone}', + ], + ], + ], +]; diff --git a/GdcHardwareManagement/src/V1alpha/resources/gdc_hardware_management_rest_client_config.php b/GdcHardwareManagement/src/V1alpha/resources/gdc_hardware_management_rest_client_config.php new file mode 100644 index 000000000000..0b2207e9893f --- /dev/null +++ b/GdcHardwareManagement/src/V1alpha/resources/gdc_hardware_management_rest_client_config.php @@ -0,0 +1,508 @@ + [ + 'google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement' => [ + 'CreateComment' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/orders/*}/comments', + 'body' => 'comment', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateHardware' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/hardware', + 'body' => 'hardware', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateHardwareGroup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/orders/*}/hardwareGroups', + 'body' => 'hardware_group', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateOrder' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/orders', + 'body' => 'order', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSite' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/sites', + 'body' => 'site', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'CreateZone' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/zones', + 'body' => 'zone', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteHardware' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/hardware/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteHardwareGroup' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/orders/*/hardwareGroups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOrder' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/orders/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteZone' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/zones/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetChangeLogEntry' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/orders/*/changeLogEntries/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetComment' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/orders/*/comments/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetHardware' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/hardware/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetHardwareGroup' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/orders/*/hardwareGroups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOrder' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/orders/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSite' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/sites/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSku' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/skus/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetZone' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/zones/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListChangeLogEntries' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/orders/*}/changeLogEntries', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListComments' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/orders/*}/comments', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListHardware' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/hardware', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListHardwareGroups' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*/orders/*}/hardwareGroups', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListOrders' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/orders', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListSites' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/sites', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListSkus' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/skus', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListZones' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{parent=projects/*/locations/*}/zones', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RecordActionOnComment' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/orders/*/comments/*}:recordAction', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SignalZoneState' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/zones/*}:signal', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'SubmitOrder' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/orders/*}:submit', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'UpdateHardware' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1alpha/{hardware.name=projects/*/locations/*/hardware/*}', + 'body' => 'hardware', + 'placeholders' => [ + 'hardware.name' => [ + 'getters' => [ + 'getHardware', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateHardwareGroup' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1alpha/{hardware_group.name=projects/*/locations/*/orders/*/hardwareGroups/*}', + 'body' => 'hardware_group', + 'placeholders' => [ + 'hardware_group.name' => [ + 'getters' => [ + 'getHardwareGroup', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateOrder' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1alpha/{order.name=projects/*/locations/*/orders/*}', + 'body' => 'order', + 'placeholders' => [ + 'order.name' => [ + 'getters' => [ + 'getOrder', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateSite' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1alpha/{site.name=projects/*/locations/*/sites/*}', + 'body' => 'site', + 'placeholders' => [ + 'site.name' => [ + 'getters' => [ + 'getSite', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateZone' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1alpha/{zone.name=projects/*/locations/*/zones/*}', + 'body' => 'zone', + 'placeholders' => [ + 'zone.name' => [ + 'getters' => [ + 'getZone', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/GdcHardwareManagement/tests/Unit/V1alpha/Client/GDCHardwareManagementClientTest.php b/GdcHardwareManagement/tests/Unit/V1alpha/Client/GDCHardwareManagementClientTest.php new file mode 100644 index 000000000000..626541545683 --- /dev/null +++ b/GdcHardwareManagement/tests/Unit/V1alpha/Client/GDCHardwareManagementClientTest.php @@ -0,0 +1,4092 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return GDCHardwareManagementClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GDCHardwareManagementClient($options); + } + + /** @test */ + public function createCommentTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createCommentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $author = 'author-1406328437'; + $text = 'text3556653'; + $expectedResponse = new Comment(); + $expectedResponse->setName($name); + $expectedResponse->setAuthor($author); + $expectedResponse->setText($text); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createCommentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $comment = new Comment(); + $commentText = 'commentText2103533612'; + $comment->setText($commentText); + $request = (new CreateCommentRequest())->setParent($formattedParent)->setComment($comment); + $response = $gapicClient->createComment($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/CreateComment', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getComment(); + $this->assertProtobufEquals($comment, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createCommentTest'); + $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 createCommentExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createCommentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $comment = new Comment(); + $commentText = 'commentText2103533612'; + $comment->setText($commentText); + $request = (new CreateCommentRequest())->setParent($formattedParent)->setComment($comment); + $response = $gapicClient->createComment($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createCommentTest'); + 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 createHardwareTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createHardwareTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $order = 'order106006350'; + $hardwareGroup = 'hardwareGroup1029386600'; + $site = 'site3530567'; + $ciqUri = 'ciqUri781916152'; + $zone = 'zone3744684'; + $expectedResponse = new Hardware(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setOrder($order); + $expectedResponse->setHardwareGroup($hardwareGroup); + $expectedResponse->setSite($site); + $expectedResponse->setCiqUri($ciqUri); + $expectedResponse->setZone($zone); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createHardwareTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $hardware = new Hardware(); + $hardwareOrder = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $hardware->setOrder($hardwareOrder); + $hardwareSite = $gapicClient->siteName('[PROJECT]', '[LOCATION]', '[SITE]'); + $hardware->setSite($hardwareSite); + $hardwareConfig = new HardwareConfig(); + $configSku = $gapicClient->skuName('[PROJECT]', '[LOCATION]', '[SKU]'); + $hardwareConfig->setSku($configSku); + $configPowerSupply = PowerSupply::POWER_SUPPLY_UNSPECIFIED; + $hardwareConfig->setPowerSupply($configPowerSupply); + $hardware->setConfig($hardwareConfig); + $hardwareZone = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $hardware->setZone($hardwareZone); + $request = (new CreateHardwareRequest())->setParent($formattedParent)->setHardware($hardware); + $response = $gapicClient->createHardware($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/CreateHardware', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getHardware(); + $this->assertProtobufEquals($hardware, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createHardwareTest'); + $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 createHardwareExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createHardwareTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $hardware = new Hardware(); + $hardwareOrder = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $hardware->setOrder($hardwareOrder); + $hardwareSite = $gapicClient->siteName('[PROJECT]', '[LOCATION]', '[SITE]'); + $hardware->setSite($hardwareSite); + $hardwareConfig = new HardwareConfig(); + $configSku = $gapicClient->skuName('[PROJECT]', '[LOCATION]', '[SKU]'); + $hardwareConfig->setSku($configSku); + $configPowerSupply = PowerSupply::POWER_SUPPLY_UNSPECIFIED; + $hardwareConfig->setPowerSupply($configPowerSupply); + $hardware->setConfig($hardwareConfig); + $hardwareZone = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $hardware->setZone($hardwareZone); + $request = (new CreateHardwareRequest())->setParent($formattedParent)->setHardware($hardware); + $response = $gapicClient->createHardware($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createHardwareTest'); + 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 createHardwareGroupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createHardwareGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $hardwareCount = 1025608696; + $site = 'site3530567'; + $zone = 'zone3744684'; + $expectedResponse = new HardwareGroup(); + $expectedResponse->setName($name); + $expectedResponse->setHardwareCount($hardwareCount); + $expectedResponse->setSite($site); + $expectedResponse->setZone($zone); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createHardwareGroupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $hardwareGroup = new HardwareGroup(); + $hardwareGroupHardwareCount = 72475600; + $hardwareGroup->setHardwareCount($hardwareGroupHardwareCount); + $hardwareGroupConfig = new HardwareConfig(); + $configSku = $gapicClient->skuName('[PROJECT]', '[LOCATION]', '[SKU]'); + $hardwareGroupConfig->setSku($configSku); + $configPowerSupply = PowerSupply::POWER_SUPPLY_UNSPECIFIED; + $hardwareGroupConfig->setPowerSupply($configPowerSupply); + $hardwareGroup->setConfig($hardwareGroupConfig); + $hardwareGroupSite = $gapicClient->siteName('[PROJECT]', '[LOCATION]', '[SITE]'); + $hardwareGroup->setSite($hardwareGroupSite); + $request = (new CreateHardwareGroupRequest())->setParent($formattedParent)->setHardwareGroup($hardwareGroup); + $response = $gapicClient->createHardwareGroup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/CreateHardwareGroup', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getHardwareGroup(); + $this->assertProtobufEquals($hardwareGroup, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createHardwareGroupTest'); + $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 createHardwareGroupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createHardwareGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $hardwareGroup = new HardwareGroup(); + $hardwareGroupHardwareCount = 72475600; + $hardwareGroup->setHardwareCount($hardwareGroupHardwareCount); + $hardwareGroupConfig = new HardwareConfig(); + $configSku = $gapicClient->skuName('[PROJECT]', '[LOCATION]', '[SKU]'); + $hardwareGroupConfig->setSku($configSku); + $configPowerSupply = PowerSupply::POWER_SUPPLY_UNSPECIFIED; + $hardwareGroupConfig->setPowerSupply($configPowerSupply); + $hardwareGroup->setConfig($hardwareGroupConfig); + $hardwareGroupSite = $gapicClient->siteName('[PROJECT]', '[LOCATION]', '[SITE]'); + $hardwareGroup->setSite($hardwareGroupSite); + $request = (new CreateHardwareGroupRequest())->setParent($formattedParent)->setHardwareGroup($hardwareGroup); + $response = $gapicClient->createHardwareGroup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createHardwareGroupTest'); + 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 createOrderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createOrderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $customerMotivation = 'customerMotivation-1685724777'; + $regionCode = 'regionCode-1566082984'; + $orderFormUri = 'orderFormUri-813891262'; + $billingId = 'billingId834271583'; + $expectedResponse = new Order(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setCustomerMotivation($customerMotivation); + $expectedResponse->setRegionCode($regionCode); + $expectedResponse->setOrderFormUri($orderFormUri); + $expectedResponse->setBillingId($billingId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createOrderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $order = new Order(); + $orderOrganizationContact = new OrganizationContact(); + $organizationContactAddress = new PostalAddress(); + $orderOrganizationContact->setAddress($organizationContactAddress); + $organizationContactContacts = []; + $orderOrganizationContact->setContacts($organizationContactContacts); + $order->setOrganizationContact($orderOrganizationContact); + $orderCustomerMotivation = 'orderCustomerMotivation2119167234'; + $order->setCustomerMotivation($orderCustomerMotivation); + $orderFulfillmentTime = new Timestamp(); + $order->setFulfillmentTime($orderFulfillmentTime); + $orderRegionCode = 'orderRegionCode220776687'; + $order->setRegionCode($orderRegionCode); + $orderBillingId = 'orderBillingId-1841403576'; + $order->setBillingId($orderBillingId); + $request = (new CreateOrderRequest())->setParent($formattedParent)->setOrder($order); + $response = $gapicClient->createOrder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/CreateOrder', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getOrder(); + $this->assertProtobufEquals($order, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createOrderTest'); + $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 createOrderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createOrderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $order = new Order(); + $orderOrganizationContact = new OrganizationContact(); + $organizationContactAddress = new PostalAddress(); + $orderOrganizationContact->setAddress($organizationContactAddress); + $organizationContactContacts = []; + $orderOrganizationContact->setContacts($organizationContactContacts); + $order->setOrganizationContact($orderOrganizationContact); + $orderCustomerMotivation = 'orderCustomerMotivation2119167234'; + $order->setCustomerMotivation($orderCustomerMotivation); + $orderFulfillmentTime = new Timestamp(); + $order->setFulfillmentTime($orderFulfillmentTime); + $orderRegionCode = 'orderRegionCode220776687'; + $order->setRegionCode($orderRegionCode); + $orderBillingId = 'orderBillingId-1841403576'; + $order->setBillingId($orderBillingId); + $request = (new CreateOrderRequest())->setParent($formattedParent)->setOrder($order); + $response = $gapicClient->createOrder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createOrderTest'); + 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 createSiteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createSiteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $googleMapsPinUri = 'googleMapsPinUri-726488480'; + $notes = 'notes105008833'; + $customerSiteId = 'customerSiteId54911410'; + $expectedResponse = new Site(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setGoogleMapsPinUri($googleMapsPinUri); + $expectedResponse->setNotes($notes); + $expectedResponse->setCustomerSiteId($customerSiteId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSiteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $site = new Site(); + $siteOrganizationContact = new OrganizationContact(); + $organizationContactAddress = new PostalAddress(); + $siteOrganizationContact->setAddress($organizationContactAddress); + $organizationContactContacts = []; + $siteOrganizationContact->setContacts($organizationContactContacts); + $site->setOrganizationContact($siteOrganizationContact); + $siteGoogleMapsPinUri = 'siteGoogleMapsPinUri583948686'; + $site->setGoogleMapsPinUri($siteGoogleMapsPinUri); + $request = (new CreateSiteRequest())->setParent($formattedParent)->setSite($site); + $response = $gapicClient->createSite($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/CreateSite', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getSite(); + $this->assertProtobufEquals($site, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSiteTest'); + $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 createSiteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createSiteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $site = new Site(); + $siteOrganizationContact = new OrganizationContact(); + $organizationContactAddress = new PostalAddress(); + $siteOrganizationContact->setAddress($organizationContactAddress); + $organizationContactContacts = []; + $siteOrganizationContact->setContacts($organizationContactContacts); + $site->setOrganizationContact($siteOrganizationContact); + $siteGoogleMapsPinUri = 'siteGoogleMapsPinUri583948686'; + $site->setGoogleMapsPinUri($siteGoogleMapsPinUri); + $request = (new CreateSiteRequest())->setParent($formattedParent)->setSite($site); + $response = $gapicClient->createSite($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSiteTest'); + 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 createZoneTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createZoneTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $ciqUri = 'ciqUri781916152'; + $globallyUniqueId = 'globallyUniqueId-1390482630'; + $expectedResponse = new Zone(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setCiqUri($ciqUri); + $expectedResponse->setGloballyUniqueId($globallyUniqueId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createZoneTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $zone = new Zone(); + $zoneContacts = []; + $zone->setContacts($zoneContacts); + $request = (new CreateZoneRequest())->setParent($formattedParent)->setZone($zone); + $response = $gapicClient->createZone($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/CreateZone', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createZoneTest'); + $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 createZoneExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createZoneTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $zone = new Zone(); + $zoneContacts = []; + $zone->setContacts($zoneContacts); + $request = (new CreateZoneRequest())->setParent($formattedParent)->setZone($zone); + $response = $gapicClient->createZone($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createZoneTest'); + 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 deleteHardwareTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteHardwareTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteHardwareTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->hardwareName('[PROJECT]', '[LOCATION]', '[HARDWARE]'); + $request = (new DeleteHardwareRequest())->setName($formattedName); + $response = $gapicClient->deleteHardware($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/DeleteHardware', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteHardwareTest'); + $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 deleteHardwareExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteHardwareTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->hardwareName('[PROJECT]', '[LOCATION]', '[HARDWARE]'); + $request = (new DeleteHardwareRequest())->setName($formattedName); + $response = $gapicClient->deleteHardware($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteHardwareTest'); + 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 deleteHardwareGroupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteHardwareGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteHardwareGroupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->hardwareGroupName('[PROJECT]', '[LOCATION]', '[ORDER]', '[HARDWARE_GROUP]'); + $request = (new DeleteHardwareGroupRequest())->setName($formattedName); + $response = $gapicClient->deleteHardwareGroup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/DeleteHardwareGroup', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteHardwareGroupTest'); + $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 deleteHardwareGroupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteHardwareGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->hardwareGroupName('[PROJECT]', '[LOCATION]', '[ORDER]', '[HARDWARE_GROUP]'); + $request = (new DeleteHardwareGroupRequest())->setName($formattedName); + $response = $gapicClient->deleteHardwareGroup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteHardwareGroupTest'); + 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 deleteOrderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteOrderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteOrderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $request = (new DeleteOrderRequest())->setName($formattedName); + $response = $gapicClient->deleteOrder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/DeleteOrder', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteOrderTest'); + $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 deleteOrderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteOrderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $request = (new DeleteOrderRequest())->setName($formattedName); + $response = $gapicClient->deleteOrder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteOrderTest'); + 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 deleteZoneTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteZoneTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteZoneTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new DeleteZoneRequest())->setName($formattedName); + $response = $gapicClient->deleteZone($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/DeleteZone', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteZoneTest'); + $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 deleteZoneExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteZoneTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new DeleteZoneRequest())->setName($formattedName); + $response = $gapicClient->deleteZone($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteZoneTest'); + 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 getChangeLogEntryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $log = 'log107332'; + $expectedResponse = new ChangeLogEntry(); + $expectedResponse->setName($name2); + $expectedResponse->setLog($log); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->changeLogEntryName('[PROJECT]', '[LOCATION]', '[ORDER]', '[CHANGE_LOG_ENTRY]'); + $request = (new GetChangeLogEntryRequest())->setName($formattedName); + $response = $gapicClient->getChangeLogEntry($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/GetChangeLogEntry', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getChangeLogEntryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->changeLogEntryName('[PROJECT]', '[LOCATION]', '[ORDER]', '[CHANGE_LOG_ENTRY]'); + $request = (new GetChangeLogEntryRequest())->setName($formattedName); + try { + $gapicClient->getChangeLogEntry($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCommentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $author = 'author-1406328437'; + $text = 'text3556653'; + $expectedResponse = new Comment(); + $expectedResponse->setName($name2); + $expectedResponse->setAuthor($author); + $expectedResponse->setText($text); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->commentName('[PROJECT]', '[LOCATION]', '[ORDER]', '[COMMENT]'); + $request = (new GetCommentRequest())->setName($formattedName); + $response = $gapicClient->getComment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/GetComment', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getCommentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->commentName('[PROJECT]', '[LOCATION]', '[ORDER]', '[COMMENT]'); + $request = (new GetCommentRequest())->setName($formattedName); + try { + $gapicClient->getComment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHardwareTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $order = 'order106006350'; + $hardwareGroup = 'hardwareGroup1029386600'; + $site = 'site3530567'; + $ciqUri = 'ciqUri781916152'; + $zone = 'zone3744684'; + $expectedResponse = new Hardware(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setOrder($order); + $expectedResponse->setHardwareGroup($hardwareGroup); + $expectedResponse->setSite($site); + $expectedResponse->setCiqUri($ciqUri); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->hardwareName('[PROJECT]', '[LOCATION]', '[HARDWARE]'); + $request = (new GetHardwareRequest())->setName($formattedName); + $response = $gapicClient->getHardware($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/GetHardware', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHardwareExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->hardwareName('[PROJECT]', '[LOCATION]', '[HARDWARE]'); + $request = (new GetHardwareRequest())->setName($formattedName); + try { + $gapicClient->getHardware($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHardwareGroupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $hardwareCount = 1025608696; + $site = 'site3530567'; + $zone = 'zone3744684'; + $expectedResponse = new HardwareGroup(); + $expectedResponse->setName($name2); + $expectedResponse->setHardwareCount($hardwareCount); + $expectedResponse->setSite($site); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->hardwareGroupName('[PROJECT]', '[LOCATION]', '[ORDER]', '[HARDWARE_GROUP]'); + $request = (new GetHardwareGroupRequest())->setName($formattedName); + $response = $gapicClient->getHardwareGroup($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/GetHardwareGroup', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHardwareGroupExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->hardwareGroupName('[PROJECT]', '[LOCATION]', '[ORDER]', '[HARDWARE_GROUP]'); + $request = (new GetHardwareGroupRequest())->setName($formattedName); + try { + $gapicClient->getHardwareGroup($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getOrderTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $customerMotivation = 'customerMotivation-1685724777'; + $regionCode = 'regionCode-1566082984'; + $orderFormUri = 'orderFormUri-813891262'; + $billingId = 'billingId834271583'; + $expectedResponse = new Order(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setCustomerMotivation($customerMotivation); + $expectedResponse->setRegionCode($regionCode); + $expectedResponse->setOrderFormUri($orderFormUri); + $expectedResponse->setBillingId($billingId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $request = (new GetOrderRequest())->setName($formattedName); + $response = $gapicClient->getOrder($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/GetOrder', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getOrderExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $request = (new GetOrderRequest())->setName($formattedName); + try { + $gapicClient->getOrder($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSiteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $googleMapsPinUri = 'googleMapsPinUri-726488480'; + $notes = 'notes105008833'; + $customerSiteId = 'customerSiteId54911410'; + $expectedResponse = new Site(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setGoogleMapsPinUri($googleMapsPinUri); + $expectedResponse->setNotes($notes); + $expectedResponse->setCustomerSiteId($customerSiteId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->siteName('[PROJECT]', '[LOCATION]', '[SITE]'); + $request = (new GetSiteRequest())->setName($formattedName); + $response = $gapicClient->getSite($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/GetSite', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSiteExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->siteName('[PROJECT]', '[LOCATION]', '[SITE]'); + $request = (new GetSiteRequest())->setName($formattedName); + try { + $gapicClient->getSite($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSkuTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $revisionId = 'revisionId513861631'; + $isActive = false; + $vcpuCount = 936475650; + $expectedResponse = new Sku(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setRevisionId($revisionId); + $expectedResponse->setIsActive($isActive); + $expectedResponse->setVcpuCount($vcpuCount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->skuName('[PROJECT]', '[LOCATION]', '[SKU]'); + $request = (new GetSkuRequest())->setName($formattedName); + $response = $gapicClient->getSku($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/GetSku', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSkuExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->skuName('[PROJECT]', '[LOCATION]', '[SKU]'); + $request = (new GetSkuRequest())->setName($formattedName); + try { + $gapicClient->getSku($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getZoneTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $ciqUri = 'ciqUri781916152'; + $globallyUniqueId = 'globallyUniqueId-1390482630'; + $expectedResponse = new Zone(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setCiqUri($ciqUri); + $expectedResponse->setGloballyUniqueId($globallyUniqueId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new GetZoneRequest())->setName($formattedName); + $response = $gapicClient->getZone($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/GetZone', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getZoneExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new GetZoneRequest())->setName($formattedName); + try { + $gapicClient->getZone($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listChangeLogEntriesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $changeLogEntriesElement = new ChangeLogEntry(); + $changeLogEntries = [$changeLogEntriesElement]; + $expectedResponse = new ListChangeLogEntriesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setChangeLogEntries($changeLogEntries); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $request = (new ListChangeLogEntriesRequest())->setParent($formattedParent); + $response = $gapicClient->listChangeLogEntries($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getChangeLogEntries()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/ListChangeLogEntries', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listChangeLogEntriesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $request = (new ListChangeLogEntriesRequest())->setParent($formattedParent); + try { + $gapicClient->listChangeLogEntries($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCommentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $commentsElement = new Comment(); + $comments = [$commentsElement]; + $expectedResponse = new ListCommentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setComments($comments); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $request = (new ListCommentsRequest())->setParent($formattedParent); + $response = $gapicClient->listComments($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getComments()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/ListComments', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCommentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $request = (new ListCommentsRequest())->setParent($formattedParent); + try { + $gapicClient->listComments($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listHardwareTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $hardwareElement = new Hardware(); + $hardware = [$hardwareElement]; + $expectedResponse = new ListHardwareResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setHardware($hardware); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListHardwareRequest())->setParent($formattedParent); + $response = $gapicClient->listHardware($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getHardware()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/ListHardware', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listHardwareExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListHardwareRequest())->setParent($formattedParent); + try { + $gapicClient->listHardware($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listHardwareGroupsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $hardwareGroupsElement = new HardwareGroup(); + $hardwareGroups = [$hardwareGroupsElement]; + $expectedResponse = new ListHardwareGroupsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setHardwareGroups($hardwareGroups); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $request = (new ListHardwareGroupsRequest())->setParent($formattedParent); + $response = $gapicClient->listHardwareGroups($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getHardwareGroups()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/ListHardwareGroups', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listHardwareGroupsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $request = (new ListHardwareGroupsRequest())->setParent($formattedParent); + try { + $gapicClient->listHardwareGroups($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOrdersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $ordersElement = new Order(); + $orders = [$ordersElement]; + $expectedResponse = new ListOrdersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setOrders($orders); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListOrdersRequest())->setParent($formattedParent); + $response = $gapicClient->listOrders($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getOrders()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/ListOrders', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOrdersExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListOrdersRequest())->setParent($formattedParent); + try { + $gapicClient->listOrders($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSitesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $sitesElement = new Site(); + $sites = [$sitesElement]; + $expectedResponse = new ListSitesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSites($sites); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSitesRequest())->setParent($formattedParent); + $response = $gapicClient->listSites($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSites()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/ListSites', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSitesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSitesRequest())->setParent($formattedParent); + try { + $gapicClient->listSites($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSkusTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $skusElement = new Sku(); + $skus = [$skusElement]; + $expectedResponse = new ListSkusResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSkus($skus); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSkusRequest())->setParent($formattedParent); + $response = $gapicClient->listSkus($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSkus()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/ListSkus', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSkusExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSkusRequest())->setParent($formattedParent); + try { + $gapicClient->listSkus($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listZonesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $zonesElement = new Zone(); + $zones = [$zonesElement]; + $expectedResponse = new ListZonesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setZones($zones); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListZonesRequest())->setParent($formattedParent); + $response = $gapicClient->listZones($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getZones()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/ListZones', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listZonesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListZonesRequest())->setParent($formattedParent); + try { + $gapicClient->listZones($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function recordActionOnCommentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $author = 'author-1406328437'; + $text = 'text3556653'; + $expectedResponse = new Comment(); + $expectedResponse->setName($name2); + $expectedResponse->setAuthor($author); + $expectedResponse->setText($text); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->commentName('[PROJECT]', '[LOCATION]', '[ORDER]', '[COMMENT]'); + $actionType = ActionType::ACTION_TYPE_UNSPECIFIED; + $request = (new RecordActionOnCommentRequest())->setName($formattedName)->setActionType($actionType); + $response = $gapicClient->recordActionOnComment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/RecordActionOnComment', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getActionType(); + $this->assertProtobufEquals($actionType, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function recordActionOnCommentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->commentName('[PROJECT]', '[LOCATION]', '[ORDER]', '[COMMENT]'); + $actionType = ActionType::ACTION_TYPE_UNSPECIFIED; + $request = (new RecordActionOnCommentRequest())->setName($formattedName)->setActionType($actionType); + try { + $gapicClient->recordActionOnComment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function signalZoneStateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/signalZoneStateTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $ciqUri = 'ciqUri781916152'; + $globallyUniqueId = 'globallyUniqueId-1390482630'; + $expectedResponse = new Zone(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setCiqUri($ciqUri); + $expectedResponse->setGloballyUniqueId($globallyUniqueId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/signalZoneStateTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $stateSignal = StateSignal::STATE_SIGNAL_UNSPECIFIED; + $request = (new SignalZoneStateRequest())->setName($formattedName)->setStateSignal($stateSignal); + $response = $gapicClient->signalZoneState($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/SignalZoneState', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getStateSignal(); + $this->assertProtobufEquals($stateSignal, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/signalZoneStateTest'); + $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 signalZoneStateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/signalZoneStateTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $stateSignal = StateSignal::STATE_SIGNAL_UNSPECIFIED; + $request = (new SignalZoneStateRequest())->setName($formattedName)->setStateSignal($stateSignal); + $response = $gapicClient->signalZoneState($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/signalZoneStateTest'); + 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 submitOrderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/submitOrderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $customerMotivation = 'customerMotivation-1685724777'; + $regionCode = 'regionCode-1566082984'; + $orderFormUri = 'orderFormUri-813891262'; + $billingId = 'billingId834271583'; + $expectedResponse = new Order(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setCustomerMotivation($customerMotivation); + $expectedResponse->setRegionCode($regionCode); + $expectedResponse->setOrderFormUri($orderFormUri); + $expectedResponse->setBillingId($billingId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/submitOrderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $request = (new SubmitOrderRequest())->setName($formattedName); + $response = $gapicClient->submitOrder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/SubmitOrder', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/submitOrderTest'); + $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 submitOrderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/submitOrderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $request = (new SubmitOrderRequest())->setName($formattedName); + $response = $gapicClient->submitOrder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/submitOrderTest'); + 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 updateHardwareTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateHardwareTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $order = 'order106006350'; + $hardwareGroup = 'hardwareGroup1029386600'; + $site = 'site3530567'; + $ciqUri = 'ciqUri781916152'; + $zone = 'zone3744684'; + $expectedResponse = new Hardware(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setOrder($order); + $expectedResponse->setHardwareGroup($hardwareGroup); + $expectedResponse->setSite($site); + $expectedResponse->setCiqUri($ciqUri); + $expectedResponse->setZone($zone); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateHardwareTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $hardware = new Hardware(); + $hardwareOrder = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $hardware->setOrder($hardwareOrder); + $hardwareSite = $gapicClient->siteName('[PROJECT]', '[LOCATION]', '[SITE]'); + $hardware->setSite($hardwareSite); + $hardwareConfig = new HardwareConfig(); + $configSku = $gapicClient->skuName('[PROJECT]', '[LOCATION]', '[SKU]'); + $hardwareConfig->setSku($configSku); + $configPowerSupply = PowerSupply::POWER_SUPPLY_UNSPECIFIED; + $hardwareConfig->setPowerSupply($configPowerSupply); + $hardware->setConfig($hardwareConfig); + $hardwareZone = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $hardware->setZone($hardwareZone); + $request = (new UpdateHardwareRequest())->setUpdateMask($updateMask)->setHardware($hardware); + $response = $gapicClient->updateHardware($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/UpdateHardware', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getHardware(); + $this->assertProtobufEquals($hardware, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateHardwareTest'); + $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 updateHardwareExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateHardwareTest'); + $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(); + $hardware = new Hardware(); + $hardwareOrder = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $hardware->setOrder($hardwareOrder); + $hardwareSite = $gapicClient->siteName('[PROJECT]', '[LOCATION]', '[SITE]'); + $hardware->setSite($hardwareSite); + $hardwareConfig = new HardwareConfig(); + $configSku = $gapicClient->skuName('[PROJECT]', '[LOCATION]', '[SKU]'); + $hardwareConfig->setSku($configSku); + $configPowerSupply = PowerSupply::POWER_SUPPLY_UNSPECIFIED; + $hardwareConfig->setPowerSupply($configPowerSupply); + $hardware->setConfig($hardwareConfig); + $hardwareZone = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $hardware->setZone($hardwareZone); + $request = (new UpdateHardwareRequest())->setUpdateMask($updateMask)->setHardware($hardware); + $response = $gapicClient->updateHardware($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateHardwareTest'); + 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 updateHardwareGroupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateHardwareGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $hardwareCount = 1025608696; + $site = 'site3530567'; + $zone = 'zone3744684'; + $expectedResponse = new HardwareGroup(); + $expectedResponse->setName($name); + $expectedResponse->setHardwareCount($hardwareCount); + $expectedResponse->setSite($site); + $expectedResponse->setZone($zone); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateHardwareGroupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $hardwareGroup = new HardwareGroup(); + $hardwareGroupHardwareCount = 72475600; + $hardwareGroup->setHardwareCount($hardwareGroupHardwareCount); + $hardwareGroupConfig = new HardwareConfig(); + $configSku = $gapicClient->skuName('[PROJECT]', '[LOCATION]', '[SKU]'); + $hardwareGroupConfig->setSku($configSku); + $configPowerSupply = PowerSupply::POWER_SUPPLY_UNSPECIFIED; + $hardwareGroupConfig->setPowerSupply($configPowerSupply); + $hardwareGroup->setConfig($hardwareGroupConfig); + $hardwareGroupSite = $gapicClient->siteName('[PROJECT]', '[LOCATION]', '[SITE]'); + $hardwareGroup->setSite($hardwareGroupSite); + $request = (new UpdateHardwareGroupRequest())->setUpdateMask($updateMask)->setHardwareGroup($hardwareGroup); + $response = $gapicClient->updateHardwareGroup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/UpdateHardwareGroup', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getHardwareGroup(); + $this->assertProtobufEquals($hardwareGroup, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateHardwareGroupTest'); + $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 updateHardwareGroupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateHardwareGroupTest'); + $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(); + $hardwareGroup = new HardwareGroup(); + $hardwareGroupHardwareCount = 72475600; + $hardwareGroup->setHardwareCount($hardwareGroupHardwareCount); + $hardwareGroupConfig = new HardwareConfig(); + $configSku = $gapicClient->skuName('[PROJECT]', '[LOCATION]', '[SKU]'); + $hardwareGroupConfig->setSku($configSku); + $configPowerSupply = PowerSupply::POWER_SUPPLY_UNSPECIFIED; + $hardwareGroupConfig->setPowerSupply($configPowerSupply); + $hardwareGroup->setConfig($hardwareGroupConfig); + $hardwareGroupSite = $gapicClient->siteName('[PROJECT]', '[LOCATION]', '[SITE]'); + $hardwareGroup->setSite($hardwareGroupSite); + $request = (new UpdateHardwareGroupRequest())->setUpdateMask($updateMask)->setHardwareGroup($hardwareGroup); + $response = $gapicClient->updateHardwareGroup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateHardwareGroupTest'); + 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 updateOrderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateOrderTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $customerMotivation = 'customerMotivation-1685724777'; + $regionCode = 'regionCode-1566082984'; + $orderFormUri = 'orderFormUri-813891262'; + $billingId = 'billingId834271583'; + $expectedResponse = new Order(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setCustomerMotivation($customerMotivation); + $expectedResponse->setRegionCode($regionCode); + $expectedResponse->setOrderFormUri($orderFormUri); + $expectedResponse->setBillingId($billingId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateOrderTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $order = new Order(); + $orderOrganizationContact = new OrganizationContact(); + $organizationContactAddress = new PostalAddress(); + $orderOrganizationContact->setAddress($organizationContactAddress); + $organizationContactContacts = []; + $orderOrganizationContact->setContacts($organizationContactContacts); + $order->setOrganizationContact($orderOrganizationContact); + $orderCustomerMotivation = 'orderCustomerMotivation2119167234'; + $order->setCustomerMotivation($orderCustomerMotivation); + $orderFulfillmentTime = new Timestamp(); + $order->setFulfillmentTime($orderFulfillmentTime); + $orderRegionCode = 'orderRegionCode220776687'; + $order->setRegionCode($orderRegionCode); + $orderBillingId = 'orderBillingId-1841403576'; + $order->setBillingId($orderBillingId); + $request = (new UpdateOrderRequest())->setUpdateMask($updateMask)->setOrder($order); + $response = $gapicClient->updateOrder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/UpdateOrder', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getOrder(); + $this->assertProtobufEquals($order, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateOrderTest'); + $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 updateOrderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateOrderTest'); + $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(); + $order = new Order(); + $orderOrganizationContact = new OrganizationContact(); + $organizationContactAddress = new PostalAddress(); + $orderOrganizationContact->setAddress($organizationContactAddress); + $organizationContactContacts = []; + $orderOrganizationContact->setContacts($organizationContactContacts); + $order->setOrganizationContact($orderOrganizationContact); + $orderCustomerMotivation = 'orderCustomerMotivation2119167234'; + $order->setCustomerMotivation($orderCustomerMotivation); + $orderFulfillmentTime = new Timestamp(); + $order->setFulfillmentTime($orderFulfillmentTime); + $orderRegionCode = 'orderRegionCode220776687'; + $order->setRegionCode($orderRegionCode); + $orderBillingId = 'orderBillingId-1841403576'; + $order->setBillingId($orderBillingId); + $request = (new UpdateOrderRequest())->setUpdateMask($updateMask)->setOrder($order); + $response = $gapicClient->updateOrder($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateOrderTest'); + 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 updateSiteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateSiteTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $description = 'description-1724546052'; + $googleMapsPinUri = 'googleMapsPinUri-726488480'; + $notes = 'notes105008833'; + $customerSiteId = 'customerSiteId54911410'; + $expectedResponse = new Site(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setDescription($description); + $expectedResponse->setGoogleMapsPinUri($googleMapsPinUri); + $expectedResponse->setNotes($notes); + $expectedResponse->setCustomerSiteId($customerSiteId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateSiteTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $site = new Site(); + $siteOrganizationContact = new OrganizationContact(); + $organizationContactAddress = new PostalAddress(); + $siteOrganizationContact->setAddress($organizationContactAddress); + $organizationContactContacts = []; + $siteOrganizationContact->setContacts($organizationContactContacts); + $site->setOrganizationContact($siteOrganizationContact); + $siteGoogleMapsPinUri = 'siteGoogleMapsPinUri583948686'; + $site->setGoogleMapsPinUri($siteGoogleMapsPinUri); + $request = (new UpdateSiteRequest())->setUpdateMask($updateMask)->setSite($site); + $response = $gapicClient->updateSite($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/UpdateSite', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getSite(); + $this->assertProtobufEquals($site, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateSiteTest'); + $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 updateSiteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateSiteTest'); + $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(); + $site = new Site(); + $siteOrganizationContact = new OrganizationContact(); + $organizationContactAddress = new PostalAddress(); + $siteOrganizationContact->setAddress($organizationContactAddress); + $organizationContactContacts = []; + $siteOrganizationContact->setContacts($organizationContactContacts); + $site->setOrganizationContact($siteOrganizationContact); + $siteGoogleMapsPinUri = 'siteGoogleMapsPinUri583948686'; + $site->setGoogleMapsPinUri($siteGoogleMapsPinUri); + $request = (new UpdateSiteRequest())->setUpdateMask($updateMask)->setSite($site); + $response = $gapicClient->updateSite($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateSiteTest'); + 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 updateZoneTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateZoneTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $ciqUri = 'ciqUri781916152'; + $globallyUniqueId = 'globallyUniqueId-1390482630'; + $expectedResponse = new Zone(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setCiqUri($ciqUri); + $expectedResponse->setGloballyUniqueId($globallyUniqueId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateZoneTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $zone = new Zone(); + $zoneContacts = []; + $zone->setContacts($zoneContacts); + $request = (new UpdateZoneRequest())->setUpdateMask($updateMask)->setZone($zone); + $response = $gapicClient->updateZone($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/UpdateZone', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateZoneTest'); + $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 updateZoneExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateZoneTest'); + $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(); + $zone = new Zone(); + $zoneContacts = []; + $zone->setContacts($zoneContacts); + $request = (new UpdateZoneRequest())->setUpdateMask($updateMask)->setZone($zone); + $response = $gapicClient->updateZone($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateZoneTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [$locationsElement]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createCommentAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createCommentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $author = 'author-1406328437'; + $text = 'text3556653'; + $expectedResponse = new Comment(); + $expectedResponse->setName($name); + $expectedResponse->setAuthor($author); + $expectedResponse->setText($text); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createCommentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->orderName('[PROJECT]', '[LOCATION]', '[ORDER]'); + $comment = new Comment(); + $commentText = 'commentText2103533612'; + $comment->setText($commentText); + $request = (new CreateCommentRequest())->setParent($formattedParent)->setComment($comment); + $response = $gapicClient->createCommentAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.gdchardwaremanagement.v1alpha.GDCHardwareManagement/CreateComment', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getComment(); + $this->assertProtobufEquals($comment, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createCommentTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/composer.json b/composer.json index 391e3b7e1aef..9ccd6a575a6b 100644 --- a/composer.json +++ b/composer.json @@ -152,6 +152,7 @@ "google/cloud-filestore": "2.0.1", "google/cloud-firestore": "1.46.0", "google/cloud-functions": "2.0.0", + "google/cloud-gdchardwaremanagement": "0.0.0", "google/cloud-gke-backup": "1.0.0", "google/cloud-gke-connect-gateway": "0.5.0", "google/cloud-gke-hub": "1.0.0", @@ -179,7 +180,7 @@ "google/cloud-networkservices": "0.2.0", "google/cloud-notebooks": "1.0.0", "google/cloud-optimization": "1.0.0", - "google/cloud-oracledatabase": "0.1.0", + "google/cloud-oracledatabase": "0.0.0", "google/cloud-orchestration-airflow": "2.1.0", "google/cloud-org-policy": "1.1.0", "google/cloud-osconfig": "2.0.0", @@ -347,6 +348,7 @@ "GPBMetadata\\Google\\Cloud\\Eventarc\\Publishing\\": "EventarcPublishing/metadata", "GPBMetadata\\Google\\Cloud\\Filestore\\": "Filestore/metadata", "GPBMetadata\\Google\\Cloud\\Functions\\": "Functions/metadata", + "GPBMetadata\\Google\\Cloud\\Gdchardwaremanagement\\": "GdcHardwareManagement/metadata", "GPBMetadata\\Google\\Cloud\\Gkebackup\\": "GkeBackup/metadata", "GPBMetadata\\Google\\Cloud\\Gkeconnect\\Gateway\\": "GkeConnectGateway/metadata", "GPBMetadata\\Google\\Cloud\\Gkehub\\": "GkeHub/metadata", @@ -572,6 +574,7 @@ "Google\\Cloud\\Firestore\\": "Firestore/src", "Google\\Cloud\\Functions\\": "Functions/src", "Google\\Cloud\\GSuiteAddOns\\": "GSuiteAddOns/src", + "Google\\Cloud\\GdcHardwareManagement\\": "GdcHardwareManagement/src", "Google\\Cloud\\GkeBackup\\": "GkeBackup/src", "Google\\Cloud\\GkeConnect\\Gateway\\": "GkeConnectGateway/src", "Google\\Cloud\\GkeHub\\": "GkeHub/src",