diff --git a/EdgeNetwork/.OwlBot.yaml b/EdgeNetwork/.OwlBot.yaml new file mode 100644 index 000000000000..92f8685deb19 --- /dev/null +++ b/EdgeNetwork/.OwlBot.yaml @@ -0,0 +1,4 @@ +deep-copy-regex: + - source: /google/cloud/edgenetwork/(v1)/.*-php/(.*) + dest: /owl-bot-staging/EdgeNetwork/$1/$2 +api-name: EdgeNetwork diff --git a/EdgeNetwork/.gitattributes b/EdgeNetwork/.gitattributes new file mode 100644 index 000000000000..8119e7fcc1b2 --- /dev/null +++ b/EdgeNetwork/.gitattributes @@ -0,0 +1,8 @@ +/*.xml.dist export-ignore +/.OwlBot.yaml export-ignore +/.github export-ignore +/.repo-metadata.json export-ignore +/owlbot.py export-ignore +/src/**/gapic_metadata.json export-ignore +/samples export-ignore +/tests export-ignore diff --git a/EdgeNetwork/.github/pull_request_template.md b/EdgeNetwork/.github/pull_request_template.md new file mode 100644 index 000000000000..a427d97c365f --- /dev/null +++ b/EdgeNetwork/.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 `EdgeNetwork/src`, and tests in `EdgeNetwork/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/EdgeNetwork/.repo-metadata.json b/EdgeNetwork/.repo-metadata.json new file mode 100644 index 000000000000..a59a390fe889 --- /dev/null +++ b/EdgeNetwork/.repo-metadata.json @@ -0,0 +1,8 @@ +{ + "language": "php", + "distribution_name": "google/cloud-edgenetwork", + "release_level": "preview", + "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-edgenetwork/latest", + "library_type": "GAPIC_AUTO", + "api_shortname": "edgenetwork" +} diff --git a/EdgeNetwork/CONTRIBUTING.md b/EdgeNetwork/CONTRIBUTING.md new file mode 100644 index 000000000000..76ea811cacdb --- /dev/null +++ b/EdgeNetwork/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/EdgeNetwork/LICENSE b/EdgeNetwork/LICENSE new file mode 100644 index 000000000000..8f71f43fee3f --- /dev/null +++ b/EdgeNetwork/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/EdgeNetwork/README.md b/EdgeNetwork/README.md new file mode 100644 index 000000000000..d9ebc7ee0c88 --- /dev/null +++ b/EdgeNetwork/README.md @@ -0,0 +1,45 @@ +# Google Cloud Edge Network for PHP + +> Idiomatic PHP client for [Google Cloud Edge Network](https://cloud.google.com/distributed-cloud/edge/latest/docs). + +[![Latest Stable Version](https://poser.pugx.org/google/cloud-edgenetwork/v/stable)](https://packagist.org/packages/google/cloud-edgenetwork) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-edgenetwork.svg)](https://packagist.org/packages/google/cloud-edgenetwork) + +* [API documentation](https://cloud.google.com/php/docs/reference/cloud-edgenetwork/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-edgenetwork +``` + +> 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-edgenetwork/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/apis). diff --git a/EdgeNetwork/VERSION b/EdgeNetwork/VERSION new file mode 100644 index 000000000000..77d6f4ca2371 --- /dev/null +++ b/EdgeNetwork/VERSION @@ -0,0 +1 @@ +0.0.0 diff --git a/EdgeNetwork/aaa.php b/EdgeNetwork/aaa.php new file mode 100644 index 000000000000..9e9f8e86aa0f --- /dev/null +++ b/EdgeNetwork/aaa.php @@ -0,0 +1,5 @@ +=7.4", + "google/gax": "^1.25.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", + "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." + } +} diff --git a/EdgeNetwork/metadata/V1/Resources.php b/EdgeNetwork/metadata/V1/Resources.php new file mode 100644 index 000000000000..559170d49911 Binary files /dev/null and b/EdgeNetwork/metadata/V1/Resources.php differ diff --git a/EdgeNetwork/metadata/V1/Service.php b/EdgeNetwork/metadata/V1/Service.php new file mode 100644 index 000000000000..c1d97709453b --- /dev/null +++ b/EdgeNetwork/metadata/V1/Service.php @@ -0,0 +1,245 @@ +internalAddGeneratedFile( + ' +‘W +)google/cloud/edgenetwork/v1/service.protogoogle.cloud.edgenetwork.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto+google/cloud/edgenetwork/v1/resources.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"” +ListZonesRequest7 +parent ( B\'àAúA!edgenetwork.googleapis.com/Zone + page_size ( + +page_token (  +filter (  +order_by ( "s +ListZonesResponse0 +zones ( 2!.google.cloud.edgenetwork.v1.Zone +next_page_token (  + unreachable ( "G +GetZoneRequest5 +name ( B\'àAúA! +edgenetwork.googleapis.com/Zone"š +ListNetworksRequest: +parent ( B*àAúA$"edgenetwork.googleapis.com/Network + page_size ( + +page_token (  +filter (  +order_by ( "| +ListNetworksResponse6 +networks ( 2$.google.cloud.edgenetwork.v1.Network +next_page_token (  + unreachable ( "M +GetNetworkRequest8 +name ( B*àAúA$ +"edgenetwork.googleapis.com/Network"À +CreateNetworkRequest: +parent ( B*àAúA$"edgenetwork.googleapis.com/Network + +network_id ( BàA: +network ( 2$.google.cloud.edgenetwork.v1.NetworkBàA + +request_id ( BàA"i +DeleteNetworkRequest8 +name ( B*àAúA$ +"edgenetwork.googleapis.com/Network + +request_id ( BàA"˜ +ListSubnetsRequest9 +parent ( B)àAúA#!edgenetwork.googleapis.com/Subnet + page_size ( + +page_token (  +filter (  +order_by ( "y +ListSubnetsResponse4 +subnets ( 2#.google.cloud.edgenetwork.v1.Subnet +next_page_token (  + unreachable ( "K +GetSubnetRequest7 +name ( B)àAúA# +!edgenetwork.googleapis.com/Subnet"» +CreateSubnetRequest9 +parent ( B)àAúA#!edgenetwork.googleapis.com/Subnet + subnet_id ( BàA8 +subnet ( 2#.google.cloud.edgenetwork.v1.SubnetBàA + +request_id ( BàA"ž +UpdateSubnetRequest4 + update_mask ( 2.google.protobuf.FieldMaskBàA8 +subnet ( 2#.google.cloud.edgenetwork.v1.SubnetBàA + +request_id ( BàA"g +DeleteSubnetRequest7 +name ( B)àAúA# +!edgenetwork.googleapis.com/Subnet + +request_id ( BàA"¤ +ListInterconnectsRequest? +parent ( B/àAúA)\'edgenetwork.googleapis.com/Interconnect + page_size ( + +page_token (  +filter (  +order_by ( "‹ +ListInterconnectsResponse@ + interconnects ( 2).google.cloud.edgenetwork.v1.Interconnect +next_page_token (  + unreachable ( "W +GetInterconnectRequest= +name ( B/àAúA) +\'edgenetwork.googleapis.com/Interconnect"¸ +"ListInterconnectAttachmentsRequestI +parent ( B9àAúA31edgenetwork.googleapis.com/InterconnectAttachment + page_size ( + +page_token (  +filter (  +order_by ( "ª +#ListInterconnectAttachmentsResponseU +interconnect_attachments ( 23.google.cloud.edgenetwork.v1.InterconnectAttachment +next_page_token (  + unreachable ( "k + GetInterconnectAttachmentRequestG +name ( B9àAúA3 +1edgenetwork.googleapis.com/InterconnectAttachment" +#CreateInterconnectAttachmentRequestI +parent ( B9àAúA31edgenetwork.googleapis.com/InterconnectAttachment\' +interconnect_attachment_id ( BàAY +interconnect_attachment ( 23.google.cloud.edgenetwork.v1.InterconnectAttachmentBàA + +request_id ( BàA"‡ +#DeleteInterconnectAttachmentRequestG +name ( B9àAúA3 +1edgenetwork.googleapis.com/InterconnectAttachment + +request_id ( BàA"˜ +ListRoutersRequest9 +parent ( B)àAúA#!edgenetwork.googleapis.com/Router + page_size ( + +page_token (  +filter (  +order_by ( "y +ListRoutersResponse4 +routers ( 2#.google.cloud.edgenetwork.v1.Router +next_page_token (  + unreachable ( "K +GetRouterRequest7 +name ( B)àAúA# +!edgenetwork.googleapis.com/Router"» +CreateRouterRequest9 +parent ( B)àAúA#!edgenetwork.googleapis.com/Router + router_id ( BàA8 +router ( 2#.google.cloud.edgenetwork.v1.RouterBàA + +request_id ( BàA"ž +UpdateRouterRequest4 + update_mask ( 2.google.protobuf.FieldMaskBàA8 +router ( 2#.google.cloud.edgenetwork.v1.RouterBàA + +request_id ( BàA"g +DeleteRouterRequest7 +name ( B)àAúA# +!edgenetwork.googleapis.com/Router + +request_id ( BàA"€ +OperationMetadata4 + create_time ( 2.google.protobuf.TimestampBàA1 +end_time ( 2.google.protobuf.TimestampBàA +target ( BàA +verb ( BàA +status_message ( BàA# +requested_cancellation (BàA + api_version ( BàA"R +DiagnoseNetworkRequest8 +name ( B*àAúA$ +"edgenetwork.googleapis.com/Network"ñ +DiagnoseNetworkResponse/ + update_time ( 2.google.protobuf.TimestampR +result ( 2B.google.cloud.edgenetwork.v1.DiagnoseNetworkResponse.NetworkStatusQ + NetworkStatus@ + subnet_status ( 2).google.cloud.edgenetwork.v1.SubnetStatus"\\ +DiagnoseInterconnectRequest= +name ( B/àAúA) +\'edgenetwork.googleapis.com/Interconnect"• +DiagnoseInterconnectResponse/ + update_time ( 2.google.protobuf.TimestampD +result ( 24.google.cloud.edgenetwork.v1.InterconnectDiagnostics"P +DiagnoseRouterRequest7 +name ( B)àAúA# +!edgenetwork.googleapis.com/Router"„ +DiagnoseRouterResponse/ + update_time ( 2.google.protobuf.Timestamp9 +result ( 2).google.cloud.edgenetwork.v1.RouterStatus"N +InitializeZoneRequest5 +name ( B\'àAúA! +edgenetwork.googleapis.com/Zone" +InitializeZoneResponse2£+ + EdgeNetworkÁ +InitializeZone2.google.cloud.edgenetwork.v1.InitializeZoneRequest3.google.cloud.edgenetwork.v1.InitializeZoneResponse"F‚Óä“9"4/v1/{name=projects/*/locations/*/zones/*}:initialize:*ÚAname¦ + ListZones-.google.cloud.edgenetwork.v1.ListZonesRequest..google.cloud.edgenetwork.v1.ListZonesResponse":‚Óä“+)/v1/{parent=projects/*/locations/*}/zonesÚAparent“ +GetZone+.google.cloud.edgenetwork.v1.GetZoneRequest!.google.cloud.edgenetwork.v1.Zone"8‚Óä“+)/v1/{name=projects/*/locations/*/zones/*}ÚAnameº + ListNetworks0.google.cloud.edgenetwork.v1.ListNetworksRequest1.google.cloud.edgenetwork.v1.ListNetworksResponse"E‚Óä“64/v1/{parent=projects/*/locations/*/zones/*}/networksÚAparent§ + +GetNetwork..google.cloud.edgenetwork.v1.GetNetworkRequest$.google.cloud.edgenetwork.v1.Network"C‚Óä“64/v1/{name=projects/*/locations/*/zones/*/networks/*}ÚAnameÊ +DiagnoseNetwork3.google.cloud.edgenetwork.v1.DiagnoseNetworkRequest4.google.cloud.edgenetwork.v1.DiagnoseNetworkResponse"L‚Óä“?=/v1/{name=projects/*/locations/*/zones/*/networks/*}:diagnoseÚAnameä + CreateNetwork1.google.cloud.edgenetwork.v1.CreateNetworkRequest.google.longrunning.Operation"€‚Óä“?"4/v1/{parent=projects/*/locations/*/zones/*}/networks:networkÚAparent,network,network_idÊA +NetworkOperationMetadataÓ + DeleteNetwork1.google.cloud.edgenetwork.v1.DeleteNetworkRequest.google.longrunning.Operation"p‚Óä“6*4/v1/{name=projects/*/locations/*/zones/*/networks/*}ÚAnameÊA* +google.protobuf.EmptyOperationMetadata¶ + ListSubnets/.google.cloud.edgenetwork.v1.ListSubnetsRequest0.google.cloud.edgenetwork.v1.ListSubnetsResponse"D‚Óä“53/v1/{parent=projects/*/locations/*/zones/*}/subnetsÚAparent£ + GetSubnet-.google.cloud.edgenetwork.v1.GetSubnetRequest#.google.cloud.edgenetwork.v1.Subnet"B‚Óä“53/v1/{name=projects/*/locations/*/zones/*/subnets/*}ÚAnameÜ + CreateSubnet0.google.cloud.edgenetwork.v1.CreateSubnetRequest.google.longrunning.Operation"{‚Óä“="3/v1/{parent=projects/*/locations/*/zones/*}/subnets:subnetÚAparent,subnet,subnet_idÊA +SubnetOperationMetadataÞ + UpdateSubnet0.google.cloud.edgenetwork.v1.UpdateSubnetRequest.google.longrunning.Operation"}‚Óä“D2:/v1/{subnet.name=projects/*/locations/*/zones/*/subnets/*}:subnetÚAsubnet,update_maskÊA +SubnetOperationMetadataÐ + DeleteSubnet0.google.cloud.edgenetwork.v1.DeleteSubnetRequest.google.longrunning.Operation"o‚Óä“5*3/v1/{name=projects/*/locations/*/zones/*/subnets/*}ÚAnameÊA* +google.protobuf.EmptyOperationMetadataÎ +ListInterconnects5.google.cloud.edgenetwork.v1.ListInterconnectsRequest6.google.cloud.edgenetwork.v1.ListInterconnectsResponse"J‚Óä“;9/v1/{parent=projects/*/locations/*/zones/*}/interconnectsÚAparent» +GetInterconnect3.google.cloud.edgenetwork.v1.GetInterconnectRequest).google.cloud.edgenetwork.v1.Interconnect"H‚Óä“;9/v1/{name=projects/*/locations/*/zones/*/interconnects/*}ÚAnameÞ +DiagnoseInterconnect8.google.cloud.edgenetwork.v1.DiagnoseInterconnectRequest9.google.cloud.edgenetwork.v1.DiagnoseInterconnectResponse"Q‚Óä“DB/v1/{name=projects/*/locations/*/zones/*/interconnects/*}:diagnoseÚAnameö +ListInterconnectAttachments?.google.cloud.edgenetwork.v1.ListInterconnectAttachmentsRequest@.google.cloud.edgenetwork.v1.ListInterconnectAttachmentsResponse"T‚Óä“EC/v1/{parent=projects/*/locations/*/zones/*}/interconnectAttachmentsÚAparentã +GetInterconnectAttachment=.google.cloud.edgenetwork.v1.GetInterconnectAttachmentRequest3.google.cloud.edgenetwork.v1.InterconnectAttachment"R‚Óä“EC/v1/{name=projects/*/locations/*/zones/*/interconnectAttachments/*}ÚAnameÐ +CreateInterconnectAttachment@.google.cloud.edgenetwork.v1.CreateInterconnectAttachmentRequest.google.longrunning.Operation"΂Óä“^"C/v1/{parent=projects/*/locations/*/zones/*}/interconnectAttachments:interconnect_attachmentÚA9parent,interconnect_attachment,interconnect_attachment_idÊA+ +InterconnectAttachmentOperationMetadata€ +DeleteInterconnectAttachment@.google.cloud.edgenetwork.v1.DeleteInterconnectAttachmentRequest.google.longrunning.Operation"‚Óä“E*C/v1/{name=projects/*/locations/*/zones/*/interconnectAttachments/*}ÚAnameÊA* +google.protobuf.EmptyOperationMetadata¶ + ListRouters/.google.cloud.edgenetwork.v1.ListRoutersRequest0.google.cloud.edgenetwork.v1.ListRoutersResponse"D‚Óä“53/v1/{parent=projects/*/locations/*/zones/*}/routersÚAparent£ + GetRouter-.google.cloud.edgenetwork.v1.GetRouterRequest#.google.cloud.edgenetwork.v1.Router"B‚Óä“53/v1/{name=projects/*/locations/*/zones/*/routers/*}ÚAnameÆ +DiagnoseRouter2.google.cloud.edgenetwork.v1.DiagnoseRouterRequest3.google.cloud.edgenetwork.v1.DiagnoseRouterResponse"K‚Óä“> + + + + tests/Unit + + + + + src + + src/V[!a-zA-Z]* + + + + diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/create_interconnect_attachment.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/create_interconnect_attachment.php new file mode 100644 index 000000000000..bee8bd6d347f --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/create_interconnect_attachment.php @@ -0,0 +1,118 @@ +setName($interconnectAttachmentName) + ->setInterconnect($formattedInterconnectAttachmentInterconnect) + ->setVlanId($interconnectAttachmentVlanId); + $request = (new CreateInterconnectAttachmentRequest()) + ->setParent($formattedParent) + ->setInterconnectAttachmentId($interconnectAttachmentId) + ->setInterconnectAttachment($interconnectAttachment); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $edgeNetworkClient->createInterconnectAttachment($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var InterconnectAttachment $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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $interconnectAttachmentId = '[INTERCONNECT_ATTACHMENT_ID]'; + $interconnectAttachmentName = '[NAME]'; + $formattedInterconnectAttachmentInterconnect = EdgeNetworkClient::interconnectName( + '[PROJECT]', + '[LOCATION]', + '[ZONE]', + '[INTERCONNECT]' + ); + $interconnectAttachmentVlanId = 0; + + create_interconnect_attachment_sample( + $formattedParent, + $interconnectAttachmentId, + $interconnectAttachmentName, + $formattedInterconnectAttachmentInterconnect, + $interconnectAttachmentVlanId + ); +} +// [END edgenetwork_v1_generated_EdgeNetwork_CreateInterconnectAttachment_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/create_network.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/create_network.php new file mode 100644 index 000000000000..5c6d224767fc --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/create_network.php @@ -0,0 +1,96 @@ +setName($networkName); + $request = (new CreateNetworkRequest()) + ->setParent($formattedParent) + ->setNetworkId($networkId) + ->setNetwork($network); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $edgeNetworkClient->createNetwork($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Network $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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $networkId = '[NETWORK_ID]'; + $networkName = '[NAME]'; + + create_network_sample($formattedParent, $networkId, $networkName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_CreateNetwork_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/create_router.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/create_router.php new file mode 100644 index 000000000000..897dd4b58319 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/create_router.php @@ -0,0 +1,108 @@ +setName($routerName) + ->setNetwork($formattedRouterNetwork); + $request = (new CreateRouterRequest()) + ->setParent($formattedParent) + ->setRouterId($routerId) + ->setRouter($router); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $edgeNetworkClient->createRouter($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Router $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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $routerId = '[ROUTER_ID]'; + $routerName = '[NAME]'; + $formattedRouterNetwork = EdgeNetworkClient::networkName( + '[PROJECT]', + '[LOCATION]', + '[ZONE]', + '[NETWORK]' + ); + + create_router_sample($formattedParent, $routerId, $routerName, $formattedRouterNetwork); +} +// [END edgenetwork_v1_generated_EdgeNetwork_CreateRouter_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/create_subnet.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/create_subnet.php new file mode 100644 index 000000000000..a5f94c0ee176 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/create_subnet.php @@ -0,0 +1,106 @@ +setName($subnetName) + ->setNetwork($formattedSubnetNetwork); + $request = (new CreateSubnetRequest()) + ->setParent($formattedParent) + ->setSubnetId($subnetId) + ->setSubnet($subnet); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $edgeNetworkClient->createSubnet($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Subnet $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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $subnetId = '[SUBNET_ID]'; + $subnetName = '[NAME]'; + $formattedSubnetNetwork = EdgeNetworkClient::networkName( + '[PROJECT]', + '[LOCATION]', + '[ZONE]', + '[NETWORK]' + ); + + create_subnet_sample($formattedParent, $subnetId, $subnetName, $formattedSubnetNetwork); +} +// [END edgenetwork_v1_generated_EdgeNetwork_CreateSubnet_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/delete_interconnect_attachment.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/delete_interconnect_attachment.php new file mode 100644 index 000000000000..da76dab20e3a --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/delete_interconnect_attachment.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $edgeNetworkClient->deleteInterconnectAttachment($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 = EdgeNetworkClient::interconnectAttachmentName( + '[PROJECT]', + '[LOCATION]', + '[ZONE]', + '[INTERCONNECT_ATTACHMENT]' + ); + + delete_interconnect_attachment_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_DeleteInterconnectAttachment_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/delete_network.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/delete_network.php new file mode 100644 index 000000000000..3de835729d41 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/delete_network.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $edgeNetworkClient->deleteNetwork($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 = EdgeNetworkClient::networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + + delete_network_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_DeleteNetwork_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/delete_router.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/delete_router.php new file mode 100644 index 000000000000..88819717e885 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/delete_router.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $edgeNetworkClient->deleteRouter($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 = EdgeNetworkClient::routerName('[PROJECT]', '[LOCATION]', '[ZONE]', '[ROUTER]'); + + delete_router_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_DeleteRouter_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/delete_subnet.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/delete_subnet.php new file mode 100644 index 000000000000..b657011cd0dc --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/delete_subnet.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $edgeNetworkClient->deleteSubnet($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 = EdgeNetworkClient::subnetName('[PROJECT]', '[LOCATION]', '[ZONE]', '[SUBNET]'); + + delete_subnet_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_DeleteSubnet_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/diagnose_interconnect.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/diagnose_interconnect.php new file mode 100644 index 000000000000..16bbda4e25ea --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/diagnose_interconnect.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var DiagnoseInterconnectResponse $response */ + $response = $edgeNetworkClient->diagnoseInterconnect($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 = EdgeNetworkClient::interconnectName( + '[PROJECT]', + '[LOCATION]', + '[ZONE]', + '[INTERCONNECT]' + ); + + diagnose_interconnect_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_DiagnoseInterconnect_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/diagnose_network.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/diagnose_network.php new file mode 100644 index 000000000000..853f9450349f --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/diagnose_network.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var DiagnoseNetworkResponse $response */ + $response = $edgeNetworkClient->diagnoseNetwork($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 = EdgeNetworkClient::networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + + diagnose_network_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_DiagnoseNetwork_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/diagnose_router.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/diagnose_router.php new file mode 100644 index 000000000000..ea17d8d0f8dd --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/diagnose_router.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var DiagnoseRouterResponse $response */ + $response = $edgeNetworkClient->diagnoseRouter($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 = EdgeNetworkClient::routerName('[PROJECT]', '[LOCATION]', '[ZONE]', '[ROUTER]'); + + diagnose_router_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_DiagnoseRouter_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/get_interconnect.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/get_interconnect.php new file mode 100644 index 000000000000..a684376c61b1 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/get_interconnect.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Interconnect $response */ + $response = $edgeNetworkClient->getInterconnect($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 = EdgeNetworkClient::interconnectName( + '[PROJECT]', + '[LOCATION]', + '[ZONE]', + '[INTERCONNECT]' + ); + + get_interconnect_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_GetInterconnect_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/get_interconnect_attachment.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/get_interconnect_attachment.php new file mode 100644 index 000000000000..c76465c3548e --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/get_interconnect_attachment.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var InterconnectAttachment $response */ + $response = $edgeNetworkClient->getInterconnectAttachment($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 = EdgeNetworkClient::interconnectAttachmentName( + '[PROJECT]', + '[LOCATION]', + '[ZONE]', + '[INTERCONNECT_ATTACHMENT]' + ); + + get_interconnect_attachment_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_GetInterconnectAttachment_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/get_location.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/get_location.php new file mode 100644 index 000000000000..2db991bfc6a1 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/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 edgenetwork_v1_generated_EdgeNetwork_GetLocation_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/get_network.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/get_network.php new file mode 100644 index 000000000000..ecbfb7823157 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/get_network.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Network $response */ + $response = $edgeNetworkClient->getNetwork($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 = EdgeNetworkClient::networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + + get_network_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_GetNetwork_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/get_router.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/get_router.php new file mode 100644 index 000000000000..b9516c3833e9 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/get_router.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Router $response */ + $response = $edgeNetworkClient->getRouter($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 = EdgeNetworkClient::routerName('[PROJECT]', '[LOCATION]', '[ZONE]', '[ROUTER]'); + + get_router_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_GetRouter_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/get_subnet.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/get_subnet.php new file mode 100644 index 000000000000..3fda9fe7619e --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/get_subnet.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Subnet $response */ + $response = $edgeNetworkClient->getSubnet($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 = EdgeNetworkClient::subnetName('[PROJECT]', '[LOCATION]', '[ZONE]', '[SUBNET]'); + + get_subnet_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_GetSubnet_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/get_zone.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/get_zone.php new file mode 100644 index 000000000000..748d1cda6e16 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/get_zone.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Zone $response */ + $response = $edgeNetworkClient->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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + + get_zone_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_GetZone_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/initialize_zone.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/initialize_zone.php new file mode 100644 index 000000000000..455b61840b3a --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/initialize_zone.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var InitializeZoneResponse $response */ + $response = $edgeNetworkClient->initializeZone($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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + + initialize_zone_sample($formattedName); +} +// [END edgenetwork_v1_generated_EdgeNetwork_InitializeZone_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/list_interconnect_attachments.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/list_interconnect_attachments.php new file mode 100644 index 000000000000..40a2c50c5804 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/list_interconnect_attachments.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $edgeNetworkClient->listInterconnectAttachments($request); + + /** @var InterconnectAttachment $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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + + list_interconnect_attachments_sample($formattedParent); +} +// [END edgenetwork_v1_generated_EdgeNetwork_ListInterconnectAttachments_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/list_interconnects.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/list_interconnects.php new file mode 100644 index 000000000000..012d1f8cd6ee --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/list_interconnects.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $edgeNetworkClient->listInterconnects($request); + + /** @var Interconnect $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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + + list_interconnects_sample($formattedParent); +} +// [END edgenetwork_v1_generated_EdgeNetwork_ListInterconnects_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/list_locations.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/list_locations.php new file mode 100644 index 000000000000..95e41c1e035c --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/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 edgenetwork_v1_generated_EdgeNetwork_ListLocations_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/list_networks.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/list_networks.php new file mode 100644 index 000000000000..b22115458634 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/list_networks.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $edgeNetworkClient->listNetworks($request); + + /** @var Network $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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + + list_networks_sample($formattedParent); +} +// [END edgenetwork_v1_generated_EdgeNetwork_ListNetworks_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/list_routers.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/list_routers.php new file mode 100644 index 000000000000..28f5e19af9b9 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/list_routers.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $edgeNetworkClient->listRouters($request); + + /** @var Router $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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + + list_routers_sample($formattedParent); +} +// [END edgenetwork_v1_generated_EdgeNetwork_ListRouters_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/list_subnets.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/list_subnets.php new file mode 100644 index 000000000000..92d250144d08 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/list_subnets.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $edgeNetworkClient->listSubnets($request); + + /** @var Subnet $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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + + list_subnets_sample($formattedParent); +} +// [END edgenetwork_v1_generated_EdgeNetwork_ListSubnets_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/list_zones.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/list_zones.php new file mode 100644 index 000000000000..4ee226cd9eca --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/list_zones.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $edgeNetworkClient->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 = EdgeNetworkClient::locationName('[PROJECT]', '[LOCATION]'); + + list_zones_sample($formattedParent); +} +// [END edgenetwork_v1_generated_EdgeNetwork_ListZones_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/update_router.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/update_router.php new file mode 100644 index 000000000000..ffc9e4432107 --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/update_router.php @@ -0,0 +1,98 @@ +setName($routerName) + ->setNetwork($formattedRouterNetwork); + $request = (new UpdateRouterRequest()) + ->setUpdateMask($updateMask) + ->setRouter($router); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $edgeNetworkClient->updateRouter($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Router $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 +{ + $routerName = '[NAME]'; + $formattedRouterNetwork = EdgeNetworkClient::networkName( + '[PROJECT]', + '[LOCATION]', + '[ZONE]', + '[NETWORK]' + ); + + update_router_sample($routerName, $formattedRouterNetwork); +} +// [END edgenetwork_v1_generated_EdgeNetwork_UpdateRouter_sync] diff --git a/EdgeNetwork/samples/V1/EdgeNetworkClient/update_subnet.php b/EdgeNetwork/samples/V1/EdgeNetworkClient/update_subnet.php new file mode 100644 index 000000000000..3390ccf38d1f --- /dev/null +++ b/EdgeNetwork/samples/V1/EdgeNetworkClient/update_subnet.php @@ -0,0 +1,96 @@ +setName($subnetName) + ->setNetwork($formattedSubnetNetwork); + $request = (new UpdateSubnetRequest()) + ->setUpdateMask($updateMask) + ->setSubnet($subnet); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $edgeNetworkClient->updateSubnet($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Subnet $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 +{ + $subnetName = '[NAME]'; + $formattedSubnetNetwork = EdgeNetworkClient::networkName( + '[PROJECT]', + '[LOCATION]', + '[ZONE]', + '[NETWORK]' + ); + + update_subnet_sample($subnetName, $formattedSubnetNetwork); +} +// [END edgenetwork_v1_generated_EdgeNetwork_UpdateSubnet_sync] diff --git a/EdgeNetwork/src/V1/Client/EdgeNetworkClient.php b/EdgeNetwork/src/V1/Client/EdgeNetworkClient.php new file mode 100644 index 000000000000..a454bbc3ad06 --- /dev/null +++ b/EdgeNetwork/src/V1/Client/EdgeNetworkClient.php @@ -0,0 +1,1173 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/edge_network_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/edge_network_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/edge_network_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/edge_network_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Formats a string containing the fully-qualified path to represent a interconnect + * resource. + * + * @param string $project + * @param string $location + * @param string $zone + * @param string $interconnect + * + * @return string The formatted interconnect resource. + */ + public static function interconnectName(string $project, string $location, string $zone, string $interconnect): string + { + return self::getPathTemplate('interconnect')->render([ + 'project' => $project, + 'location' => $location, + 'zone' => $zone, + 'interconnect' => $interconnect, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * interconnect_attachment resource. + * + * @param string $project + * @param string $location + * @param string $zone + * @param string $interconnectAttachment + * + * @return string The formatted interconnect_attachment resource. + */ + public static function interconnectAttachmentName(string $project, string $location, string $zone, string $interconnectAttachment): string + { + return self::getPathTemplate('interconnectAttachment')->render([ + 'project' => $project, + 'location' => $location, + 'zone' => $zone, + 'interconnect_attachment' => $interconnectAttachment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a network + * resource. + * + * @param string $project + * @param string $location + * @param string $zone + * @param string $network + * + * @return string The formatted network resource. + */ + public static function networkName(string $project, string $location, string $zone, string $network): string + { + return self::getPathTemplate('network')->render([ + 'project' => $project, + 'location' => $location, + 'zone' => $zone, + 'network' => $network, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a router + * resource. + * + * @param string $project + * @param string $location + * @param string $zone + * @param string $router + * + * @return string The formatted router resource. + */ + public static function routerName(string $project, string $location, string $zone, string $router): string + { + return self::getPathTemplate('router')->render([ + 'project' => $project, + 'location' => $location, + 'zone' => $zone, + 'router' => $router, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a subnet + * resource. + * + * @param string $project + * @param string $location + * @param string $zone + * @param string $subnet + * + * @return string The formatted subnet resource. + */ + public static function subnetName(string $project, string $location, string $zone, string $subnet): string + { + return self::getPathTemplate('subnet')->render([ + 'project' => $project, + 'location' => $location, + 'zone' => $zone, + 'subnet' => $subnet, + ]); + } + + /** + * 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. + */ + 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 + * - interconnect: projects/{project}/locations/{location}/zones/{zone}/interconnects/{interconnect} + * - interconnectAttachment: projects/{project}/locations/{location}/zones/{zone}/interconnectAttachments/{interconnect_attachment} + * - location: projects/{project}/locations/{location} + * - network: projects/{project}/locations/{location}/zones/{zone}/networks/{network} + * - router: projects/{project}/locations/{location}/zones/{zone}/routers/{router} + * - subnet: projects/{project}/locations/{location}/zones/{zone}/subnets/{subnet} + * - 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. + */ + 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 'edgenetwork.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new InterconnectAttachment in a given project and location. + * + * The async variant is + * {@see EdgeNetworkClient::createInterconnectAttachmentAsync()} . + * + * @example samples/V1/EdgeNetworkClient/create_interconnect_attachment.php + * + * @param CreateInterconnectAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createInterconnectAttachment(CreateInterconnectAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateInterconnectAttachment', $request, $callOptions)->wait(); + } + + /** + * Creates a new Network in a given project and location. + * + * The async variant is {@see EdgeNetworkClient::createNetworkAsync()} . + * + * @example samples/V1/EdgeNetworkClient/create_network.php + * + * @param CreateNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createNetwork(CreateNetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateNetwork', $request, $callOptions)->wait(); + } + + /** + * Creates a new Router in a given project and location. + * + * The async variant is {@see EdgeNetworkClient::createRouterAsync()} . + * + * @example samples/V1/EdgeNetworkClient/create_router.php + * + * @param CreateRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createRouter(CreateRouterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateRouter', $request, $callOptions)->wait(); + } + + /** + * Creates a new Subnet in a given project and location. + * + * The async variant is {@see EdgeNetworkClient::createSubnetAsync()} . + * + * @example samples/V1/EdgeNetworkClient/create_subnet.php + * + * @param CreateSubnetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSubnet(CreateSubnetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateSubnet', $request, $callOptions)->wait(); + } + + /** + * Deletes a single InterconnectAttachment. + * + * The async variant is + * {@see EdgeNetworkClient::deleteInterconnectAttachmentAsync()} . + * + * @example samples/V1/EdgeNetworkClient/delete_interconnect_attachment.php + * + * @param DeleteInterconnectAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteInterconnectAttachment(DeleteInterconnectAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteInterconnectAttachment', $request, $callOptions)->wait(); + } + + /** + * Deletes a single Network. + * + * The async variant is {@see EdgeNetworkClient::deleteNetworkAsync()} . + * + * @example samples/V1/EdgeNetworkClient/delete_network.php + * + * @param DeleteNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteNetwork(DeleteNetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteNetwork', $request, $callOptions)->wait(); + } + + /** + * Deletes a single Router. + * + * The async variant is {@see EdgeNetworkClient::deleteRouterAsync()} . + * + * @example samples/V1/EdgeNetworkClient/delete_router.php + * + * @param DeleteRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteRouter(DeleteRouterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteRouter', $request, $callOptions)->wait(); + } + + /** + * Deletes a single Subnet. + * + * The async variant is {@see EdgeNetworkClient::deleteSubnetAsync()} . + * + * @example samples/V1/EdgeNetworkClient/delete_subnet.php + * + * @param DeleteSubnetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSubnet(DeleteSubnetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteSubnet', $request, $callOptions)->wait(); + } + + /** + * Get the diagnostics of a single interconnect resource. + * + * The async variant is {@see EdgeNetworkClient::diagnoseInterconnectAsync()} . + * + * @example samples/V1/EdgeNetworkClient/diagnose_interconnect.php + * + * @param DiagnoseInterconnectRequest $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 DiagnoseInterconnectResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function diagnoseInterconnect(DiagnoseInterconnectRequest $request, array $callOptions = []): DiagnoseInterconnectResponse + { + return $this->startApiCall('DiagnoseInterconnect', $request, $callOptions)->wait(); + } + + /** + * Get the diagnostics of a single network resource. + * + * The async variant is {@see EdgeNetworkClient::diagnoseNetworkAsync()} . + * + * @example samples/V1/EdgeNetworkClient/diagnose_network.php + * + * @param DiagnoseNetworkRequest $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 DiagnoseNetworkResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function diagnoseNetwork(DiagnoseNetworkRequest $request, array $callOptions = []): DiagnoseNetworkResponse + { + return $this->startApiCall('DiagnoseNetwork', $request, $callOptions)->wait(); + } + + /** + * Get the diagnostics of a single router resource. + * + * The async variant is {@see EdgeNetworkClient::diagnoseRouterAsync()} . + * + * @example samples/V1/EdgeNetworkClient/diagnose_router.php + * + * @param DiagnoseRouterRequest $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 DiagnoseRouterResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function diagnoseRouter(DiagnoseRouterRequest $request, array $callOptions = []): DiagnoseRouterResponse + { + return $this->startApiCall('DiagnoseRouter', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single Interconnect. + * + * The async variant is {@see EdgeNetworkClient::getInterconnectAsync()} . + * + * @example samples/V1/EdgeNetworkClient/get_interconnect.php + * + * @param GetInterconnectRequest $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 Interconnect + * + * @throws ApiException Thrown if the API call fails. + */ + public function getInterconnect(GetInterconnectRequest $request, array $callOptions = []): Interconnect + { + return $this->startApiCall('GetInterconnect', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single InterconnectAttachment. + * + * The async variant is {@see EdgeNetworkClient::getInterconnectAttachmentAsync()} + * . + * + * @example samples/V1/EdgeNetworkClient/get_interconnect_attachment.php + * + * @param GetInterconnectAttachmentRequest $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 InterconnectAttachment + * + * @throws ApiException Thrown if the API call fails. + */ + public function getInterconnectAttachment(GetInterconnectAttachmentRequest $request, array $callOptions = []): InterconnectAttachment + { + return $this->startApiCall('GetInterconnectAttachment', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single Network. + * + * The async variant is {@see EdgeNetworkClient::getNetworkAsync()} . + * + * @example samples/V1/EdgeNetworkClient/get_network.php + * + * @param GetNetworkRequest $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 Network + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNetwork(GetNetworkRequest $request, array $callOptions = []): Network + { + return $this->startApiCall('GetNetwork', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single Router. + * + * The async variant is {@see EdgeNetworkClient::getRouterAsync()} . + * + * @example samples/V1/EdgeNetworkClient/get_router.php + * + * @param GetRouterRequest $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 Router + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRouter(GetRouterRequest $request, array $callOptions = []): Router + { + return $this->startApiCall('GetRouter', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single Subnet. + * + * The async variant is {@see EdgeNetworkClient::getSubnetAsync()} . + * + * @example samples/V1/EdgeNetworkClient/get_subnet.php + * + * @param GetSubnetRequest $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 Subnet + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSubnet(GetSubnetRequest $request, array $callOptions = []): Subnet + { + return $this->startApiCall('GetSubnet', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single Zone. + * + * The async variant is {@see EdgeNetworkClient::getZoneAsync()} . + * + * @example samples/V1/EdgeNetworkClient/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. + */ + public function getZone(GetZoneRequest $request, array $callOptions = []): Zone + { + return $this->startApiCall('GetZone', $request, $callOptions)->wait(); + } + + /** + * InitializeZone will initialize resources for a zone in a project. + * + * The async variant is {@see EdgeNetworkClient::initializeZoneAsync()} . + * + * @example samples/V1/EdgeNetworkClient/initialize_zone.php + * + * @param InitializeZoneRequest $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 InitializeZoneResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function initializeZone(InitializeZoneRequest $request, array $callOptions = []): InitializeZoneResponse + { + return $this->startApiCall('InitializeZone', $request, $callOptions)->wait(); + } + + /** + * Lists InterconnectAttachments in a given project and location. + * + * The async variant is + * {@see EdgeNetworkClient::listInterconnectAttachmentsAsync()} . + * + * @example samples/V1/EdgeNetworkClient/list_interconnect_attachments.php + * + * @param ListInterconnectAttachmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listInterconnectAttachments(ListInterconnectAttachmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListInterconnectAttachments', $request, $callOptions); + } + + /** + * Lists Interconnects in a given project and location. + * + * The async variant is {@see EdgeNetworkClient::listInterconnectsAsync()} . + * + * @example samples/V1/EdgeNetworkClient/list_interconnects.php + * + * @param ListInterconnectsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listInterconnects(ListInterconnectsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListInterconnects', $request, $callOptions); + } + + /** + * Lists Networks in a given project and location. + * + * The async variant is {@see EdgeNetworkClient::listNetworksAsync()} . + * + * @example samples/V1/EdgeNetworkClient/list_networks.php + * + * @param ListNetworksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNetworks(ListNetworksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListNetworks', $request, $callOptions); + } + + /** + * Lists Routers in a given project and location. + * + * The async variant is {@see EdgeNetworkClient::listRoutersAsync()} . + * + * @example samples/V1/EdgeNetworkClient/list_routers.php + * + * @param ListRoutersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listRouters(ListRoutersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListRouters', $request, $callOptions); + } + + /** + * Lists Subnets in a given project and location. + * + * The async variant is {@see EdgeNetworkClient::listSubnetsAsync()} . + * + * @example samples/V1/EdgeNetworkClient/list_subnets.php + * + * @param ListSubnetsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listSubnets(ListSubnetsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSubnets', $request, $callOptions); + } + + /** + * Lists Zones in a given project and location. + * + * The async variant is {@see EdgeNetworkClient::listZonesAsync()} . + * + * @example samples/V1/EdgeNetworkClient/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. + */ + public function listZones(ListZonesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListZones', $request, $callOptions); + } + + /** + * Updates the parameters of a single Router. + * + * The async variant is {@see EdgeNetworkClient::updateRouterAsync()} . + * + * @example samples/V1/EdgeNetworkClient/update_router.php + * + * @param UpdateRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateRouter(UpdateRouterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateRouter', $request, $callOptions)->wait(); + } + + /** + * Updates the parameters of a single Subnet. + * + * The async variant is {@see EdgeNetworkClient::updateSubnetAsync()} . + * + * @example samples/V1/EdgeNetworkClient/update_subnet.php + * + * @param UpdateSubnetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateSubnet(UpdateSubnetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateSubnet', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see EdgeNetworkClient::getLocationAsync()} . + * + * @example samples/V1/EdgeNetworkClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see EdgeNetworkClient::listLocationsAsync()} . + * + * @example samples/V1/EdgeNetworkClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/EdgeNetwork/src/V1/CreateInterconnectAttachmentRequest.php b/EdgeNetwork/src/V1/CreateInterconnectAttachmentRequest.php new file mode 100644 index 000000000000..1264f1153224 --- /dev/null +++ b/EdgeNetwork/src/V1/CreateInterconnectAttachmentRequest.php @@ -0,0 +1,247 @@ +google.cloud.edgenetwork.v1.CreateInterconnectAttachmentRequest + */ +class CreateInterconnectAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * interconnect_attachment_id from the method_signature of Create RPC + * + * Generated from protobuf field string interconnect_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect_attachment_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectAttachment interconnect_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect_attachment = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see EdgeNetworkClient::zoneName()} for help formatting this field. + * @param \Google\Cloud\EdgeNetwork\V1\InterconnectAttachment $interconnectAttachment Required. The resource being created + * @param string $interconnectAttachmentId Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * interconnect_attachment_id from the method_signature of Create RPC + * + * @return \Google\Cloud\EdgeNetwork\V1\CreateInterconnectAttachmentRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\EdgeNetwork\V1\InterconnectAttachment $interconnectAttachment, string $interconnectAttachmentId): self + { + return (new self()) + ->setParent($parent) + ->setInterconnectAttachment($interconnectAttachment) + ->setInterconnectAttachmentId($interconnectAttachmentId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $interconnect_attachment_id + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * interconnect_attachment_id from the method_signature of Create RPC + * @type \Google\Cloud\EdgeNetwork\V1\InterconnectAttachment $interconnect_attachment + * Required. The resource being created + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * 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. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * interconnect_attachment_id from the method_signature of Create RPC + * + * Generated from protobuf field string interconnect_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInterconnectAttachmentId() + { + return $this->interconnect_attachment_id; + } + + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * interconnect_attachment_id from the method_signature of Create RPC + * + * Generated from protobuf field string interconnect_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInterconnectAttachmentId($var) + { + GPBUtil::checkString($var, True); + $this->interconnect_attachment_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectAttachment interconnect_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\EdgeNetwork\V1\InterconnectAttachment|null + */ + public function getInterconnectAttachment() + { + return $this->interconnect_attachment; + } + + public function hasInterconnectAttachment() + { + return isset($this->interconnect_attachment); + } + + public function clearInterconnectAttachment() + { + unset($this->interconnect_attachment); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectAttachment interconnect_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\EdgeNetwork\V1\InterconnectAttachment $var + * @return $this + */ + public function setInterconnectAttachment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\InterconnectAttachment::class); + $this->interconnect_attachment = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/CreateNetworkRequest.php b/EdgeNetwork/src/V1/CreateNetworkRequest.php new file mode 100644 index 000000000000..f6a3d7b68b95 --- /dev/null +++ b/EdgeNetwork/src/V1/CreateNetworkRequest.php @@ -0,0 +1,247 @@ +google.cloud.edgenetwork.v1.CreateNetworkRequest + */ +class CreateNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * network_id from the method_signature of Create RPC + * + * Generated from protobuf field string network_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Network network = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see EdgeNetworkClient::zoneName()} for help formatting this field. + * @param \Google\Cloud\EdgeNetwork\V1\Network $network Required. The resource being created + * @param string $networkId Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * network_id from the method_signature of Create RPC + * + * @return \Google\Cloud\EdgeNetwork\V1\CreateNetworkRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\EdgeNetwork\V1\Network $network, string $networkId): self + { + return (new self()) + ->setParent($parent) + ->setNetwork($network) + ->setNetworkId($networkId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $network_id + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * network_id from the method_signature of Create RPC + * @type \Google\Cloud\EdgeNetwork\V1\Network $network + * Required. The resource being created + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * 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. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * network_id from the method_signature of Create RPC + * + * Generated from protobuf field string network_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkId() + { + return $this->network_id; + } + + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * network_id from the method_signature of Create RPC + * + * Generated from protobuf field string network_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkId($var) + { + GPBUtil::checkString($var, True); + $this->network_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Network network = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\EdgeNetwork\V1\Network|null + */ + public function getNetwork() + { + return $this->network; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Network network = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\EdgeNetwork\V1\Network $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\Network::class); + $this->network = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/CreateRouterRequest.php b/EdgeNetwork/src/V1/CreateRouterRequest.php new file mode 100644 index 000000000000..4bbaaa3346e6 --- /dev/null +++ b/EdgeNetwork/src/V1/CreateRouterRequest.php @@ -0,0 +1,247 @@ +google.cloud.edgenetwork.v1.CreateRouterRequest + */ +class CreateRouterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * router_id from the method_signature of Create RPC + * + * Generated from protobuf field string router_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Router router = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see EdgeNetworkClient::zoneName()} for help formatting this field. + * @param \Google\Cloud\EdgeNetwork\V1\Router $router Required. The resource being created + * @param string $routerId Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * router_id from the method_signature of Create RPC + * + * @return \Google\Cloud\EdgeNetwork\V1\CreateRouterRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\EdgeNetwork\V1\Router $router, string $routerId): self + { + return (new self()) + ->setParent($parent) + ->setRouter($router) + ->setRouterId($routerId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $router_id + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * router_id from the method_signature of Create RPC + * @type \Google\Cloud\EdgeNetwork\V1\Router $router + * Required. The resource being created + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * 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. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * router_id from the method_signature of Create RPC + * + * Generated from protobuf field string router_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRouterId() + { + return $this->router_id; + } + + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * router_id from the method_signature of Create RPC + * + * Generated from protobuf field string router_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRouterId($var) + { + GPBUtil::checkString($var, True); + $this->router_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Router router = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\EdgeNetwork\V1\Router|null + */ + public function getRouter() + { + return $this->router; + } + + public function hasRouter() + { + return isset($this->router); + } + + public function clearRouter() + { + unset($this->router); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Router router = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\EdgeNetwork\V1\Router $var + * @return $this + */ + public function setRouter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\Router::class); + $this->router = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/CreateSubnetRequest.php b/EdgeNetwork/src/V1/CreateSubnetRequest.php new file mode 100644 index 000000000000..66558a9ba58f --- /dev/null +++ b/EdgeNetwork/src/V1/CreateSubnetRequest.php @@ -0,0 +1,247 @@ +google.cloud.edgenetwork.v1.CreateSubnetRequest + */ +class CreateSubnetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * subnet_id from the method_signature of Create RPC + * + * Generated from protobuf field string subnet_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subnet_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Subnet subnet = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subnet = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see EdgeNetworkClient::zoneName()} for help formatting this field. + * @param \Google\Cloud\EdgeNetwork\V1\Subnet $subnet Required. The resource being created + * @param string $subnetId Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * subnet_id from the method_signature of Create RPC + * + * @return \Google\Cloud\EdgeNetwork\V1\CreateSubnetRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\EdgeNetwork\V1\Subnet $subnet, string $subnetId): self + { + return (new self()) + ->setParent($parent) + ->setSubnet($subnet) + ->setSubnetId($subnetId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $subnet_id + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * subnet_id from the method_signature of Create RPC + * @type \Google\Cloud\EdgeNetwork\V1\Subnet $subnet + * Required. The resource being created + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * 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. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * subnet_id from the method_signature of Create RPC + * + * Generated from protobuf field string subnet_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSubnetId() + { + return $this->subnet_id; + } + + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * subnet_id from the method_signature of Create RPC + * + * Generated from protobuf field string subnet_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSubnetId($var) + { + GPBUtil::checkString($var, True); + $this->subnet_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Subnet subnet = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\EdgeNetwork\V1\Subnet|null + */ + public function getSubnet() + { + return $this->subnet; + } + + public function hasSubnet() + { + return isset($this->subnet); + } + + public function clearSubnet() + { + unset($this->subnet); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Subnet subnet = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\EdgeNetwork\V1\Subnet $var + * @return $this + */ + public function setSubnet($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\Subnet::class); + $this->subnet = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/DeleteInterconnectAttachmentRequest.php b/EdgeNetwork/src/V1/DeleteInterconnectAttachmentRequest.php new file mode 100644 index 000000000000..4bceb13d9f0b --- /dev/null +++ b/EdgeNetwork/src/V1/DeleteInterconnectAttachmentRequest.php @@ -0,0 +1,155 @@ +google.cloud.edgenetwork.v1.DeleteInterconnectAttachmentRequest + */ +class DeleteInterconnectAttachmentRequest 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 = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see EdgeNetworkClient::interconnectAttachmentName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\DeleteInterconnectAttachmentRequest + * + * @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 + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/DeleteNetworkRequest.php b/EdgeNetwork/src/V1/DeleteNetworkRequest.php new file mode 100644 index 000000000000..baca7343c01d --- /dev/null +++ b/EdgeNetwork/src/V1/DeleteNetworkRequest.php @@ -0,0 +1,155 @@ +google.cloud.edgenetwork.v1.DeleteNetworkRequest + */ +class DeleteNetworkRequest 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 = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see EdgeNetworkClient::networkName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\DeleteNetworkRequest + * + * @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 + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/DeleteRouterRequest.php b/EdgeNetwork/src/V1/DeleteRouterRequest.php new file mode 100644 index 000000000000..6ce2a9abce39 --- /dev/null +++ b/EdgeNetwork/src/V1/DeleteRouterRequest.php @@ -0,0 +1,155 @@ +google.cloud.edgenetwork.v1.DeleteRouterRequest + */ +class DeleteRouterRequest 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 = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see EdgeNetworkClient::routerName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\DeleteRouterRequest + * + * @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 + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/DeleteSubnetRequest.php b/EdgeNetwork/src/V1/DeleteSubnetRequest.php new file mode 100644 index 000000000000..74e05066fb86 --- /dev/null +++ b/EdgeNetwork/src/V1/DeleteSubnetRequest.php @@ -0,0 +1,155 @@ +google.cloud.edgenetwork.v1.DeleteSubnetRequest + */ +class DeleteSubnetRequest 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 = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see EdgeNetworkClient::subnetName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\DeleteSubnetRequest + * + * @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 + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\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; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/DiagnoseInterconnectRequest.php b/EdgeNetwork/src/V1/DiagnoseInterconnectRequest.php new file mode 100644 index 000000000000..4b54776b9332 --- /dev/null +++ b/EdgeNetwork/src/V1/DiagnoseInterconnectRequest.php @@ -0,0 +1,82 @@ +google.cloud.edgenetwork.v1.DiagnoseInterconnectRequest + */ +class DiagnoseInterconnectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the interconnect resource. + * + * 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 interconnect resource. Please see + * {@see EdgeNetworkClient::interconnectName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\DiagnoseInterconnectRequest + * + * @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 interconnect resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the interconnect 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. The name of the interconnect 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/EdgeNetwork/src/V1/DiagnoseInterconnectResponse.php b/EdgeNetwork/src/V1/DiagnoseInterconnectResponse.php new file mode 100644 index 000000000000..0d8c929ede38 --- /dev/null +++ b/EdgeNetwork/src/V1/DiagnoseInterconnectResponse.php @@ -0,0 +1,122 @@ +google.cloud.edgenetwork.v1.DiagnoseInterconnectResponse + */ +class DiagnoseInterconnectResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The time when the interconnect diagnostics was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; + */ + protected $update_time = null; + /** + * The network status of a specific interconnect. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectDiagnostics result = 2; + */ + protected $result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $update_time + * The time when the interconnect diagnostics was last updated. + * @type \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics $result + * The network status of a specific interconnect. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The time when the interconnect diagnostics was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; + * @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); + } + + /** + * The time when the interconnect diagnostics was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * The network status of a specific interconnect. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectDiagnostics result = 2; + * @return \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics|null + */ + public function getResult() + { + return $this->result; + } + + public function hasResult() + { + return isset($this->result); + } + + public function clearResult() + { + unset($this->result); + } + + /** + * The network status of a specific interconnect. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectDiagnostics result = 2; + * @param \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics::class); + $this->result = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/DiagnoseNetworkRequest.php b/EdgeNetwork/src/V1/DiagnoseNetworkRequest.php new file mode 100644 index 000000000000..51fde143de64 --- /dev/null +++ b/EdgeNetwork/src/V1/DiagnoseNetworkRequest.php @@ -0,0 +1,81 @@ +google.cloud.edgenetwork.v1.DiagnoseNetworkRequest + */ +class DiagnoseNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the network resource. + * + * 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 network resource. Please see + * {@see EdgeNetworkClient::networkName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\DiagnoseNetworkRequest + * + * @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 network resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the network 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. The name of the network 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/EdgeNetwork/src/V1/DiagnoseNetworkResponse.php b/EdgeNetwork/src/V1/DiagnoseNetworkResponse.php new file mode 100644 index 000000000000..8b8bf18fd4d8 --- /dev/null +++ b/EdgeNetwork/src/V1/DiagnoseNetworkResponse.php @@ -0,0 +1,121 @@ +google.cloud.edgenetwork.v1.DiagnoseNetworkResponse + */ +class DiagnoseNetworkResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The time when the network status was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; + */ + protected $update_time = null; + /** + * The network status of a specific network. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.DiagnoseNetworkResponse.NetworkStatus result = 2; + */ + protected $result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $update_time + * The time when the network status was last updated. + * @type \Google\Cloud\EdgeNetwork\V1\DiagnoseNetworkResponse\NetworkStatus $result + * The network status of a specific network. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The time when the network status was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; + * @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); + } + + /** + * The time when the network status was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * The network status of a specific network. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.DiagnoseNetworkResponse.NetworkStatus result = 2; + * @return \Google\Cloud\EdgeNetwork\V1\DiagnoseNetworkResponse\NetworkStatus|null + */ + public function getResult() + { + return $this->result; + } + + public function hasResult() + { + return isset($this->result); + } + + public function clearResult() + { + unset($this->result); + } + + /** + * The network status of a specific network. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.DiagnoseNetworkResponse.NetworkStatus result = 2; + * @param \Google\Cloud\EdgeNetwork\V1\DiagnoseNetworkResponse\NetworkStatus $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\DiagnoseNetworkResponse\NetworkStatus::class); + $this->result = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/DiagnoseNetworkResponse/NetworkStatus.php b/EdgeNetwork/src/V1/DiagnoseNetworkResponse/NetworkStatus.php new file mode 100644 index 000000000000..f19340940a41 --- /dev/null +++ b/EdgeNetwork/src/V1/DiagnoseNetworkResponse/NetworkStatus.php @@ -0,0 +1,69 @@ +google.cloud.edgenetwork.v1.DiagnoseNetworkResponse.NetworkStatus + */ +class NetworkStatus extends \Google\Protobuf\Internal\Message +{ + /** + * A list of status for the subnets under the current network. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.SubnetStatus subnet_status = 1; + */ + private $subnet_status; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\EdgeNetwork\V1\SubnetStatus>|\Google\Protobuf\Internal\RepeatedField $subnet_status + * A list of status for the subnets under the current network. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * A list of status for the subnets under the current network. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.SubnetStatus subnet_status = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubnetStatus() + { + return $this->subnet_status; + } + + /** + * A list of status for the subnets under the current network. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.SubnetStatus subnet_status = 1; + * @param array<\Google\Cloud\EdgeNetwork\V1\SubnetStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubnetStatus($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\SubnetStatus::class); + $this->subnet_status = $arr; + + return $this; + } + +} + + diff --git a/EdgeNetwork/src/V1/DiagnoseRouterRequest.php b/EdgeNetwork/src/V1/DiagnoseRouterRequest.php new file mode 100644 index 000000000000..bb19420ef91e --- /dev/null +++ b/EdgeNetwork/src/V1/DiagnoseRouterRequest.php @@ -0,0 +1,81 @@ +google.cloud.edgenetwork.v1.DiagnoseRouterRequest + */ +class DiagnoseRouterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the router resource. + * + * 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 router resource. Please see + * {@see EdgeNetworkClient::routerName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\DiagnoseRouterRequest + * + * @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 router resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the router 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. The name of the router 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/EdgeNetwork/src/V1/DiagnoseRouterResponse.php b/EdgeNetwork/src/V1/DiagnoseRouterResponse.php new file mode 100644 index 000000000000..833f8a2f0cf3 --- /dev/null +++ b/EdgeNetwork/src/V1/DiagnoseRouterResponse.php @@ -0,0 +1,121 @@ +google.cloud.edgenetwork.v1.DiagnoseRouterResponse + */ +class DiagnoseRouterResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The time when the router status was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; + */ + protected $update_time = null; + /** + * The network status of a specific router. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.RouterStatus result = 2; + */ + protected $result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $update_time + * The time when the router status was last updated. + * @type \Google\Cloud\EdgeNetwork\V1\RouterStatus $result + * The network status of a specific router. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The time when the router status was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; + * @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); + } + + /** + * The time when the router status was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * The network status of a specific router. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.RouterStatus result = 2; + * @return \Google\Cloud\EdgeNetwork\V1\RouterStatus|null + */ + public function getResult() + { + return $this->result; + } + + public function hasResult() + { + return isset($this->result); + } + + public function clearResult() + { + unset($this->result); + } + + /** + * The network status of a specific router. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.RouterStatus result = 2; + * @param \Google\Cloud\EdgeNetwork\V1\RouterStatus $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\RouterStatus::class); + $this->result = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/GetInterconnectAttachmentRequest.php b/EdgeNetwork/src/V1/GetInterconnectAttachmentRequest.php new file mode 100644 index 000000000000..86fe850adc6b --- /dev/null +++ b/EdgeNetwork/src/V1/GetInterconnectAttachmentRequest.php @@ -0,0 +1,81 @@ +google.cloud.edgenetwork.v1.GetInterconnectAttachmentRequest + */ +class GetInterconnectAttachmentRequest 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 EdgeNetworkClient::interconnectAttachmentName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\GetInterconnectAttachmentRequest + * + * @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\Edgenetwork\V1\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/EdgeNetwork/src/V1/GetInterconnectRequest.php b/EdgeNetwork/src/V1/GetInterconnectRequest.php new file mode 100644 index 000000000000..e4bec26ad53e --- /dev/null +++ b/EdgeNetwork/src/V1/GetInterconnectRequest.php @@ -0,0 +1,81 @@ +google.cloud.edgenetwork.v1.GetInterconnectRequest + */ +class GetInterconnectRequest 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 EdgeNetworkClient::interconnectName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\GetInterconnectRequest + * + * @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\Edgenetwork\V1\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/EdgeNetwork/src/V1/GetNetworkRequest.php b/EdgeNetwork/src/V1/GetNetworkRequest.php new file mode 100644 index 000000000000..866b8997d290 --- /dev/null +++ b/EdgeNetwork/src/V1/GetNetworkRequest.php @@ -0,0 +1,81 @@ +google.cloud.edgenetwork.v1.GetNetworkRequest + */ +class GetNetworkRequest 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 EdgeNetworkClient::networkName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\GetNetworkRequest + * + * @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\Edgenetwork\V1\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/EdgeNetwork/src/V1/GetRouterRequest.php b/EdgeNetwork/src/V1/GetRouterRequest.php new file mode 100644 index 000000000000..97c99a0439f4 --- /dev/null +++ b/EdgeNetwork/src/V1/GetRouterRequest.php @@ -0,0 +1,81 @@ +google.cloud.edgenetwork.v1.GetRouterRequest + */ +class GetRouterRequest 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 EdgeNetworkClient::routerName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\GetRouterRequest + * + * @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\Edgenetwork\V1\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/EdgeNetwork/src/V1/GetSubnetRequest.php b/EdgeNetwork/src/V1/GetSubnetRequest.php new file mode 100644 index 000000000000..35b6a9200013 --- /dev/null +++ b/EdgeNetwork/src/V1/GetSubnetRequest.php @@ -0,0 +1,81 @@ +google.cloud.edgenetwork.v1.GetSubnetRequest + */ +class GetSubnetRequest 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 EdgeNetworkClient::subnetName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\GetSubnetRequest + * + * @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\Edgenetwork\V1\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/EdgeNetwork/src/V1/GetZoneRequest.php b/EdgeNetwork/src/V1/GetZoneRequest.php new file mode 100644 index 000000000000..98b10469b904 --- /dev/null +++ b/EdgeNetwork/src/V1/GetZoneRequest.php @@ -0,0 +1,81 @@ +google.cloud.edgenetwork.v1.GetZoneRequest + */ +class GetZoneRequest 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 EdgeNetworkClient::zoneName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\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. Name of the resource + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\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/EdgeNetwork/src/V1/InitializeZoneRequest.php b/EdgeNetwork/src/V1/InitializeZoneRequest.php new file mode 100644 index 000000000000..ecccd767dca9 --- /dev/null +++ b/EdgeNetwork/src/V1/InitializeZoneRequest.php @@ -0,0 +1,81 @@ +google.cloud.edgenetwork.v1.InitializeZoneRequest + */ +class InitializeZoneRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the zone resource. + * + * 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 resource. Please see + * {@see EdgeNetworkClient::zoneName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\InitializeZoneRequest + * + * @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 resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the zone 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. The name of the zone 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/EdgeNetwork/src/V1/InitializeZoneResponse.php b/EdgeNetwork/src/V1/InitializeZoneResponse.php new file mode 100644 index 000000000000..2268e8824ebc --- /dev/null +++ b/EdgeNetwork/src/V1/InitializeZoneResponse.php @@ -0,0 +1,33 @@ +google.cloud.edgenetwork.v1.InitializeZoneResponse + */ +class InitializeZoneResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + +} + diff --git a/EdgeNetwork/src/V1/Interconnect.php b/EdgeNetwork/src/V1/Interconnect.php new file mode 100644 index 000000000000..3f31f9ae700b --- /dev/null +++ b/EdgeNetwork/src/V1/Interconnect.php @@ -0,0 +1,371 @@ +google.cloud.edgenetwork.v1.Interconnect + */ +class Interconnect extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The canonical resource name of the interconnect. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. The time when the subnet was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the subnet was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + */ + private $labels; + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Type of interconnect, which takes only the value 'DEDICATED' for + * now. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Interconnect.InterconnectType interconnect_type = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $interconnect_type = 0; + /** + * Output only. Unique identifier for the link. + * + * Generated from protobuf field string uuid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uuid = ''; + /** + * Output only. Cloud resource name of the switch device. + * + * Generated from protobuf field string device_cloud_resource_name = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $device_cloud_resource_name = ''; + /** + * Output only. Physical ports (e.g., TenGigE0/0/0/1) that form the + * interconnect. + * + * Generated from protobuf field repeated string physical_ports = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $physical_ports; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The canonical resource name of the interconnect. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the subnet was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the subnet was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels associated with this resource. + * @type string $description + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * @type int $interconnect_type + * Optional. Type of interconnect, which takes only the value 'DEDICATED' for + * now. + * @type string $uuid + * Output only. Unique identifier for the link. + * @type string $device_cloud_resource_name + * Output only. Cloud resource name of the switch device. + * @type array|\Google\Protobuf\Internal\RepeatedField $physical_ports + * Output only. Physical ports (e.g., TenGigE0/0/0/1) that form the + * interconnect. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The canonical resource name of the interconnect. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The canonical resource name of the interconnect. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The time when the subnet 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. The time when the subnet 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. The time when the subnet 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. The time when the subnet 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; + } + + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + * @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. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Type of interconnect, which takes only the value 'DEDICATED' for + * now. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Interconnect.InterconnectType interconnect_type = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getInterconnectType() + { + return $this->interconnect_type; + } + + /** + * Optional. Type of interconnect, which takes only the value 'DEDICATED' for + * now. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Interconnect.InterconnectType interconnect_type = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setInterconnectType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\EdgeNetwork\V1\Interconnect\InterconnectType::class); + $this->interconnect_type = $var; + + return $this; + } + + /** + * Output only. Unique identifier for the link. + * + * Generated from protobuf field string uuid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUuid() + { + return $this->uuid; + } + + /** + * Output only. Unique identifier for the link. + * + * Generated from protobuf field string uuid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUuid($var) + { + GPBUtil::checkString($var, True); + $this->uuid = $var; + + return $this; + } + + /** + * Output only. Cloud resource name of the switch device. + * + * Generated from protobuf field string device_cloud_resource_name = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDeviceCloudResourceName() + { + return $this->device_cloud_resource_name; + } + + /** + * Output only. Cloud resource name of the switch device. + * + * Generated from protobuf field string device_cloud_resource_name = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDeviceCloudResourceName($var) + { + GPBUtil::checkString($var, True); + $this->device_cloud_resource_name = $var; + + return $this; + } + + /** + * Output only. Physical ports (e.g., TenGigE0/0/0/1) that form the + * interconnect. + * + * Generated from protobuf field repeated string physical_ports = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPhysicalPorts() + { + return $this->physical_ports; + } + + /** + * Output only. Physical ports (e.g., TenGigE0/0/0/1) that form the + * interconnect. + * + * Generated from protobuf field repeated string physical_ports = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPhysicalPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->physical_ports = $arr; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/Interconnect/InterconnectType.php b/EdgeNetwork/src/V1/Interconnect/InterconnectType.php new file mode 100644 index 000000000000..b6736e200a84 --- /dev/null +++ b/EdgeNetwork/src/V1/Interconnect/InterconnectType.php @@ -0,0 +1,55 @@ +google.cloud.edgenetwork.v1.Interconnect.InterconnectType + */ +class InterconnectType +{ + /** + * Unspecified. + * + * Generated from protobuf enum INTERCONNECT_TYPE_UNSPECIFIED = 0; + */ + const INTERCONNECT_TYPE_UNSPECIFIED = 0; + /** + * Dedicated Interconnect. + * + * Generated from protobuf enum DEDICATED = 1; + */ + const DEDICATED = 1; + + private static $valueToName = [ + self::INTERCONNECT_TYPE_UNSPECIFIED => 'INTERCONNECT_TYPE_UNSPECIFIED', + self::DEDICATED => 'DEDICATED', + ]; + + 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/EdgeNetwork/src/V1/InterconnectAttachment.php b/EdgeNetwork/src/V1/InterconnectAttachment.php new file mode 100644 index 000000000000..f1082b7d7ad3 --- /dev/null +++ b/EdgeNetwork/src/V1/InterconnectAttachment.php @@ -0,0 +1,417 @@ +google.cloud.edgenetwork.v1.InterconnectAttachment + */ +class InterconnectAttachment extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The canonical resource name of the interconnect attachment. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. The time when the interconnect attachment was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the interconnect attachment was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + */ + private $labels; + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Required. The canonical name of underlying Interconnect object that this + * attachment's traffic will traverse through. The name is in the form of + * `projects/{project}/locations/{location}/zones/{zone}/interconnects/{interconnect}`. + * + * Generated from protobuf field string interconnect = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $interconnect = ''; + /** + * Optional. The canonical Network name in the form of + * `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`. + * + * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Required. VLAN id provided by user. Must be site-wise unique. + * + * Generated from protobuf field int32 vlan_id = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vlan_id = 0; + /** + * IP (L3) MTU value of the virtual edge cloud. + * Valid values are: 1500 and 9000. + * Default to 1500 if not set. + * + * Generated from protobuf field int32 mtu = 9; + */ + protected $mtu = 0; + /** + * Output only. Current stage of the resource to the device by config push. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.ResourceState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The canonical resource name of the interconnect attachment. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the interconnect attachment was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the interconnect attachment was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels associated with this resource. + * @type string $description + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * @type string $interconnect + * Required. The canonical name of underlying Interconnect object that this + * attachment's traffic will traverse through. The name is in the form of + * `projects/{project}/locations/{location}/zones/{zone}/interconnects/{interconnect}`. + * @type string $network + * Optional. The canonical Network name in the form of + * `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`. + * @type int $vlan_id + * Required. VLAN id provided by user. Must be site-wise unique. + * @type int $mtu + * IP (L3) MTU value of the virtual edge cloud. + * Valid values are: 1500 and 9000. + * Default to 1500 if not set. + * @type int $state + * Output only. Current stage of the resource to the device by config push. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The canonical resource name of the interconnect attachment. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The canonical resource name of the interconnect attachment. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The time when the interconnect attachment 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. The time when the interconnect attachment 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. The time when the interconnect attachment 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. The time when the interconnect attachment 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; + } + + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + * @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. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Required. The canonical name of underlying Interconnect object that this + * attachment's traffic will traverse through. The name is in the form of + * `projects/{project}/locations/{location}/zones/{zone}/interconnects/{interconnect}`. + * + * Generated from protobuf field string interconnect = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getInterconnect() + { + return $this->interconnect; + } + + /** + * Required. The canonical name of underlying Interconnect object that this + * attachment's traffic will traverse through. The name is in the form of + * `projects/{project}/locations/{location}/zones/{zone}/interconnects/{interconnect}`. + * + * Generated from protobuf field string interconnect = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setInterconnect($var) + { + GPBUtil::checkString($var, True); + $this->interconnect = $var; + + return $this; + } + + /** + * Optional. The canonical Network name in the form of + * `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`. + * + * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Optional. The canonical Network name in the form of + * `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`. + * + * Generated from protobuf field string network = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Required. VLAN id provided by user. Must be site-wise unique. + * + * Generated from protobuf field int32 vlan_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getVlanId() + { + return $this->vlan_id; + } + + /** + * Required. VLAN id provided by user. Must be site-wise unique. + * + * Generated from protobuf field int32 vlan_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setVlanId($var) + { + GPBUtil::checkInt32($var); + $this->vlan_id = $var; + + return $this; + } + + /** + * IP (L3) MTU value of the virtual edge cloud. + * Valid values are: 1500 and 9000. + * Default to 1500 if not set. + * + * Generated from protobuf field int32 mtu = 9; + * @return int + */ + public function getMtu() + { + return $this->mtu; + } + + /** + * IP (L3) MTU value of the virtual edge cloud. + * Valid values are: 1500 and 9000. + * Default to 1500 if not set. + * + * Generated from protobuf field int32 mtu = 9; + * @param int $var + * @return $this + */ + public function setMtu($var) + { + GPBUtil::checkInt32($var); + $this->mtu = $var; + + return $this; + } + + /** + * Output only. Current stage of the resource to the device by config push. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.ResourceState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current stage of the resource to the device by config push. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.ResourceState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\EdgeNetwork\V1\ResourceState::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/InterconnectDiagnostics.php b/EdgeNetwork/src/V1/InterconnectDiagnostics.php new file mode 100644 index 000000000000..c8acdd241add --- /dev/null +++ b/EdgeNetwork/src/V1/InterconnectDiagnostics.php @@ -0,0 +1,144 @@ +google.cloud.edgenetwork.v1.InterconnectDiagnostics + */ +class InterconnectDiagnostics extends \Google\Protobuf\Internal\Message +{ + /** + * The MAC address of the Interconnect's bundle interface. + * + * Generated from protobuf field string mac_address = 1; + */ + protected $mac_address = ''; + /** + * A list of LinkLayerAddress, describing the ip address and corresponding + * link-layer address of the neighbors for this interconnect. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.LinkLayerAddress link_layer_addresses = 2; + */ + private $link_layer_addresses; + /** + * A list of LinkStatus objects, used to describe the status for each link on + * the Interconnect. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkStatus links = 3; + */ + private $links; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mac_address + * The MAC address of the Interconnect's bundle interface. + * @type array<\Google\Cloud\EdgeNetwork\V1\LinkLayerAddress>|\Google\Protobuf\Internal\RepeatedField $link_layer_addresses + * A list of LinkLayerAddress, describing the ip address and corresponding + * link-layer address of the neighbors for this interconnect. + * @type array<\Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\LinkStatus>|\Google\Protobuf\Internal\RepeatedField $links + * A list of LinkStatus objects, used to describe the status for each link on + * the Interconnect. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The MAC address of the Interconnect's bundle interface. + * + * Generated from protobuf field string mac_address = 1; + * @return string + */ + public function getMacAddress() + { + return $this->mac_address; + } + + /** + * The MAC address of the Interconnect's bundle interface. + * + * Generated from protobuf field string mac_address = 1; + * @param string $var + * @return $this + */ + public function setMacAddress($var) + { + GPBUtil::checkString($var, True); + $this->mac_address = $var; + + return $this; + } + + /** + * A list of LinkLayerAddress, describing the ip address and corresponding + * link-layer address of the neighbors for this interconnect. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.LinkLayerAddress link_layer_addresses = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinkLayerAddresses() + { + return $this->link_layer_addresses; + } + + /** + * A list of LinkLayerAddress, describing the ip address and corresponding + * link-layer address of the neighbors for this interconnect. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.LinkLayerAddress link_layer_addresses = 2; + * @param array<\Google\Cloud\EdgeNetwork\V1\LinkLayerAddress>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinkLayerAddresses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\LinkLayerAddress::class); + $this->link_layer_addresses = $arr; + + return $this; + } + + /** + * A list of LinkStatus objects, used to describe the status for each link on + * the Interconnect. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkStatus links = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinks() + { + return $this->links; + } + + /** + * A list of LinkStatus objects, used to describe the status for each link on + * the Interconnect. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkStatus links = 3; + * @param array<\Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\LinkStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\LinkStatus::class); + $this->links = $arr; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/InterconnectDiagnostics/LinkLACPStatus.php b/EdgeNetwork/src/V1/InterconnectDiagnostics/LinkLACPStatus.php new file mode 100644 index 000000000000..c9d28f24d20d --- /dev/null +++ b/EdgeNetwork/src/V1/InterconnectDiagnostics/LinkLACPStatus.php @@ -0,0 +1,254 @@ +google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLACPStatus + */ +class LinkLACPStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The state of a LACP link. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLACPStatus.State state = 1; + */ + protected $state = 0; + /** + * System ID of the port on Google's side of the LACP exchange. + * + * Generated from protobuf field string google_system_id = 2; + */ + protected $google_system_id = ''; + /** + * System ID of the port on the neighbor's side of the LACP exchange. + * + * Generated from protobuf field string neighbor_system_id = 3; + */ + protected $neighbor_system_id = ''; + /** + * A true value indicates that the participant will allow the link to be + * used as part of the aggregate. + * A false value indicates the link should be used as an individual link. + * + * Generated from protobuf field bool aggregatable = 4; + */ + protected $aggregatable = false; + /** + * If true, the participant is collecting incoming frames on the link, + * otherwise false + * + * Generated from protobuf field bool collecting = 5; + */ + protected $collecting = false; + /** + * When true, the participant is distributing outgoing frames; when false, + * distribution is disabled + * + * Generated from protobuf field bool distributing = 6; + */ + protected $distributing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * The state of a LACP link. + * @type string $google_system_id + * System ID of the port on Google's side of the LACP exchange. + * @type string $neighbor_system_id + * System ID of the port on the neighbor's side of the LACP exchange. + * @type bool $aggregatable + * A true value indicates that the participant will allow the link to be + * used as part of the aggregate. + * A false value indicates the link should be used as an individual link. + * @type bool $collecting + * If true, the participant is collecting incoming frames on the link, + * otherwise false + * @type bool $distributing + * When true, the participant is distributing outgoing frames; when false, + * distribution is disabled + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The state of a LACP link. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLACPStatus.State state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of a LACP link. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLACPStatus.State state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\LinkLACPStatus\State::class); + $this->state = $var; + + return $this; + } + + /** + * System ID of the port on Google's side of the LACP exchange. + * + * Generated from protobuf field string google_system_id = 2; + * @return string + */ + public function getGoogleSystemId() + { + return $this->google_system_id; + } + + /** + * System ID of the port on Google's side of the LACP exchange. + * + * Generated from protobuf field string google_system_id = 2; + * @param string $var + * @return $this + */ + public function setGoogleSystemId($var) + { + GPBUtil::checkString($var, True); + $this->google_system_id = $var; + + return $this; + } + + /** + * System ID of the port on the neighbor's side of the LACP exchange. + * + * Generated from protobuf field string neighbor_system_id = 3; + * @return string + */ + public function getNeighborSystemId() + { + return $this->neighbor_system_id; + } + + /** + * System ID of the port on the neighbor's side of the LACP exchange. + * + * Generated from protobuf field string neighbor_system_id = 3; + * @param string $var + * @return $this + */ + public function setNeighborSystemId($var) + { + GPBUtil::checkString($var, True); + $this->neighbor_system_id = $var; + + return $this; + } + + /** + * A true value indicates that the participant will allow the link to be + * used as part of the aggregate. + * A false value indicates the link should be used as an individual link. + * + * Generated from protobuf field bool aggregatable = 4; + * @return bool + */ + public function getAggregatable() + { + return $this->aggregatable; + } + + /** + * A true value indicates that the participant will allow the link to be + * used as part of the aggregate. + * A false value indicates the link should be used as an individual link. + * + * Generated from protobuf field bool aggregatable = 4; + * @param bool $var + * @return $this + */ + public function setAggregatable($var) + { + GPBUtil::checkBool($var); + $this->aggregatable = $var; + + return $this; + } + + /** + * If true, the participant is collecting incoming frames on the link, + * otherwise false + * + * Generated from protobuf field bool collecting = 5; + * @return bool + */ + public function getCollecting() + { + return $this->collecting; + } + + /** + * If true, the participant is collecting incoming frames on the link, + * otherwise false + * + * Generated from protobuf field bool collecting = 5; + * @param bool $var + * @return $this + */ + public function setCollecting($var) + { + GPBUtil::checkBool($var); + $this->collecting = $var; + + return $this; + } + + /** + * When true, the participant is distributing outgoing frames; when false, + * distribution is disabled + * + * Generated from protobuf field bool distributing = 6; + * @return bool + */ + public function getDistributing() + { + return $this->distributing; + } + + /** + * When true, the participant is distributing outgoing frames; when false, + * distribution is disabled + * + * Generated from protobuf field bool distributing = 6; + * @param bool $var + * @return $this + */ + public function setDistributing($var) + { + GPBUtil::checkBool($var); + $this->distributing = $var; + + return $this; + } + +} + + diff --git a/EdgeNetwork/src/V1/InterconnectDiagnostics/LinkLACPStatus/State.php b/EdgeNetwork/src/V1/InterconnectDiagnostics/LinkLACPStatus/State.php new file mode 100644 index 000000000000..8cebaf607daf --- /dev/null +++ b/EdgeNetwork/src/V1/InterconnectDiagnostics/LinkLACPStatus/State.php @@ -0,0 +1,63 @@ +google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLACPStatus.State + */ +class State +{ + /** + * The default state indicating state is in unknown state. + * + * Generated from protobuf enum UNKNOWN = 0; + */ + const UNKNOWN = 0; + /** + * The link is configured and active within the bundle. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * The link is not configured within the bundle, this means the rest of + * the object should be empty. + * + * Generated from protobuf enum DETACHED = 2; + */ + const DETACHED = 2; + + private static $valueToName = [ + self::UNKNOWN => 'UNKNOWN', + self::ACTIVE => 'ACTIVE', + self::DETACHED => 'DETACHED', + ]; + + 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/EdgeNetwork/src/V1/InterconnectDiagnostics/LinkLLDPStatus.php b/EdgeNetwork/src/V1/InterconnectDiagnostics/LinkLLDPStatus.php new file mode 100644 index 000000000000..a25ee8c63af3 --- /dev/null +++ b/EdgeNetwork/src/V1/InterconnectDiagnostics/LinkLLDPStatus.php @@ -0,0 +1,250 @@ +google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLLDPStatus + */ +class LinkLLDPStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The peer system's administratively assigned name. + * + * Generated from protobuf field string peer_system_name = 1; + */ + protected $peer_system_name = ''; + /** + * The textual description of the network entity of LLDP peer. + * + * Generated from protobuf field string peer_system_description = 2; + */ + protected $peer_system_description = ''; + /** + * The peer chassis component of the endpoint identifier associated with the + * transmitting LLDP agent. + * + * Generated from protobuf field string peer_chassis_id = 3; + */ + protected $peer_chassis_id = ''; + /** + * The format and source of the peer chassis identifier string. + * + * Generated from protobuf field string peer_chassis_id_type = 4; + */ + protected $peer_chassis_id_type = ''; + /** + * The port component of the endpoint identifier associated with the + * transmitting LLDP agent. If the specified port is an IEEE 802.3 Repeater + * port, then this TLV is optional. + * + * Generated from protobuf field string peer_port_id = 5; + */ + protected $peer_port_id = ''; + /** + * The format and source of the peer port identifier string. + * + * Generated from protobuf field string peer_port_id_type = 6; + */ + protected $peer_port_id_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $peer_system_name + * The peer system's administratively assigned name. + * @type string $peer_system_description + * The textual description of the network entity of LLDP peer. + * @type string $peer_chassis_id + * The peer chassis component of the endpoint identifier associated with the + * transmitting LLDP agent. + * @type string $peer_chassis_id_type + * The format and source of the peer chassis identifier string. + * @type string $peer_port_id + * The port component of the endpoint identifier associated with the + * transmitting LLDP agent. If the specified port is an IEEE 802.3 Repeater + * port, then this TLV is optional. + * @type string $peer_port_id_type + * The format and source of the peer port identifier string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The peer system's administratively assigned name. + * + * Generated from protobuf field string peer_system_name = 1; + * @return string + */ + public function getPeerSystemName() + { + return $this->peer_system_name; + } + + /** + * The peer system's administratively assigned name. + * + * Generated from protobuf field string peer_system_name = 1; + * @param string $var + * @return $this + */ + public function setPeerSystemName($var) + { + GPBUtil::checkString($var, True); + $this->peer_system_name = $var; + + return $this; + } + + /** + * The textual description of the network entity of LLDP peer. + * + * Generated from protobuf field string peer_system_description = 2; + * @return string + */ + public function getPeerSystemDescription() + { + return $this->peer_system_description; + } + + /** + * The textual description of the network entity of LLDP peer. + * + * Generated from protobuf field string peer_system_description = 2; + * @param string $var + * @return $this + */ + public function setPeerSystemDescription($var) + { + GPBUtil::checkString($var, True); + $this->peer_system_description = $var; + + return $this; + } + + /** + * The peer chassis component of the endpoint identifier associated with the + * transmitting LLDP agent. + * + * Generated from protobuf field string peer_chassis_id = 3; + * @return string + */ + public function getPeerChassisId() + { + return $this->peer_chassis_id; + } + + /** + * The peer chassis component of the endpoint identifier associated with the + * transmitting LLDP agent. + * + * Generated from protobuf field string peer_chassis_id = 3; + * @param string $var + * @return $this + */ + public function setPeerChassisId($var) + { + GPBUtil::checkString($var, True); + $this->peer_chassis_id = $var; + + return $this; + } + + /** + * The format and source of the peer chassis identifier string. + * + * Generated from protobuf field string peer_chassis_id_type = 4; + * @return string + */ + public function getPeerChassisIdType() + { + return $this->peer_chassis_id_type; + } + + /** + * The format and source of the peer chassis identifier string. + * + * Generated from protobuf field string peer_chassis_id_type = 4; + * @param string $var + * @return $this + */ + public function setPeerChassisIdType($var) + { + GPBUtil::checkString($var, True); + $this->peer_chassis_id_type = $var; + + return $this; + } + + /** + * The port component of the endpoint identifier associated with the + * transmitting LLDP agent. If the specified port is an IEEE 802.3 Repeater + * port, then this TLV is optional. + * + * Generated from protobuf field string peer_port_id = 5; + * @return string + */ + public function getPeerPortId() + { + return $this->peer_port_id; + } + + /** + * The port component of the endpoint identifier associated with the + * transmitting LLDP agent. If the specified port is an IEEE 802.3 Repeater + * port, then this TLV is optional. + * + * Generated from protobuf field string peer_port_id = 5; + * @param string $var + * @return $this + */ + public function setPeerPortId($var) + { + GPBUtil::checkString($var, True); + $this->peer_port_id = $var; + + return $this; + } + + /** + * The format and source of the peer port identifier string. + * + * Generated from protobuf field string peer_port_id_type = 6; + * @return string + */ + public function getPeerPortIdType() + { + return $this->peer_port_id_type; + } + + /** + * The format and source of the peer port identifier string. + * + * Generated from protobuf field string peer_port_id_type = 6; + * @param string $var + * @return $this + */ + public function setPeerPortIdType($var) + { + GPBUtil::checkString($var, True); + $this->peer_port_id_type = $var; + + return $this; + } + +} + + diff --git a/EdgeNetwork/src/V1/InterconnectDiagnostics/LinkStatus.php b/EdgeNetwork/src/V1/InterconnectDiagnostics/LinkStatus.php new file mode 100644 index 000000000000..5bd664591b7b --- /dev/null +++ b/EdgeNetwork/src/V1/InterconnectDiagnostics/LinkStatus.php @@ -0,0 +1,194 @@ +google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkStatus + */ +class LinkStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The unique ID for this link assigned during turn up by Google. + * + * Generated from protobuf field string circuit_id = 1; + */ + protected $circuit_id = ''; + /** + * Describing the state of a LACP link. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLACPStatus lacp_status = 2; + */ + protected $lacp_status = null; + /** + * A list of LinkLLDPStatus objects, used to describe LLDP status of each + * peer for each link on the Interconnect. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLLDPStatus lldp_statuses = 3; + */ + private $lldp_statuses; + /** + * Packet counts specific statistics for this link. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectDiagnostics.PacketCounts packet_counts = 4; + */ + protected $packet_counts = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $circuit_id + * The unique ID for this link assigned during turn up by Google. + * @type \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\LinkLACPStatus $lacp_status + * Describing the state of a LACP link. + * @type array<\Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\LinkLLDPStatus>|\Google\Protobuf\Internal\RepeatedField $lldp_statuses + * A list of LinkLLDPStatus objects, used to describe LLDP status of each + * peer for each link on the Interconnect. + * @type \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\PacketCounts $packet_counts + * Packet counts specific statistics for this link. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The unique ID for this link assigned during turn up by Google. + * + * Generated from protobuf field string circuit_id = 1; + * @return string + */ + public function getCircuitId() + { + return $this->circuit_id; + } + + /** + * The unique ID for this link assigned during turn up by Google. + * + * Generated from protobuf field string circuit_id = 1; + * @param string $var + * @return $this + */ + public function setCircuitId($var) + { + GPBUtil::checkString($var, True); + $this->circuit_id = $var; + + return $this; + } + + /** + * Describing the state of a LACP link. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLACPStatus lacp_status = 2; + * @return \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\LinkLACPStatus|null + */ + public function getLacpStatus() + { + return $this->lacp_status; + } + + public function hasLacpStatus() + { + return isset($this->lacp_status); + } + + public function clearLacpStatus() + { + unset($this->lacp_status); + } + + /** + * Describing the state of a LACP link. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLACPStatus lacp_status = 2; + * @param \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\LinkLACPStatus $var + * @return $this + */ + public function setLacpStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\LinkLACPStatus::class); + $this->lacp_status = $var; + + return $this; + } + + /** + * A list of LinkLLDPStatus objects, used to describe LLDP status of each + * peer for each link on the Interconnect. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLLDPStatus lldp_statuses = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLldpStatuses() + { + return $this->lldp_statuses; + } + + /** + * A list of LinkLLDPStatus objects, used to describe LLDP status of each + * peer for each link on the Interconnect. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.InterconnectDiagnostics.LinkLLDPStatus lldp_statuses = 3; + * @param array<\Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\LinkLLDPStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLldpStatuses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\LinkLLDPStatus::class); + $this->lldp_statuses = $arr; + + return $this; + } + + /** + * Packet counts specific statistics for this link. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectDiagnostics.PacketCounts packet_counts = 4; + * @return \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\PacketCounts|null + */ + public function getPacketCounts() + { + return $this->packet_counts; + } + + public function hasPacketCounts() + { + return isset($this->packet_counts); + } + + public function clearPacketCounts() + { + unset($this->packet_counts); + } + + /** + * Packet counts specific statistics for this link. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.InterconnectDiagnostics.PacketCounts packet_counts = 4; + * @param \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\PacketCounts $var + * @return $this + */ + public function setPacketCounts($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\InterconnectDiagnostics\PacketCounts::class); + $this->packet_counts = $var; + + return $this; + } + +} + + diff --git a/EdgeNetwork/src/V1/InterconnectDiagnostics/PacketCounts.php b/EdgeNetwork/src/V1/InterconnectDiagnostics/PacketCounts.php new file mode 100644 index 000000000000..8dc73e61c942 --- /dev/null +++ b/EdgeNetwork/src/V1/InterconnectDiagnostics/PacketCounts.php @@ -0,0 +1,250 @@ +google.cloud.edgenetwork.v1.InterconnectDiagnostics.PacketCounts + */ +class PacketCounts extends \Google\Protobuf\Internal\Message +{ + /** + * The number of packets that are delivered. + * + * Generated from protobuf field int64 inbound_unicast = 1; + */ + protected $inbound_unicast = 0; + /** + * The number of inbound packets that contained errors. + * + * Generated from protobuf field int64 inbound_errors = 2; + */ + protected $inbound_errors = 0; + /** + * The number of inbound packets that were chosen to be discarded even + * though no errors had been detected to prevent their being deliverable. + * + * Generated from protobuf field int64 inbound_discards = 3; + */ + protected $inbound_discards = 0; + /** + * The total number of packets that are requested be transmitted. + * + * Generated from protobuf field int64 outbound_unicast = 4; + */ + protected $outbound_unicast = 0; + /** + * The number of outbound packets that could not be transmitted because of + * errors. + * + * Generated from protobuf field int64 outbound_errors = 5; + */ + protected $outbound_errors = 0; + /** + * The number of outbound packets that were chosen to be discarded even + * though no errors had been detected to prevent their being transmitted. + * + * Generated from protobuf field int64 outbound_discards = 6; + */ + protected $outbound_discards = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $inbound_unicast + * The number of packets that are delivered. + * @type int|string $inbound_errors + * The number of inbound packets that contained errors. + * @type int|string $inbound_discards + * The number of inbound packets that were chosen to be discarded even + * though no errors had been detected to prevent their being deliverable. + * @type int|string $outbound_unicast + * The total number of packets that are requested be transmitted. + * @type int|string $outbound_errors + * The number of outbound packets that could not be transmitted because of + * errors. + * @type int|string $outbound_discards + * The number of outbound packets that were chosen to be discarded even + * though no errors had been detected to prevent their being transmitted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The number of packets that are delivered. + * + * Generated from protobuf field int64 inbound_unicast = 1; + * @return int|string + */ + public function getInboundUnicast() + { + return $this->inbound_unicast; + } + + /** + * The number of packets that are delivered. + * + * Generated from protobuf field int64 inbound_unicast = 1; + * @param int|string $var + * @return $this + */ + public function setInboundUnicast($var) + { + GPBUtil::checkInt64($var); + $this->inbound_unicast = $var; + + return $this; + } + + /** + * The number of inbound packets that contained errors. + * + * Generated from protobuf field int64 inbound_errors = 2; + * @return int|string + */ + public function getInboundErrors() + { + return $this->inbound_errors; + } + + /** + * The number of inbound packets that contained errors. + * + * Generated from protobuf field int64 inbound_errors = 2; + * @param int|string $var + * @return $this + */ + public function setInboundErrors($var) + { + GPBUtil::checkInt64($var); + $this->inbound_errors = $var; + + return $this; + } + + /** + * The number of inbound packets that were chosen to be discarded even + * though no errors had been detected to prevent their being deliverable. + * + * Generated from protobuf field int64 inbound_discards = 3; + * @return int|string + */ + public function getInboundDiscards() + { + return $this->inbound_discards; + } + + /** + * The number of inbound packets that were chosen to be discarded even + * though no errors had been detected to prevent their being deliverable. + * + * Generated from protobuf field int64 inbound_discards = 3; + * @param int|string $var + * @return $this + */ + public function setInboundDiscards($var) + { + GPBUtil::checkInt64($var); + $this->inbound_discards = $var; + + return $this; + } + + /** + * The total number of packets that are requested be transmitted. + * + * Generated from protobuf field int64 outbound_unicast = 4; + * @return int|string + */ + public function getOutboundUnicast() + { + return $this->outbound_unicast; + } + + /** + * The total number of packets that are requested be transmitted. + * + * Generated from protobuf field int64 outbound_unicast = 4; + * @param int|string $var + * @return $this + */ + public function setOutboundUnicast($var) + { + GPBUtil::checkInt64($var); + $this->outbound_unicast = $var; + + return $this; + } + + /** + * The number of outbound packets that could not be transmitted because of + * errors. + * + * Generated from protobuf field int64 outbound_errors = 5; + * @return int|string + */ + public function getOutboundErrors() + { + return $this->outbound_errors; + } + + /** + * The number of outbound packets that could not be transmitted because of + * errors. + * + * Generated from protobuf field int64 outbound_errors = 5; + * @param int|string $var + * @return $this + */ + public function setOutboundErrors($var) + { + GPBUtil::checkInt64($var); + $this->outbound_errors = $var; + + return $this; + } + + /** + * The number of outbound packets that were chosen to be discarded even + * though no errors had been detected to prevent their being transmitted. + * + * Generated from protobuf field int64 outbound_discards = 6; + * @return int|string + */ + public function getOutboundDiscards() + { + return $this->outbound_discards; + } + + /** + * The number of outbound packets that were chosen to be discarded even + * though no errors had been detected to prevent their being transmitted. + * + * Generated from protobuf field int64 outbound_discards = 6; + * @param int|string $var + * @return $this + */ + public function setOutboundDiscards($var) + { + GPBUtil::checkInt64($var); + $this->outbound_discards = $var; + + return $this; + } + +} + + diff --git a/EdgeNetwork/src/V1/LinkLayerAddress.php b/EdgeNetwork/src/V1/LinkLayerAddress.php new file mode 100644 index 000000000000..9d50ff8146bb --- /dev/null +++ b/EdgeNetwork/src/V1/LinkLayerAddress.php @@ -0,0 +1,101 @@ +google.cloud.edgenetwork.v1.LinkLayerAddress + */ +class LinkLayerAddress extends \Google\Protobuf\Internal\Message +{ + /** + * The MAC address of this neighbor. + * + * Generated from protobuf field string mac_address = 1; + */ + protected $mac_address = ''; + /** + * The IP address of this neighbor. + * + * Generated from protobuf field string ip_address = 2; + */ + protected $ip_address = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mac_address + * The MAC address of this neighbor. + * @type string $ip_address + * The IP address of this neighbor. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The MAC address of this neighbor. + * + * Generated from protobuf field string mac_address = 1; + * @return string + */ + public function getMacAddress() + { + return $this->mac_address; + } + + /** + * The MAC address of this neighbor. + * + * Generated from protobuf field string mac_address = 1; + * @param string $var + * @return $this + */ + public function setMacAddress($var) + { + GPBUtil::checkString($var, True); + $this->mac_address = $var; + + return $this; + } + + /** + * The IP address of this neighbor. + * + * Generated from protobuf field string ip_address = 2; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * The IP address of this neighbor. + * + * Generated from protobuf field string ip_address = 2; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/ListInterconnectAttachmentsRequest.php b/EdgeNetwork/src/V1/ListInterconnectAttachmentsRequest.php new file mode 100644 index 000000000000..5d2583b3bdc7 --- /dev/null +++ b/EdgeNetwork/src/V1/ListInterconnectAttachmentsRequest.php @@ -0,0 +1,221 @@ +google.cloud.edgenetwork.v1.ListInterconnectAttachmentsRequest + */ +class ListInterconnectAttachmentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListInterconnectAttachmentsRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListInterconnectAttachmentsRequest + * Please see {@see EdgeNetworkClient::zoneName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\ListInterconnectAttachmentsRequest + * + * @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. Parent value for ListInterconnectAttachmentsRequest + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results the server should return. + * @type string $filter + * Filtering results + * @type string $order_by + * Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListInterconnectAttachmentsRequest + * + * 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. Parent value for ListInterconnectAttachmentsRequest + * + * 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; + } + + /** + * 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; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * 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; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/ListInterconnectAttachmentsResponse.php b/EdgeNetwork/src/V1/ListInterconnectAttachmentsResponse.php new file mode 100644 index 000000000000..4b8fd35dd010 --- /dev/null +++ b/EdgeNetwork/src/V1/ListInterconnectAttachmentsResponse.php @@ -0,0 +1,135 @@ +google.cloud.edgenetwork.v1.ListInterconnectAttachmentsResponse + */ +class ListInterconnectAttachmentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of InterconnectAttachment + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.InterconnectAttachment interconnect_attachments = 1; + */ + private $interconnect_attachments; + /** + * 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\EdgeNetwork\V1\InterconnectAttachment>|\Google\Protobuf\Internal\RepeatedField $interconnect_attachments + * The list of InterconnectAttachment + * @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\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of InterconnectAttachment + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.InterconnectAttachment interconnect_attachments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInterconnectAttachments() + { + return $this->interconnect_attachments; + } + + /** + * The list of InterconnectAttachment + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.InterconnectAttachment interconnect_attachments = 1; + * @param array<\Google\Cloud\EdgeNetwork\V1\InterconnectAttachment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInterconnectAttachments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\InterconnectAttachment::class); + $this->interconnect_attachments = $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/EdgeNetwork/src/V1/ListInterconnectsRequest.php b/EdgeNetwork/src/V1/ListInterconnectsRequest.php new file mode 100644 index 000000000000..0c22bb3c6d3c --- /dev/null +++ b/EdgeNetwork/src/V1/ListInterconnectsRequest.php @@ -0,0 +1,221 @@ +google.cloud.edgenetwork.v1.ListInterconnectsRequest + */ +class ListInterconnectsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListInterconnectsRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListInterconnectsRequest + * Please see {@see EdgeNetworkClient::zoneName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\ListInterconnectsRequest + * + * @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. Parent value for ListInterconnectsRequest + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results the server should return. + * @type string $filter + * Filtering results + * @type string $order_by + * Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListInterconnectsRequest + * + * 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. Parent value for ListInterconnectsRequest + * + * 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; + } + + /** + * 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; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * 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; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/ListInterconnectsResponse.php b/EdgeNetwork/src/V1/ListInterconnectsResponse.php new file mode 100644 index 000000000000..c026998f4466 --- /dev/null +++ b/EdgeNetwork/src/V1/ListInterconnectsResponse.php @@ -0,0 +1,135 @@ +google.cloud.edgenetwork.v1.ListInterconnectsResponse + */ +class ListInterconnectsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Interconnect + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Interconnect interconnects = 1; + */ + private $interconnects; + /** + * 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\EdgeNetwork\V1\Interconnect>|\Google\Protobuf\Internal\RepeatedField $interconnects + * The list of Interconnect + * @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\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Interconnect + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Interconnect interconnects = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInterconnects() + { + return $this->interconnects; + } + + /** + * The list of Interconnect + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Interconnect interconnects = 1; + * @param array<\Google\Cloud\EdgeNetwork\V1\Interconnect>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInterconnects($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\Interconnect::class); + $this->interconnects = $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/EdgeNetwork/src/V1/ListNetworksRequest.php b/EdgeNetwork/src/V1/ListNetworksRequest.php new file mode 100644 index 000000000000..dbc3ed4cd5f4 --- /dev/null +++ b/EdgeNetwork/src/V1/ListNetworksRequest.php @@ -0,0 +1,221 @@ +google.cloud.edgenetwork.v1.ListNetworksRequest + */ +class ListNetworksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListNetworksRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListNetworksRequest + * Please see {@see EdgeNetworkClient::zoneName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\ListNetworksRequest + * + * @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. Parent value for ListNetworksRequest + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results the server should return. + * @type string $filter + * Filtering results + * @type string $order_by + * Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListNetworksRequest + * + * 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. Parent value for ListNetworksRequest + * + * 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; + } + + /** + * 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; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * 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; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/ListNetworksResponse.php b/EdgeNetwork/src/V1/ListNetworksResponse.php new file mode 100644 index 000000000000..e5038c2be94b --- /dev/null +++ b/EdgeNetwork/src/V1/ListNetworksResponse.php @@ -0,0 +1,135 @@ +google.cloud.edgenetwork.v1.ListNetworksResponse + */ +class ListNetworksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Network + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Network networks = 1; + */ + private $networks; + /** + * 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\EdgeNetwork\V1\Network>|\Google\Protobuf\Internal\RepeatedField $networks + * The list of Network + * @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\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Network + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Network networks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworks() + { + return $this->networks; + } + + /** + * The list of Network + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Network networks = 1; + * @param array<\Google\Cloud\EdgeNetwork\V1\Network>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\Network::class); + $this->networks = $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/EdgeNetwork/src/V1/ListRoutersRequest.php b/EdgeNetwork/src/V1/ListRoutersRequest.php new file mode 100644 index 000000000000..56ddcb9571c4 --- /dev/null +++ b/EdgeNetwork/src/V1/ListRoutersRequest.php @@ -0,0 +1,221 @@ +google.cloud.edgenetwork.v1.ListRoutersRequest + */ +class ListRoutersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListRoutersRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListRoutersRequest + * Please see {@see EdgeNetworkClient::zoneName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\ListRoutersRequest + * + * @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. Parent value for ListRoutersRequest + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results the server should return. + * @type string $filter + * Filtering results + * @type string $order_by + * Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListRoutersRequest + * + * 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. Parent value for ListRoutersRequest + * + * 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; + } + + /** + * 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; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * 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; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/ListRoutersResponse.php b/EdgeNetwork/src/V1/ListRoutersResponse.php new file mode 100644 index 000000000000..446303c4e1f1 --- /dev/null +++ b/EdgeNetwork/src/V1/ListRoutersResponse.php @@ -0,0 +1,135 @@ +google.cloud.edgenetwork.v1.ListRoutersResponse + */ +class ListRoutersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Router + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Router routers = 1; + */ + private $routers; + /** + * 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\EdgeNetwork\V1\Router>|\Google\Protobuf\Internal\RepeatedField $routers + * The list of Router + * @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\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Router + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Router routers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRouters() + { + return $this->routers; + } + + /** + * The list of Router + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Router routers = 1; + * @param array<\Google\Cloud\EdgeNetwork\V1\Router>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRouters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\Router::class); + $this->routers = $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/EdgeNetwork/src/V1/ListSubnetsRequest.php b/EdgeNetwork/src/V1/ListSubnetsRequest.php new file mode 100644 index 000000000000..71b1546d0442 --- /dev/null +++ b/EdgeNetwork/src/V1/ListSubnetsRequest.php @@ -0,0 +1,221 @@ +google.cloud.edgenetwork.v1.ListSubnetsRequest + */ +class ListSubnetsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListSubnetsRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListSubnetsRequest + * Please see {@see EdgeNetworkClient::zoneName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\ListSubnetsRequest + * + * @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. Parent value for ListSubnetsRequest + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results the server should return. + * @type string $filter + * Filtering results + * @type string $order_by + * Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListSubnetsRequest + * + * 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. Parent value for ListSubnetsRequest + * + * 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; + } + + /** + * 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; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * 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; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/ListSubnetsResponse.php b/EdgeNetwork/src/V1/ListSubnetsResponse.php new file mode 100644 index 000000000000..c8e1193fa73d --- /dev/null +++ b/EdgeNetwork/src/V1/ListSubnetsResponse.php @@ -0,0 +1,135 @@ +google.cloud.edgenetwork.v1.ListSubnetsResponse + */ +class ListSubnetsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Subnet + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Subnet subnets = 1; + */ + private $subnets; + /** + * 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\EdgeNetwork\V1\Subnet>|\Google\Protobuf\Internal\RepeatedField $subnets + * The list of Subnet + * @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\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Subnet + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Subnet subnets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubnets() + { + return $this->subnets; + } + + /** + * The list of Subnet + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Subnet subnets = 1; + * @param array<\Google\Cloud\EdgeNetwork\V1\Subnet>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubnets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\Subnet::class); + $this->subnets = $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/EdgeNetwork/src/V1/ListZonesRequest.php b/EdgeNetwork/src/V1/ListZonesRequest.php new file mode 100644 index 000000000000..bbde93d7da3c --- /dev/null +++ b/EdgeNetwork/src/V1/ListZonesRequest.php @@ -0,0 +1,221 @@ +google.cloud.edgenetwork.v1.ListZonesRequest + */ +class ListZonesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListZonesRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * 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; + */ + protected $page_size = 0; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + */ + protected $filter = ''; + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListZonesRequest + * Please see {@see EdgeNetworkClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\EdgeNetwork\V1\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. Parent value for ListZonesRequest + * @type int $page_size + * Requested page size. Server may return fewer items than requested. + * If unspecified, server will pick an appropriate default. + * @type string $page_token + * A token identifying a page of results the server should return. + * @type string $filter + * Filtering results + * @type string $order_by + * Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListZonesRequest + * + * 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. Parent value for ListZonesRequest + * + * 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; + } + + /** + * 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; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * 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; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filtering results + * + * Generated from protobuf field string filter = 4; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Hint for how to order the results + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/ListZonesResponse.php b/EdgeNetwork/src/V1/ListZonesResponse.php new file mode 100644 index 000000000000..95b8c7d15153 --- /dev/null +++ b/EdgeNetwork/src/V1/ListZonesResponse.php @@ -0,0 +1,135 @@ +google.cloud.edgenetwork.v1.ListZonesResponse + */ +class ListZonesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Zone + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.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\EdgeNetwork\V1\Zone>|\Google\Protobuf\Internal\RepeatedField $zones + * The list of Zone + * @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\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Zone + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Zone zones = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getZones() + { + return $this->zones; + } + + /** + * The list of Zone + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Zone zones = 1; + * @param array<\Google\Cloud\EdgeNetwork\V1\Zone>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setZones($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\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/EdgeNetwork/src/V1/Network.php b/EdgeNetwork/src/V1/Network.php new file mode 100644 index 000000000000..57d60cd558fd --- /dev/null +++ b/EdgeNetwork/src/V1/Network.php @@ -0,0 +1,269 @@ +google.cloud.edgenetwork.v1.Network + */ +class Network extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The canonical resource name of the network. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. The time when the network was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the network was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + */ + private $labels; + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * IP (L3) MTU value of the network. + * Valid values are: 1500 and 9000. + * Default to 1500 if not set. + * + * Generated from protobuf field int32 mtu = 6; + */ + protected $mtu = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The canonical resource name of the network. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the network was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the network was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels associated with this resource. + * @type string $description + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * @type int $mtu + * IP (L3) MTU value of the network. + * Valid values are: 1500 and 9000. + * Default to 1500 if not set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The canonical resource name of the network. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The canonical resource name of the network. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The time when the network 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. The time when the network 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. The time when the network 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. The time when the network 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; + } + + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + * @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. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * IP (L3) MTU value of the network. + * Valid values are: 1500 and 9000. + * Default to 1500 if not set. + * + * Generated from protobuf field int32 mtu = 6; + * @return int + */ + public function getMtu() + { + return $this->mtu; + } + + /** + * IP (L3) MTU value of the network. + * Valid values are: 1500 and 9000. + * Default to 1500 if not set. + * + * Generated from protobuf field int32 mtu = 6; + * @param int $var + * @return $this + */ + public function setMtu($var) + { + GPBUtil::checkInt32($var); + $this->mtu = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/OperationMetadata.php b/EdgeNetwork/src/V1/OperationMetadata.php new file mode 100644 index 000000000000..370335b35ce5 --- /dev/null +++ b/EdgeNetwork/src/V1/OperationMetadata.php @@ -0,0 +1,307 @@ +google.cloud.edgenetwork.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have 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. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have 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\Edgenetwork\V1\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. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have 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/EdgeNetwork/src/V1/ResourceState.php b/EdgeNetwork/src/V1/ResourceState.php new file mode 100644 index 000000000000..d0048a99e748 --- /dev/null +++ b/EdgeNetwork/src/V1/ResourceState.php @@ -0,0 +1,86 @@ + + * PROVISIONING -> RUNNING. A normal lifecycle of an existing resource being + * deleted would be: RUNNING -> DELETING. Any failures during processing will + * result the resource to be in a SUSPENDED state. + * + * Protobuf type google.cloud.edgenetwork.v1.ResourceState + */ +class ResourceState +{ + /** + * Unspecified state. + * + * Generated from protobuf enum STATE_UNKNOWN = 0; + */ + const STATE_UNKNOWN = 0; + /** + * The resource is being prepared to be applied to the rack. + * + * Generated from protobuf enum STATE_PENDING = 1; + */ + const STATE_PENDING = 1; + /** + * The resource has started being applied to the rack. + * + * Generated from protobuf enum STATE_PROVISIONING = 2; + */ + const STATE_PROVISIONING = 2; + /** + * The resource has been pushed to the rack. + * + * Generated from protobuf enum STATE_RUNNING = 3; + */ + const STATE_RUNNING = 3; + /** + * The resource failed to push to the rack. + * + * Generated from protobuf enum STATE_SUSPENDED = 4; + */ + const STATE_SUSPENDED = 4; + /** + * The resource is under deletion. + * + * Generated from protobuf enum STATE_DELETING = 5; + */ + const STATE_DELETING = 5; + + private static $valueToName = [ + self::STATE_UNKNOWN => 'STATE_UNKNOWN', + self::STATE_PENDING => 'STATE_PENDING', + self::STATE_PROVISIONING => 'STATE_PROVISIONING', + self::STATE_RUNNING => 'STATE_RUNNING', + self::STATE_SUSPENDED => 'STATE_SUSPENDED', + self::STATE_DELETING => 'STATE_DELETING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/EdgeNetwork/src/V1/Router.php b/EdgeNetwork/src/V1/Router.php new file mode 100644 index 000000000000..246cd561add4 --- /dev/null +++ b/EdgeNetwork/src/V1/Router.php @@ -0,0 +1,453 @@ +google.cloud.edgenetwork.v1.Router + */ +class Router extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The canonical resource name of the router. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. The time when the router was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the router was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + */ + private $labels; + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Required. The canonical name of the network to which this router belongs. + * The name is in the form of + * `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`. + * + * Generated from protobuf field string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * Router interfaces. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Router.Interface interface = 7; + */ + private $interface; + /** + * BGP peers. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Router.BgpPeer bgp_peer = 8; + */ + private $bgp_peer; + /** + * BGP information specific to this router. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Router.Bgp bgp = 9; + */ + protected $bgp = null; + /** + * Output only. Current stage of the resource to the device by config push. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.ResourceState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Optional. A list of CIDRs in IP/Length format to advertise northbound as + * static routes from this router. + * + * Generated from protobuf field repeated string route_advertisements = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $route_advertisements; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The canonical resource name of the router. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the router was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the router was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels associated with this resource. + * @type string $description + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * @type string $network + * Required. The canonical name of the network to which this router belongs. + * The name is in the form of + * `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`. + * @type array<\Google\Cloud\EdgeNetwork\V1\Router\PBInterface>|\Google\Protobuf\Internal\RepeatedField $interface + * Router interfaces. + * @type array<\Google\Cloud\EdgeNetwork\V1\Router\BgpPeer>|\Google\Protobuf\Internal\RepeatedField $bgp_peer + * BGP peers. + * @type \Google\Cloud\EdgeNetwork\V1\Router\Bgp $bgp + * BGP information specific to this router. + * @type int $state + * Output only. Current stage of the resource to the device by config push. + * @type array|\Google\Protobuf\Internal\RepeatedField $route_advertisements + * Optional. A list of CIDRs in IP/Length format to advertise northbound as + * static routes from this router. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The canonical resource name of the router. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The canonical resource name of the router. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The time when the router 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. The time when the router 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. The time when the router 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. The time when the router 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; + } + + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + * @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. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Required. The canonical name of the network to which this router belongs. + * The name is in the form of + * `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`. + * + * Generated from protobuf field string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Required. The canonical name of the network to which this router belongs. + * The name is in the form of + * `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`. + * + * Generated from protobuf field string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Router interfaces. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Router.Interface interface = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInterface() + { + return $this->interface; + } + + /** + * Router interfaces. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Router.Interface interface = 7; + * @param array<\Google\Cloud\EdgeNetwork\V1\Router\PBInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInterface($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\Router\PBInterface::class); + $this->interface = $arr; + + return $this; + } + + /** + * BGP peers. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Router.BgpPeer bgp_peer = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBgpPeer() + { + return $this->bgp_peer; + } + + /** + * BGP peers. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.Router.BgpPeer bgp_peer = 8; + * @param array<\Google\Cloud\EdgeNetwork\V1\Router\BgpPeer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBgpPeer($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\Router\BgpPeer::class); + $this->bgp_peer = $arr; + + return $this; + } + + /** + * BGP information specific to this router. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Router.Bgp bgp = 9; + * @return \Google\Cloud\EdgeNetwork\V1\Router\Bgp|null + */ + public function getBgp() + { + return $this->bgp; + } + + public function hasBgp() + { + return isset($this->bgp); + } + + public function clearBgp() + { + unset($this->bgp); + } + + /** + * BGP information specific to this router. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Router.Bgp bgp = 9; + * @param \Google\Cloud\EdgeNetwork\V1\Router\Bgp $var + * @return $this + */ + public function setBgp($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\Router\Bgp::class); + $this->bgp = $var; + + return $this; + } + + /** + * Output only. Current stage of the resource to the device by config push. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.ResourceState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current stage of the resource to the device by config push. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.ResourceState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\EdgeNetwork\V1\ResourceState::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. A list of CIDRs in IP/Length format to advertise northbound as + * static routes from this router. + * + * Generated from protobuf field repeated string route_advertisements = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRouteAdvertisements() + { + return $this->route_advertisements; + } + + /** + * Optional. A list of CIDRs in IP/Length format to advertise northbound as + * static routes from this router. + * + * Generated from protobuf field repeated string route_advertisements = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRouteAdvertisements($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->route_advertisements = $arr; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/Router/Bgp.php b/EdgeNetwork/src/V1/Router/Bgp.php new file mode 100644 index 000000000000..f3f0d3941537 --- /dev/null +++ b/EdgeNetwork/src/V1/Router/Bgp.php @@ -0,0 +1,106 @@ +google.cloud.edgenetwork.v1.Router.Bgp + */ +class Bgp extends \Google\Protobuf\Internal\Message +{ + /** + * Locally assigned BGP ASN. + * + * Generated from protobuf field uint32 asn = 1; + */ + protected $asn = 0; + /** + * The interval in seconds between BGP keepalive messages that are + * sent to the peer. Default is 20 with value between 20 and 60. + * + * Generated from protobuf field uint32 keepalive_interval_in_seconds = 2; + */ + protected $keepalive_interval_in_seconds = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $asn + * Locally assigned BGP ASN. + * @type int $keepalive_interval_in_seconds + * The interval in seconds between BGP keepalive messages that are + * sent to the peer. Default is 20 with value between 20 and 60. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Locally assigned BGP ASN. + * + * Generated from protobuf field uint32 asn = 1; + * @return int + */ + public function getAsn() + { + return $this->asn; + } + + /** + * Locally assigned BGP ASN. + * + * Generated from protobuf field uint32 asn = 1; + * @param int $var + * @return $this + */ + public function setAsn($var) + { + GPBUtil::checkUint32($var); + $this->asn = $var; + + return $this; + } + + /** + * The interval in seconds between BGP keepalive messages that are + * sent to the peer. Default is 20 with value between 20 and 60. + * + * Generated from protobuf field uint32 keepalive_interval_in_seconds = 2; + * @return int + */ + public function getKeepaliveIntervalInSeconds() + { + return $this->keepalive_interval_in_seconds; + } + + /** + * The interval in seconds between BGP keepalive messages that are + * sent to the peer. Default is 20 with value between 20 and 60. + * + * Generated from protobuf field uint32 keepalive_interval_in_seconds = 2; + * @param int $var + * @return $this + */ + public function setKeepaliveIntervalInSeconds($var) + { + GPBUtil::checkUint32($var); + $this->keepalive_interval_in_seconds = $var; + + return $this; + } + +} + + diff --git a/EdgeNetwork/src/V1/Router/BgpPeer.php b/EdgeNetwork/src/V1/Router/BgpPeer.php new file mode 100644 index 000000000000..f84fc06c3a0c --- /dev/null +++ b/EdgeNetwork/src/V1/Router/BgpPeer.php @@ -0,0 +1,319 @@ +google.cloud.edgenetwork.v1.Router.BgpPeer + */ +class BgpPeer extends \Google\Protobuf\Internal\Message +{ + /** + * Name of this BGP peer. Unique within the Zones resource. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Name of the RouterInterface the BGP peer is associated with. + * + * Generated from protobuf field string interface = 2; + */ + protected $interface = ''; + /** + * IP range of the interface within Google. + * + * Generated from protobuf field string interface_ipv4_cidr = 3; + */ + protected $interface_ipv4_cidr = ''; + /** + * IPv6 range of the interface within Google. + * + * Generated from protobuf field string interface_ipv6_cidr = 7; + */ + protected $interface_ipv6_cidr = ''; + /** + * IP range of the BGP interface outside Google. + * + * Generated from protobuf field string peer_ipv4_cidr = 4; + */ + protected $peer_ipv4_cidr = ''; + /** + * IPv6 range of the BGP interface outside Google. + * + * Generated from protobuf field string peer_ipv6_cidr = 6; + */ + protected $peer_ipv6_cidr = ''; + /** + * Peer BGP Autonomous System Number (ASN). Each BGP interface may use + * a different value. + * + * Generated from protobuf field uint32 peer_asn = 5; + */ + protected $peer_asn = 0; + /** + * Output only. Local BGP Autonomous System Number (ASN). + * This field is ST_NOT_REQUIRED because it stores private ASNs, which are + * meaningless outside the zone in which they are being used. + * + * Generated from protobuf field uint32 local_asn = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $local_asn = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of this BGP peer. Unique within the Zones resource. + * @type string $interface + * Name of the RouterInterface the BGP peer is associated with. + * @type string $interface_ipv4_cidr + * IP range of the interface within Google. + * @type string $interface_ipv6_cidr + * IPv6 range of the interface within Google. + * @type string $peer_ipv4_cidr + * IP range of the BGP interface outside Google. + * @type string $peer_ipv6_cidr + * IPv6 range of the BGP interface outside Google. + * @type int $peer_asn + * Peer BGP Autonomous System Number (ASN). Each BGP interface may use + * a different value. + * @type int $local_asn + * Output only. Local BGP Autonomous System Number (ASN). + * This field is ST_NOT_REQUIRED because it stores private ASNs, which are + * meaningless outside the zone in which they are being used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Name of this BGP peer. Unique within the Zones resource. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of this BGP peer. Unique within the Zones resource. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Name of the RouterInterface the BGP peer is associated with. + * + * Generated from protobuf field string interface = 2; + * @return string + */ + public function getInterface() + { + return $this->interface; + } + + /** + * Name of the RouterInterface the BGP peer is associated with. + * + * Generated from protobuf field string interface = 2; + * @param string $var + * @return $this + */ + public function setInterface($var) + { + GPBUtil::checkString($var, True); + $this->interface = $var; + + return $this; + } + + /** + * IP range of the interface within Google. + * + * Generated from protobuf field string interface_ipv4_cidr = 3; + * @return string + */ + public function getInterfaceIpv4Cidr() + { + return $this->interface_ipv4_cidr; + } + + /** + * IP range of the interface within Google. + * + * Generated from protobuf field string interface_ipv4_cidr = 3; + * @param string $var + * @return $this + */ + public function setInterfaceIpv4Cidr($var) + { + GPBUtil::checkString($var, True); + $this->interface_ipv4_cidr = $var; + + return $this; + } + + /** + * IPv6 range of the interface within Google. + * + * Generated from protobuf field string interface_ipv6_cidr = 7; + * @return string + */ + public function getInterfaceIpv6Cidr() + { + return $this->interface_ipv6_cidr; + } + + /** + * IPv6 range of the interface within Google. + * + * Generated from protobuf field string interface_ipv6_cidr = 7; + * @param string $var + * @return $this + */ + public function setInterfaceIpv6Cidr($var) + { + GPBUtil::checkString($var, True); + $this->interface_ipv6_cidr = $var; + + return $this; + } + + /** + * IP range of the BGP interface outside Google. + * + * Generated from protobuf field string peer_ipv4_cidr = 4; + * @return string + */ + public function getPeerIpv4Cidr() + { + return $this->peer_ipv4_cidr; + } + + /** + * IP range of the BGP interface outside Google. + * + * Generated from protobuf field string peer_ipv4_cidr = 4; + * @param string $var + * @return $this + */ + public function setPeerIpv4Cidr($var) + { + GPBUtil::checkString($var, True); + $this->peer_ipv4_cidr = $var; + + return $this; + } + + /** + * IPv6 range of the BGP interface outside Google. + * + * Generated from protobuf field string peer_ipv6_cidr = 6; + * @return string + */ + public function getPeerIpv6Cidr() + { + return $this->peer_ipv6_cidr; + } + + /** + * IPv6 range of the BGP interface outside Google. + * + * Generated from protobuf field string peer_ipv6_cidr = 6; + * @param string $var + * @return $this + */ + public function setPeerIpv6Cidr($var) + { + GPBUtil::checkString($var, True); + $this->peer_ipv6_cidr = $var; + + return $this; + } + + /** + * Peer BGP Autonomous System Number (ASN). Each BGP interface may use + * a different value. + * + * Generated from protobuf field uint32 peer_asn = 5; + * @return int + */ + public function getPeerAsn() + { + return $this->peer_asn; + } + + /** + * Peer BGP Autonomous System Number (ASN). Each BGP interface may use + * a different value. + * + * Generated from protobuf field uint32 peer_asn = 5; + * @param int $var + * @return $this + */ + public function setPeerAsn($var) + { + GPBUtil::checkUint32($var); + $this->peer_asn = $var; + + return $this; + } + + /** + * Output only. Local BGP Autonomous System Number (ASN). + * This field is ST_NOT_REQUIRED because it stores private ASNs, which are + * meaningless outside the zone in which they are being used. + * + * Generated from protobuf field uint32 local_asn = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getLocalAsn() + { + return $this->local_asn; + } + + /** + * Output only. Local BGP Autonomous System Number (ASN). + * This field is ST_NOT_REQUIRED because it stores private ASNs, which are + * meaningless outside the zone in which they are being used. + * + * Generated from protobuf field uint32 local_asn = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setLocalAsn($var) + { + GPBUtil::checkUint32($var); + $this->local_asn = $var; + + return $this; + } + +} + + diff --git a/EdgeNetwork/src/V1/Router/PBInterface.php b/EdgeNetwork/src/V1/Router/PBInterface.php new file mode 100644 index 000000000000..0b8e1228d5a4 --- /dev/null +++ b/EdgeNetwork/src/V1/Router/PBInterface.php @@ -0,0 +1,247 @@ +google.cloud.edgenetwork.v1.Router.Interface + */ +class PBInterface extends \Google\Protobuf\Internal\Message +{ + /** + * Name of this interface entry. Unique within the Zones resource. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * IP address and range of the interface. + * + * Generated from protobuf field string ipv4_cidr = 3; + */ + protected $ipv4_cidr = ''; + /** + * IPv6 address and range of the interface. + * + * Generated from protobuf field string ipv6_cidr = 6; + */ + protected $ipv6_cidr = ''; + /** + * The canonical name of the linked Interconnect attachment. + * + * Generated from protobuf field string linked_interconnect_attachment = 2; + */ + protected $linked_interconnect_attachment = ''; + /** + * The canonical name of the subnetwork resource that this interface + * belongs to. + * + * Generated from protobuf field string subnetwork = 4; + */ + protected $subnetwork = ''; + /** + * Create loopback interface in the router when specified. + * The number of IP addresses must match the number of TOR devices. + * + * Generated from protobuf field repeated string loopback_ip_addresses = 5; + */ + private $loopback_ip_addresses; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of this interface entry. Unique within the Zones resource. + * @type string $ipv4_cidr + * IP address and range of the interface. + * @type string $ipv6_cidr + * IPv6 address and range of the interface. + * @type string $linked_interconnect_attachment + * The canonical name of the linked Interconnect attachment. + * @type string $subnetwork + * The canonical name of the subnetwork resource that this interface + * belongs to. + * @type array|\Google\Protobuf\Internal\RepeatedField $loopback_ip_addresses + * Create loopback interface in the router when specified. + * The number of IP addresses must match the number of TOR devices. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Name of this interface entry. Unique within the Zones resource. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of this interface entry. Unique within the Zones resource. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * IP address and range of the interface. + * + * Generated from protobuf field string ipv4_cidr = 3; + * @return string + */ + public function getIpv4Cidr() + { + return $this->ipv4_cidr; + } + + /** + * IP address and range of the interface. + * + * Generated from protobuf field string ipv4_cidr = 3; + * @param string $var + * @return $this + */ + public function setIpv4Cidr($var) + { + GPBUtil::checkString($var, True); + $this->ipv4_cidr = $var; + + return $this; + } + + /** + * IPv6 address and range of the interface. + * + * Generated from protobuf field string ipv6_cidr = 6; + * @return string + */ + public function getIpv6Cidr() + { + return $this->ipv6_cidr; + } + + /** + * IPv6 address and range of the interface. + * + * Generated from protobuf field string ipv6_cidr = 6; + * @param string $var + * @return $this + */ + public function setIpv6Cidr($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_cidr = $var; + + return $this; + } + + /** + * The canonical name of the linked Interconnect attachment. + * + * Generated from protobuf field string linked_interconnect_attachment = 2; + * @return string + */ + public function getLinkedInterconnectAttachment() + { + return $this->linked_interconnect_attachment; + } + + /** + * The canonical name of the linked Interconnect attachment. + * + * Generated from protobuf field string linked_interconnect_attachment = 2; + * @param string $var + * @return $this + */ + public function setLinkedInterconnectAttachment($var) + { + GPBUtil::checkString($var, True); + $this->linked_interconnect_attachment = $var; + + return $this; + } + + /** + * The canonical name of the subnetwork resource that this interface + * belongs to. + * + * Generated from protobuf field string subnetwork = 4; + * @return string + */ + public function getSubnetwork() + { + return $this->subnetwork; + } + + /** + * The canonical name of the subnetwork resource that this interface + * belongs to. + * + * Generated from protobuf field string subnetwork = 4; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * Create loopback interface in the router when specified. + * The number of IP addresses must match the number of TOR devices. + * + * Generated from protobuf field repeated string loopback_ip_addresses = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLoopbackIpAddresses() + { + return $this->loopback_ip_addresses; + } + + /** + * Create loopback interface in the router when specified. + * The number of IP addresses must match the number of TOR devices. + * + * Generated from protobuf field repeated string loopback_ip_addresses = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLoopbackIpAddresses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->loopback_ip_addresses = $arr; + + return $this; + } + +} + + diff --git a/EdgeNetwork/src/V1/RouterStatus.php b/EdgeNetwork/src/V1/RouterStatus.php new file mode 100644 index 000000000000..60d9f8abd801 --- /dev/null +++ b/EdgeNetwork/src/V1/RouterStatus.php @@ -0,0 +1,105 @@ +google.cloud.edgenetwork.v1.RouterStatus + */ +class RouterStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The canonical name of the network to which this router belongs. + * + * Generated from protobuf field string network = 1 [(.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * A list of BgpPeerStatus objects, describing all BGP peers related to this + * router. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.RouterStatus.BgpPeerStatus bgp_peer_status = 2; + */ + private $bgp_peer_status; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * The canonical name of the network to which this router belongs. + * @type array<\Google\Cloud\EdgeNetwork\V1\RouterStatus\BgpPeerStatus>|\Google\Protobuf\Internal\RepeatedField $bgp_peer_status + * A list of BgpPeerStatus objects, describing all BGP peers related to this + * router. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The canonical name of the network to which this router belongs. + * + * Generated from protobuf field string network = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * The canonical name of the network to which this router belongs. + * + * Generated from protobuf field string network = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * A list of BgpPeerStatus objects, describing all BGP peers related to this + * router. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.RouterStatus.BgpPeerStatus bgp_peer_status = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBgpPeerStatus() + { + return $this->bgp_peer_status; + } + + /** + * A list of BgpPeerStatus objects, describing all BGP peers related to this + * router. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.RouterStatus.BgpPeerStatus bgp_peer_status = 2; + * @param array<\Google\Cloud\EdgeNetwork\V1\RouterStatus\BgpPeerStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBgpPeerStatus($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\RouterStatus\BgpPeerStatus::class); + $this->bgp_peer_status = $arr; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/RouterStatus/BgpPeerStatus.php b/EdgeNetwork/src/V1/RouterStatus/BgpPeerStatus.php new file mode 100644 index 000000000000..de5c0451923d --- /dev/null +++ b/EdgeNetwork/src/V1/RouterStatus/BgpPeerStatus.php @@ -0,0 +1,324 @@ +google.cloud.edgenetwork.v1.RouterStatus.BgpPeerStatus + */ +class BgpPeerStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Name of this BGP peer. Unique within the Routers resource. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * IP address of the local BGP interface. + * + * Generated from protobuf field string ip_address = 2; + */ + protected $ip_address = ''; + /** + * IP address of the remote BGP interface. + * + * Generated from protobuf field string peer_ip_address = 3; + */ + protected $peer_ip_address = ''; + /** + * The current status of BGP. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.RouterStatus.BgpPeerStatus.BgpStatus status = 4; + */ + protected $status = 0; + /** + * BGP state as specified in RFC1771. + * + * Generated from protobuf field string state = 5; + */ + protected $state = ''; + /** + * Time this session has been up. + * Format: + * 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds + * + * Generated from protobuf field string uptime = 6; + */ + protected $uptime = ''; + /** + * Time this session has been up, in seconds. + * + * Generated from protobuf field int64 uptime_seconds = 7; + */ + protected $uptime_seconds = 0; + /** + * A collection of counts for prefixes. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.RouterStatus.PrefixCounter prefix_counter = 8; + */ + protected $prefix_counter = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of this BGP peer. Unique within the Routers resource. + * @type string $ip_address + * IP address of the local BGP interface. + * @type string $peer_ip_address + * IP address of the remote BGP interface. + * @type int $status + * The current status of BGP. + * @type string $state + * BGP state as specified in RFC1771. + * @type string $uptime + * Time this session has been up. + * Format: + * 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds + * @type int|string $uptime_seconds + * Time this session has been up, in seconds. + * @type \Google\Cloud\EdgeNetwork\V1\RouterStatus\PrefixCounter $prefix_counter + * A collection of counts for prefixes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Name of this BGP peer. Unique within the Routers resource. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of this BGP peer. Unique within the Routers resource. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * IP address of the local BGP interface. + * + * Generated from protobuf field string ip_address = 2; + * @return string + */ + public function getIpAddress() + { + return $this->ip_address; + } + + /** + * IP address of the local BGP interface. + * + * Generated from protobuf field string ip_address = 2; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * IP address of the remote BGP interface. + * + * Generated from protobuf field string peer_ip_address = 3; + * @return string + */ + public function getPeerIpAddress() + { + return $this->peer_ip_address; + } + + /** + * IP address of the remote BGP interface. + * + * Generated from protobuf field string peer_ip_address = 3; + * @param string $var + * @return $this + */ + public function setPeerIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->peer_ip_address = $var; + + return $this; + } + + /** + * The current status of BGP. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.RouterStatus.BgpPeerStatus.BgpStatus status = 4; + * @return int + */ + public function getStatus() + { + return $this->status; + } + + /** + * The current status of BGP. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.RouterStatus.BgpPeerStatus.BgpStatus status = 4; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\EdgeNetwork\V1\RouterStatus\BgpPeerStatus\BgpStatus::class); + $this->status = $var; + + return $this; + } + + /** + * BGP state as specified in RFC1771. + * + * Generated from protobuf field string state = 5; + * @return string + */ + public function getState() + { + return $this->state; + } + + /** + * BGP state as specified in RFC1771. + * + * Generated from protobuf field string state = 5; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + + /** + * Time this session has been up. + * Format: + * 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds + * + * Generated from protobuf field string uptime = 6; + * @return string + */ + public function getUptime() + { + return $this->uptime; + } + + /** + * Time this session has been up. + * Format: + * 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds + * + * Generated from protobuf field string uptime = 6; + * @param string $var + * @return $this + */ + public function setUptime($var) + { + GPBUtil::checkString($var, True); + $this->uptime = $var; + + return $this; + } + + /** + * Time this session has been up, in seconds. + * + * Generated from protobuf field int64 uptime_seconds = 7; + * @return int|string + */ + public function getUptimeSeconds() + { + return $this->uptime_seconds; + } + + /** + * Time this session has been up, in seconds. + * + * Generated from protobuf field int64 uptime_seconds = 7; + * @param int|string $var + * @return $this + */ + public function setUptimeSeconds($var) + { + GPBUtil::checkInt64($var); + $this->uptime_seconds = $var; + + return $this; + } + + /** + * A collection of counts for prefixes. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.RouterStatus.PrefixCounter prefix_counter = 8; + * @return \Google\Cloud\EdgeNetwork\V1\RouterStatus\PrefixCounter|null + */ + public function getPrefixCounter() + { + return $this->prefix_counter; + } + + public function hasPrefixCounter() + { + return isset($this->prefix_counter); + } + + public function clearPrefixCounter() + { + unset($this->prefix_counter); + } + + /** + * A collection of counts for prefixes. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.RouterStatus.PrefixCounter prefix_counter = 8; + * @param \Google\Cloud\EdgeNetwork\V1\RouterStatus\PrefixCounter $var + * @return $this + */ + public function setPrefixCounter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\RouterStatus\PrefixCounter::class); + $this->prefix_counter = $var; + + return $this; + } + +} + + diff --git a/EdgeNetwork/src/V1/RouterStatus/BgpPeerStatus/BgpStatus.php b/EdgeNetwork/src/V1/RouterStatus/BgpPeerStatus/BgpStatus.php new file mode 100644 index 000000000000..1b8cdd16c26e --- /dev/null +++ b/EdgeNetwork/src/V1/RouterStatus/BgpPeerStatus/BgpStatus.php @@ -0,0 +1,62 @@ +google.cloud.edgenetwork.v1.RouterStatus.BgpPeerStatus.BgpStatus + */ +class BgpStatus +{ + /** + * The default status indicating BGP session is in unknown state. + * + * Generated from protobuf enum UNKNOWN = 0; + */ + const UNKNOWN = 0; + /** + * The UP status indicating BGP session is established. + * + * Generated from protobuf enum UP = 1; + */ + const UP = 1; + /** + * The DOWN state indicating BGP session is not established yet. + * + * Generated from protobuf enum DOWN = 2; + */ + const DOWN = 2; + + private static $valueToName = [ + self::UNKNOWN => 'UNKNOWN', + self::UP => 'UP', + self::DOWN => 'DOWN', + ]; + + 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/EdgeNetwork/src/V1/RouterStatus/PrefixCounter.php b/EdgeNetwork/src/V1/RouterStatus/PrefixCounter.php new file mode 100644 index 000000000000..5c8f9dbb226a --- /dev/null +++ b/EdgeNetwork/src/V1/RouterStatus/PrefixCounter.php @@ -0,0 +1,238 @@ +google.cloud.edgenetwork.v1.RouterStatus.PrefixCounter + */ +class PrefixCounter extends \Google\Protobuf\Internal\Message +{ + /** + * Number of prefixes advertised. + * + * Generated from protobuf field int64 advertised = 1; + */ + protected $advertised = 0; + /** + * Number of prefixes denied. + * + * Generated from protobuf field int64 denied = 2; + */ + protected $denied = 0; + /** + * Number of prefixes received. + * + * Generated from protobuf field int64 received = 3; + */ + protected $received = 0; + /** + * Number of prefixes sent. + * + * Generated from protobuf field int64 sent = 4; + */ + protected $sent = 0; + /** + * Number of prefixes suppressed. + * + * Generated from protobuf field int64 suppressed = 5; + */ + protected $suppressed = 0; + /** + * Number of prefixes withdrawn. + * + * Generated from protobuf field int64 withdrawn = 6; + */ + protected $withdrawn = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $advertised + * Number of prefixes advertised. + * @type int|string $denied + * Number of prefixes denied. + * @type int|string $received + * Number of prefixes received. + * @type int|string $sent + * Number of prefixes sent. + * @type int|string $suppressed + * Number of prefixes suppressed. + * @type int|string $withdrawn + * Number of prefixes withdrawn. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Number of prefixes advertised. + * + * Generated from protobuf field int64 advertised = 1; + * @return int|string + */ + public function getAdvertised() + { + return $this->advertised; + } + + /** + * Number of prefixes advertised. + * + * Generated from protobuf field int64 advertised = 1; + * @param int|string $var + * @return $this + */ + public function setAdvertised($var) + { + GPBUtil::checkInt64($var); + $this->advertised = $var; + + return $this; + } + + /** + * Number of prefixes denied. + * + * Generated from protobuf field int64 denied = 2; + * @return int|string + */ + public function getDenied() + { + return $this->denied; + } + + /** + * Number of prefixes denied. + * + * Generated from protobuf field int64 denied = 2; + * @param int|string $var + * @return $this + */ + public function setDenied($var) + { + GPBUtil::checkInt64($var); + $this->denied = $var; + + return $this; + } + + /** + * Number of prefixes received. + * + * Generated from protobuf field int64 received = 3; + * @return int|string + */ + public function getReceived() + { + return $this->received; + } + + /** + * Number of prefixes received. + * + * Generated from protobuf field int64 received = 3; + * @param int|string $var + * @return $this + */ + public function setReceived($var) + { + GPBUtil::checkInt64($var); + $this->received = $var; + + return $this; + } + + /** + * Number of prefixes sent. + * + * Generated from protobuf field int64 sent = 4; + * @return int|string + */ + public function getSent() + { + return $this->sent; + } + + /** + * Number of prefixes sent. + * + * Generated from protobuf field int64 sent = 4; + * @param int|string $var + * @return $this + */ + public function setSent($var) + { + GPBUtil::checkInt64($var); + $this->sent = $var; + + return $this; + } + + /** + * Number of prefixes suppressed. + * + * Generated from protobuf field int64 suppressed = 5; + * @return int|string + */ + public function getSuppressed() + { + return $this->suppressed; + } + + /** + * Number of prefixes suppressed. + * + * Generated from protobuf field int64 suppressed = 5; + * @param int|string $var + * @return $this + */ + public function setSuppressed($var) + { + GPBUtil::checkInt64($var); + $this->suppressed = $var; + + return $this; + } + + /** + * Number of prefixes withdrawn. + * + * Generated from protobuf field int64 withdrawn = 6; + * @return int|string + */ + public function getWithdrawn() + { + return $this->withdrawn; + } + + /** + * Number of prefixes withdrawn. + * + * Generated from protobuf field int64 withdrawn = 6; + * @param int|string $var + * @return $this + */ + public function setWithdrawn($var) + { + GPBUtil::checkInt64($var); + $this->withdrawn = $var; + + return $this; + } + +} + + diff --git a/EdgeNetwork/src/V1/Subnet.php b/EdgeNetwork/src/V1/Subnet.php new file mode 100644 index 000000000000..ad6a87df15d6 --- /dev/null +++ b/EdgeNetwork/src/V1/Subnet.php @@ -0,0 +1,401 @@ +google.cloud.edgenetwork.v1.Subnet + */ +class Subnet extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The canonical resource name of the subnet. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. The time when the subnet was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the subnet was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + */ + private $labels; + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Required. The network that this subnetwork belongs to. + * + * Generated from protobuf field string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $network = ''; + /** + * The ranges of ipv4 addresses that are owned by this subnetwork. + * + * Generated from protobuf field repeated string ipv4_cidr = 7; + */ + private $ipv4_cidr; + /** + * The ranges of ipv6 addresses that are owned by this subnetwork. + * + * Generated from protobuf field repeated string ipv6_cidr = 8; + */ + private $ipv6_cidr; + /** + * Optional. VLAN id provided by user. If not specified we assign one + * automatically. + * + * Generated from protobuf field int32 vlan_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $vlan_id = 0; + /** + * Output only. Current stage of the resource to the device by config push. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.ResourceState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The canonical resource name of the subnet. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the subnet was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the subnet was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels associated with this resource. + * @type string $description + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * @type string $network + * Required. The network that this subnetwork belongs to. + * @type array|\Google\Protobuf\Internal\RepeatedField $ipv4_cidr + * The ranges of ipv4 addresses that are owned by this subnetwork. + * @type array|\Google\Protobuf\Internal\RepeatedField $ipv6_cidr + * The ranges of ipv6 addresses that are owned by this subnetwork. + * @type int $vlan_id + * Optional. VLAN id provided by user. If not specified we assign one + * automatically. + * @type int $state + * Output only. Current stage of the resource to the device by config push. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The canonical resource name of the subnet. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The canonical resource name of the subnet. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The time when the subnet 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. The time when the subnet 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. The time when the subnet 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. The time when the subnet 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; + } + + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels associated with this resource. + * + * Generated from protobuf field map labels = 4; + * @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. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. A free-text description of the resource. Max length 1024 + * characters. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Required. The network that this subnetwork belongs to. + * + * Generated from protobuf field string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Required. The network that this subnetwork belongs to. + * + * Generated from protobuf field string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * The ranges of ipv4 addresses that are owned by this subnetwork. + * + * Generated from protobuf field repeated string ipv4_cidr = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIpv4Cidr() + { + return $this->ipv4_cidr; + } + + /** + * The ranges of ipv4 addresses that are owned by this subnetwork. + * + * Generated from protobuf field repeated string ipv4_cidr = 7; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIpv4Cidr($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ipv4_cidr = $arr; + + return $this; + } + + /** + * The ranges of ipv6 addresses that are owned by this subnetwork. + * + * Generated from protobuf field repeated string ipv6_cidr = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIpv6Cidr() + { + return $this->ipv6_cidr; + } + + /** + * The ranges of ipv6 addresses that are owned by this subnetwork. + * + * Generated from protobuf field repeated string ipv6_cidr = 8; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIpv6Cidr($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ipv6_cidr = $arr; + + return $this; + } + + /** + * Optional. VLAN id provided by user. If not specified we assign one + * automatically. + * + * Generated from protobuf field int32 vlan_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getVlanId() + { + return $this->vlan_id; + } + + /** + * Optional. VLAN id provided by user. If not specified we assign one + * automatically. + * + * Generated from protobuf field int32 vlan_id = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setVlanId($var) + { + GPBUtil::checkInt32($var); + $this->vlan_id = $var; + + return $this; + } + + /** + * Output only. Current stage of the resource to the device by config push. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.ResourceState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current stage of the resource to the device by config push. + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.ResourceState state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\EdgeNetwork\V1\ResourceState::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/SubnetStatus.php b/EdgeNetwork/src/V1/SubnetStatus.php new file mode 100644 index 000000000000..9da065106467 --- /dev/null +++ b/EdgeNetwork/src/V1/SubnetStatus.php @@ -0,0 +1,140 @@ +google.cloud.edgenetwork.v1.SubnetStatus + */ +class SubnetStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The name of CCFE subnet resource. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * BVI MAC address. + * + * Generated from protobuf field string mac_address = 2; + */ + protected $mac_address = ''; + /** + * A list of LinkLayerAddress, describing the ip address and corresponding + * link-layer address of the neighbors for this subnet. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.LinkLayerAddress link_layer_addresses = 3; + */ + private $link_layer_addresses; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of CCFE subnet resource. + * @type string $mac_address + * BVI MAC address. + * @type array<\Google\Cloud\EdgeNetwork\V1\LinkLayerAddress>|\Google\Protobuf\Internal\RepeatedField $link_layer_addresses + * A list of LinkLayerAddress, describing the ip address and corresponding + * link-layer address of the neighbors for this subnet. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The name of CCFE subnet resource. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of CCFE subnet resource. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * BVI MAC address. + * + * Generated from protobuf field string mac_address = 2; + * @return string + */ + public function getMacAddress() + { + return $this->mac_address; + } + + /** + * BVI MAC address. + * + * Generated from protobuf field string mac_address = 2; + * @param string $var + * @return $this + */ + public function setMacAddress($var) + { + GPBUtil::checkString($var, True); + $this->mac_address = $var; + + return $this; + } + + /** + * A list of LinkLayerAddress, describing the ip address and corresponding + * link-layer address of the neighbors for this subnet. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.LinkLayerAddress link_layer_addresses = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinkLayerAddresses() + { + return $this->link_layer_addresses; + } + + /** + * A list of LinkLayerAddress, describing the ip address and corresponding + * link-layer address of the neighbors for this subnet. + * + * Generated from protobuf field repeated .google.cloud.edgenetwork.v1.LinkLayerAddress link_layer_addresses = 3; + * @param array<\Google\Cloud\EdgeNetwork\V1\LinkLayerAddress>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinkLayerAddresses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\EdgeNetwork\V1\LinkLayerAddress::class); + $this->link_layer_addresses = $arr; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/UpdateRouterRequest.php b/EdgeNetwork/src/V1/UpdateRouterRequest.php new file mode 100644 index 000000000000..30f64b5788a3 --- /dev/null +++ b/EdgeNetwork/src/V1/UpdateRouterRequest.php @@ -0,0 +1,230 @@ +google.cloud.edgenetwork.v1.UpdateRouterRequest + */ +class UpdateRouterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Router resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Router router = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\EdgeNetwork\V1\Router $router Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * Router resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\EdgeNetwork\V1\UpdateRouterRequest + * + * @experimental + */ + public static function build(\Google\Cloud\EdgeNetwork\V1\Router $router, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setRouter($router) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * Router resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\EdgeNetwork\V1\Router $router + * Required. The resource being updated + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Router resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Router resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Router router = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\EdgeNetwork\V1\Router|null + */ + public function getRouter() + { + return $this->router; + } + + public function hasRouter() + { + return isset($this->router); + } + + public function clearRouter() + { + unset($this->router); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Router router = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\EdgeNetwork\V1\Router $var + * @return $this + */ + public function setRouter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\Router::class); + $this->router = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/UpdateSubnetRequest.php b/EdgeNetwork/src/V1/UpdateSubnetRequest.php new file mode 100644 index 000000000000..b4033b549422 --- /dev/null +++ b/EdgeNetwork/src/V1/UpdateSubnetRequest.php @@ -0,0 +1,230 @@ +google.cloud.edgenetwork.v1.UpdateSubnetRequest + */ +class UpdateSubnetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Subnet resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Subnet subnet = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subnet = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\EdgeNetwork\V1\Subnet $subnet Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * Subnet resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\EdgeNetwork\V1\UpdateSubnetRequest + * + * @experimental + */ + public static function build(\Google\Cloud\EdgeNetwork\V1\Subnet $subnet, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setSubnet($subnet) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * Subnet resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\EdgeNetwork\V1\Subnet $subnet + * Required. The resource being updated + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Subnet resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Subnet resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Subnet subnet = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\EdgeNetwork\V1\Subnet|null + */ + public function getSubnet() + { + return $this->subnet; + } + + public function hasSubnet() + { + return isset($this->subnet); + } + + public function clearSubnet() + { + unset($this->subnet); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.edgenetwork.v1.Subnet subnet = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\EdgeNetwork\V1\Subnet $var + * @return $this + */ + public function setSubnet($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\EdgeNetwork\V1\Subnet::class); + $this->subnet = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/Zone.php b/EdgeNetwork/src/V1/Zone.php new file mode 100644 index 000000000000..ce3a2c4cf256 --- /dev/null +++ b/EdgeNetwork/src/V1/Zone.php @@ -0,0 +1,223 @@ +google.cloud.edgenetwork.v1.Zone + */ +class Zone extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the zone. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. The time when the 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. The time when the zone was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 4; + */ + private $labels; + /** + * The deployment layout type. + * + * Generated from protobuf field string layout_name = 5; + */ + protected $layout_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the zone. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the zone was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the zone was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels as key value pairs + * @type string $layout_name + * The deployment layout type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Edgenetwork\V1\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the zone. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the zone. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The time when the 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. The time when the 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. The time when the 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. The time when the 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; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels as key value pairs + * + * Generated from protobuf field map labels = 4; + * @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; + } + + /** + * The deployment layout type. + * + * Generated from protobuf field string layout_name = 5; + * @return string + */ + public function getLayoutName() + { + return $this->layout_name; + } + + /** + * The deployment layout type. + * + * Generated from protobuf field string layout_name = 5; + * @param string $var + * @return $this + */ + public function setLayoutName($var) + { + GPBUtil::checkString($var, True); + $this->layout_name = $var; + + return $this; + } + +} + diff --git a/EdgeNetwork/src/V1/gapic_metadata.json b/EdgeNetwork/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..38d2cf56bb69 --- /dev/null +++ b/EdgeNetwork/src/V1/gapic_metadata.json @@ -0,0 +1,158 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.edgenetwork.v1", + "libraryPackage": "Google\\Cloud\\EdgeNetwork\\V1", + "services": { + "EdgeNetwork": { + "clients": { + "grpc": { + "libraryClient": "EdgeNetworkGapicClient", + "rpcs": { + "CreateInterconnectAttachment": { + "methods": [ + "createInterconnectAttachment" + ] + }, + "CreateNetwork": { + "methods": [ + "createNetwork" + ] + }, + "CreateRouter": { + "methods": [ + "createRouter" + ] + }, + "CreateSubnet": { + "methods": [ + "createSubnet" + ] + }, + "DeleteInterconnectAttachment": { + "methods": [ + "deleteInterconnectAttachment" + ] + }, + "DeleteNetwork": { + "methods": [ + "deleteNetwork" + ] + }, + "DeleteRouter": { + "methods": [ + "deleteRouter" + ] + }, + "DeleteSubnet": { + "methods": [ + "deleteSubnet" + ] + }, + "DiagnoseInterconnect": { + "methods": [ + "diagnoseInterconnect" + ] + }, + "DiagnoseNetwork": { + "methods": [ + "diagnoseNetwork" + ] + }, + "DiagnoseRouter": { + "methods": [ + "diagnoseRouter" + ] + }, + "GetInterconnect": { + "methods": [ + "getInterconnect" + ] + }, + "GetInterconnectAttachment": { + "methods": [ + "getInterconnectAttachment" + ] + }, + "GetNetwork": { + "methods": [ + "getNetwork" + ] + }, + "GetRouter": { + "methods": [ + "getRouter" + ] + }, + "GetSubnet": { + "methods": [ + "getSubnet" + ] + }, + "GetZone": { + "methods": [ + "getZone" + ] + }, + "InitializeZone": { + "methods": [ + "initializeZone" + ] + }, + "ListInterconnectAttachments": { + "methods": [ + "listInterconnectAttachments" + ] + }, + "ListInterconnects": { + "methods": [ + "listInterconnects" + ] + }, + "ListNetworks": { + "methods": [ + "listNetworks" + ] + }, + "ListRouters": { + "methods": [ + "listRouters" + ] + }, + "ListSubnets": { + "methods": [ + "listSubnets" + ] + }, + "ListZones": { + "methods": [ + "listZones" + ] + }, + "UpdateRouter": { + "methods": [ + "updateRouter" + ] + }, + "UpdateSubnet": { + "methods": [ + "updateSubnet" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/EdgeNetwork/src/V1/resources/edge_network_client_config.json b/EdgeNetwork/src/V1/resources/edge_network_client_config.json new file mode 100644 index 000000000000..05aa7f74e20a --- /dev/null +++ b/EdgeNetwork/src/V1/resources/edge_network_client_config.json @@ -0,0 +1,184 @@ +{ + "interfaces": { + "google.cloud.edgenetwork.v1.EdgeNetwork": { + "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": { + "CreateInterconnectAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateNetwork": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateRouter": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateSubnet": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteInterconnectAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteNetwork": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteRouter": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteSubnet": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DiagnoseInterconnect": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DiagnoseNetwork": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DiagnoseRouter": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetInterconnect": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetInterconnectAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetNetwork": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetRouter": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetSubnet": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetZone": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "InitializeZone": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListInterconnectAttachments": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListInterconnects": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListNetworks": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListRouters": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListSubnets": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListZones": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateRouter": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateSubnet": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_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/EdgeNetwork/src/V1/resources/edge_network_descriptor_config.php b/EdgeNetwork/src/V1/resources/edge_network_descriptor_config.php new file mode 100644 index 000000000000..8b4460362287 --- /dev/null +++ b/EdgeNetwork/src/V1/resources/edge_network_descriptor_config.php @@ -0,0 +1,483 @@ + [ + 'google.cloud.edgenetwork.v1.EdgeNetwork' => [ + 'CreateInterconnectAttachment' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\EdgeNetwork\V1\InterconnectAttachment', + 'metadataReturnType' => '\Google\Cloud\EdgeNetwork\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateNetwork' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\EdgeNetwork\V1\Network', + 'metadataReturnType' => '\Google\Cloud\EdgeNetwork\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateRouter' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\EdgeNetwork\V1\Router', + 'metadataReturnType' => '\Google\Cloud\EdgeNetwork\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSubnet' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\EdgeNetwork\V1\Subnet', + 'metadataReturnType' => '\Google\Cloud\EdgeNetwork\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteInterconnectAttachment' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\EdgeNetwork\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteNetwork' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\EdgeNetwork\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteRouter' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\EdgeNetwork\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSubnet' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\EdgeNetwork\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateRouter' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\EdgeNetwork\V1\Router', + 'metadataReturnType' => '\Google\Cloud\EdgeNetwork\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'router.name', + 'fieldAccessors' => [ + 'getRouter', + 'getName', + ], + ], + ], + ], + 'UpdateSubnet' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\EdgeNetwork\V1\Subnet', + 'metadataReturnType' => '\Google\Cloud\EdgeNetwork\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'subnet.name', + 'fieldAccessors' => [ + 'getSubnet', + 'getName', + ], + ], + ], + ], + 'DiagnoseInterconnect' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\DiagnoseInterconnectResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DiagnoseNetwork' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\DiagnoseNetworkResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DiagnoseRouter' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\DiagnoseRouterResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetInterconnect' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\Interconnect', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetInterconnectAttachment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\InterconnectAttachment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetNetwork' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\Network', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetRouter' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\Router', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSubnet' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\Subnet', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetZone' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\Zone', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'InitializeZone' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\InitializeZoneResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListInterconnectAttachments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getInterconnectAttachments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\ListInterconnectAttachmentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListInterconnects' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getInterconnects', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\ListInterconnectsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListNetworks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getNetworks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\ListNetworksResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListRouters' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRouters', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\ListRoutersResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListSubnets' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSubnets', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\EdgeNetwork\V1\ListSubnetsResponse', + '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\EdgeNetwork\V1\ListZonesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'interconnect' => 'projects/{project}/locations/{location}/zones/{zone}/interconnects/{interconnect}', + 'interconnectAttachment' => 'projects/{project}/locations/{location}/zones/{zone}/interconnectAttachments/{interconnect_attachment}', + 'location' => 'projects/{project}/locations/{location}', + 'network' => 'projects/{project}/locations/{location}/zones/{zone}/networks/{network}', + 'router' => 'projects/{project}/locations/{location}/zones/{zone}/routers/{router}', + 'subnet' => 'projects/{project}/locations/{location}/zones/{zone}/subnets/{subnet}', + 'zone' => 'projects/{project}/locations/{location}/zones/{zone}', + ], + ], + ], +]; diff --git a/EdgeNetwork/src/V1/resources/edge_network_rest_client_config.php b/EdgeNetwork/src/V1/resources/edge_network_rest_client_config.php new file mode 100644 index 000000000000..0bab94514eae --- /dev/null +++ b/EdgeNetwork/src/V1/resources/edge_network_rest_client_config.php @@ -0,0 +1,393 @@ + [ + 'google.cloud.edgenetwork.v1.EdgeNetwork' => [ + 'CreateInterconnectAttachment' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/zones/*}/interconnectAttachments', + 'body' => 'interconnect_attachment', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'interconnect_attachment_id', + ], + ], + 'CreateNetwork' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/zones/*}/networks', + 'body' => 'network', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'network_id', + ], + ], + 'CreateRouter' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/zones/*}/routers', + 'body' => 'router', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'router_id', + ], + ], + 'CreateSubnet' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/zones/*}/subnets', + 'body' => 'subnet', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'subnet_id', + ], + ], + 'DeleteInterconnectAttachment' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*/interconnectAttachments/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteNetwork' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*/networks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteRouter' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*/routers/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSubnet' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*/subnets/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DiagnoseInterconnect' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*/interconnects/*}:diagnose', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DiagnoseNetwork' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*/networks/*}:diagnose', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DiagnoseRouter' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*/routers/*}:diagnose', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetInterconnect' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*/interconnects/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetInterconnectAttachment' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*/interconnectAttachments/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetNetwork' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*/networks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetRouter' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*/routers/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSubnet' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*/subnets/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetZone' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'InitializeZone' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/zones/*}:initialize', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListInterconnectAttachments' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/zones/*}/interconnectAttachments', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListInterconnects' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/zones/*}/interconnects', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListNetworks' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/zones/*}/networks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListRouters' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/zones/*}/routers', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListSubnets' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/zones/*}/subnets', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListZones' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/zones', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateRouter' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{router.name=projects/*/locations/*/zones/*/routers/*}', + 'body' => 'router', + 'placeholders' => [ + 'router.name' => [ + 'getters' => [ + 'getRouter', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateSubnet' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{subnet.name=projects/*/locations/*/zones/*/subnets/*}', + 'body' => 'subnet', + 'placeholders' => [ + 'subnet.name' => [ + 'getters' => [ + 'getSubnet', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/EdgeNetwork/tests/Unit/V1/Client/EdgeNetworkClientTest.php b/EdgeNetwork/tests/Unit/V1/Client/EdgeNetworkClientTest.php new file mode 100644 index 000000000000..1fd2c877f014 --- /dev/null +++ b/EdgeNetwork/tests/Unit/V1/Client/EdgeNetworkClientTest.php @@ -0,0 +1,2786 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return EdgeNetworkClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new EdgeNetworkClient($options); + } + + /** @test */ + public function createInterconnectAttachmentTest() + { + $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/createInterconnectAttachmentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $interconnect = 'interconnect-849140594'; + $network = 'network1843485230'; + $vlanId = 536153463; + $mtu = 108462; + $expectedResponse = new InterconnectAttachment(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setInterconnect($interconnect); + $expectedResponse->setNetwork($network); + $expectedResponse->setVlanId($vlanId); + $expectedResponse->setMtu($mtu); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInterconnectAttachmentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $interconnectAttachmentId = 'interconnectAttachmentId1313228742'; + $interconnectAttachment = new InterconnectAttachment(); + $interconnectAttachmentName = 'interconnectAttachmentName-1161503108'; + $interconnectAttachment->setName($interconnectAttachmentName); + $interconnectAttachmentInterconnect = $gapicClient->interconnectName('[PROJECT]', '[LOCATION]', '[ZONE]', '[INTERCONNECT]'); + $interconnectAttachment->setInterconnect($interconnectAttachmentInterconnect); + $interconnectAttachmentVlanId = 725855631; + $interconnectAttachment->setVlanId($interconnectAttachmentVlanId); + $request = (new CreateInterconnectAttachmentRequest()) + ->setParent($formattedParent) + ->setInterconnectAttachmentId($interconnectAttachmentId) + ->setInterconnectAttachment($interconnectAttachment); + $response = $gapicClient->createInterconnectAttachment($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.edgenetwork.v1.EdgeNetwork/CreateInterconnectAttachment', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInterconnectAttachmentId(); + $this->assertProtobufEquals($interconnectAttachmentId, $actualValue); + $actualValue = $actualApiRequestObject->getInterconnectAttachment(); + $this->assertProtobufEquals($interconnectAttachment, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInterconnectAttachmentTest'); + $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 createInterconnectAttachmentExceptionTest() + { + $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/createInterconnectAttachmentTest'); + $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->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $interconnectAttachmentId = 'interconnectAttachmentId1313228742'; + $interconnectAttachment = new InterconnectAttachment(); + $interconnectAttachmentName = 'interconnectAttachmentName-1161503108'; + $interconnectAttachment->setName($interconnectAttachmentName); + $interconnectAttachmentInterconnect = $gapicClient->interconnectName('[PROJECT]', '[LOCATION]', '[ZONE]', '[INTERCONNECT]'); + $interconnectAttachment->setInterconnect($interconnectAttachmentInterconnect); + $interconnectAttachmentVlanId = 725855631; + $interconnectAttachment->setVlanId($interconnectAttachmentVlanId); + $request = (new CreateInterconnectAttachmentRequest()) + ->setParent($formattedParent) + ->setInterconnectAttachmentId($interconnectAttachmentId) + ->setInterconnectAttachment($interconnectAttachment); + $response = $gapicClient->createInterconnectAttachment($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInterconnectAttachmentTest'); + 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 createNetworkTest() + { + $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/createNetworkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $mtu = 108462; + $expectedResponse = new Network(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setMtu($mtu); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createNetworkTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $networkId = 'networkId-478232372'; + $network = new Network(); + $networkName = 'networkName-1940815399'; + $network->setName($networkName); + $request = (new CreateNetworkRequest()) + ->setParent($formattedParent) + ->setNetworkId($networkId) + ->setNetwork($network); + $response = $gapicClient->createNetwork($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.edgenetwork.v1.EdgeNetwork/CreateNetwork', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkId(); + $this->assertProtobufEquals($networkId, $actualValue); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createNetworkTest'); + $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 createNetworkExceptionTest() + { + $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/createNetworkTest'); + $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->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $networkId = 'networkId-478232372'; + $network = new Network(); + $networkName = 'networkName-1940815399'; + $network->setName($networkName); + $request = (new CreateNetworkRequest()) + ->setParent($formattedParent) + ->setNetworkId($networkId) + ->setNetwork($network); + $response = $gapicClient->createNetwork($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createNetworkTest'); + 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 createRouterTest() + { + $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/createRouterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $network = 'network1843485230'; + $expectedResponse = new Router(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setNetwork($network); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createRouterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $routerId = 'routerId168536529'; + $router = new Router(); + $routerName = 'routerName929151348'; + $router->setName($routerName); + $routerNetwork = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $router->setNetwork($routerNetwork); + $request = (new CreateRouterRequest()) + ->setParent($formattedParent) + ->setRouterId($routerId) + ->setRouter($router); + $response = $gapicClient->createRouter($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.edgenetwork.v1.EdgeNetwork/CreateRouter', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getRouterId(); + $this->assertProtobufEquals($routerId, $actualValue); + $actualValue = $actualApiRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createRouterTest'); + $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 createRouterExceptionTest() + { + $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/createRouterTest'); + $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->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $routerId = 'routerId168536529'; + $router = new Router(); + $routerName = 'routerName929151348'; + $router->setName($routerName); + $routerNetwork = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $router->setNetwork($routerNetwork); + $request = (new CreateRouterRequest()) + ->setParent($formattedParent) + ->setRouterId($routerId) + ->setRouter($router); + $response = $gapicClient->createRouter($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createRouterTest'); + 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 createSubnetTest() + { + $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/createSubnetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $network = 'network1843485230'; + $vlanId = 536153463; + $expectedResponse = new Subnet(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setNetwork($network); + $expectedResponse->setVlanId($vlanId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSubnetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $subnetId = 'subnetId373593405'; + $subnet = new Subnet(); + $subnetName = 'subnetName-1304020088'; + $subnet->setName($subnetName); + $subnetNetwork = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $subnet->setNetwork($subnetNetwork); + $request = (new CreateSubnetRequest()) + ->setParent($formattedParent) + ->setSubnetId($subnetId) + ->setSubnet($subnet); + $response = $gapicClient->createSubnet($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.edgenetwork.v1.EdgeNetwork/CreateSubnet', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetId(); + $this->assertProtobufEquals($subnetId, $actualValue); + $actualValue = $actualApiRequestObject->getSubnet(); + $this->assertProtobufEquals($subnet, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSubnetTest'); + $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 createSubnetExceptionTest() + { + $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/createSubnetTest'); + $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->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $subnetId = 'subnetId373593405'; + $subnet = new Subnet(); + $subnetName = 'subnetName-1304020088'; + $subnet->setName($subnetName); + $subnetNetwork = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $subnet->setNetwork($subnetNetwork); + $request = (new CreateSubnetRequest()) + ->setParent($formattedParent) + ->setSubnetId($subnetId) + ->setSubnet($subnet); + $response = $gapicClient->createSubnet($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSubnetTest'); + 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 deleteInterconnectAttachmentTest() + { + $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/deleteInterconnectAttachmentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteInterconnectAttachmentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->interconnectAttachmentName('[PROJECT]', '[LOCATION]', '[ZONE]', '[INTERCONNECT_ATTACHMENT]'); + $request = (new DeleteInterconnectAttachmentRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteInterconnectAttachment($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.edgenetwork.v1.EdgeNetwork/DeleteInterconnectAttachment', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInterconnectAttachmentTest'); + $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 deleteInterconnectAttachmentExceptionTest() + { + $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/deleteInterconnectAttachmentTest'); + $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->interconnectAttachmentName('[PROJECT]', '[LOCATION]', '[ZONE]', '[INTERCONNECT_ATTACHMENT]'); + $request = (new DeleteInterconnectAttachmentRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteInterconnectAttachment($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteInterconnectAttachmentTest'); + 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 deleteNetworkTest() + { + $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/deleteNetworkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteNetworkTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $request = (new DeleteNetworkRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteNetwork($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.edgenetwork.v1.EdgeNetwork/DeleteNetwork', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteNetworkTest'); + $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 deleteNetworkExceptionTest() + { + $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/deleteNetworkTest'); + $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->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $request = (new DeleteNetworkRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteNetwork($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteNetworkTest'); + 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 deleteRouterTest() + { + $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/deleteRouterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteRouterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->routerName('[PROJECT]', '[LOCATION]', '[ZONE]', '[ROUTER]'); + $request = (new DeleteRouterRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteRouter($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.edgenetwork.v1.EdgeNetwork/DeleteRouter', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteRouterTest'); + $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 deleteRouterExceptionTest() + { + $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/deleteRouterTest'); + $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->routerName('[PROJECT]', '[LOCATION]', '[ZONE]', '[ROUTER]'); + $request = (new DeleteRouterRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteRouter($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteRouterTest'); + 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 deleteSubnetTest() + { + $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/deleteSubnetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteSubnetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->subnetName('[PROJECT]', '[LOCATION]', '[ZONE]', '[SUBNET]'); + $request = (new DeleteSubnetRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteSubnet($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.edgenetwork.v1.EdgeNetwork/DeleteSubnet', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteSubnetTest'); + $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 deleteSubnetExceptionTest() + { + $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/deleteSubnetTest'); + $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->subnetName('[PROJECT]', '[LOCATION]', '[ZONE]', '[SUBNET]'); + $request = (new DeleteSubnetRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteSubnet($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteSubnetTest'); + 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 diagnoseInterconnectTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DiagnoseInterconnectResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->interconnectName('[PROJECT]', '[LOCATION]', '[ZONE]', '[INTERCONNECT]'); + $request = (new DiagnoseInterconnectRequest()) + ->setName($formattedName); + $response = $gapicClient->diagnoseInterconnect($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.edgenetwork.v1.EdgeNetwork/DiagnoseInterconnect', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function diagnoseInterconnectExceptionTest() + { + $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->interconnectName('[PROJECT]', '[LOCATION]', '[ZONE]', '[INTERCONNECT]'); + $request = (new DiagnoseInterconnectRequest()) + ->setName($formattedName); + try { + $gapicClient->diagnoseInterconnect($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 diagnoseNetworkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DiagnoseNetworkResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $request = (new DiagnoseNetworkRequest()) + ->setName($formattedName); + $response = $gapicClient->diagnoseNetwork($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.edgenetwork.v1.EdgeNetwork/DiagnoseNetwork', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function diagnoseNetworkExceptionTest() + { + $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->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $request = (new DiagnoseNetworkRequest()) + ->setName($formattedName); + try { + $gapicClient->diagnoseNetwork($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 diagnoseRouterTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DiagnoseRouterResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->routerName('[PROJECT]', '[LOCATION]', '[ZONE]', '[ROUTER]'); + $request = (new DiagnoseRouterRequest()) + ->setName($formattedName); + $response = $gapicClient->diagnoseRouter($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.edgenetwork.v1.EdgeNetwork/DiagnoseRouter', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function diagnoseRouterExceptionTest() + { + $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->routerName('[PROJECT]', '[LOCATION]', '[ZONE]', '[ROUTER]'); + $request = (new DiagnoseRouterRequest()) + ->setName($formattedName); + try { + $gapicClient->diagnoseRouter($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 getInterconnectTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $uuid = 'uuid3601339'; + $deviceCloudResourceName = 'deviceCloudResourceName390470697'; + $expectedResponse = new Interconnect(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setUuid($uuid); + $expectedResponse->setDeviceCloudResourceName($deviceCloudResourceName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->interconnectName('[PROJECT]', '[LOCATION]', '[ZONE]', '[INTERCONNECT]'); + $request = (new GetInterconnectRequest()) + ->setName($formattedName); + $response = $gapicClient->getInterconnect($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.edgenetwork.v1.EdgeNetwork/GetInterconnect', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInterconnectExceptionTest() + { + $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->interconnectName('[PROJECT]', '[LOCATION]', '[ZONE]', '[INTERCONNECT]'); + $request = (new GetInterconnectRequest()) + ->setName($formattedName); + try { + $gapicClient->getInterconnect($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 getInterconnectAttachmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $interconnect = 'interconnect-849140594'; + $network = 'network1843485230'; + $vlanId = 536153463; + $mtu = 108462; + $expectedResponse = new InterconnectAttachment(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setInterconnect($interconnect); + $expectedResponse->setNetwork($network); + $expectedResponse->setVlanId($vlanId); + $expectedResponse->setMtu($mtu); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->interconnectAttachmentName('[PROJECT]', '[LOCATION]', '[ZONE]', '[INTERCONNECT_ATTACHMENT]'); + $request = (new GetInterconnectAttachmentRequest()) + ->setName($formattedName); + $response = $gapicClient->getInterconnectAttachment($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.edgenetwork.v1.EdgeNetwork/GetInterconnectAttachment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getInterconnectAttachmentExceptionTest() + { + $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->interconnectAttachmentName('[PROJECT]', '[LOCATION]', '[ZONE]', '[INTERCONNECT_ATTACHMENT]'); + $request = (new GetInterconnectAttachmentRequest()) + ->setName($formattedName); + try { + $gapicClient->getInterconnectAttachment($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 getNetworkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $mtu = 108462; + $expectedResponse = new Network(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setMtu($mtu); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $request = (new GetNetworkRequest()) + ->setName($formattedName); + $response = $gapicClient->getNetwork($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.edgenetwork.v1.EdgeNetwork/GetNetwork', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNetworkExceptionTest() + { + $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->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $request = (new GetNetworkRequest()) + ->setName($formattedName); + try { + $gapicClient->getNetwork($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 getRouterTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $network = 'network1843485230'; + $expectedResponse = new Router(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setNetwork($network); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->routerName('[PROJECT]', '[LOCATION]', '[ZONE]', '[ROUTER]'); + $request = (new GetRouterRequest()) + ->setName($formattedName); + $response = $gapicClient->getRouter($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.edgenetwork.v1.EdgeNetwork/GetRouter', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRouterExceptionTest() + { + $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->routerName('[PROJECT]', '[LOCATION]', '[ZONE]', '[ROUTER]'); + $request = (new GetRouterRequest()) + ->setName($formattedName); + try { + $gapicClient->getRouter($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 getSubnetTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $network = 'network1843485230'; + $vlanId = 536153463; + $expectedResponse = new Subnet(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setNetwork($network); + $expectedResponse->setVlanId($vlanId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->subnetName('[PROJECT]', '[LOCATION]', '[ZONE]', '[SUBNET]'); + $request = (new GetSubnetRequest()) + ->setName($formattedName); + $response = $gapicClient->getSubnet($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.edgenetwork.v1.EdgeNetwork/GetSubnet', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSubnetExceptionTest() + { + $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->subnetName('[PROJECT]', '[LOCATION]', '[ZONE]', '[SUBNET]'); + $request = (new GetSubnetRequest()) + ->setName($formattedName); + try { + $gapicClient->getSubnet($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'; + $layoutName = 'layoutName2011406976'; + $expectedResponse = new Zone(); + $expectedResponse->setName($name2); + $expectedResponse->setLayoutName($layoutName); + $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.edgenetwork.v1.EdgeNetwork/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 initializeZoneTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new InitializeZoneResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new InitializeZoneRequest()) + ->setName($formattedName); + $response = $gapicClient->initializeZone($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.edgenetwork.v1.EdgeNetwork/InitializeZone', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function initializeZoneExceptionTest() + { + $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 InitializeZoneRequest()) + ->setName($formattedName); + try { + $gapicClient->initializeZone($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 listInterconnectAttachmentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $interconnectAttachmentsElement = new InterconnectAttachment(); + $interconnectAttachments = [ + $interconnectAttachmentsElement, + ]; + $expectedResponse = new ListInterconnectAttachmentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setInterconnectAttachments($interconnectAttachments); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new ListInterconnectAttachmentsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listInterconnectAttachments($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getInterconnectAttachments()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.edgenetwork.v1.EdgeNetwork/ListInterconnectAttachments', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInterconnectAttachmentsExceptionTest() + { + $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->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new ListInterconnectAttachmentsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listInterconnectAttachments($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 listInterconnectsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $interconnectsElement = new Interconnect(); + $interconnects = [ + $interconnectsElement, + ]; + $expectedResponse = new ListInterconnectsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setInterconnects($interconnects); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new ListInterconnectsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listInterconnects($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getInterconnects()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.edgenetwork.v1.EdgeNetwork/ListInterconnects', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInterconnectsExceptionTest() + { + $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->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new ListInterconnectsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listInterconnects($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 listNetworksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $networksElement = new Network(); + $networks = [ + $networksElement, + ]; + $expectedResponse = new ListNetworksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setNetworks($networks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new ListNetworksRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listNetworks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getNetworks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.edgenetwork.v1.EdgeNetwork/ListNetworks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworksExceptionTest() + { + $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->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new ListNetworksRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listNetworks($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 listRoutersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $routersElement = new Router(); + $routers = [ + $routersElement, + ]; + $expectedResponse = new ListRoutersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRouters($routers); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new ListRoutersRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listRouters($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRouters()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.edgenetwork.v1.EdgeNetwork/ListRouters', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRoutersExceptionTest() + { + $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->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new ListRoutersRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listRouters($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 listSubnetsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $subnetsElement = new Subnet(); + $subnets = [ + $subnetsElement, + ]; + $expectedResponse = new ListSubnetsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSubnets($subnets); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new ListSubnetsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listSubnets($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSubnets()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.edgenetwork.v1.EdgeNetwork/ListSubnets', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSubnetsExceptionTest() + { + $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->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $request = (new ListSubnetsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listSubnets($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.edgenetwork.v1.EdgeNetwork/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 updateRouterTest() + { + $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/updateRouterTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $network = 'network1843485230'; + $expectedResponse = new Router(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setNetwork($network); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateRouterTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $router = new Router(); + $routerName = 'routerName929151348'; + $router->setName($routerName); + $routerNetwork = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $router->setNetwork($routerNetwork); + $request = (new UpdateRouterRequest()) + ->setUpdateMask($updateMask) + ->setRouter($router); + $response = $gapicClient->updateRouter($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.edgenetwork.v1.EdgeNetwork/UpdateRouter', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateRouterTest'); + $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 updateRouterExceptionTest() + { + $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/updateRouterTest'); + $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(); + $router = new Router(); + $routerName = 'routerName929151348'; + $router->setName($routerName); + $routerNetwork = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $router->setNetwork($routerNetwork); + $request = (new UpdateRouterRequest()) + ->setUpdateMask($updateMask) + ->setRouter($router); + $response = $gapicClient->updateRouter($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateRouterTest'); + 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 updateSubnetTest() + { + $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/updateSubnetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $network = 'network1843485230'; + $vlanId = 536153463; + $expectedResponse = new Subnet(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setNetwork($network); + $expectedResponse->setVlanId($vlanId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateSubnetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $subnet = new Subnet(); + $subnetName = 'subnetName-1304020088'; + $subnet->setName($subnetName); + $subnetNetwork = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $subnet->setNetwork($subnetNetwork); + $request = (new UpdateSubnetRequest()) + ->setUpdateMask($updateMask) + ->setSubnet($subnet); + $response = $gapicClient->updateSubnet($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.edgenetwork.v1.EdgeNetwork/UpdateSubnet', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getSubnet(); + $this->assertProtobufEquals($subnet, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateSubnetTest'); + $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 updateSubnetExceptionTest() + { + $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/updateSubnetTest'); + $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(); + $subnet = new Subnet(); + $subnetName = 'subnetName-1304020088'; + $subnet->setName($subnetName); + $subnetNetwork = $gapicClient->networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]'); + $subnet->setNetwork($subnetNetwork); + $request = (new UpdateSubnetRequest()) + ->setUpdateMask($updateMask) + ->setSubnet($subnet); + $response = $gapicClient->updateSubnet($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateSubnetTest'); + 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 createInterconnectAttachmentAsyncTest() + { + $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/createInterconnectAttachmentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $interconnect = 'interconnect-849140594'; + $network = 'network1843485230'; + $vlanId = 536153463; + $mtu = 108462; + $expectedResponse = new InterconnectAttachment(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setInterconnect($interconnect); + $expectedResponse->setNetwork($network); + $expectedResponse->setVlanId($vlanId); + $expectedResponse->setMtu($mtu); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createInterconnectAttachmentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->zoneName('[PROJECT]', '[LOCATION]', '[ZONE]'); + $interconnectAttachmentId = 'interconnectAttachmentId1313228742'; + $interconnectAttachment = new InterconnectAttachment(); + $interconnectAttachmentName = 'interconnectAttachmentName-1161503108'; + $interconnectAttachment->setName($interconnectAttachmentName); + $interconnectAttachmentInterconnect = $gapicClient->interconnectName('[PROJECT]', '[LOCATION]', '[ZONE]', '[INTERCONNECT]'); + $interconnectAttachment->setInterconnect($interconnectAttachmentInterconnect); + $interconnectAttachmentVlanId = 725855631; + $interconnectAttachment->setVlanId($interconnectAttachmentVlanId); + $request = (new CreateInterconnectAttachmentRequest()) + ->setParent($formattedParent) + ->setInterconnectAttachmentId($interconnectAttachmentId) + ->setInterconnectAttachment($interconnectAttachment); + $response = $gapicClient->createInterconnectAttachmentAsync($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.edgenetwork.v1.EdgeNetwork/CreateInterconnectAttachment', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getInterconnectAttachmentId(); + $this->assertProtobufEquals($interconnectAttachmentId, $actualValue); + $actualValue = $actualApiRequestObject->getInterconnectAttachment(); + $this->assertProtobufEquals($interconnectAttachment, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createInterconnectAttachmentTest'); + $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 1386b145cbf5..2afa9037650c 100644 --- a/composer.json +++ b/composer.json @@ -137,6 +137,7 @@ "google/cloud-dms": "1.4.2", "google/cloud-document-ai": "1.8.2", "google/cloud-domains": "0.4.2", + "google/cloud-edgenetwork": "0.0.0", "google/cloud-error-reporting": "0.21.1", "google/cloud-essential-contacts": "0.3.4", "google/cloud-eventarc": "1.2.2", @@ -298,6 +299,7 @@ "GPBMetadata\\Google\\Cloud\\Discoveryengine\\": "DiscoveryEngine/metadata", "GPBMetadata\\Google\\Cloud\\Documentai\\": "DocumentAi/metadata", "GPBMetadata\\Google\\Cloud\\Domains\\": "Domains/metadata", + "GPBMetadata\\Google\\Cloud\\Edgenetwork\\": "EdgeNetwork/metadata", "GPBMetadata\\Google\\Cloud\\Essentialcontacts\\": "EssentialContacts/metadata", "GPBMetadata\\Google\\Cloud\\Eventarc\\": "Eventarc/metadata", "GPBMetadata\\Google\\Cloud\\Eventarc\\Publishing\\": "EventarcPublishing/metadata", @@ -476,6 +478,7 @@ "Google\\Cloud\\Dlp\\": "Dlp/src", "Google\\Cloud\\DocumentAI\\": "DocumentAi/src", "Google\\Cloud\\Domains\\": "Domains/src", + "Google\\Cloud\\EdgeNetwork\\": "EdgeNetwork/src", "Google\\Cloud\\ErrorReporting\\": "ErrorReporting/src", "Google\\Cloud\\EssentialContacts\\": "EssentialContacts/src", "Google\\Cloud\\Eventarc\\": "Eventarc/src",