diff --git a/Asset/composer.json b/Asset/composer.json index 27c9ea777ae..92af0ee294a 100644 --- a/Asset/composer.json +++ b/Asset/composer.json @@ -23,7 +23,7 @@ } }, "require": { - "google/gax": "^0.37.0" + "google/gax": "^0.38.0" }, "require-dev": { "phpunit/phpunit": "^4.8|^5.0", diff --git a/BigQueryDataTransfer/composer.json b/BigQueryDataTransfer/composer.json index 47e80a64071..951f0327553 100644 --- a/BigQueryDataTransfer/composer.json +++ b/BigQueryDataTransfer/composer.json @@ -18,7 +18,7 @@ } }, "require": { - "google/gax": "^0.37" + "google/gax": "^0.38.0" }, "require-dev": { "phpunit/phpunit": "^4.8|^5.0", diff --git a/Bigtable/composer.json b/Bigtable/composer.json index 4ea0754bb99..3ebb99b2af3 100644 --- a/Bigtable/composer.json +++ b/Bigtable/composer.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "minimum-stability": "stable", "require": { - "google/gax": "^0.37", + "google/gax": "^0.38.0", "google/cloud-core": "^1.23" }, "require-dev": { diff --git a/CommonProtos/.gitignore b/CommonProtos/.gitignore new file mode 100644 index 00000000000..7e3271eadd6 --- /dev/null +++ b/CommonProtos/.gitignore @@ -0,0 +1,12 @@ + +# Directories created when regenerating protos +out/ +tmp_common_protos/ + +# Composer related dirs +composer.lock +vendor/ + +# Doc generation dirs +tmp_gh-pages/ +cache/ diff --git a/CommonProtos/CONTRIBUTING.md b/CommonProtos/CONTRIBUTING.md new file mode 100644 index 00000000000..216e08780b3 --- /dev/null +++ b/CommonProtos/CONTRIBUTING.md @@ -0,0 +1,45 @@ +## Contributing + +We are pleased that you are interested in contributing to our work. + +### Generated Protocol Buffer Classes + +The classes in this repository are generated by the protocol buffer +compiler, also known as protoc. As such, we can not accept contributions +directly to these generated classes. Instead, changes should be +suggested upstream in the [Googleapis][googleapis] +repository. + + +### Documentation + +We want for both protocol buffers and the types that we have provided here +to be understandable to everyone, including to those who may be unfamiliar +with the ecosystem or concepts. + +That means we want our documentation to be better, and welcome anyone +willing to help with this. For documentation in the generated classes, please +open a pull request against the [Googleapis][googleapis] +repository. + +Any improvements to READMEs or other non-generated documentation or +development scripts in this repository would be greatly appreciated - please +open a pull request. + + +## Contributor License Agreement + +Before we can accept your pull requests, you will need to sign a Contributor +License Agreement (CLA): + + - **If you are an individual writing original source code** and **you own the + intellectual property**, then you need to sign an [individual CLA][]. + - **If you work for a company that wants to allow you to contribute your + work**, then you need to sign a [corporate CLA][]. + +You can sign these electronically (just scroll to the bottom). After that, +we'll be able to accept your pull requests. + + [individual CLA]: https://developers.google.com/open-source/cla/individual + [corporate CLA]: https://developers.google.com/open-source/cla/corporate + [googleapis]: https://github.com/googleapis/googleapis diff --git a/CommonProtos/LICENSE b/CommonProtos/LICENSE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/CommonProtos/LICENSE @@ -0,0 +1,201 @@ + 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/CommonProtos/README.md b/CommonProtos/README.md new file mode 100644 index 00000000000..5ec9bee6f35 --- /dev/null +++ b/CommonProtos/README.md @@ -0,0 +1,45 @@ +# Google Cloud PHP Common Protos + +[![Build Status](https://api.travis-ci.org/googleapis/google-cloud-php-common-protos.svg?branch=master)](https://travis-ci.org/googleapis/google-cloud-php-common-protos) + +**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. + +This repository is a home for the [protocol buffer][protobuf] types which are +shared by multiple Google Cloud APIs, generated for PHP. +The protobuf definitions for these generated PHP classes are provided in the +[Googleapis][googleapis] repository. + +## Using these generated classes + +These classes are made available under an Apache license (see `LICENSE`) and +you are free to depend on them within your applications. They are +considered stable and will not change in backwards-incompaible ways. + +They are distributed as the [google/cloud-common-protos][packagist-cloud-common-protos] +composer package, available on [Packagist][packagist]. + +In order to depend on these classes, add the following line to your +composer.json file in the `requires` section: + +``` + "google/cloud-common-protos": "^0.1" +``` + +Or else use composer from the command line: + +```bash +composer require googe/cloud-common-protos +``` + +## License + +These classes are licensed using the Apache 2.0 software license, a +permissive, copyfree license. You are free to use them in your applications +provided the license terms are honored. + + [protobuf]: https://developers.google.com/protocol-buffers/ + [googleapis]: https://github.com/googleapis/googleapis/ + [packagist-cloud-common-protos]: https://packagist.org/packages/google/cloud-common-protos/ + [packagist]: https://packagist.org/ diff --git a/CommonProtos/composer.json b/CommonProtos/composer.json new file mode 100644 index 00000000000..d4c75058c5c --- /dev/null +++ b/CommonProtos/composer.json @@ -0,0 +1,29 @@ +{ + "name": "google/cloud-common-protos", + "type": "library", + "description": "Common Protos for Google Cloud APIs", + "keywords": ["google"], + "homepage": "https://github.com/googleapis/google-cloud-php-common-protos", + "license": "Apache-2.0", + "require": { + "google/protobuf": "^3.6.1", + "google/common-protos": "^0.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "autoload": { + "psr-4": { + "Google\\Cloud\\": "src", + "GPBMetadata\\Google\\": "metadata" + } + }, + "extra": { + "component": { + "id": "cloud-common-protos", + "target": "googleapis/google-cloud-php-common-protos.git", + "path": "CommonProtos", + "entry": "README.md" + } + } +} diff --git a/CommonProtos/dev/regenerate.sh b/CommonProtos/dev/regenerate.sh new file mode 100644 index 00000000000..be88a0ee13e --- /dev/null +++ b/CommonProtos/dev/regenerate.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# Copyright 2018 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. + +# Protos to generate +PROTOS_TO_GENERATE="google/cloud/audit/audit_log.proto google/devtools/source/v1/source_context.proto" + +# Constants +REQUIRED_PROTOC_VERSION="libprotoc 3.6.1" +GOOGLEAPIS_REPO="https://github.com/googleapis/googleapis.git" + +# Directories +: "${ROOT_DIR:=$(pwd)}" +echo "root dir: ${ROOT_DIR}" +TEMP_COMMON_PROTOS_DIR="${ROOT_DIR}/tmp_common_protos" +PROTOC_OUT_DIR="${ROOT_DIR}/out" +SRC_DIR="${ROOT_DIR}/src" +METADATA_DIR="${ROOT_DIR}/metadata" + +# Protoc bin +: "${PROTOC_BIN:=$(which protoc)}" +echo "protoc bin: ${PROTOC_BIN}" + +# Check protoc version +PROTOC_VERSION=$($PROTOC_BIN --version) +echo "protoc version: ${PROTOC_VERSION}" + +if [ "${PROTOC_VERSION}" != "${REQUIRED_PROTOC_VERSION}" ] +then + echo "Invalid protoc version, expected '${REQUIRED_PROTOC_VERSION}', got '${PROTOC_VERSION}'" + exit 1 +fi + +rm -rf ${TEMP_COMMON_PROTOS_DIR} +git clone ${GOOGLEAPIS_REPO} ${TEMP_COMMON_PROTOS_DIR} + +rm -rf ${PROTOC_OUT_DIR} +mkdir ${PROTOC_OUT_DIR} + +PROTOC_ARGS="--php_out ${PROTOC_OUT_DIR} -I${TEMP_COMMON_PROTOS_DIR} ${PROTOS_TO_GENERATE}" +echo "Calling protoc with args: ${PROTOC_ARGS}" +${PROTOC_BIN} ${PROTOC_ARGS} + +rm -rf ${SRC_DIR} +mkdir ${SRC_DIR} + +rm -rf ${METADATA_DIR} +mkdir ${METADATA_DIR} + +echo "Copy protos to src and metadata locations" +cp -r ${PROTOC_OUT_DIR}/Google/Cloud/* ${SRC_DIR}/ +cp -r ${PROTOC_OUT_DIR}/GPBMetadata/Google/* ${METADATA_DIR}/ diff --git a/CommonProtos/metadata/Cloud/Audit/AuditLog.php b/CommonProtos/metadata/Cloud/Audit/AuditLog.php new file mode 100644 index 00000000000..fdc7b67f6e2 --- /dev/null +++ b/CommonProtos/metadata/Cloud/Audit/AuditLog.php @@ -0,0 +1,58 @@ +internalAddGeneratedFile(hex2bin( + "0a92070a22676f6f676c652f636c6f75642f61756469742f61756469745f" . + "6c6f672e70726f746f1212676f6f676c652e636c6f75642e61756469741a" . + "19676f6f676c652f70726f746f6275662f616e792e70726f746f1a1c676f" . + "6f676c652f70726f746f6275662f7374727563742e70726f746f1a17676f" . + "6f676c652f7270632f7374617475732e70726f746f22d4030a0841756469" . + "744c6f6712140a0c736572766963655f6e616d6518072001280912130a0b" . + "6d6574686f645f6e616d6518082001280912150a0d7265736f757263655f" . + "6e616d65180b20012809121a0a126e756d5f726573706f6e73655f697465" . + "6d73180c2001280312220a0673746174757318022001280b32122e676f6f" . + "676c652e7270632e53746174757312430a1361757468656e746963617469" . + "6f6e5f696e666f18032001280b32262e676f6f676c652e636c6f75642e61" . + "756469742e41757468656e7469636174696f6e496e666f12410a12617574" . + "686f72697a6174696f6e5f696e666f18092003280b32252e676f6f676c65" . + "2e636c6f75642e61756469742e417574686f72697a6174696f6e496e666f" . + "123d0a10726571756573745f6d6574616461746118042001280b32232e67" . + "6f6f676c652e636c6f75642e61756469742e526571756573744d65746164" . + "61746112280a077265717565737418102001280b32172e676f6f676c652e" . + "70726f746f6275662e53747275637412290a08726573706f6e7365181120" . + "01280b32172e676f6f676c652e70726f746f6275662e537472756374122a" . + "0a0c736572766963655f64617461180f2001280b32142e676f6f676c652e" . + "70726f746f6275662e416e79222d0a1241757468656e7469636174696f6e" . + "496e666f12170a0f7072696e636970616c5f656d61696c18012001280922" . + "4a0a11417574686f72697a6174696f6e496e666f12100a087265736f7572" . + "636518012001280912120a0a7065726d697373696f6e180220012809120f" . + "0a076772616e74656418032001280822480a0f526571756573744d657461" . + "6461746112110a0963616c6c65725f697018012001280912220a1a63616c" . + "6c65725f737570706c6965645f757365725f6167656e7418022001280942" . + "620a16636f6d2e676f6f676c652e636c6f75642e6175646974420d417564" . + "69744c6f6750726f746f50015a37676f6f676c652e676f6c616e672e6f72" . + "672f67656e70726f746f2f676f6f676c65617069732f636c6f75642f6175" . + "6469743b6175646974620670726f746f33" + )); + + static::$is_initialized = true; + } +} + diff --git a/CommonProtos/metadata/Devtools/Source/V1/SourceContext.php b/CommonProtos/metadata/Devtools/Source/V1/SourceContext.php new file mode 100644 index 00000000000..2c228673502 --- /dev/null +++ b/CommonProtos/metadata/Devtools/Source/V1/SourceContext.php @@ -0,0 +1,83 @@ +internalAddGeneratedFile(hex2bin( + "0ad90d0a2e676f6f676c652f646576746f6f6c732f736f757263652f7631" . + "2f736f757263655f636f6e746578742e70726f746f1219676f6f676c652e" . + "646576746f6f6c732e736f757263652e763122b4020a0d536f7572636543" . + "6f6e7465787412470a0a636c6f75645f7265706f18012001280b32312e67" . + "6f6f676c652e646576746f6f6c732e736f757263652e76312e436c6f7564" . + "5265706f536f75726365436f6e74657874480012510a0f636c6f75645f77" . + "6f726b737061636518022001280b32362e676f6f676c652e646576746f6f" . + "6c732e736f757263652e76312e436c6f7564576f726b7370616365536f75" . + "726365436f6e74657874480012400a0667657272697418032001280b322e" . + "2e676f6f676c652e646576746f6f6c732e736f757263652e76312e476572" . + "726974536f75726365436f6e746578744800123a0a036769741806200128" . + "0b322b2e676f6f676c652e646576746f6f6c732e736f757263652e76312e" . + "476974536f75726365436f6e74657874480042090a07636f6e7465787422" . + "cf010a15457874656e646564536f75726365436f6e7465787412390a0763" . + "6f6e7465787418012001280b32282e676f6f676c652e646576746f6f6c73" . + "2e736f757263652e76312e536f75726365436f6e74657874124c0a066c61" . + "62656c7318022003280b323c2e676f6f676c652e646576746f6f6c732e73" . + "6f757263652e76312e457874656e646564536f75726365436f6e74657874" . + "2e4c6162656c73456e7472791a2d0a0b4c6162656c73456e747279120b0a" . + "036b6579180120012809120d0a0576616c75651802200128093a02380122" . + "8c010a0c416c696173436f6e74657874123a0a046b696e6418012001280e" . + "322c2e676f6f676c652e646576746f6f6c732e736f757263652e76312e41" . + "6c696173436f6e746578742e4b696e64120c0a046e616d65180220012809" . + "22320a044b696e6412070a03414e59100012090a0546495845441001120b" . + "0a074d4f5641424c45100212090a054f54484552100422cb010a16436c6f" . + "75645265706f536f75726365436f6e7465787412320a077265706f5f6964" . + "18012001280b32212e676f6f676c652e646576746f6f6c732e736f757263" . + "652e76312e5265706f496412150a0b7265766973696f6e5f696418022001" . + "2809480012180a0a616c6961735f6e616d65180320012809420218014800" . + "12400a0d616c6961735f636f6e7465787418042001280b32272e676f6f67" . + "6c652e646576746f6f6c732e736f757263652e76312e416c696173436f6e" . + "746578744800420a0a087265766973696f6e22750a1b436c6f7564576f72" . + "6b7370616365536f75726365436f6e7465787412410a0c776f726b737061" . + "63655f696418012001280b322b2e676f6f676c652e646576746f6f6c732e" . + "736f757263652e76312e436c6f7564576f726b7370616365496412130a0b" . + "736e617073686f745f696418022001280922be010a13476572726974536f" . + "75726365436f6e7465787412100a08686f73745f75726918012001280912" . + "160a0e6765727269745f70726f6a65637418022001280912150a0b726576" . + "6973696f6e5f6964180320012809480012180a0a616c6961735f6e616d65" . + "18042001280942021801480012400a0d616c6961735f636f6e7465787418" . + "052001280b32272e676f6f676c652e646576746f6f6c732e736f75726365" . + "2e76312e416c696173436f6e746578744800420a0a087265766973696f6e" . + "22340a10476974536f75726365436f6e74657874120b0a0375726c180120" . + "01280912130a0b7265766973696f6e5f696418022001280922620a065265" . + "706f496412430a0f70726f6a6563745f7265706f5f696418012001280b32" . + "282e676f6f676c652e646576746f6f6c732e736f757263652e76312e5072" . + "6f6a6563745265706f49644800120d0a0375696418022001280948004204" . + "0a02696422360a0d50726f6a6563745265706f496412120a0a70726f6a65" . + "63745f696418012001280912110a097265706f5f6e616d65180220012809" . + "22540a10436c6f7564576f726b7370616365496412320a077265706f5f69" . + "6418012001280b32212e676f6f676c652e646576746f6f6c732e736f7572" . + "63652e76312e5265706f4964120c0a046e616d6518022001280942bd010a" . + "1d636f6d2e676f6f676c652e646576746f6f6c732e736f757263652e7631" . + "4212536f75726365436f6e7465787450726f746f50015a3f676f6f676c65" . + "2e676f6c616e672e6f72672f67656e70726f746f2f676f6f676c65617069" . + "732f646576746f6f6c732f736f757263652f76313b736f75726365f80101" . + "aa021f476f6f676c652e436c6f75642e446576546f6f6c732e536f757263" . + "652e5631ca021f476f6f676c655c436c6f75645c446576546f6f6c735c53" . + "6f757263655c5631620670726f746f33" + )); + + static::$is_initialized = true; + } +} + diff --git a/CommonProtos/phpunit.xml.dist b/CommonProtos/phpunit.xml.dist new file mode 100644 index 00000000000..d75d0ba878b --- /dev/null +++ b/CommonProtos/phpunit.xml.dist @@ -0,0 +1,14 @@ + + + + + tests + + + + + src + + + diff --git a/CommonProtos/src/Audit/AuditLog.php b/CommonProtos/src/Audit/AuditLog.php new file mode 100644 index 00000000000..2195b65f1d8 --- /dev/null +++ b/CommonProtos/src/Audit/AuditLog.php @@ -0,0 +1,499 @@ +google.cloud.audit.AuditLog + */ +class AuditLog extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the API service performing the operation. For example, + * `"datastore.googleapis.com"`. + * + * Generated from protobuf field string service_name = 7; + */ + private $service_name = ''; + /** + * The name of the service method or operation. + * For API calls, this should be the name of the API method. + * For example, + * "google.datastore.v1.Datastore.RunQuery" + * "google.logging.v1.LoggingService.DeleteLog" + * + * Generated from protobuf field string method_name = 8; + */ + private $method_name = ''; + /** + * The resource or collection that is the target of the operation. + * The name is a scheme-less URI, not including the API service name. + * For example: + * "shelves/SHELF_ID/books" + * "shelves/SHELF_ID/books/BOOK_ID" + * + * Generated from protobuf field string resource_name = 11; + */ + private $resource_name = ''; + /** + * The number of items returned from a List or Query API method, + * if applicable. + * + * Generated from protobuf field int64 num_response_items = 12; + */ + private $num_response_items = 0; + /** + * The status of the overall operation. + * + * Generated from protobuf field .google.rpc.Status status = 2; + */ + private $status = null; + /** + * Authentication information. + * + * Generated from protobuf field .google.cloud.audit.AuthenticationInfo authentication_info = 3; + */ + private $authentication_info = null; + /** + * Authorization information. If there are multiple + * resources or permissions involved, then there is + * one AuthorizationInfo element for each {resource, permission} tuple. + * + * Generated from protobuf field repeated .google.cloud.audit.AuthorizationInfo authorization_info = 9; + */ + private $authorization_info; + /** + * Metadata about the operation. + * + * Generated from protobuf field .google.cloud.audit.RequestMetadata request_metadata = 4; + */ + private $request_metadata = null; + /** + * The operation request. This may not include all request parameters, + * such as those that are too large, privacy-sensitive, or duplicated + * elsewhere in the log record. + * It should never include user-generated data, such as file contents. + * When the JSON object represented here has a proto equivalent, the proto + * name will be indicated in the `@type` property. + * + * Generated from protobuf field .google.protobuf.Struct request = 16; + */ + private $request = null; + /** + * The operation response. This may not include all response elements, + * such as those that are too large, privacy-sensitive, or duplicated + * elsewhere in the log record. + * It should never include user-generated data, such as file contents. + * When the JSON object represented here has a proto equivalent, the proto + * name will be indicated in the `@type` property. + * + * Generated from protobuf field .google.protobuf.Struct response = 17; + */ + private $response = null; + /** + * Other service-specific data about the request, response, and other + * activities. + * + * Generated from protobuf field .google.protobuf.Any service_data = 15; + */ + private $service_data = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service_name + * The name of the API service performing the operation. For example, + * `"datastore.googleapis.com"`. + * @type string $method_name + * The name of the service method or operation. + * For API calls, this should be the name of the API method. + * For example, + * "google.datastore.v1.Datastore.RunQuery" + * "google.logging.v1.LoggingService.DeleteLog" + * @type string $resource_name + * The resource or collection that is the target of the operation. + * The name is a scheme-less URI, not including the API service name. + * For example: + * "shelves/SHELF_ID/books" + * "shelves/SHELF_ID/books/BOOK_ID" + * @type int|string $num_response_items + * The number of items returned from a List or Query API method, + * if applicable. + * @type \Google\Rpc\Status $status + * The status of the overall operation. + * @type \Google\Cloud\Audit\AuthenticationInfo $authentication_info + * Authentication information. + * @type \Google\Cloud\Audit\AuthorizationInfo[]|\Google\Protobuf\Internal\RepeatedField $authorization_info + * Authorization information. If there are multiple + * resources or permissions involved, then there is + * one AuthorizationInfo element for each {resource, permission} tuple. + * @type \Google\Cloud\Audit\RequestMetadata $request_metadata + * Metadata about the operation. + * @type \Google\Protobuf\Struct $request + * The operation request. This may not include all request parameters, + * such as those that are too large, privacy-sensitive, or duplicated + * elsewhere in the log record. + * It should never include user-generated data, such as file contents. + * When the JSON object represented here has a proto equivalent, the proto + * name will be indicated in the `@type` property. + * @type \Google\Protobuf\Struct $response + * The operation response. This may not include all response elements, + * such as those that are too large, privacy-sensitive, or duplicated + * elsewhere in the log record. + * It should never include user-generated data, such as file contents. + * When the JSON object represented here has a proto equivalent, the proto + * name will be indicated in the `@type` property. + * @type \Google\Protobuf\Any $service_data + * Other service-specific data about the request, response, and other + * activities. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Audit\AuditLog::initOnce(); + parent::__construct($data); + } + + /** + * The name of the API service performing the operation. For example, + * `"datastore.googleapis.com"`. + * + * Generated from protobuf field string service_name = 7; + * @return string + */ + public function getServiceName() + { + return $this->service_name; + } + + /** + * The name of the API service performing the operation. For example, + * `"datastore.googleapis.com"`. + * + * Generated from protobuf field string service_name = 7; + * @param string $var + * @return $this + */ + public function setServiceName($var) + { + GPBUtil::checkString($var, True); + $this->service_name = $var; + + return $this; + } + + /** + * The name of the service method or operation. + * For API calls, this should be the name of the API method. + * For example, + * "google.datastore.v1.Datastore.RunQuery" + * "google.logging.v1.LoggingService.DeleteLog" + * + * Generated from protobuf field string method_name = 8; + * @return string + */ + public function getMethodName() + { + return $this->method_name; + } + + /** + * The name of the service method or operation. + * For API calls, this should be the name of the API method. + * For example, + * "google.datastore.v1.Datastore.RunQuery" + * "google.logging.v1.LoggingService.DeleteLog" + * + * Generated from protobuf field string method_name = 8; + * @param string $var + * @return $this + */ + public function setMethodName($var) + { + GPBUtil::checkString($var, True); + $this->method_name = $var; + + return $this; + } + + /** + * The resource or collection that is the target of the operation. + * The name is a scheme-less URI, not including the API service name. + * For example: + * "shelves/SHELF_ID/books" + * "shelves/SHELF_ID/books/BOOK_ID" + * + * Generated from protobuf field string resource_name = 11; + * @return string + */ + public function getResourceName() + { + return $this->resource_name; + } + + /** + * The resource or collection that is the target of the operation. + * The name is a scheme-less URI, not including the API service name. + * For example: + * "shelves/SHELF_ID/books" + * "shelves/SHELF_ID/books/BOOK_ID" + * + * Generated from protobuf field string resource_name = 11; + * @param string $var + * @return $this + */ + public function setResourceName($var) + { + GPBUtil::checkString($var, True); + $this->resource_name = $var; + + return $this; + } + + /** + * The number of items returned from a List or Query API method, + * if applicable. + * + * Generated from protobuf field int64 num_response_items = 12; + * @return int|string + */ + public function getNumResponseItems() + { + return $this->num_response_items; + } + + /** + * The number of items returned from a List or Query API method, + * if applicable. + * + * Generated from protobuf field int64 num_response_items = 12; + * @param int|string $var + * @return $this + */ + public function setNumResponseItems($var) + { + GPBUtil::checkInt64($var); + $this->num_response_items = $var; + + return $this; + } + + /** + * The status of the overall operation. + * + * Generated from protobuf field .google.rpc.Status status = 2; + * @return \Google\Rpc\Status + */ + public function getStatus() + { + return $this->status; + } + + /** + * The status of the overall operation. + * + * Generated from protobuf field .google.rpc.Status status = 2; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->status = $var; + + return $this; + } + + /** + * Authentication information. + * + * Generated from protobuf field .google.cloud.audit.AuthenticationInfo authentication_info = 3; + * @return \Google\Cloud\Audit\AuthenticationInfo + */ + public function getAuthenticationInfo() + { + return $this->authentication_info; + } + + /** + * Authentication information. + * + * Generated from protobuf field .google.cloud.audit.AuthenticationInfo authentication_info = 3; + * @param \Google\Cloud\Audit\AuthenticationInfo $var + * @return $this + */ + public function setAuthenticationInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Audit\AuthenticationInfo::class); + $this->authentication_info = $var; + + return $this; + } + + /** + * Authorization information. If there are multiple + * resources or permissions involved, then there is + * one AuthorizationInfo element for each {resource, permission} tuple. + * + * Generated from protobuf field repeated .google.cloud.audit.AuthorizationInfo authorization_info = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAuthorizationInfo() + { + return $this->authorization_info; + } + + /** + * Authorization information. If there are multiple + * resources or permissions involved, then there is + * one AuthorizationInfo element for each {resource, permission} tuple. + * + * Generated from protobuf field repeated .google.cloud.audit.AuthorizationInfo authorization_info = 9; + * @param \Google\Cloud\Audit\AuthorizationInfo[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAuthorizationInfo($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Audit\AuthorizationInfo::class); + $this->authorization_info = $arr; + + return $this; + } + + /** + * Metadata about the operation. + * + * Generated from protobuf field .google.cloud.audit.RequestMetadata request_metadata = 4; + * @return \Google\Cloud\Audit\RequestMetadata + */ + public function getRequestMetadata() + { + return $this->request_metadata; + } + + /** + * Metadata about the operation. + * + * Generated from protobuf field .google.cloud.audit.RequestMetadata request_metadata = 4; + * @param \Google\Cloud\Audit\RequestMetadata $var + * @return $this + */ + public function setRequestMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Audit\RequestMetadata::class); + $this->request_metadata = $var; + + return $this; + } + + /** + * The operation request. This may not include all request parameters, + * such as those that are too large, privacy-sensitive, or duplicated + * elsewhere in the log record. + * It should never include user-generated data, such as file contents. + * When the JSON object represented here has a proto equivalent, the proto + * name will be indicated in the `@type` property. + * + * Generated from protobuf field .google.protobuf.Struct request = 16; + * @return \Google\Protobuf\Struct + */ + public function getRequest() + { + return $this->request; + } + + /** + * The operation request. This may not include all request parameters, + * such as those that are too large, privacy-sensitive, or duplicated + * elsewhere in the log record. + * It should never include user-generated data, such as file contents. + * When the JSON object represented here has a proto equivalent, the proto + * name will be indicated in the `@type` property. + * + * Generated from protobuf field .google.protobuf.Struct request = 16; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->request = $var; + + return $this; + } + + /** + * The operation response. This may not include all response elements, + * such as those that are too large, privacy-sensitive, or duplicated + * elsewhere in the log record. + * It should never include user-generated data, such as file contents. + * When the JSON object represented here has a proto equivalent, the proto + * name will be indicated in the `@type` property. + * + * Generated from protobuf field .google.protobuf.Struct response = 17; + * @return \Google\Protobuf\Struct + */ + public function getResponse() + { + return $this->response; + } + + /** + * The operation response. This may not include all response elements, + * such as those that are too large, privacy-sensitive, or duplicated + * elsewhere in the log record. + * It should never include user-generated data, such as file contents. + * When the JSON object represented here has a proto equivalent, the proto + * name will be indicated in the `@type` property. + * + * Generated from protobuf field .google.protobuf.Struct response = 17; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setResponse($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->response = $var; + + return $this; + } + + /** + * Other service-specific data about the request, response, and other + * activities. + * + * Generated from protobuf field .google.protobuf.Any service_data = 15; + * @return \Google\Protobuf\Any + */ + public function getServiceData() + { + return $this->service_data; + } + + /** + * Other service-specific data about the request, response, and other + * activities. + * + * Generated from protobuf field .google.protobuf.Any service_data = 15; + * @param \Google\Protobuf\Any $var + * @return $this + */ + public function setServiceData($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); + $this->service_data = $var; + + return $this; + } + +} + diff --git a/CommonProtos/src/Audit/AuthenticationInfo.php b/CommonProtos/src/Audit/AuthenticationInfo.php new file mode 100644 index 00000000000..7d422ddf51d --- /dev/null +++ b/CommonProtos/src/Audit/AuthenticationInfo.php @@ -0,0 +1,67 @@ +google.cloud.audit.AuthenticationInfo + */ +class AuthenticationInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The email address of the authenticated user making the request. + * + * Generated from protobuf field string principal_email = 1; + */ + private $principal_email = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $principal_email + * The email address of the authenticated user making the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Audit\AuditLog::initOnce(); + parent::__construct($data); + } + + /** + * The email address of the authenticated user making the request. + * + * Generated from protobuf field string principal_email = 1; + * @return string + */ + public function getPrincipalEmail() + { + return $this->principal_email; + } + + /** + * The email address of the authenticated user making the request. + * + * Generated from protobuf field string principal_email = 1; + * @param string $var + * @return $this + */ + public function setPrincipalEmail($var) + { + GPBUtil::checkString($var, True); + $this->principal_email = $var; + + return $this; + } + +} + diff --git a/CommonProtos/src/Audit/AuthorizationInfo.php b/CommonProtos/src/Audit/AuthorizationInfo.php new file mode 100644 index 00000000000..53b6a9cbb64 --- /dev/null +++ b/CommonProtos/src/Audit/AuthorizationInfo.php @@ -0,0 +1,143 @@ +google.cloud.audit.AuthorizationInfo + */ +class AuthorizationInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The resource being accessed, as a REST-style string. For example: + * bigquery.googlapis.com/projects/PROJECTID/datasets/DATASETID + * + * Generated from protobuf field string resource = 1; + */ + private $resource = ''; + /** + * The required IAM permission. + * + * Generated from protobuf field string permission = 2; + */ + private $permission = ''; + /** + * Whether or not authorization for `resource` and `permission` + * was granted. + * + * Generated from protobuf field bool granted = 3; + */ + private $granted = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * The resource being accessed, as a REST-style string. For example: + * bigquery.googlapis.com/projects/PROJECTID/datasets/DATASETID + * @type string $permission + * The required IAM permission. + * @type bool $granted + * Whether or not authorization for `resource` and `permission` + * was granted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Audit\AuditLog::initOnce(); + parent::__construct($data); + } + + /** + * The resource being accessed, as a REST-style string. For example: + * bigquery.googlapis.com/projects/PROJECTID/datasets/DATASETID + * + * Generated from protobuf field string resource = 1; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * The resource being accessed, as a REST-style string. For example: + * bigquery.googlapis.com/projects/PROJECTID/datasets/DATASETID + * + * Generated from protobuf field string resource = 1; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The required IAM permission. + * + * Generated from protobuf field string permission = 2; + * @return string + */ + public function getPermission() + { + return $this->permission; + } + + /** + * The required IAM permission. + * + * Generated from protobuf field string permission = 2; + * @param string $var + * @return $this + */ + public function setPermission($var) + { + GPBUtil::checkString($var, True); + $this->permission = $var; + + return $this; + } + + /** + * Whether or not authorization for `resource` and `permission` + * was granted. + * + * Generated from protobuf field bool granted = 3; + * @return bool + */ + public function getGranted() + { + return $this->granted; + } + + /** + * Whether or not authorization for `resource` and `permission` + * was granted. + * + * Generated from protobuf field bool granted = 3; + * @param bool $var + * @return $this + */ + public function setGranted($var) + { + GPBUtil::checkBool($var); + $this->granted = $var; + + return $this; + } + +} + diff --git a/CommonProtos/src/Audit/RequestMetadata.php b/CommonProtos/src/Audit/RequestMetadata.php new file mode 100644 index 00000000000..9d50125d411 --- /dev/null +++ b/CommonProtos/src/Audit/RequestMetadata.php @@ -0,0 +1,133 @@ +google.cloud.audit.RequestMetadata + */ +class RequestMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The IP address of the caller. + * + * Generated from protobuf field string caller_ip = 1; + */ + private $caller_ip = ''; + /** + * The user agent of the caller. + * This information is not authenticated and should be treated accordingly. + * For example: + * + `google-api-python-client/1.4.0`: + * The request was made by the Google API client for Python. + * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: + * The request was made by the Google Cloud SDK CLI (gcloud). + * + `AppEngine-Google; (+http://code.google.com/appengine; appid: s~my-project`: + * The request was made from the `my-project` App Engine app. + * + * Generated from protobuf field string caller_supplied_user_agent = 2; + */ + private $caller_supplied_user_agent = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $caller_ip + * The IP address of the caller. + * @type string $caller_supplied_user_agent + * The user agent of the caller. + * This information is not authenticated and should be treated accordingly. + * For example: + * + `google-api-python-client/1.4.0`: + * The request was made by the Google API client for Python. + * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: + * The request was made by the Google Cloud SDK CLI (gcloud). + * + `AppEngine-Google; (+http://code.google.com/appengine; appid: s~my-project`: + * The request was made from the `my-project` App Engine app. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Audit\AuditLog::initOnce(); + parent::__construct($data); + } + + /** + * The IP address of the caller. + * + * Generated from protobuf field string caller_ip = 1; + * @return string + */ + public function getCallerIp() + { + return $this->caller_ip; + } + + /** + * The IP address of the caller. + * + * Generated from protobuf field string caller_ip = 1; + * @param string $var + * @return $this + */ + public function setCallerIp($var) + { + GPBUtil::checkString($var, True); + $this->caller_ip = $var; + + return $this; + } + + /** + * The user agent of the caller. + * This information is not authenticated and should be treated accordingly. + * For example: + * + `google-api-python-client/1.4.0`: + * The request was made by the Google API client for Python. + * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: + * The request was made by the Google Cloud SDK CLI (gcloud). + * + `AppEngine-Google; (+http://code.google.com/appengine; appid: s~my-project`: + * The request was made from the `my-project` App Engine app. + * + * Generated from protobuf field string caller_supplied_user_agent = 2; + * @return string + */ + public function getCallerSuppliedUserAgent() + { + return $this->caller_supplied_user_agent; + } + + /** + * The user agent of the caller. + * This information is not authenticated and should be treated accordingly. + * For example: + * + `google-api-python-client/1.4.0`: + * The request was made by the Google API client for Python. + * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: + * The request was made by the Google Cloud SDK CLI (gcloud). + * + `AppEngine-Google; (+http://code.google.com/appengine; appid: s~my-project`: + * The request was made from the `my-project` App Engine app. + * + * Generated from protobuf field string caller_supplied_user_agent = 2; + * @param string $var + * @return $this + */ + public function setCallerSuppliedUserAgent($var) + { + GPBUtil::checkString($var, True); + $this->caller_supplied_user_agent = $var; + + return $this; + } + +} + diff --git a/CommonProtos/src/DevTools/Source/V1/AliasContext.php b/CommonProtos/src/DevTools/Source/V1/AliasContext.php new file mode 100644 index 00000000000..d18e108791d --- /dev/null +++ b/CommonProtos/src/DevTools/Source/V1/AliasContext.php @@ -0,0 +1,101 @@ +google.devtools.source.v1.AliasContext + */ +class AliasContext extends \Google\Protobuf\Internal\Message +{ + /** + * The alias kind. + * + * Generated from protobuf field .google.devtools.source.v1.AliasContext.Kind kind = 1; + */ + private $kind = 0; + /** + * The alias name. + * + * Generated from protobuf field string name = 2; + */ + private $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $kind + * The alias kind. + * @type string $name + * The alias name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Source\V1\SourceContext::initOnce(); + parent::__construct($data); + } + + /** + * The alias kind. + * + * Generated from protobuf field .google.devtools.source.v1.AliasContext.Kind kind = 1; + * @return int + */ + public function getKind() + { + return $this->kind; + } + + /** + * The alias kind. + * + * Generated from protobuf field .google.devtools.source.v1.AliasContext.Kind kind = 1; + * @param int $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DevTools\Source\V1\AliasContext_Kind::class); + $this->kind = $var; + + return $this; + } + + /** + * The alias name. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The alias name. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/CommonProtos/src/DevTools/Source/V1/AliasContext/Kind.php b/CommonProtos/src/DevTools/Source/V1/AliasContext/Kind.php new file mode 100644 index 00000000000..e0ca48749b3 --- /dev/null +++ b/CommonProtos/src/DevTools/Source/V1/AliasContext/Kind.php @@ -0,0 +1,44 @@ +google.devtools.source.v1.AliasContext.Kind + */ +class Kind +{ + /** + * Do not use. + * + * Generated from protobuf enum ANY = 0; + */ + const ANY = 0; + /** + * Git tag + * + * Generated from protobuf enum FIXED = 1; + */ + const FIXED = 1; + /** + * Git branch + * + * Generated from protobuf enum MOVABLE = 2; + */ + const MOVABLE = 2; + /** + * OTHER is used to specify non-standard aliases, those not of the kinds + * above. For example, if a Git repo has a ref named "refs/foo/bar", it + * is considered to be of kind OTHER. + * + * Generated from protobuf enum OTHER = 4; + */ + const OTHER = 4; +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Kind::class, \Google\Cloud\DevTools\Source\V1\AliasContext_Kind::class); + diff --git a/CommonProtos/src/DevTools/Source/V1/AliasContext_Kind.php b/CommonProtos/src/DevTools/Source/V1/AliasContext_Kind.php new file mode 100644 index 00000000000..7f426f39fb0 --- /dev/null +++ b/CommonProtos/src/DevTools/Source/V1/AliasContext_Kind.php @@ -0,0 +1,16 @@ +google.devtools.source.v1.CloudRepoSourceContext + */ +class CloudRepoSourceContext extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of the repo. + * + * Generated from protobuf field .google.devtools.source.v1.RepoId repo_id = 1; + */ + private $repo_id = null; + protected $revision; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DevTools\Source\V1\RepoId $repo_id + * The ID of the repo. + * @type string $revision_id + * A revision ID. + * @type string $alias_name + * The name of an alias (branch, tag, etc.). + * @type \Google\Cloud\DevTools\Source\V1\AliasContext $alias_context + * An alias, which may be a branch or tag. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Source\V1\SourceContext::initOnce(); + parent::__construct($data); + } + + /** + * The ID of the repo. + * + * Generated from protobuf field .google.devtools.source.v1.RepoId repo_id = 1; + * @return \Google\Cloud\DevTools\Source\V1\RepoId + */ + public function getRepoId() + { + return $this->repo_id; + } + + /** + * The ID of the repo. + * + * Generated from protobuf field .google.devtools.source.v1.RepoId repo_id = 1; + * @param \Google\Cloud\DevTools\Source\V1\RepoId $var + * @return $this + */ + public function setRepoId($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\RepoId::class); + $this->repo_id = $var; + + return $this; + } + + /** + * A revision ID. + * + * Generated from protobuf field string revision_id = 2; + * @return string + */ + public function getRevisionId() + { + return $this->readOneof(2); + } + + /** + * A revision ID. + * + * Generated from protobuf field string revision_id = 2; + * @param string $var + * @return $this + */ + public function setRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The name of an alias (branch, tag, etc.). + * + * Generated from protobuf field string alias_name = 3 [deprecated = true]; + * @return string + */ + public function getAliasName() + { + return $this->readOneof(3); + } + + /** + * The name of an alias (branch, tag, etc.). + * + * Generated from protobuf field string alias_name = 3 [deprecated = true]; + * @param string $var + * @return $this + */ + public function setAliasName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * An alias, which may be a branch or tag. + * + * Generated from protobuf field .google.devtools.source.v1.AliasContext alias_context = 4; + * @return \Google\Cloud\DevTools\Source\V1\AliasContext + */ + public function getAliasContext() + { + return $this->readOneof(4); + } + + /** + * An alias, which may be a branch or tag. + * + * Generated from protobuf field .google.devtools.source.v1.AliasContext alias_context = 4; + * @param \Google\Cloud\DevTools\Source\V1\AliasContext $var + * @return $this + */ + public function setAliasContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\AliasContext::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getRevision() + { + return $this->whichOneof("revision"); + } + +} + diff --git a/CommonProtos/src/DevTools/Source/V1/CloudWorkspaceId.php b/CommonProtos/src/DevTools/Source/V1/CloudWorkspaceId.php new file mode 100644 index 00000000000..b0262f3a8e1 --- /dev/null +++ b/CommonProtos/src/DevTools/Source/V1/CloudWorkspaceId.php @@ -0,0 +1,107 @@ +google.devtools.source.v1.CloudWorkspaceId + */ +class CloudWorkspaceId extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of the repo containing the workspace. + * + * Generated from protobuf field .google.devtools.source.v1.RepoId repo_id = 1; + */ + private $repo_id = null; + /** + * The unique name of the workspace within the repo. This is the name + * chosen by the client in the Source API's CreateWorkspace method. + * + * Generated from protobuf field string name = 2; + */ + private $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DevTools\Source\V1\RepoId $repo_id + * The ID of the repo containing the workspace. + * @type string $name + * The unique name of the workspace within the repo. This is the name + * chosen by the client in the Source API's CreateWorkspace method. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Source\V1\SourceContext::initOnce(); + parent::__construct($data); + } + + /** + * The ID of the repo containing the workspace. + * + * Generated from protobuf field .google.devtools.source.v1.RepoId repo_id = 1; + * @return \Google\Cloud\DevTools\Source\V1\RepoId + */ + public function getRepoId() + { + return $this->repo_id; + } + + /** + * The ID of the repo containing the workspace. + * + * Generated from protobuf field .google.devtools.source.v1.RepoId repo_id = 1; + * @param \Google\Cloud\DevTools\Source\V1\RepoId $var + * @return $this + */ + public function setRepoId($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\RepoId::class); + $this->repo_id = $var; + + return $this; + } + + /** + * The unique name of the workspace within the repo. This is the name + * chosen by the client in the Source API's CreateWorkspace method. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The unique name of the workspace within the repo. This is the name + * chosen by the client in the Source API's CreateWorkspace method. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/CommonProtos/src/DevTools/Source/V1/CloudWorkspaceSourceContext.php b/CommonProtos/src/DevTools/Source/V1/CloudWorkspaceSourceContext.php new file mode 100644 index 00000000000..bfcbbe28ad4 --- /dev/null +++ b/CommonProtos/src/DevTools/Source/V1/CloudWorkspaceSourceContext.php @@ -0,0 +1,105 @@ +google.devtools.source.v1.CloudWorkspaceSourceContext + */ +class CloudWorkspaceSourceContext extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of the workspace. + * + * Generated from protobuf field .google.devtools.source.v1.CloudWorkspaceId workspace_id = 1; + */ + private $workspace_id = null; + /** + * The ID of the snapshot. + * An empty snapshot_id refers to the most recent snapshot. + * + * Generated from protobuf field string snapshot_id = 2; + */ + private $snapshot_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DevTools\Source\V1\CloudWorkspaceId $workspace_id + * The ID of the workspace. + * @type string $snapshot_id + * The ID of the snapshot. + * An empty snapshot_id refers to the most recent snapshot. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Source\V1\SourceContext::initOnce(); + parent::__construct($data); + } + + /** + * The ID of the workspace. + * + * Generated from protobuf field .google.devtools.source.v1.CloudWorkspaceId workspace_id = 1; + * @return \Google\Cloud\DevTools\Source\V1\CloudWorkspaceId + */ + public function getWorkspaceId() + { + return $this->workspace_id; + } + + /** + * The ID of the workspace. + * + * Generated from protobuf field .google.devtools.source.v1.CloudWorkspaceId workspace_id = 1; + * @param \Google\Cloud\DevTools\Source\V1\CloudWorkspaceId $var + * @return $this + */ + public function setWorkspaceId($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\CloudWorkspaceId::class); + $this->workspace_id = $var; + + return $this; + } + + /** + * The ID of the snapshot. + * An empty snapshot_id refers to the most recent snapshot. + * + * Generated from protobuf field string snapshot_id = 2; + * @return string + */ + public function getSnapshotId() + { + return $this->snapshot_id; + } + + /** + * The ID of the snapshot. + * An empty snapshot_id refers to the most recent snapshot. + * + * Generated from protobuf field string snapshot_id = 2; + * @param string $var + * @return $this + */ + public function setSnapshotId($var) + { + GPBUtil::checkString($var, True); + $this->snapshot_id = $var; + + return $this; + } + +} + diff --git a/CommonProtos/src/DevTools/Source/V1/ExtendedSourceContext.php b/CommonProtos/src/DevTools/Source/V1/ExtendedSourceContext.php new file mode 100644 index 00000000000..3a3c9a9881e --- /dev/null +++ b/CommonProtos/src/DevTools/Source/V1/ExtendedSourceContext.php @@ -0,0 +1,102 @@ +google.devtools.source.v1.ExtendedSourceContext + */ +class ExtendedSourceContext extends \Google\Protobuf\Internal\Message +{ + /** + * Any source context. + * + * Generated from protobuf field .google.devtools.source.v1.SourceContext context = 1; + */ + private $context = null; + /** + * Labels with user defined metadata. + * + * Generated from protobuf field map labels = 2; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DevTools\Source\V1\SourceContext $context + * Any source context. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels with user defined metadata. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Source\V1\SourceContext::initOnce(); + parent::__construct($data); + } + + /** + * Any source context. + * + * Generated from protobuf field .google.devtools.source.v1.SourceContext context = 1; + * @return \Google\Cloud\DevTools\Source\V1\SourceContext + */ + public function getContext() + { + return $this->context; + } + + /** + * Any source context. + * + * Generated from protobuf field .google.devtools.source.v1.SourceContext context = 1; + * @param \Google\Cloud\DevTools\Source\V1\SourceContext $var + * @return $this + */ + public function setContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\SourceContext::class); + $this->context = $var; + + return $this; + } + + /** + * Labels with user defined metadata. + * + * Generated from protobuf field map labels = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels with user defined metadata. + * + * Generated from protobuf field map labels = 2; + * @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; + } + +} + diff --git a/CommonProtos/src/DevTools/Source/V1/GerritSourceContext.php b/CommonProtos/src/DevTools/Source/V1/GerritSourceContext.php new file mode 100644 index 00000000000..26b2c2fac6a --- /dev/null +++ b/CommonProtos/src/DevTools/Source/V1/GerritSourceContext.php @@ -0,0 +1,202 @@ +google.devtools.source.v1.GerritSourceContext + */ +class GerritSourceContext extends \Google\Protobuf\Internal\Message +{ + /** + * The URI of a running Gerrit instance. + * + * Generated from protobuf field string host_uri = 1; + */ + private $host_uri = ''; + /** + * The full project name within the host. Projects may be nested, so + * "project/subproject" is a valid project name. + * The "repo name" is hostURI/project. + * + * Generated from protobuf field string gerrit_project = 2; + */ + private $gerrit_project = ''; + protected $revision; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host_uri + * The URI of a running Gerrit instance. + * @type string $gerrit_project + * The full project name within the host. Projects may be nested, so + * "project/subproject" is a valid project name. + * The "repo name" is hostURI/project. + * @type string $revision_id + * A revision (commit) ID. + * @type string $alias_name + * The name of an alias (branch, tag, etc.). + * @type \Google\Cloud\DevTools\Source\V1\AliasContext $alias_context + * An alias, which may be a branch or tag. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Source\V1\SourceContext::initOnce(); + parent::__construct($data); + } + + /** + * The URI of a running Gerrit instance. + * + * Generated from protobuf field string host_uri = 1; + * @return string + */ + public function getHostUri() + { + return $this->host_uri; + } + + /** + * The URI of a running Gerrit instance. + * + * Generated from protobuf field string host_uri = 1; + * @param string $var + * @return $this + */ + public function setHostUri($var) + { + GPBUtil::checkString($var, True); + $this->host_uri = $var; + + return $this; + } + + /** + * The full project name within the host. Projects may be nested, so + * "project/subproject" is a valid project name. + * The "repo name" is hostURI/project. + * + * Generated from protobuf field string gerrit_project = 2; + * @return string + */ + public function getGerritProject() + { + return $this->gerrit_project; + } + + /** + * The full project name within the host. Projects may be nested, so + * "project/subproject" is a valid project name. + * The "repo name" is hostURI/project. + * + * Generated from protobuf field string gerrit_project = 2; + * @param string $var + * @return $this + */ + public function setGerritProject($var) + { + GPBUtil::checkString($var, True); + $this->gerrit_project = $var; + + return $this; + } + + /** + * A revision (commit) ID. + * + * Generated from protobuf field string revision_id = 3; + * @return string + */ + public function getRevisionId() + { + return $this->readOneof(3); + } + + /** + * A revision (commit) ID. + * + * Generated from protobuf field string revision_id = 3; + * @param string $var + * @return $this + */ + public function setRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The name of an alias (branch, tag, etc.). + * + * Generated from protobuf field string alias_name = 4 [deprecated = true]; + * @return string + */ + public function getAliasName() + { + return $this->readOneof(4); + } + + /** + * The name of an alias (branch, tag, etc.). + * + * Generated from protobuf field string alias_name = 4 [deprecated = true]; + * @param string $var + * @return $this + */ + public function setAliasName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * An alias, which may be a branch or tag. + * + * Generated from protobuf field .google.devtools.source.v1.AliasContext alias_context = 5; + * @return \Google\Cloud\DevTools\Source\V1\AliasContext + */ + public function getAliasContext() + { + return $this->readOneof(5); + } + + /** + * An alias, which may be a branch or tag. + * + * Generated from protobuf field .google.devtools.source.v1.AliasContext alias_context = 5; + * @param \Google\Cloud\DevTools\Source\V1\AliasContext $var + * @return $this + */ + public function setAliasContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\AliasContext::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getRevision() + { + return $this->whichOneof("revision"); + } + +} + diff --git a/CommonProtos/src/DevTools/Source/V1/GitSourceContext.php b/CommonProtos/src/DevTools/Source/V1/GitSourceContext.php new file mode 100644 index 00000000000..0bb9c1ffc84 --- /dev/null +++ b/CommonProtos/src/DevTools/Source/V1/GitSourceContext.php @@ -0,0 +1,106 @@ +google.devtools.source.v1.GitSourceContext + */ +class GitSourceContext extends \Google\Protobuf\Internal\Message +{ + /** + * Git repository URL. + * + * Generated from protobuf field string url = 1; + */ + private $url = ''; + /** + * Git commit hash. + * required. + * + * Generated from protobuf field string revision_id = 2; + */ + private $revision_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $url + * Git repository URL. + * @type string $revision_id + * Git commit hash. + * required. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Source\V1\SourceContext::initOnce(); + parent::__construct($data); + } + + /** + * Git repository URL. + * + * Generated from protobuf field string url = 1; + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Git repository URL. + * + * Generated from protobuf field string url = 1; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + + /** + * Git commit hash. + * required. + * + * Generated from protobuf field string revision_id = 2; + * @return string + */ + public function getRevisionId() + { + return $this->revision_id; + } + + /** + * Git commit hash. + * required. + * + * Generated from protobuf field string revision_id = 2; + * @param string $var + * @return $this + */ + public function setRevisionId($var) + { + GPBUtil::checkString($var, True); + $this->revision_id = $var; + + return $this; + } + +} + diff --git a/CommonProtos/src/DevTools/Source/V1/ProjectRepoId.php b/CommonProtos/src/DevTools/Source/V1/ProjectRepoId.php new file mode 100644 index 00000000000..1b495d45ad2 --- /dev/null +++ b/CommonProtos/src/DevTools/Source/V1/ProjectRepoId.php @@ -0,0 +1,102 @@ +google.devtools.source.v1.ProjectRepoId + */ +class ProjectRepoId extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of the project. + * + * Generated from protobuf field string project_id = 1; + */ + private $project_id = ''; + /** + * The name of the repo. Leave empty for the default repo. + * + * Generated from protobuf field string repo_name = 2; + */ + private $repo_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * The ID of the project. + * @type string $repo_name + * The name of the repo. Leave empty for the default repo. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Source\V1\SourceContext::initOnce(); + parent::__construct($data); + } + + /** + * The ID of the project. + * + * Generated from protobuf field string project_id = 1; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * The ID of the project. + * + * Generated from protobuf field string project_id = 1; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The name of the repo. Leave empty for the default repo. + * + * Generated from protobuf field string repo_name = 2; + * @return string + */ + public function getRepoName() + { + return $this->repo_name; + } + + /** + * The name of the repo. Leave empty for the default repo. + * + * Generated from protobuf field string repo_name = 2; + * @param string $var + * @return $this + */ + public function setRepoName($var) + { + GPBUtil::checkString($var, True); + $this->repo_name = $var; + + return $this; + } + +} + diff --git a/CommonProtos/src/DevTools/Source/V1/RepoId.php b/CommonProtos/src/DevTools/Source/V1/RepoId.php new file mode 100644 index 00000000000..34a1670203e --- /dev/null +++ b/CommonProtos/src/DevTools/Source/V1/RepoId.php @@ -0,0 +1,98 @@ +google.devtools.source.v1.RepoId + */ +class RepoId extends \Google\Protobuf\Internal\Message +{ + protected $id; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DevTools\Source\V1\ProjectRepoId $project_repo_id + * A combination of a project ID and a repo name. + * @type string $uid + * A server-assigned, globally unique identifier. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Source\V1\SourceContext::initOnce(); + parent::__construct($data); + } + + /** + * A combination of a project ID and a repo name. + * + * Generated from protobuf field .google.devtools.source.v1.ProjectRepoId project_repo_id = 1; + * @return \Google\Cloud\DevTools\Source\V1\ProjectRepoId + */ + public function getProjectRepoId() + { + return $this->readOneof(1); + } + + /** + * A combination of a project ID and a repo name. + * + * Generated from protobuf field .google.devtools.source.v1.ProjectRepoId project_repo_id = 1; + * @param \Google\Cloud\DevTools\Source\V1\ProjectRepoId $var + * @return $this + */ + public function setProjectRepoId($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\ProjectRepoId::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A server-assigned, globally unique identifier. + * + * Generated from protobuf field string uid = 2; + * @return string + */ + public function getUid() + { + return $this->readOneof(2); + } + + /** + * A server-assigned, globally unique identifier. + * + * Generated from protobuf field string uid = 2; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getId() + { + return $this->whichOneof("id"); + } + +} + diff --git a/CommonProtos/src/DevTools/Source/V1/SourceContext.php b/CommonProtos/src/DevTools/Source/V1/SourceContext.php new file mode 100644 index 00000000000..1eee7c37257 --- /dev/null +++ b/CommonProtos/src/DevTools/Source/V1/SourceContext.php @@ -0,0 +1,155 @@ +google.devtools.source.v1.SourceContext + */ +class SourceContext extends \Google\Protobuf\Internal\Message +{ + protected $context; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DevTools\Source\V1\CloudRepoSourceContext $cloud_repo + * A SourceContext referring to a revision in a cloud repo. + * @type \Google\Cloud\DevTools\Source\V1\CloudWorkspaceSourceContext $cloud_workspace + * A SourceContext referring to a snapshot in a cloud workspace. + * @type \Google\Cloud\DevTools\Source\V1\GerritSourceContext $gerrit + * A SourceContext referring to a Gerrit project. + * @type \Google\Cloud\DevTools\Source\V1\GitSourceContext $git + * A SourceContext referring to any third party Git repo (e.g. GitHub). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Source\V1\SourceContext::initOnce(); + parent::__construct($data); + } + + /** + * A SourceContext referring to a revision in a cloud repo. + * + * Generated from protobuf field .google.devtools.source.v1.CloudRepoSourceContext cloud_repo = 1; + * @return \Google\Cloud\DevTools\Source\V1\CloudRepoSourceContext + */ + public function getCloudRepo() + { + return $this->readOneof(1); + } + + /** + * A SourceContext referring to a revision in a cloud repo. + * + * Generated from protobuf field .google.devtools.source.v1.CloudRepoSourceContext cloud_repo = 1; + * @param \Google\Cloud\DevTools\Source\V1\CloudRepoSourceContext $var + * @return $this + */ + public function setCloudRepo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\CloudRepoSourceContext::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A SourceContext referring to a snapshot in a cloud workspace. + * + * Generated from protobuf field .google.devtools.source.v1.CloudWorkspaceSourceContext cloud_workspace = 2; + * @return \Google\Cloud\DevTools\Source\V1\CloudWorkspaceSourceContext + */ + public function getCloudWorkspace() + { + return $this->readOneof(2); + } + + /** + * A SourceContext referring to a snapshot in a cloud workspace. + * + * Generated from protobuf field .google.devtools.source.v1.CloudWorkspaceSourceContext cloud_workspace = 2; + * @param \Google\Cloud\DevTools\Source\V1\CloudWorkspaceSourceContext $var + * @return $this + */ + public function setCloudWorkspace($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\CloudWorkspaceSourceContext::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A SourceContext referring to a Gerrit project. + * + * Generated from protobuf field .google.devtools.source.v1.GerritSourceContext gerrit = 3; + * @return \Google\Cloud\DevTools\Source\V1\GerritSourceContext + */ + public function getGerrit() + { + return $this->readOneof(3); + } + + /** + * A SourceContext referring to a Gerrit project. + * + * Generated from protobuf field .google.devtools.source.v1.GerritSourceContext gerrit = 3; + * @param \Google\Cloud\DevTools\Source\V1\GerritSourceContext $var + * @return $this + */ + public function setGerrit($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\GerritSourceContext::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A SourceContext referring to any third party Git repo (e.g. GitHub). + * + * Generated from protobuf field .google.devtools.source.v1.GitSourceContext git = 6; + * @return \Google\Cloud\DevTools\Source\V1\GitSourceContext + */ + public function getGit() + { + return $this->readOneof(6); + } + + /** + * A SourceContext referring to any third party Git repo (e.g. GitHub). + * + * Generated from protobuf field .google.devtools.source.v1.GitSourceContext git = 6; + * @param \Google\Cloud\DevTools\Source\V1\GitSourceContext $var + * @return $this + */ + public function setGit($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\GitSourceContext::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getContext() + { + return $this->whichOneof("context"); + } + +} + diff --git a/CommonProtos/tests/Unit/InstantiateClassesTest.php b/CommonProtos/tests/Unit/InstantiateClassesTest.php new file mode 100644 index 00000000000..f5f9dba5072 --- /dev/null +++ b/CommonProtos/tests/Unit/InstantiateClassesTest.php @@ -0,0 +1,61 @@ +assertNotNull($instance); + } + + public function classesProvider() + { + $directoryPrefix = __DIR__ . '/../../src'; + $directoryPrefixLength = strlen($directoryPrefix); + $phpFileSuffix = '.php'; + $phpFileSuffixLength = strlen($phpFileSuffix); + $phpFileSuffixRegex = '#.+\.php$#'; + + $dir = new RecursiveDirectoryIterator($directoryPrefix); + $it = new RecursiveIteratorIterator($dir); + $reg = new RegexIterator($it, $phpFileSuffixRegex, RecursiveRegexIterator::GET_MATCH); + foreach ($reg as $files) { + $file = $files[0]; + // Remove prefix and suffix + $trimmedFile = substr($file, $directoryPrefixLength, -$phpFileSuffixLength); + // Prepend standard '\Google\Cloud' portion of namespace, then replace '/' with '\' + $fullyQualifiedName = "\\Google\\Cloud" . str_replace("/", "\\", $trimmedFile); + yield [$fullyQualifiedName]; + } + } +} diff --git a/CommonProtos/tests/bootstrap.php b/CommonProtos/tests/bootstrap.php new file mode 100644 index 00000000000..935e75baac0 --- /dev/null +++ b/CommonProtos/tests/bootstrap.php @@ -0,0 +1,22 @@ +*/metadata Firestore/tests/Conformance tests/Component/TestComposerInstall.php + CommonProtos