From f6d88660bd1ecd209d3f73be316b022749525216 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 15:49:41 -0700 Subject: [PATCH] feat: Update Compute Engine API to revision 20230307 (#770) (#5973) Source-Link: https://github.com/googleapis/googleapis/commit/c2016e5ebbba3a0578fda69bd4ebf1ac16425f08 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0885fd7ae8a805a377974edfba60ab7c9327f75a Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiMDg4NWZkN2FlOGE4MDVhMzc3OTc0ZWRmYmE2MGFiN2M5MzI3Zjc1YSJ9 --- Compute/metadata/V1/Compute.php | Bin 572574 -> 579129 bytes Compute/samples/V1/AutoscalersClient/get.php | 2 +- .../samples/V1/BackendBucketsClient/get.php | 2 +- .../samples/V1/BackendServicesClient/get.php | 2 +- Compute/samples/V1/DiskTypesClient/get.php | 2 +- Compute/samples/V1/DisksClient/get.php | 2 +- Compute/samples/V1/DisksClient/update.php | 82 +++ .../V1/FirewallPoliciesClient/move.php | 2 +- .../samples/V1/GlobalAddressesClient/get.php | 2 +- .../GlobalNetworkEndpointGroupsClient/get.php | 2 +- Compute/samples/V1/HealthChecksClient/get.php | 2 +- Compute/samples/V1/ImagesClient/get.php | 2 +- .../V1/ImagesClient/get_from_family.php | 4 +- .../V1/InstanceGroupManagersClient/get.php | 2 +- .../aggregated_list.php | 68 +++ .../V1/InstanceTemplatesClient/get.php | 2 +- Compute/samples/V1/InstancesClient/get.php | 2 +- .../samples/V1/InstancesClient/set_name.php | 82 +++ .../samples/V1/MachineImagesClient/get.php | 2 +- Compute/samples/V1/MachineTypesClient/get.php | 2 +- .../V1/NetworkEndpointGroupsClient/get.php | 2 +- Compute/samples/V1/NetworksClient/get.php | 2 +- .../samples/V1/NodeTemplatesClient/get.php | 2 +- Compute/samples/V1/NodeTypesClient/get.php | 2 +- .../V1/RegionCommitmentsClient/get.php | 2 +- .../samples/V1/RegionDiskTypesClient/get.php | 2 +- .../samples/V1/RegionDisksClient/update.php | 82 +++ .../V1/RegionHealthChecksClient/get.php | 2 +- .../RegionInstanceTemplatesClient/delete.php | 78 +++ .../V1/RegionInstanceTemplatesClient/get.php | 69 +++ .../RegionInstanceTemplatesClient/insert.php | 80 +++ .../V1/RegionInstanceTemplatesClient/list.php | 70 +++ .../RegionNetworkEndpointGroupsClient/get.php | 2 +- .../V1/RegionTargetHttpProxiesClient/get.php | 2 +- .../V1/RegionTargetHttpsProxiesClient/get.php | 2 +- .../samples/V1/RegionUrlMapsClient/get.php | 2 +- Compute/samples/V1/RegionsClient/get.php | 2 +- Compute/samples/V1/RoutersClient/get.php | 2 +- Compute/samples/V1/RoutesClient/get.php | 2 +- Compute/samples/V1/SnapshotsClient/get.php | 2 +- .../samples/V1/SslCertificatesClient/get.php | 2 +- .../samples/V1/SslPoliciesClient/insert.php | 2 +- Compute/samples/V1/SubnetworksClient/get.php | 2 +- .../V1/TargetHttpProxiesClient/get.php | 2 +- .../V1/TargetHttpsProxiesClient/get.php | 2 +- .../samples/V1/TargetInstancesClient/get.php | 2 +- Compute/samples/V1/TargetPoolsClient/get.php | 2 +- .../samples/V1/TargetSslProxiesClient/get.php | 2 +- .../samples/V1/TargetTcpProxiesClient/get.php | 2 +- .../V1/TargetVpnGatewaysClient/get.php | 2 +- Compute/samples/V1/UrlMapsClient/get.php | 2 +- Compute/samples/V1/VpnGatewaysClient/get.php | 2 +- Compute/samples/V1/VpnTunnelsClient/get.php | 2 +- Compute/samples/V1/ZonesClient/get.php | 2 +- Compute/src/V1/AccessConfig.php | 8 +- Compute/src/V1/Address/Purpose.php | 2 +- ...AggregatedListInstanceTemplatesRequest.php | 331 +++++++++++ Compute/src/V1/AllocationResourceStatus.php | 8 + ...ionResourceStatusSpecificSKUAllocation.php | 8 + .../V1/AutoscalingPolicyScalingSchedule.php | 8 +- Compute/src/V1/BackendService.php | 8 +- .../V1/BackendService/LocalityLbPolicy.php | 7 + ...yLoadBalancingPolicyConfigCustomPolicy.php | 8 +- ...ocalityLoadBalancingPolicyConfigPolicy.php | 8 +- .../Name.php | 9 +- Compute/src/V1/BackendServiceLogConfig.php | 82 +++ .../BackendServiceLogConfig/OptionalMode.php | 69 +++ Compute/src/V1/Binding.php | 8 +- Compute/src/V1/Commitment/Status.php | 2 + Compute/src/V1/Commitment/Type.php | 5 + .../DeleteRegionInstanceTemplateRequest.php | 179 ++++++ .../Enums/BackendService/LocalityLbPolicy.php | 2 + .../Name.php | 2 + .../BackendServiceLogConfig/OptionalMode.php | 40 ++ Compute/src/V1/Enums/Commitment/Type.php | 2 + Compute/src/V1/Enums/Quota/Metric.php | 2 + .../Op.php | 45 ++ Compute/src/V1/ForwardingRule.php | 78 +++ .../src/V1/Gapic/AutoscalersGapicClient.php | 2 +- .../V1/Gapic/BackendBucketsGapicClient.php | 2 +- .../V1/Gapic/BackendServicesGapicClient.php | 2 +- Compute/src/V1/Gapic/DiskTypesGapicClient.php | 2 +- Compute/src/V1/Gapic/DisksGapicClient.php | 93 ++- .../V1/Gapic/FirewallPoliciesGapicClient.php | 4 +- .../V1/Gapic/GlobalAddressesGapicClient.php | 2 +- ...GlobalNetworkEndpointGroupsGapicClient.php | 2 +- .../src/V1/Gapic/HealthChecksGapicClient.php | 2 +- Compute/src/V1/Gapic/ImagesGapicClient.php | 6 +- .../InstanceGroupManagersGapicClient.php | 2 +- .../V1/Gapic/InstanceTemplatesGapicClient.php | 126 ++++- Compute/src/V1/Gapic/InstancesGapicClient.php | 83 ++- .../src/V1/Gapic/MachineImagesGapicClient.php | 2 +- .../src/V1/Gapic/MachineTypesGapicClient.php | 2 +- .../NetworkEndpointGroupsGapicClient.php | 2 +- Compute/src/V1/Gapic/NetworksGapicClient.php | 2 +- .../src/V1/Gapic/NodeTemplatesGapicClient.php | 2 +- Compute/src/V1/Gapic/NodeTypesGapicClient.php | 2 +- .../V1/Gapic/RegionCommitmentsGapicClient.php | 2 +- .../V1/Gapic/RegionDiskTypesGapicClient.php | 2 +- .../src/V1/Gapic/RegionDisksGapicClient.php | 91 +++ .../Gapic/RegionHealthChecksGapicClient.php | 2 +- .../RegionInstanceTemplatesGapicClient.php | 535 ++++++++++++++++++ ...RegionNetworkEndpointGroupsGapicClient.php | 2 +- .../RegionTargetHttpProxiesGapicClient.php | 2 +- .../RegionTargetHttpsProxiesGapicClient.php | 2 +- .../src/V1/Gapic/RegionUrlMapsGapicClient.php | 2 +- Compute/src/V1/Gapic/RegionsGapicClient.php | 2 +- Compute/src/V1/Gapic/RoutersGapicClient.php | 2 +- Compute/src/V1/Gapic/RoutesGapicClient.php | 2 +- Compute/src/V1/Gapic/SnapshotsGapicClient.php | 2 +- .../V1/Gapic/SslCertificatesGapicClient.php | 2 +- .../src/V1/Gapic/SslPoliciesGapicClient.php | 2 +- .../src/V1/Gapic/SubnetworksGapicClient.php | 2 +- .../V1/Gapic/TargetHttpProxiesGapicClient.php | 2 +- .../Gapic/TargetHttpsProxiesGapicClient.php | 2 +- .../V1/Gapic/TargetInstancesGapicClient.php | 2 +- .../src/V1/Gapic/TargetPoolsGapicClient.php | 2 +- .../V1/Gapic/TargetSslProxiesGapicClient.php | 2 +- .../V1/Gapic/TargetTcpProxiesGapicClient.php | 2 +- .../V1/Gapic/TargetVpnGatewaysGapicClient.php | 2 +- Compute/src/V1/Gapic/UrlMapsGapicClient.php | 2 +- .../src/V1/Gapic/VpnGatewaysGapicClient.php | 2 +- .../src/V1/Gapic/VpnTunnelsGapicClient.php | 2 +- Compute/src/V1/Gapic/ZonesGapicClient.php | 2 +- Compute/src/V1/GetFromFamilyImageRequest.php | 8 +- .../V1/GetRegionInstanceTemplateRequest.php | 135 +++++ Compute/src/V1/GuestOsFeature.php | 8 +- Compute/src/V1/GuestOsFeature/Type.php | 2 +- Compute/src/V1/Image.php | 8 +- .../InsertRegionInstanceTemplateRequest.php | 189 +++++++ ...stanceGroupManagersApplyUpdatesRequest.php | 8 +- Compute/src/V1/InstanceTemplate.php | 44 ++ .../src/V1/InstanceTemplateAggregatedList.php | 287 ++++++++++ .../src/V1/InstanceTemplatesScopedList.php | 110 ++++ Compute/src/V1/InstancesSetNameRequest.php | 120 ++++ Compute/src/V1/Interconnect.php | 8 +- Compute/src/V1/InterconnectAttachment.php | 16 +- Compute/src/V1/InterconnectLocation.php | 8 +- .../src/V1/ListFirewallPoliciesRequest.php | 8 +- .../V1/ListRegionInstanceTemplatesRequest.php | 321 +++++++++++ Compute/src/V1/MoveFirewallPolicyRequest.php | 8 +- Compute/src/V1/NetworkInterface.php | 8 +- Compute/src/V1/NodeTemplate.php | 8 +- Compute/src/V1/Quota/Metric.php | 5 + ...stanceGroupManagersApplyUpdatesRequest.php | 8 +- .../src/V1/RegionInstanceTemplatesClient.php | 34 ++ Compute/src/V1/Reservation.php | 7 + .../ResourcePolicyInstanceSchedulePolicy.php | 8 +- Compute/src/V1/RouterBgpPeer.php | 8 +- Compute/src/V1/SecurityPolicy.php | 8 +- Compute/src/V1/SecurityPolicy/Type.php | 2 +- Compute/src/V1/SecurityPolicyRule.php | 52 +- ...curityPolicyRulePreconfiguredWafConfig.php | 66 +++ ...icyRulePreconfiguredWafConfigExclusion.php | 246 ++++++++ ...onfiguredWafConfigExclusionFieldParams.php | 124 ++++ .../Op.php | 83 +++ .../V1/SecurityPolicyRuleRateLimitOptions.php | 8 +- Compute/src/V1/SetNameInstanceRequest.php | 223 ++++++++ Compute/src/V1/UpdateDiskRequest.php | 304 ++++++++++ Compute/src/V1/UpdateRegionDiskRequest.php | 304 ++++++++++ Compute/src/V1/VpnGateway.php | 8 +- Compute/src/V1/WafExpressionSetExpression.php | 44 ++ Compute/src/V1/gapic_metadata.json | 49 ++ .../src/V1/resources/disks_client_config.json | 5 + .../V1/resources/disks_descriptor_config.php | 16 + .../V1/resources/disks_rest_client_config.php | 22 + .../instance_templates_client_config.json | 5 + .../instance_templates_descriptor_config.php | 10 + .../instance_templates_rest_client_config.php | 11 + .../V1/resources/instances_client_config.json | 5 + .../resources/instances_descriptor_config.php | 16 + .../instances_rest_client_config.php | 22 + .../resources/region_disks_client_config.json | 5 + .../region_disks_descriptor_config.php | 16 + .../region_disks_rest_client_config.php | 22 + ...gion_instance_templates_client_config.json | 65 +++ ...n_instance_templates_descriptor_config.php | 50 ++ ..._instance_templates_rest_client_config.php | 164 ++++++ Compute/tests/Unit/V1/DisksClientTest.php | 123 ++++ .../Unit/V1/ForwardingRulesClientTest.php | 2 + .../V1/GlobalForwardingRulesClientTest.php | 2 + .../Unit/V1/InstanceTemplatesClientTest.php | 79 +++ Compute/tests/Unit/V1/InstancesClientTest.php | 124 ++++ .../tests/Unit/V1/RegionDisksClientTest.php | 123 ++++ .../V1/RegionInstanceTemplatesClientTest.php | 464 +++++++++++++++ 185 files changed, 6667 insertions(+), 219 deletions(-) create mode 100644 Compute/samples/V1/DisksClient/update.php create mode 100644 Compute/samples/V1/InstanceTemplatesClient/aggregated_list.php create mode 100644 Compute/samples/V1/InstancesClient/set_name.php create mode 100644 Compute/samples/V1/RegionDisksClient/update.php create mode 100644 Compute/samples/V1/RegionInstanceTemplatesClient/delete.php create mode 100644 Compute/samples/V1/RegionInstanceTemplatesClient/get.php create mode 100644 Compute/samples/V1/RegionInstanceTemplatesClient/insert.php create mode 100644 Compute/samples/V1/RegionInstanceTemplatesClient/list.php create mode 100644 Compute/src/V1/AggregatedListInstanceTemplatesRequest.php create mode 100644 Compute/src/V1/BackendServiceLogConfig/OptionalMode.php create mode 100644 Compute/src/V1/DeleteRegionInstanceTemplateRequest.php create mode 100644 Compute/src/V1/Enums/BackendServiceLogConfig/OptionalMode.php create mode 100644 Compute/src/V1/Enums/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams/Op.php create mode 100644 Compute/src/V1/Gapic/RegionInstanceTemplatesGapicClient.php create mode 100644 Compute/src/V1/GetRegionInstanceTemplateRequest.php create mode 100644 Compute/src/V1/InsertRegionInstanceTemplateRequest.php create mode 100644 Compute/src/V1/InstanceTemplateAggregatedList.php create mode 100644 Compute/src/V1/InstanceTemplatesScopedList.php create mode 100644 Compute/src/V1/InstancesSetNameRequest.php create mode 100644 Compute/src/V1/ListRegionInstanceTemplatesRequest.php create mode 100644 Compute/src/V1/RegionInstanceTemplatesClient.php create mode 100644 Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfig.php create mode 100644 Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfigExclusion.php create mode 100644 Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams.php create mode 100644 Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams/Op.php create mode 100644 Compute/src/V1/SetNameInstanceRequest.php create mode 100644 Compute/src/V1/UpdateDiskRequest.php create mode 100644 Compute/src/V1/UpdateRegionDiskRequest.php create mode 100644 Compute/src/V1/resources/region_instance_templates_client_config.json create mode 100644 Compute/src/V1/resources/region_instance_templates_descriptor_config.php create mode 100644 Compute/src/V1/resources/region_instance_templates_rest_client_config.php create mode 100644 Compute/tests/Unit/V1/RegionInstanceTemplatesClientTest.php diff --git a/Compute/metadata/V1/Compute.php b/Compute/metadata/V1/Compute.php index f28c1ba80077a778ca5e67580104340eb44cef2c..ce6fedb6625b675472a75c4f5e709fd196771e02 100644 GIT binary patch delta 3121 zcmb7GYgAO%70$WOnFBb(fXoF389*vNmJie{gBmlygc-}s@EA04t#BFPf+NTbGlP~k zt;RGONv!B~x#JTMQR^dOXx8-|mr0k8NRw)9o`TlA6_;rmwVKwRnE{H?tk$3Rp1r?s zpKqVDzq93^sR#F@b=;!p+gsB*?@*_+10DEy>p?C*+SvT^1XxO!V9 zhh884QwiBTX2n|90x7kFl3zSLd9lXh4Y)nEt{Sn@E!9-`h1;i={eX;ghFX_|qXrfi zcq$}e>#}{*jVMEHK`$euOT-a=*8*>iB>G$dNw~0fnUyS37K$vUF2s?JK42S3CBga< zd#?FutDS7XQQ)*X?52Ft=2)C-);^{ig1MZMVyDBV{r2DO2ZPYD=4W#9OLEPkDL;Q8 zUi#QQdoJp@OJgKAE7;LaO|Gxg}3 z&b0FkLw!R**Cr-W&i&vS17XQ=*a}LV<`BKjI)@aVGf~^I`<1hu8$LLc33oL}3muJU znp}D_P4;%>D^83)Dx!AAz_{no{BCSooD)%ck}e39fU(!(3y>bwR!PFW=1;3a)G-iSh9;v} zm|2E?hK5328PcOTm~a9mB0aR1p(Z52<1RETB|hA1t>07cE0;vKHw@($&a|zc96TqG z@+=+CB#4r&(+Ll5fzu0CC@=UxrjarlN2e)y%+|dDN$Hvw#+$_hZ%o zC)`vLQo$uRHH%S`>g3fQW`H(^iHBd!r!+G4Q9QghpBfi&fX2fJe85#(4o|J1_28X? zVxVFjGX|P6DHVv{6BO$TdVyRJkp(yESo5I&a~f&8a&kU32}SHfII$n6u#t{6=&V@h z4g*VKKq6O#+!MdB>OlJ^2wFSXLq`G z+{noCdY@0K4TSEnu==~*M-Vjm=;VZK4UQ5AFAm&vi{I{_345i}w1fH;o6X4Z% zsAW*rO|4yi{Us@^A6h>Kj6V)#?I(!6d87$-8xaC{e| zn@}(~Znmp3CzNDig9lBIc>=T0EiDpGoot&&&Z^47L18H)(5!`r>UO4#bmMG0Q;O6u zdOMSANW}5tPcbXC+nH`^#!7@UiX|eBJJ3+zsd1M#6p@Sg@G^8RjHO?c*VOyTN%RY! z-+rrHzO*-7`QnGCnES(1m$G=m|4THGrF$MH_`(e)f_bXll3xsX#844r=-%w^nMtl$ zL}tlYIknvg9qkM*{vU-r9USEaE}v_Ge=zzy$yFiw?n7_hCJzgv%PH+CA@Dhm0KOFA zp5%o2Q-Vp2H4ZOVN(AJ=#kR1$g6g&b)1J?IbkPhBg{gz$Lqkn`fJ_2$g)&yL> zDv3--avnrCalb29F7$@o&v^f$UkV5-_x-gOx_46g#ldj$C-qB&r#*7R2X}`|dXHDQ zoERF)j|Fdl4$})=HA3s}_|U(g)u#F|iL5rg+`Uw-$I`hHWJ}4$GcwultCMVQxLPEK?gav-U1A$q@8m7oi9yXYer|jLp zp3X#bVNn-5c2el&BGvlc0rx^O5rpQWO;JQ^HuS6sZQETDek%MoNZHfHDpRS8iHfA= zUWrueE+WhYdEtdfE(uy1cnP?d7#q#SL0uP@0A;;wy&}bN-@XvLO^c)Z$G@}BGvLkjs_DTuq5!@Ts>DIIL2PLV z%JSVR0@wR3UL9L3)WFj~mg_^PkC-Epr+aKF?1A&k|nspfV}o`VAqwzLXTUq?)f+ z<~H)?u}NR3us-ZxKi0>uTLQ=b%#DKaACfkZ*MlA|P3P0WwuY#G{VG2ZnwohP+*;2i zBO@GJ&kOMGRNjED!}!1RqrwS!^Y0V(t84t!2eNR#iR)HF_j$s1<1XQQzm;GgXhfPY z>B{Ydw5PY9bk9a^1R5D8{d^-A3#*>wqtTyW$#s4V5FfU{ch~tRLR4(1-*EIZzH#}E M1H7{1fa(_gACUP91k{+fI(1}m( z*mp9p%oxwH#g-TJl|m#Yw6)04XSCnwj~%;NZ(|Ka@fe4?bBy^tF1Tf^>$yF}D=9)r zK&#T-l}6el&&(-dt*UyjUJ}x3b^B0L!`cj(Lki&pfHzK&O7wtMwl|jFyIO_kv7>5EYV*u1iix zK~@guGt^17OR6MqRpCRY!T=HqyfQY)T(D>?DW7-_f| zB~6V>2<1x%>jvn=FO*e4GvCgbPv*lGcC*cLSWs-my00$euicN<9k3E#-eSGUsv=c~ z^m@O(&)(nHzQXqGW-`+zxj<+=FjlqmB@9U_s) p*)sn0j#x0A&w3+jz2vfkpS&R5_>XF8l~!dpdS6T2`&#}={{khv6Kwzh diff --git a/Compute/samples/V1/AutoscalersClient/get.php b/Compute/samples/V1/AutoscalersClient/get.php index 08ab4b33604..13c5b09fe16 100644 --- a/Compute/samples/V1/AutoscalersClient/get.php +++ b/Compute/samples/V1/AutoscalersClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\AutoscalersClient; /** - * Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request. + * Returns the specified autoscaler resource. * * @param string $autoscaler Name of the autoscaler to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/BackendBucketsClient/get.php b/Compute/samples/V1/BackendBucketsClient/get.php index 2a6d582b2ee..5149ea6dfa1 100644 --- a/Compute/samples/V1/BackendBucketsClient/get.php +++ b/Compute/samples/V1/BackendBucketsClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\BackendBucketsClient; /** - * Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request. + * Returns the specified BackendBucket resource. * * @param string $backendBucket Name of the BackendBucket resource to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/BackendServicesClient/get.php b/Compute/samples/V1/BackendServicesClient/get.php index e6b5047306e..23cf5369925 100644 --- a/Compute/samples/V1/BackendServicesClient/get.php +++ b/Compute/samples/V1/BackendServicesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\BackendServicesClient; /** - * Returns the specified BackendService resource. Gets a list of available backend services. + * Returns the specified BackendService resource. * * @param string $backendService Name of the BackendService resource to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/DiskTypesClient/get.php b/Compute/samples/V1/DiskTypesClient/get.php index 6d8e7c6c68f..fda92fb73c8 100644 --- a/Compute/samples/V1/DiskTypesClient/get.php +++ b/Compute/samples/V1/DiskTypesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\DiskTypesClient; /** - * Returns the specified disk type. Gets a list of available disk types by making a list() request. + * Returns the specified disk type. * * @param string $diskType Name of the disk type to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/DisksClient/get.php b/Compute/samples/V1/DisksClient/get.php index 8761107e0f9..29672045216 100644 --- a/Compute/samples/V1/DisksClient/get.php +++ b/Compute/samples/V1/DisksClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\DisksClient; /** - * Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request. + * Returns the specified persistent disk. * * @param string $disk Name of the persistent disk to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/DisksClient/update.php b/Compute/samples/V1/DisksClient/update.php new file mode 100644 index 00000000000..d1ffad77127 --- /dev/null +++ b/Compute/samples/V1/DisksClient/update.php @@ -0,0 +1,82 @@ +update($disk, $diskResource, $project, $zone); + $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 +{ + $disk = '[DISK]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + update_sample($disk, $project, $zone); +} +// [END compute_v1_generated_Disks_Update_sync] diff --git a/Compute/samples/V1/FirewallPoliciesClient/move.php b/Compute/samples/V1/FirewallPoliciesClient/move.php index 6c042484b91..7d20479f62f 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/move.php +++ b/Compute/samples/V1/FirewallPoliciesClient/move.php @@ -32,7 +32,7 @@ * Moves the specified firewall policy. * * @param string $firewallPolicy Name of the firewall policy to update. - * @param string $parentId The new parent of the firewall policy. + * @param string $parentId The new parent of the firewall policy. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. */ function move_sample(string $firewallPolicy, string $parentId): void { diff --git a/Compute/samples/V1/GlobalAddressesClient/get.php b/Compute/samples/V1/GlobalAddressesClient/get.php index 5d13ddb1540..db5bb20d5a3 100644 --- a/Compute/samples/V1/GlobalAddressesClient/get.php +++ b/Compute/samples/V1/GlobalAddressesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\GlobalAddressesClient; /** - * Returns the specified address resource. Gets a list of available addresses by making a list() request. + * Returns the specified address resource. * * @param string $address Name of the address resource to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/get.php b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/get.php index d793a0d14d5..341c706882d 100644 --- a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/get.php +++ b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\NetworkEndpointGroup; /** - * Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * Returns the specified network endpoint group. * * @param string $networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/HealthChecksClient/get.php b/Compute/samples/V1/HealthChecksClient/get.php index 2c14466dfc0..2d05ed1b034 100644 --- a/Compute/samples/V1/HealthChecksClient/get.php +++ b/Compute/samples/V1/HealthChecksClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\HealthChecksClient; /** - * Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + * Returns the specified HealthCheck resource. * * @param string $healthCheck Name of the HealthCheck resource to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/ImagesClient/get.php b/Compute/samples/V1/ImagesClient/get.php index a683a41e998..1b0efb3e115 100644 --- a/Compute/samples/V1/ImagesClient/get.php +++ b/Compute/samples/V1/ImagesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\ImagesClient; /** - * Returns the specified image. Gets a list of available images by making a list() request. + * Returns the specified image. * * @param string $image Name of the image resource to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/ImagesClient/get_from_family.php b/Compute/samples/V1/ImagesClient/get_from_family.php index b236870f813..1f46c7dd33a 100644 --- a/Compute/samples/V1/ImagesClient/get_from_family.php +++ b/Compute/samples/V1/ImagesClient/get_from_family.php @@ -28,10 +28,10 @@ use Google\Cloud\Compute\V1\ImagesClient; /** - * Returns the latest image that is part of an image family and is not deprecated. + * Returns the latest image that is part of an image family and is not deprecated. For more information on image families, see Public image families documentation. * * @param string $family Name of the image family to search for. - * @param string $project Project ID for this request. + * @param string $project The image project that the image belongs to. For example, to get a CentOS image, specify centos-cloud as the image project. */ function get_from_family_sample(string $family, string $project): void { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/get.php b/Compute/samples/V1/InstanceGroupManagersClient/get.php index 05142da72ee..9ad469e4c52 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/get.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\InstanceGroupManagersClient; /** - * Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request. + * Returns all of the details about the specified managed instance group. * * @param string $instanceGroupManager The name of the managed instance group. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/InstanceTemplatesClient/aggregated_list.php b/Compute/samples/V1/InstanceTemplatesClient/aggregated_list.php new file mode 100644 index 00000000000..c4be4a2e792 --- /dev/null +++ b/Compute/samples/V1/InstanceTemplatesClient/aggregated_list.php @@ -0,0 +1,68 @@ +aggregatedList($project); + + 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 +{ + $project = '[PROJECT]'; + + aggregated_list_sample($project); +} +// [END compute_v1_generated_InstanceTemplates_AggregatedList_sync] diff --git a/Compute/samples/V1/InstanceTemplatesClient/get.php b/Compute/samples/V1/InstanceTemplatesClient/get.php index 7dbe5ea7177..8b38a1c1c88 100644 --- a/Compute/samples/V1/InstanceTemplatesClient/get.php +++ b/Compute/samples/V1/InstanceTemplatesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\InstanceTemplatesClient; /** - * Returns the specified instance template. Gets a list of available instance templates by making a list() request. + * Returns the specified instance template. * * @param string $instanceTemplate The name of the instance template. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/InstancesClient/get.php b/Compute/samples/V1/InstancesClient/get.php index 19ae3deee01..ce80922a54f 100644 --- a/Compute/samples/V1/InstancesClient/get.php +++ b/Compute/samples/V1/InstancesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\InstancesClient; /** - * Returns the specified Instance resource. Gets a list of available instances by making a list() request. + * Returns the specified Instance resource. * * @param string $instance Name of the instance resource to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/InstancesClient/set_name.php b/Compute/samples/V1/InstancesClient/set_name.php new file mode 100644 index 00000000000..73c062924c4 --- /dev/null +++ b/Compute/samples/V1/InstancesClient/set_name.php @@ -0,0 +1,82 @@ +setName($instance, $instancesSetNameRequestResource, $project, $zone); + $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 +{ + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + set_name_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SetName_sync] diff --git a/Compute/samples/V1/MachineImagesClient/get.php b/Compute/samples/V1/MachineImagesClient/get.php index 994a76618e5..ab0ba19f6bf 100644 --- a/Compute/samples/V1/MachineImagesClient/get.php +++ b/Compute/samples/V1/MachineImagesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\MachineImagesClient; /** - * Returns the specified machine image. Gets a list of available machine images by making a list() request. + * Returns the specified machine image. * * @param string $machineImage The name of the machine image. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/MachineTypesClient/get.php b/Compute/samples/V1/MachineTypesClient/get.php index aac8e07d5ff..409cbba2949 100644 --- a/Compute/samples/V1/MachineTypesClient/get.php +++ b/Compute/samples/V1/MachineTypesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\MachineTypesClient; /** - * Returns the specified machine type. Gets a list of available machine types by making a list() request. + * Returns the specified machine type. * * @param string $machineType Name of the machine type to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/NetworkEndpointGroupsClient/get.php b/Compute/samples/V1/NetworkEndpointGroupsClient/get.php index 731d9643da8..db8b2ad4912 100644 --- a/Compute/samples/V1/NetworkEndpointGroupsClient/get.php +++ b/Compute/samples/V1/NetworkEndpointGroupsClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\NetworkEndpointGroupsClient; /** - * Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * Returns the specified network endpoint group. * * @param string $networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/NetworksClient/get.php b/Compute/samples/V1/NetworksClient/get.php index 2b800e1a0d5..af8bd497320 100644 --- a/Compute/samples/V1/NetworksClient/get.php +++ b/Compute/samples/V1/NetworksClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\NetworksClient; /** - * Returns the specified network. Gets a list of available networks by making a list() request. + * Returns the specified network. * * @param string $network Name of the network to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/NodeTemplatesClient/get.php b/Compute/samples/V1/NodeTemplatesClient/get.php index 40563239aac..f1b6ca4f0b4 100644 --- a/Compute/samples/V1/NodeTemplatesClient/get.php +++ b/Compute/samples/V1/NodeTemplatesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\NodeTemplatesClient; /** - * Returns the specified node template. Gets a list of available node templates by making a list() request. + * Returns the specified node template. * * @param string $nodeTemplate Name of the node template to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/NodeTypesClient/get.php b/Compute/samples/V1/NodeTypesClient/get.php index ac386e92a95..88d08cd118d 100644 --- a/Compute/samples/V1/NodeTypesClient/get.php +++ b/Compute/samples/V1/NodeTypesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\NodeTypesClient; /** - * Returns the specified node type. Gets a list of available node types by making a list() request. + * Returns the specified node type. * * @param string $nodeType Name of the node type to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/RegionCommitmentsClient/get.php b/Compute/samples/V1/RegionCommitmentsClient/get.php index 63618bf398f..8f7fafd2539 100644 --- a/Compute/samples/V1/RegionCommitmentsClient/get.php +++ b/Compute/samples/V1/RegionCommitmentsClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\RegionCommitmentsClient; /** - * Returns the specified commitment resource. Gets a list of available commitments by making a list() request. + * Returns the specified commitment resource. * * @param string $commitment Name of the commitment to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/RegionDiskTypesClient/get.php b/Compute/samples/V1/RegionDiskTypesClient/get.php index 5302d06e177..32f208c6416 100644 --- a/Compute/samples/V1/RegionDiskTypesClient/get.php +++ b/Compute/samples/V1/RegionDiskTypesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\RegionDiskTypesClient; /** - * Returns the specified regional disk type. Gets a list of available disk types by making a list() request. + * Returns the specified regional disk type. * * @param string $diskType Name of the disk type to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/RegionDisksClient/update.php b/Compute/samples/V1/RegionDisksClient/update.php new file mode 100644 index 00000000000..c4cd2495b3c --- /dev/null +++ b/Compute/samples/V1/RegionDisksClient/update.php @@ -0,0 +1,82 @@ +update($disk, $diskResource, $project, $region); + $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 +{ + $disk = '[DISK]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + update_sample($disk, $project, $region); +} +// [END compute_v1_generated_RegionDisks_Update_sync] diff --git a/Compute/samples/V1/RegionHealthChecksClient/get.php b/Compute/samples/V1/RegionHealthChecksClient/get.php index dd54a426815..4ac7f83f08f 100644 --- a/Compute/samples/V1/RegionHealthChecksClient/get.php +++ b/Compute/samples/V1/RegionHealthChecksClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\RegionHealthChecksClient; /** - * Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + * Returns the specified HealthCheck resource. * * @param string $healthCheck Name of the HealthCheck resource to return. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/RegionInstanceTemplatesClient/delete.php b/Compute/samples/V1/RegionInstanceTemplatesClient/delete.php new file mode 100644 index 00000000000..d0e711a17e2 --- /dev/null +++ b/Compute/samples/V1/RegionInstanceTemplatesClient/delete.php @@ -0,0 +1,78 @@ +delete($instanceTemplate, $project, $region); + $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 +{ + $instanceTemplate = '[INSTANCE_TEMPLATE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($instanceTemplate, $project, $region); +} +// [END compute_v1_generated_RegionInstanceTemplates_Delete_sync] diff --git a/Compute/samples/V1/RegionInstanceTemplatesClient/get.php b/Compute/samples/V1/RegionInstanceTemplatesClient/get.php new file mode 100644 index 00000000000..9249dc8b1c9 --- /dev/null +++ b/Compute/samples/V1/RegionInstanceTemplatesClient/get.php @@ -0,0 +1,69 @@ +get($instanceTemplate, $project, $region); + 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 +{ + $instanceTemplate = '[INSTANCE_TEMPLATE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($instanceTemplate, $project, $region); +} +// [END compute_v1_generated_RegionInstanceTemplates_Get_sync] diff --git a/Compute/samples/V1/RegionInstanceTemplatesClient/insert.php b/Compute/samples/V1/RegionInstanceTemplatesClient/insert.php new file mode 100644 index 00000000000..89689bc60b6 --- /dev/null +++ b/Compute/samples/V1/RegionInstanceTemplatesClient/insert.php @@ -0,0 +1,80 @@ +insert($instanceTemplateResource, $project, $region); + $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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + + insert_sample($project, $region); +} +// [END compute_v1_generated_RegionInstanceTemplates_Insert_sync] diff --git a/Compute/samples/V1/RegionInstanceTemplatesClient/list.php b/Compute/samples/V1/RegionInstanceTemplatesClient/list.php new file mode 100644 index 00000000000..fabb18f166a --- /dev/null +++ b/Compute/samples/V1/RegionInstanceTemplatesClient/list.php @@ -0,0 +1,70 @@ +list($project, $region); + + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + + list_sample($project, $region); +} +// [END compute_v1_generated_RegionInstanceTemplates_List_sync] diff --git a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/get.php b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/get.php index 9a4392f4145..8bcc56c0a51 100644 --- a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/get.php +++ b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsClient; /** - * Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * Returns the specified network endpoint group. * * @param string $networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. * @param string $project Project ID for this request. diff --git a/Compute/samples/V1/RegionTargetHttpProxiesClient/get.php b/Compute/samples/V1/RegionTargetHttpProxiesClient/get.php index 2a18c8ade4b..853ee5f17d7 100644 --- a/Compute/samples/V1/RegionTargetHttpProxiesClient/get.php +++ b/Compute/samples/V1/RegionTargetHttpProxiesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\TargetHttpProxy; /** - * Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + * Returns the specified TargetHttpProxy resource in the specified region. * * @param string $project Project ID for this request. * @param string $region Name of the region scoping this request. diff --git a/Compute/samples/V1/RegionTargetHttpsProxiesClient/get.php b/Compute/samples/V1/RegionTargetHttpsProxiesClient/get.php index 84cbd17acf9..fe0b6f6b6f4 100644 --- a/Compute/samples/V1/RegionTargetHttpsProxiesClient/get.php +++ b/Compute/samples/V1/RegionTargetHttpsProxiesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\TargetHttpsProxy; /** - * Returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + * Returns the specified TargetHttpsProxy resource in the specified region. * * @param string $project Project ID for this request. * @param string $region Name of the region scoping this request. diff --git a/Compute/samples/V1/RegionUrlMapsClient/get.php b/Compute/samples/V1/RegionUrlMapsClient/get.php index f924fd13029..d604429d731 100644 --- a/Compute/samples/V1/RegionUrlMapsClient/get.php +++ b/Compute/samples/V1/RegionUrlMapsClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\UrlMap; /** - * Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. + * Returns the specified UrlMap resource. * * @param string $project Project ID for this request. * @param string $region Name of the region scoping this request. diff --git a/Compute/samples/V1/RegionsClient/get.php b/Compute/samples/V1/RegionsClient/get.php index 371a80ab3ee..55e67b5cbd9 100644 --- a/Compute/samples/V1/RegionsClient/get.php +++ b/Compute/samples/V1/RegionsClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\RegionsClient; /** - * Returns the specified Region resource. Gets a list of available regions by making a list() request. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request. + * Returns the specified Region resource. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request. * * @param string $project Project ID for this request. * @param string $region Name of the region resource to return. diff --git a/Compute/samples/V1/RoutersClient/get.php b/Compute/samples/V1/RoutersClient/get.php index 85f5334cbb8..529d3943915 100644 --- a/Compute/samples/V1/RoutersClient/get.php +++ b/Compute/samples/V1/RoutersClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\RoutersClient; /** - * Returns the specified Router resource. Gets a list of available routers by making a list() request. + * Returns the specified Router resource. * * @param string $project Project ID for this request. * @param string $region Name of the region for this request. diff --git a/Compute/samples/V1/RoutesClient/get.php b/Compute/samples/V1/RoutesClient/get.php index d786f2278e7..ed21dc2b004 100644 --- a/Compute/samples/V1/RoutesClient/get.php +++ b/Compute/samples/V1/RoutesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\RoutesClient; /** - * Returns the specified Route resource. Gets a list of available routes by making a list() request. + * Returns the specified Route resource. * * @param string $project Project ID for this request. * @param string $route Name of the Route resource to return. diff --git a/Compute/samples/V1/SnapshotsClient/get.php b/Compute/samples/V1/SnapshotsClient/get.php index e2b6572dfed..cf474645b32 100644 --- a/Compute/samples/V1/SnapshotsClient/get.php +++ b/Compute/samples/V1/SnapshotsClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\SnapshotsClient; /** - * Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request. + * Returns the specified Snapshot resource. * * @param string $project Project ID for this request. * @param string $snapshot Name of the Snapshot resource to return. diff --git a/Compute/samples/V1/SslCertificatesClient/get.php b/Compute/samples/V1/SslCertificatesClient/get.php index 382cf490300..6ceac6d2e6a 100644 --- a/Compute/samples/V1/SslCertificatesClient/get.php +++ b/Compute/samples/V1/SslCertificatesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\SslCertificatesClient; /** - * Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request. + * Returns the specified SslCertificate resource. * * @param string $project Project ID for this request. * @param string $sslCertificate Name of the SslCertificate resource to return. diff --git a/Compute/samples/V1/SslPoliciesClient/insert.php b/Compute/samples/V1/SslPoliciesClient/insert.php index 458dbfe2935..175a2518b88 100644 --- a/Compute/samples/V1/SslPoliciesClient/insert.php +++ b/Compute/samples/V1/SslPoliciesClient/insert.php @@ -30,7 +30,7 @@ use Google\Rpc\Status; /** - * Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request. + * Returns the specified SSL policy resource. * * @param string $project Project ID for this request. */ diff --git a/Compute/samples/V1/SubnetworksClient/get.php b/Compute/samples/V1/SubnetworksClient/get.php index 5f2754da496..3b241ff4b0d 100644 --- a/Compute/samples/V1/SubnetworksClient/get.php +++ b/Compute/samples/V1/SubnetworksClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\SubnetworksClient; /** - * Returns the specified subnetwork. Gets a list of available subnetworks list() request. + * Returns the specified subnetwork. * * @param string $project Project ID for this request. * @param string $region Name of the region scoping this request. diff --git a/Compute/samples/V1/TargetHttpProxiesClient/get.php b/Compute/samples/V1/TargetHttpProxiesClient/get.php index 84903c63ad3..291a12c3d55 100644 --- a/Compute/samples/V1/TargetHttpProxiesClient/get.php +++ b/Compute/samples/V1/TargetHttpProxiesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\TargetHttpProxy; /** - * Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request. + * Returns the specified TargetHttpProxy resource. * * @param string $project Project ID for this request. * @param string $targetHttpProxy Name of the TargetHttpProxy resource to return. diff --git a/Compute/samples/V1/TargetHttpsProxiesClient/get.php b/Compute/samples/V1/TargetHttpsProxiesClient/get.php index 61ac53e1c4f..06b2907920c 100644 --- a/Compute/samples/V1/TargetHttpsProxiesClient/get.php +++ b/Compute/samples/V1/TargetHttpsProxiesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\TargetHttpsProxy; /** - * Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request. + * Returns the specified TargetHttpsProxy resource. * * @param string $project Project ID for this request. * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to return. diff --git a/Compute/samples/V1/TargetInstancesClient/get.php b/Compute/samples/V1/TargetInstancesClient/get.php index 30c43eba9b6..33975c7d8a3 100644 --- a/Compute/samples/V1/TargetInstancesClient/get.php +++ b/Compute/samples/V1/TargetInstancesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\TargetInstancesClient; /** - * Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request. + * Returns the specified TargetInstance resource. * * @param string $project Project ID for this request. * @param string $targetInstance Name of the TargetInstance resource to return. diff --git a/Compute/samples/V1/TargetPoolsClient/get.php b/Compute/samples/V1/TargetPoolsClient/get.php index 252c91e698a..88609cd547e 100644 --- a/Compute/samples/V1/TargetPoolsClient/get.php +++ b/Compute/samples/V1/TargetPoolsClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\TargetPoolsClient; /** - * Returns the specified target pool. Gets a list of available target pools by making a list() request. + * Returns the specified target pool. * * @param string $project Project ID for this request. * @param string $region Name of the region scoping this request. diff --git a/Compute/samples/V1/TargetSslProxiesClient/get.php b/Compute/samples/V1/TargetSslProxiesClient/get.php index 7a26fa1f40b..b2db52493bc 100644 --- a/Compute/samples/V1/TargetSslProxiesClient/get.php +++ b/Compute/samples/V1/TargetSslProxiesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\TargetSslProxy; /** - * Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request. + * Returns the specified TargetSslProxy resource. * * @param string $project Project ID for this request. * @param string $targetSslProxy Name of the TargetSslProxy resource to return. diff --git a/Compute/samples/V1/TargetTcpProxiesClient/get.php b/Compute/samples/V1/TargetTcpProxiesClient/get.php index 5eaac17130b..52cd2b44116 100644 --- a/Compute/samples/V1/TargetTcpProxiesClient/get.php +++ b/Compute/samples/V1/TargetTcpProxiesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\TargetTcpProxy; /** - * Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request. + * Returns the specified TargetTcpProxy resource. * * @param string $project Project ID for this request. * @param string $targetTcpProxy Name of the TargetTcpProxy resource to return. diff --git a/Compute/samples/V1/TargetVpnGatewaysClient/get.php b/Compute/samples/V1/TargetVpnGatewaysClient/get.php index f0b6d1352e8..bb6927b1ac1 100644 --- a/Compute/samples/V1/TargetVpnGatewaysClient/get.php +++ b/Compute/samples/V1/TargetVpnGatewaysClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\TargetVpnGatewaysClient; /** - * Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request. + * Returns the specified target VPN gateway. * * @param string $project Project ID for this request. * @param string $region Name of the region for this request. diff --git a/Compute/samples/V1/UrlMapsClient/get.php b/Compute/samples/V1/UrlMapsClient/get.php index 518749be413..222f7849589 100644 --- a/Compute/samples/V1/UrlMapsClient/get.php +++ b/Compute/samples/V1/UrlMapsClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\UrlMapsClient; /** - * Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. + * Returns the specified UrlMap resource. * * @param string $project Project ID for this request. * @param string $urlMap Name of the UrlMap resource to return. diff --git a/Compute/samples/V1/VpnGatewaysClient/get.php b/Compute/samples/V1/VpnGatewaysClient/get.php index 972eb0ec76f..3357c5d6de0 100644 --- a/Compute/samples/V1/VpnGatewaysClient/get.php +++ b/Compute/samples/V1/VpnGatewaysClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\VpnGatewaysClient; /** - * Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request. + * Returns the specified VPN gateway. * * @param string $project Project ID for this request. * @param string $region Name of the region for this request. diff --git a/Compute/samples/V1/VpnTunnelsClient/get.php b/Compute/samples/V1/VpnTunnelsClient/get.php index fd612800c55..9db29409fa4 100644 --- a/Compute/samples/V1/VpnTunnelsClient/get.php +++ b/Compute/samples/V1/VpnTunnelsClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\VpnTunnelsClient; /** - * Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request. + * Returns the specified VpnTunnel resource. * * @param string $project Project ID for this request. * @param string $region Name of the region for this request. diff --git a/Compute/samples/V1/ZonesClient/get.php b/Compute/samples/V1/ZonesClient/get.php index b3de57cbf37..bab2354b770 100644 --- a/Compute/samples/V1/ZonesClient/get.php +++ b/Compute/samples/V1/ZonesClient/get.php @@ -28,7 +28,7 @@ use Google\Cloud\Compute\V1\ZonesClient; /** - * Returns the specified Zone resource. Gets a list of available zones by making a list() request. + * Returns the specified Zone resource. * * @param string $project Project ID for this request. * @param string $zone Name of the zone resource to return. diff --git a/Compute/src/V1/AccessConfig.php b/Compute/src/V1/AccessConfig.php index 3ecdc5199af..b939a0dc4a7 100644 --- a/Compute/src/V1/AccessConfig.php +++ b/Compute/src/V1/AccessConfig.php @@ -16,7 +16,7 @@ class AccessConfig extends \Google\Protobuf\Internal\Message { /** - * The first IPv6 address of the external IPv6 range associated with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. The field is output only, an IPv6 address from a subnetwork associated with the instance will be allocated dynamically. + * The first IPv6 address of the external IPv6 range associated with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. To use a static external IP address, it must be unused and in the same region as the instance's zone. If not specified, Google Cloud will automatically assign an external IPv6 address from the instance's subnetwork. * * Generated from protobuf field optional string external_ipv6 = 532703707; */ @@ -79,7 +79,7 @@ class AccessConfig extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $external_ipv6 - * The first IPv6 address of the external IPv6 range associated with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. The field is output only, an IPv6 address from a subnetwork associated with the instance will be allocated dynamically. + * The first IPv6 address of the external IPv6 range associated with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. To use a static external IP address, it must be unused and in the same region as the instance's zone. If not specified, Google Cloud will automatically assign an external IPv6 address from the instance's subnetwork. * @type int $external_ipv6_prefix_length * The prefix length of the external IPv6 range. * @type string $kind @@ -106,7 +106,7 @@ public function __construct($data = NULL) { } /** - * The first IPv6 address of the external IPv6 range associated with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. The field is output only, an IPv6 address from a subnetwork associated with the instance will be allocated dynamically. + * The first IPv6 address of the external IPv6 range associated with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. To use a static external IP address, it must be unused and in the same region as the instance's zone. If not specified, Google Cloud will automatically assign an external IPv6 address from the instance's subnetwork. * * Generated from protobuf field optional string external_ipv6 = 532703707; * @return string @@ -127,7 +127,7 @@ public function clearExternalIpv6() } /** - * The first IPv6 address of the external IPv6 range associated with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. The field is output only, an IPv6 address from a subnetwork associated with the instance will be allocated dynamically. + * The first IPv6 address of the external IPv6 range associated with this instance, prefix length is stored in externalIpv6PrefixLength in ipv6AccessConfig. To use a static external IP address, it must be unused and in the same region as the instance's zone. If not specified, Google Cloud will automatically assign an external IPv6 address from the instance's subnetwork. * * Generated from protobuf field optional string external_ipv6 = 532703707; * @param string $var diff --git a/Compute/src/V1/Address/Purpose.php b/Compute/src/V1/Address/Purpose.php index cc638c8e993..7c04c770889 100644 --- a/Compute/src/V1/Address/Purpose.php +++ b/Compute/src/V1/Address/Purpose.php @@ -32,7 +32,7 @@ class Purpose */ const GCE_ENDPOINT = 230515243; /** - * A regional internal IP address range reserved for the VLAN attachment that is used in HA VPN over Cloud Interconnect. This regional internal IP address range must not overlap with any IP address range of subnet/route in the VPC network and its peering networks. After the VLAN attachment is created with the reserved IP address range, when creating a new VPN gateway, its interface IP address is allocated from the associated VLAN attachment���s IP address range. + * A regional internal IP address range reserved for the VLAN attachment that is used in HA VPN over Cloud Interconnect. This regional internal IP address range must not overlap with any IP address range of subnet/route in the VPC network and its peering networks. After the VLAN attachment is created with the reserved IP address range, when creating a new VPN gateway, its interface IP address is allocated from the associated VLAN attachment’s IP address range. * * Generated from protobuf enum IPSEC_INTERCONNECT = 340437251; */ diff --git a/Compute/src/V1/AggregatedListInstanceTemplatesRequest.php b/Compute/src/V1/AggregatedListInstanceTemplatesRequest.php new file mode 100644 index 00000000000..f46f5cb2f88 --- /dev/null +++ b/Compute/src/V1/AggregatedListInstanceTemplatesRequest.php @@ -0,0 +1,331 @@ +google.cloud.compute.v1.AggregatedListInstanceTemplatesRequest + */ +class AggregatedListInstanceTemplatesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. + * + * Generated from protobuf field optional string filter = 336120696; + */ + private $filter = null; + /** + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * + * Generated from protobuf field optional bool include_all_scopes = 391327988; + */ + private $include_all_scopes = null; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * + * Generated from protobuf field optional uint32 max_results = 54715419; + */ + private $max_results = null; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * + * Generated from protobuf field optional string order_by = 160562920; + */ + private $order_by = null; + /** + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * + * Generated from protobuf field optional string page_token = 19994697; + */ + private $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + private $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + private $return_partial_success = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filter + * A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. + * @type bool $include_all_scopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @type int $max_results + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @type string $order_by + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @type string $page_token + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @type string $project + * Name of the project scoping this request. + * @type bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. + * + * Generated from protobuf field optional string filter = 336120696; + * @return string + */ + public function getFilter() + { + return isset($this->filter) ? $this->filter : ''; + } + + public function hasFilter() + { + return isset($this->filter); + } + + public function clearFilter() + { + unset($this->filter); + } + + /** + * A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. + * + * Generated from protobuf field optional string filter = 336120696; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * + * Generated from protobuf field optional bool include_all_scopes = 391327988; + * @return bool + */ + public function getIncludeAllScopes() + { + return isset($this->include_all_scopes) ? $this->include_all_scopes : false; + } + + public function hasIncludeAllScopes() + { + return isset($this->include_all_scopes); + } + + public function clearIncludeAllScopes() + { + unset($this->include_all_scopes); + } + + /** + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * + * Generated from protobuf field optional bool include_all_scopes = 391327988; + * @param bool $var + * @return $this + */ + public function setIncludeAllScopes($var) + { + GPBUtil::checkBool($var); + $this->include_all_scopes = $var; + + return $this; + } + + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * + * Generated from protobuf field optional uint32 max_results = 54715419; + * @return int + */ + public function getMaxResults() + { + return isset($this->max_results) ? $this->max_results : 0; + } + + public function hasMaxResults() + { + return isset($this->max_results); + } + + public function clearMaxResults() + { + unset($this->max_results); + } + + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * + * Generated from protobuf field optional uint32 max_results = 54715419; + * @param int $var + * @return $this + */ + public function setMaxResults($var) + { + GPBUtil::checkUint32($var); + $this->max_results = $var; + + return $this; + } + + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * + * Generated from protobuf field optional string order_by = 160562920; + * @return string + */ + public function getOrderBy() + { + return isset($this->order_by) ? $this->order_by : ''; + } + + public function hasOrderBy() + { + return isset($this->order_by); + } + + public function clearOrderBy() + { + unset($this->order_by); + } + + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * + * Generated from protobuf field optional string order_by = 160562920; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * + * Generated from protobuf field optional string page_token = 19994697; + * @return string + */ + public function getPageToken() + { + return isset($this->page_token) ? $this->page_token : ''; + } + + public function hasPageToken() + { + return isset($this->page_token); + } + + public function clearPageToken() + { + unset($this->page_token); + } + + /** + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * + * Generated from protobuf field optional string page_token = 19994697; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + * @return bool + */ + public function getReturnPartialSuccess() + { + return isset($this->return_partial_success) ? $this->return_partial_success : false; + } + + public function hasReturnPartialSuccess() + { + return isset($this->return_partial_success); + } + + public function clearReturnPartialSuccess() + { + unset($this->return_partial_success); + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + * @param bool $var + * @return $this + */ + public function setReturnPartialSuccess($var) + { + GPBUtil::checkBool($var); + $this->return_partial_success = $var; + + return $this; + } + +} + diff --git a/Compute/src/V1/AllocationResourceStatus.php b/Compute/src/V1/AllocationResourceStatus.php index 77861086ff8..7c16453892e 100644 --- a/Compute/src/V1/AllocationResourceStatus.php +++ b/Compute/src/V1/AllocationResourceStatus.php @@ -9,12 +9,15 @@ use Google\Protobuf\Internal\GPBUtil; /** + * [Output Only] Contains output only fields. * * Generated from protobuf message google.cloud.compute.v1.AllocationResourceStatus */ class AllocationResourceStatus extends \Google\Protobuf\Internal\Message { /** + * Allocation Properties of this reservation. + * * Generated from protobuf field optional .google.cloud.compute.v1.AllocationResourceStatusSpecificSKUAllocation specific_sku_allocation = 196231151; */ private $specific_sku_allocation = null; @@ -26,6 +29,7 @@ class AllocationResourceStatus extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\Compute\V1\AllocationResourceStatusSpecificSKUAllocation $specific_sku_allocation + * Allocation Properties of this reservation. * } */ public function __construct($data = NULL) { @@ -34,6 +38,8 @@ public function __construct($data = NULL) { } /** + * Allocation Properties of this reservation. + * * Generated from protobuf field optional .google.cloud.compute.v1.AllocationResourceStatusSpecificSKUAllocation specific_sku_allocation = 196231151; * @return \Google\Cloud\Compute\V1\AllocationResourceStatusSpecificSKUAllocation|null */ @@ -53,6 +59,8 @@ public function clearSpecificSkuAllocation() } /** + * Allocation Properties of this reservation. + * * Generated from protobuf field optional .google.cloud.compute.v1.AllocationResourceStatusSpecificSKUAllocation specific_sku_allocation = 196231151; * @param \Google\Cloud\Compute\V1\AllocationResourceStatusSpecificSKUAllocation $var * @return $this diff --git a/Compute/src/V1/AllocationResourceStatusSpecificSKUAllocation.php b/Compute/src/V1/AllocationResourceStatusSpecificSKUAllocation.php index 259c47358fa..70463c33cb2 100644 --- a/Compute/src/V1/AllocationResourceStatusSpecificSKUAllocation.php +++ b/Compute/src/V1/AllocationResourceStatusSpecificSKUAllocation.php @@ -9,12 +9,15 @@ use Google\Protobuf\Internal\GPBUtil; /** + * Contains Properties set for the reservation. * * Generated from protobuf message google.cloud.compute.v1.AllocationResourceStatusSpecificSKUAllocation */ class AllocationResourceStatusSpecificSKUAllocation extends \Google\Protobuf\Internal\Message { /** + * ID of the instance template used to populate reservation properties. + * * Generated from protobuf field optional string source_instance_template_id = 111196154; */ private $source_instance_template_id = null; @@ -26,6 +29,7 @@ class AllocationResourceStatusSpecificSKUAllocation extends \Google\Protobuf\Int * Optional. Data for populating the Message object. * * @type string $source_instance_template_id + * ID of the instance template used to populate reservation properties. * } */ public function __construct($data = NULL) { @@ -34,6 +38,8 @@ public function __construct($data = NULL) { } /** + * ID of the instance template used to populate reservation properties. + * * Generated from protobuf field optional string source_instance_template_id = 111196154; * @return string */ @@ -53,6 +59,8 @@ public function clearSourceInstanceTemplateId() } /** + * ID of the instance template used to populate reservation properties. + * * Generated from protobuf field optional string source_instance_template_id = 111196154; * @param string $var * @return $this diff --git a/Compute/src/V1/AutoscalingPolicyScalingSchedule.php b/Compute/src/V1/AutoscalingPolicyScalingSchedule.php index cea6f6e65ba..c857e0101d2 100644 --- a/Compute/src/V1/AutoscalingPolicyScalingSchedule.php +++ b/Compute/src/V1/AutoscalingPolicyScalingSchedule.php @@ -46,7 +46,7 @@ class AutoscalingPolicyScalingSchedule extends \Google\Protobuf\Internal\Message */ private $schedule = null; /** - * The time zone to use when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field is assigned a default value of ���UTC��� if left empty. + * The time zone to use when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field is assigned a default value of “UTC” if left empty. * * Generated from protobuf field optional string time_zone = 36848094; */ @@ -69,7 +69,7 @@ class AutoscalingPolicyScalingSchedule extends \Google\Protobuf\Internal\Message * @type string $schedule * The start timestamps of time intervals when this scaling schedule is to provide a scaling signal. This field uses the extended cron format (with an optional year field). The expression can describe a single timestamp if the optional year is set, in which case the scaling schedule runs once. The schedule is interpreted with respect to time_zone. This field is required. Note: These timestamps only describe when autoscaler starts providing the scaling signal. The VMs need additional time to become serving. * @type string $time_zone - * The time zone to use when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field is assigned a default value of ���UTC��� if left empty. + * The time zone to use when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field is assigned a default value of “UTC” if left empty. * } */ public function __construct($data = NULL) { @@ -258,7 +258,7 @@ public function setSchedule($var) } /** - * The time zone to use when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field is assigned a default value of ���UTC��� if left empty. + * The time zone to use when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field is assigned a default value of “UTC” if left empty. * * Generated from protobuf field optional string time_zone = 36848094; * @return string @@ -279,7 +279,7 @@ public function clearTimeZone() } /** - * The time zone to use when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field is assigned a default value of ���UTC��� if left empty. + * The time zone to use when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field is assigned a default value of “UTC” if left empty. * * Generated from protobuf field optional string time_zone = 36848094; * @param string $var diff --git a/Compute/src/V1/BackendService.php b/Compute/src/V1/BackendService.php index 5ecbbd1c45f..281745a66e4 100644 --- a/Compute/src/V1/BackendService.php +++ b/Compute/src/V1/BackendService.php @@ -140,7 +140,7 @@ class BackendService extends \Google\Protobuf\Internal\Message */ private $load_balancing_scheme = null; /** - * A list of locality load balancing policies to be used in order of preference. Either the policy or the customPolicy field should be set. Overrides any value set in the localityLbPolicy field. localityLbPolicies is only supported when the BackendService is referenced by a URL Map that is referenced by a target gRPC proxy that has the validateForProxyless field set to true. + * A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration. * * Generated from protobuf field repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557; */ @@ -298,7 +298,7 @@ class BackendService extends \Google\Protobuf\Internal\Message * Specifies the load balancer type. A backend service created for one type of load balancer cannot be used with another. For more information, refer to Choosing a load balancer. * Check the LoadBalancingScheme enum for the list of possible values. * @type array<\Google\Cloud\Compute\V1\BackendServiceLocalityLoadBalancingPolicyConfig>|\Google\Protobuf\Internal\RepeatedField $locality_lb_policies - * A list of locality load balancing policies to be used in order of preference. Either the policy or the customPolicy field should be set. Overrides any value set in the localityLbPolicy field. localityLbPolicies is only supported when the BackendService is referenced by a URL Map that is referenced by a target gRPC proxy that has the validateForProxyless field set to true. + * A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration. * @type string $locality_lb_policy * The load balancing algorithm used within the scope of the locality. The possible values are: - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. - RANDOM: The load balancer selects a random healthy host. - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824 This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. If sessionAffinity is not NONE, and this field is not set to MAGLEV or RING_HASH, session affinity settings will not take effect. Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. * Check the LocalityLbPolicy enum for the list of possible values. @@ -1055,7 +1055,7 @@ public function setLoadBalancingScheme($var) } /** - * A list of locality load balancing policies to be used in order of preference. Either the policy or the customPolicy field should be set. Overrides any value set in the localityLbPolicy field. localityLbPolicies is only supported when the BackendService is referenced by a URL Map that is referenced by a target gRPC proxy that has the validateForProxyless field set to true. + * A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration. * * Generated from protobuf field repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557; * @return \Google\Protobuf\Internal\RepeatedField @@ -1066,7 +1066,7 @@ public function getLocalityLbPolicies() } /** - * A list of locality load balancing policies to be used in order of preference. Either the policy or the customPolicy field should be set. Overrides any value set in the localityLbPolicy field. localityLbPolicies is only supported when the BackendService is referenced by a URL Map that is referenced by a target gRPC proxy that has the validateForProxyless field set to true. + * A list of locality load-balancing policies to be used in order of preference. When you use localityLbPolicies, you must set at least one value for either the localityLbPolicies[].policy or the localityLbPolicies[].customPolicy field. localityLbPolicies overrides any value set in the localityLbPolicy field. For an example of how to use this field, see Define a list of preferred policies. Caution: This field and its children are intended for use in a service mesh that includes gRPC clients only. Envoy proxies can't use backend services that have this configuration. * * Generated from protobuf field repeated .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig locality_lb_policies = 140982557; * @param array<\Google\Cloud\Compute\V1\BackendServiceLocalityLoadBalancingPolicyConfig>|\Google\Protobuf\Internal\RepeatedField $var diff --git a/Compute/src/V1/BackendService/LocalityLbPolicy.php b/Compute/src/V1/BackendService/LocalityLbPolicy.php index 25475f0bf7b..7252e744fe4 100644 --- a/Compute/src/V1/BackendService/LocalityLbPolicy.php +++ b/Compute/src/V1/BackendService/LocalityLbPolicy.php @@ -59,6 +59,12 @@ class LocalityLbPolicy * Generated from protobuf enum ROUND_ROBIN = 153895801; */ const ROUND_ROBIN = 153895801; + /** + * Per-instance weighted Load Balancing via health check reported weights. If set, the Backend Service must configure a non legacy HTTP-based Health Check, and health check replies are expected to contain non-standard HTTP response header field X-Load-Balancing-Endpoint-Weight to specify the per-instance weights. If set, Load Balancing is weighted based on the per-instance weights reported in the last processed health check replies, as long as every instance either reported a valid weight or had UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains equal-weight. This option is only supported in Network Load Balancing. + * + * Generated from protobuf enum WEIGHTED_MAGLEV = 254930962; + */ + const WEIGHTED_MAGLEV = 254930962; private static $valueToName = [ self::UNDEFINED_LOCALITY_LB_POLICY => 'UNDEFINED_LOCALITY_LB_POLICY', @@ -69,6 +75,7 @@ class LocalityLbPolicy self::RANDOM => 'RANDOM', self::RING_HASH => 'RING_HASH', self::ROUND_ROBIN => 'ROUND_ROBIN', + self::WEIGHTED_MAGLEV => 'WEIGHTED_MAGLEV', ]; public static function name($value) diff --git a/Compute/src/V1/BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy.php b/Compute/src/V1/BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy.php index 56c3ba01ebf..b7f24a428a2 100644 --- a/Compute/src/V1/BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy.php +++ b/Compute/src/V1/BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy.php @@ -22,7 +22,7 @@ class BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy extends \Googl */ private $data = null; /** - * Identifies the custom policy. The value should match the type the custom implementation is registered with on the gRPC clients. It should follow protocol buffer message naming conventions and include the full path (e.g. myorg.CustomLbPolicy). The maximum length is 256 characters. Note that specifying the same custom policy more than once for a backend is not a valid configuration and will be rejected. + * Identifies the custom policy. The value should match the name of a custom implementation registered on the gRPC clients. It should follow protocol buffer message naming conventions and include the full path (for example, myorg.CustomLbPolicy). The maximum length is 256 characters. Do not specify the same custom policy more than once for a backend. If you do, the configuration is rejected. For an example of how to use this field, see Use a custom policy. * * Generated from protobuf field optional string name = 3373707; */ @@ -37,7 +37,7 @@ class BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy extends \Googl * @type string $data * An optional, arbitrary JSON object with configuration data, understood by a locally installed custom policy implementation. * @type string $name - * Identifies the custom policy. The value should match the type the custom implementation is registered with on the gRPC clients. It should follow protocol buffer message naming conventions and include the full path (e.g. myorg.CustomLbPolicy). The maximum length is 256 characters. Note that specifying the same custom policy more than once for a backend is not a valid configuration and will be rejected. + * Identifies the custom policy. The value should match the name of a custom implementation registered on the gRPC clients. It should follow protocol buffer message naming conventions and include the full path (for example, myorg.CustomLbPolicy). The maximum length is 256 characters. Do not specify the same custom policy more than once for a backend. If you do, the configuration is rejected. For an example of how to use this field, see Use a custom policy. * } */ public function __construct($data = NULL) { @@ -82,7 +82,7 @@ public function setData($var) } /** - * Identifies the custom policy. The value should match the type the custom implementation is registered with on the gRPC clients. It should follow protocol buffer message naming conventions and include the full path (e.g. myorg.CustomLbPolicy). The maximum length is 256 characters. Note that specifying the same custom policy more than once for a backend is not a valid configuration and will be rejected. + * Identifies the custom policy. The value should match the name of a custom implementation registered on the gRPC clients. It should follow protocol buffer message naming conventions and include the full path (for example, myorg.CustomLbPolicy). The maximum length is 256 characters. Do not specify the same custom policy more than once for a backend. If you do, the configuration is rejected. For an example of how to use this field, see Use a custom policy. * * Generated from protobuf field optional string name = 3373707; * @return string @@ -103,7 +103,7 @@ public function clearName() } /** - * Identifies the custom policy. The value should match the type the custom implementation is registered with on the gRPC clients. It should follow protocol buffer message naming conventions and include the full path (e.g. myorg.CustomLbPolicy). The maximum length is 256 characters. Note that specifying the same custom policy more than once for a backend is not a valid configuration and will be rejected. + * Identifies the custom policy. The value should match the name of a custom implementation registered on the gRPC clients. It should follow protocol buffer message naming conventions and include the full path (for example, myorg.CustomLbPolicy). The maximum length is 256 characters. Do not specify the same custom policy more than once for a backend. If you do, the configuration is rejected. For an example of how to use this field, see Use a custom policy. * * Generated from protobuf field optional string name = 3373707; * @param string $var diff --git a/Compute/src/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy.php b/Compute/src/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy.php index 9814659de1c..6ee4d5ac35b 100644 --- a/Compute/src/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy.php +++ b/Compute/src/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy.php @@ -16,7 +16,7 @@ class BackendServiceLocalityLoadBalancingPolicyConfigPolicy extends \Google\Protobuf\Internal\Message { /** - * The name of a locality load balancer policy to be used. The value should be one of the predefined ones as supported by localityLbPolicy, although at the moment only ROUND_ROBIN is supported. This field should only be populated when the customPolicy field is not used. Note that specifying the same policy more than once for a backend is not a valid configuration and will be rejected. + * The name of a locality load-balancing policy. Valid values include ROUND_ROBIN and, for Java clients, LEAST_REQUEST. For information about these values, see the description of localityLbPolicy. Do not specify the same policy more than once for a backend. If you do, the configuration is rejected. * Check the Name enum for the list of possible values. * * Generated from protobuf field optional string name = 3373707; @@ -30,7 +30,7 @@ class BackendServiceLocalityLoadBalancingPolicyConfigPolicy extends \Google\Prot * Optional. Data for populating the Message object. * * @type string $name - * The name of a locality load balancer policy to be used. The value should be one of the predefined ones as supported by localityLbPolicy, although at the moment only ROUND_ROBIN is supported. This field should only be populated when the customPolicy field is not used. Note that specifying the same policy more than once for a backend is not a valid configuration and will be rejected. + * The name of a locality load-balancing policy. Valid values include ROUND_ROBIN and, for Java clients, LEAST_REQUEST. For information about these values, see the description of localityLbPolicy. Do not specify the same policy more than once for a backend. If you do, the configuration is rejected. * Check the Name enum for the list of possible values. * } */ @@ -40,7 +40,7 @@ public function __construct($data = NULL) { } /** - * The name of a locality load balancer policy to be used. The value should be one of the predefined ones as supported by localityLbPolicy, although at the moment only ROUND_ROBIN is supported. This field should only be populated when the customPolicy field is not used. Note that specifying the same policy more than once for a backend is not a valid configuration and will be rejected. + * The name of a locality load-balancing policy. Valid values include ROUND_ROBIN and, for Java clients, LEAST_REQUEST. For information about these values, see the description of localityLbPolicy. Do not specify the same policy more than once for a backend. If you do, the configuration is rejected. * Check the Name enum for the list of possible values. * * Generated from protobuf field optional string name = 3373707; @@ -62,7 +62,7 @@ public function clearName() } /** - * The name of a locality load balancer policy to be used. The value should be one of the predefined ones as supported by localityLbPolicy, although at the moment only ROUND_ROBIN is supported. This field should only be populated when the customPolicy field is not used. Note that specifying the same policy more than once for a backend is not a valid configuration and will be rejected. + * The name of a locality load-balancing policy. Valid values include ROUND_ROBIN and, for Java clients, LEAST_REQUEST. For information about these values, see the description of localityLbPolicy. Do not specify the same policy more than once for a backend. If you do, the configuration is rejected. * Check the Name enum for the list of possible values. * * Generated from protobuf field optional string name = 3373707; diff --git a/Compute/src/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy/Name.php b/Compute/src/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy/Name.php index 7269deed113..d9568926b6e 100644 --- a/Compute/src/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy/Name.php +++ b/Compute/src/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy/Name.php @@ -7,7 +7,7 @@ use UnexpectedValueException; /** - * The name of a locality load balancer policy to be used. The value should be one of the predefined ones as supported by localityLbPolicy, although at the moment only ROUND_ROBIN is supported. This field should only be populated when the customPolicy field is not used. Note that specifying the same policy more than once for a backend is not a valid configuration and will be rejected. + * The name of a locality load-balancing policy. Valid values include ROUND_ROBIN and, for Java clients, LEAST_REQUEST. For information about these values, see the description of localityLbPolicy. Do not specify the same policy more than once for a backend. If you do, the configuration is rejected. * * Protobuf type google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfigPolicy.Name */ @@ -59,6 +59,12 @@ class Name * Generated from protobuf enum ROUND_ROBIN = 153895801; */ const ROUND_ROBIN = 153895801; + /** + * Per-instance weighted Load Balancing via health check reported weights. If set, the Backend Service must configure a non legacy HTTP-based Health Check, and health check replies are expected to contain non-standard HTTP response header field X-Load-Balancing-Endpoint-Weight to specify the per-instance weights. If set, Load Balancing is weighted based on the per-instance weights reported in the last processed health check replies, as long as every instance either reported a valid weight or had UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains equal-weight. This option is only supported in Network Load Balancing. + * + * Generated from protobuf enum WEIGHTED_MAGLEV = 254930962; + */ + const WEIGHTED_MAGLEV = 254930962; private static $valueToName = [ self::UNDEFINED_NAME => 'UNDEFINED_NAME', @@ -69,6 +75,7 @@ class Name self::RANDOM => 'RANDOM', self::RING_HASH => 'RING_HASH', self::ROUND_ROBIN => 'ROUND_ROBIN', + self::WEIGHTED_MAGLEV => 'WEIGHTED_MAGLEV', ]; public static function name($value) diff --git a/Compute/src/V1/BackendServiceLogConfig.php b/Compute/src/V1/BackendServiceLogConfig.php index 90052292fe0..aba14cd1130 100644 --- a/Compute/src/V1/BackendServiceLogConfig.php +++ b/Compute/src/V1/BackendServiceLogConfig.php @@ -21,6 +21,19 @@ class BackendServiceLogConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional bool enable = 311764355; */ private $enable = null; + /** + * This field can only be specified if logging is enabled for this backend service and "logConfig.optionalMode" was set to CUSTOM. Contains a list of optional fields you want to include in the logs. For example: serverInstance, serverGkeDetails.cluster, serverGkeDetails.pod.podNamespace + * + * Generated from protobuf field repeated string optional_fields = 528589944; + */ + private $optional_fields; + /** + * This field can only be specified if logging is enabled for this backend service. Configures whether all, none or a subset of optional fields should be added to the reported logs. One of [INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM]. Default is EXCLUDE_ALL_OPTIONAL. + * Check the OptionalMode enum for the list of possible values. + * + * Generated from protobuf field optional string optional_mode = 128697122; + */ + private $optional_mode = null; /** * This field can only be specified if logging is enabled for this backend service. The value of the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The default value is 1.0. * @@ -36,6 +49,11 @@ class BackendServiceLogConfig extends \Google\Protobuf\Internal\Message * * @type bool $enable * Denotes whether to enable logging for the load balancer traffic served by this backend service. The default value is false. + * @type array|\Google\Protobuf\Internal\RepeatedField $optional_fields + * This field can only be specified if logging is enabled for this backend service and "logConfig.optionalMode" was set to CUSTOM. Contains a list of optional fields you want to include in the logs. For example: serverInstance, serverGkeDetails.cluster, serverGkeDetails.pod.podNamespace + * @type string $optional_mode + * This field can only be specified if logging is enabled for this backend service. Configures whether all, none or a subset of optional fields should be added to the reported logs. One of [INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM]. Default is EXCLUDE_ALL_OPTIONAL. + * Check the OptionalMode enum for the list of possible values. * @type float $sample_rate * This field can only be specified if logging is enabled for this backend service. The value of the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The default value is 1.0. * } @@ -81,6 +99,70 @@ public function setEnable($var) return $this; } + /** + * This field can only be specified if logging is enabled for this backend service and "logConfig.optionalMode" was set to CUSTOM. Contains a list of optional fields you want to include in the logs. For example: serverInstance, serverGkeDetails.cluster, serverGkeDetails.pod.podNamespace + * + * Generated from protobuf field repeated string optional_fields = 528589944; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptionalFields() + { + return $this->optional_fields; + } + + /** + * This field can only be specified if logging is enabled for this backend service and "logConfig.optionalMode" was set to CUSTOM. Contains a list of optional fields you want to include in the logs. For example: serverInstance, serverGkeDetails.cluster, serverGkeDetails.pod.podNamespace + * + * Generated from protobuf field repeated string optional_fields = 528589944; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptionalFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->optional_fields = $arr; + + return $this; + } + + /** + * This field can only be specified if logging is enabled for this backend service. Configures whether all, none or a subset of optional fields should be added to the reported logs. One of [INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM]. Default is EXCLUDE_ALL_OPTIONAL. + * Check the OptionalMode enum for the list of possible values. + * + * Generated from protobuf field optional string optional_mode = 128697122; + * @return string + */ + public function getOptionalMode() + { + return isset($this->optional_mode) ? $this->optional_mode : ''; + } + + public function hasOptionalMode() + { + return isset($this->optional_mode); + } + + public function clearOptionalMode() + { + unset($this->optional_mode); + } + + /** + * This field can only be specified if logging is enabled for this backend service. Configures whether all, none or a subset of optional fields should be added to the reported logs. One of [INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM]. Default is EXCLUDE_ALL_OPTIONAL. + * Check the OptionalMode enum for the list of possible values. + * + * Generated from protobuf field optional string optional_mode = 128697122; + * @param string $var + * @return $this + */ + public function setOptionalMode($var) + { + GPBUtil::checkString($var, True); + $this->optional_mode = $var; + + return $this; + } + /** * This field can only be specified if logging is enabled for this backend service. The value of the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The default value is 1.0. * diff --git a/Compute/src/V1/BackendServiceLogConfig/OptionalMode.php b/Compute/src/V1/BackendServiceLogConfig/OptionalMode.php new file mode 100644 index 00000000000..cd0c5670bc6 --- /dev/null +++ b/Compute/src/V1/BackendServiceLogConfig/OptionalMode.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.BackendServiceLogConfig.OptionalMode + */ +class OptionalMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_OPTIONAL_MODE = 0; + */ + const UNDEFINED_OPTIONAL_MODE = 0; + /** + * A subset of optional fields. + * + * Generated from protobuf enum CUSTOM = 388595569; + */ + const CUSTOM = 388595569; + /** + * None optional fields. + * + * Generated from protobuf enum EXCLUDE_ALL_OPTIONAL = 168636099; + */ + const EXCLUDE_ALL_OPTIONAL = 168636099; + /** + * All optional fields. + * + * Generated from protobuf enum INCLUDE_ALL_OPTIONAL = 535606965; + */ + const INCLUDE_ALL_OPTIONAL = 535606965; + + private static $valueToName = [ + self::UNDEFINED_OPTIONAL_MODE => 'UNDEFINED_OPTIONAL_MODE', + self::CUSTOM => 'CUSTOM', + self::EXCLUDE_ALL_OPTIONAL => 'EXCLUDE_ALL_OPTIONAL', + self::INCLUDE_ALL_OPTIONAL => 'INCLUDE_ALL_OPTIONAL', + ]; + + 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/Compute/src/V1/Binding.php b/Compute/src/V1/Binding.php index fc3b8e27bb5..cd5f06013bd 100644 --- a/Compute/src/V1/Binding.php +++ b/Compute/src/V1/Binding.php @@ -28,7 +28,7 @@ class Binding extends \Google\Protobuf\Internal\Message */ private $condition = null; /** - * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. + * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * * Generated from protobuf field repeated string members = 412010777; */ @@ -51,7 +51,7 @@ class Binding extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Compute\V1\Expr $condition * The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). * @type array|\Google\Protobuf\Internal\RepeatedField $members - * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. + * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * @type string $role * Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. * } @@ -134,7 +134,7 @@ public function setCondition($var) } /** - * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. + * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * * Generated from protobuf field repeated string members = 412010777; * @return \Google\Protobuf\Internal\RepeatedField @@ -145,7 +145,7 @@ public function getMembers() } /** - * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. + * Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * * Generated from protobuf field repeated string members = 412010777; * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/Compute/src/V1/Commitment/Status.php b/Compute/src/V1/Commitment/Status.php index 4e7abfd587b..1cad544b039 100644 --- a/Compute/src/V1/Commitment/Status.php +++ b/Compute/src/V1/Commitment/Status.php @@ -24,6 +24,8 @@ class Status */ const ACTIVE = 314733318; /** + * Deprecate CANCELED status. Will use separate status to differentiate cancel by mergeCud or manual cancellation. + * * Generated from protobuf enum CANCELLED = 41957681; */ const CANCELLED = 41957681; diff --git a/Compute/src/V1/Commitment/Type.php b/Compute/src/V1/Commitment/Type.php index 47caf365d0f..0f77e1fe9a8 100644 --- a/Compute/src/V1/Commitment/Type.php +++ b/Compute/src/V1/Commitment/Type.php @@ -31,6 +31,10 @@ class Type * Generated from protobuf enum COMPUTE_OPTIMIZED_C2D = 383246453; */ const COMPUTE_OPTIMIZED_C2D = 383246453; + /** + * Generated from protobuf enum COMPUTE_OPTIMIZED_C3 = 428004784; + */ + const COMPUTE_OPTIMIZED_C3 = 428004784; /** * Generated from protobuf enum GENERAL_PURPOSE = 299793543; */ @@ -69,6 +73,7 @@ class Type self::ACCELERATOR_OPTIMIZED => 'ACCELERATOR_OPTIMIZED', self::COMPUTE_OPTIMIZED => 'COMPUTE_OPTIMIZED', self::COMPUTE_OPTIMIZED_C2D => 'COMPUTE_OPTIMIZED_C2D', + self::COMPUTE_OPTIMIZED_C3 => 'COMPUTE_OPTIMIZED_C3', self::GENERAL_PURPOSE => 'GENERAL_PURPOSE', self::GENERAL_PURPOSE_E2 => 'GENERAL_PURPOSE_E2', self::GENERAL_PURPOSE_N2 => 'GENERAL_PURPOSE_N2', diff --git a/Compute/src/V1/DeleteRegionInstanceTemplateRequest.php b/Compute/src/V1/DeleteRegionInstanceTemplateRequest.php new file mode 100644 index 00000000000..31219823c1f --- /dev/null +++ b/Compute/src/V1/DeleteRegionInstanceTemplateRequest.php @@ -0,0 +1,179 @@ +google.cloud.compute.v1.DeleteRegionInstanceTemplateRequest + */ +class DeleteRegionInstanceTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the instance template to delete. + * + * Generated from protobuf field string instance_template = 309248228 [(.google.api.field_behavior) = REQUIRED]; + */ + private $instance_template = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + private $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + private $region = ''; + /** + * 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. 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 optional string request_id = 37109963; + */ + private $request_id = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_template + * The name of the instance template to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $request_id + * 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. 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\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the instance template to delete. + * + * Generated from protobuf field string instance_template = 309248228 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceTemplate() + { + return $this->instance_template; + } + + /** + * The name of the instance template to delete. + * + * Generated from protobuf field string instance_template = 309248228 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceTemplate($var) + { + GPBUtil::checkString($var, True); + $this->instance_template = $var; + + return $this; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + + /** + * 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. 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 optional string request_id = 37109963; + * @return string + */ + public function getRequestId() + { + return isset($this->request_id) ? $this->request_id : ''; + } + + public function hasRequestId() + { + return isset($this->request_id); + } + + public function clearRequestId() + { + unset($this->request_id); + } + + /** + * 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. 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 optional string request_id = 37109963; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/Compute/src/V1/Enums/BackendService/LocalityLbPolicy.php b/Compute/src/V1/Enums/BackendService/LocalityLbPolicy.php index 5297a931d48..11ee06b8808 100644 --- a/Compute/src/V1/Enums/BackendService/LocalityLbPolicy.php +++ b/Compute/src/V1/Enums/BackendService/LocalityLbPolicy.php @@ -45,4 +45,6 @@ class LocalityLbPolicy const RING_HASH = 'RING_HASH'; const ROUND_ROBIN = 'ROUND_ROBIN'; + + const WEIGHTED_MAGLEV = 'WEIGHTED_MAGLEV'; } diff --git a/Compute/src/V1/Enums/BackendServiceLocalityLoadBalancingPolicyConfigPolicy/Name.php b/Compute/src/V1/Enums/BackendServiceLocalityLoadBalancingPolicyConfigPolicy/Name.php index 9bb20edfdf5..a126219871e 100644 --- a/Compute/src/V1/Enums/BackendServiceLocalityLoadBalancingPolicyConfigPolicy/Name.php +++ b/Compute/src/V1/Enums/BackendServiceLocalityLoadBalancingPolicyConfigPolicy/Name.php @@ -46,4 +46,6 @@ class Name const RING_HASH = 'RING_HASH'; const ROUND_ROBIN = 'ROUND_ROBIN'; + + const WEIGHTED_MAGLEV = 'WEIGHTED_MAGLEV'; } diff --git a/Compute/src/V1/Enums/BackendServiceLogConfig/OptionalMode.php b/Compute/src/V1/Enums/BackendServiceLogConfig/OptionalMode.php new file mode 100644 index 00000000000..08e21beac1e --- /dev/null +++ b/Compute/src/V1/Enums/BackendServiceLogConfig/OptionalMode.php @@ -0,0 +1,40 @@ +optional string backend_service = 306946058; */ private $backend_service = null; + /** + * [Output Only] The URL for the corresponding base Forwarding Rule. By base Forwarding Rule, we mean the Forwarding Rule that has the same IP address, protocol, and port settings with the current Forwarding Rule, but without sourceIPRanges specified. Always empty if the current Forwarding Rule does not have sourceIPRanges specified. + * + * Generated from protobuf field optional string base_forwarding_rule = 524873104; + */ + private $base_forwarding_rule = null; /** * [Output Only] Creation timestamp in RFC3339 text format. * @@ -194,6 +200,12 @@ class ForwardingRule extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional string service_name = 359880149; */ private $service_name = null; + /** + * If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each source_ip_range entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + * + * Generated from protobuf field repeated string source_ip_ranges = 111563210; + */ + private $source_ip_ranges; /** * This field identifies the subnetwork that the load balanced IP should belong to for this Forwarding Rule, used in internal load balancing and network load balancing with IPv6. If the network specified is in auto subnet mode, this field is optional. However, a subnetwork must be specified if the network is in custom subnet mode or when creating external forwarding rule with IPv6. * @@ -224,6 +236,8 @@ class ForwardingRule extends \Google\Protobuf\Internal\Message * This field is used along with the backend_service field for internal load balancing or with the target field for internal TargetInstance. If the field is set to TRUE, clients can access ILB from all regions. Otherwise only allows access from clients in the same region as the internal load balancer. * @type string $backend_service * Identifies the backend service to which the forwarding rule sends traffic. Required for Internal TCP/UDP Load Balancing and Network Load Balancing; must be omitted for all other load balancer types. + * @type string $base_forwarding_rule + * [Output Only] The URL for the corresponding base Forwarding Rule. By base Forwarding Rule, we mean the Forwarding Rule that has the same IP address, protocol, and port settings with the current Forwarding Rule, but without sourceIPRanges specified. Always empty if the current Forwarding Rule does not have sourceIPRanges specified. * @type string $creation_timestamp * [Output Only] Creation timestamp in RFC3339 text format. * @type string $description @@ -276,6 +290,8 @@ class ForwardingRule extends \Google\Protobuf\Internal\Message * An optional prefix to the service name for this Forwarding Rule. If specified, the prefix is the first label of the fully qualified service name. The label must be 1-63 characters long, and comply with RFC1035. Specifically, the label must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. This field is only used for internal load balancing. * @type string $service_name * [Output Only] The internal fully qualified service name for this Forwarding Rule. This field is only used for internal load balancing. + * @type array|\Google\Protobuf\Internal\RepeatedField $source_ip_ranges + * If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each source_ip_range entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). * @type string $subnetwork * This field identifies the subnetwork that the load balanced IP should belong to for this Forwarding Rule, used in internal load balancing and network load balancing with IPv6. If the network specified is in auto subnet mode, this field is optional. However, a subnetwork must be specified if the network is in custom subnet mode or when creating external forwarding rule with IPv6. * @type string $target @@ -469,6 +485,42 @@ public function setBackendService($var) return $this; } + /** + * [Output Only] The URL for the corresponding base Forwarding Rule. By base Forwarding Rule, we mean the Forwarding Rule that has the same IP address, protocol, and port settings with the current Forwarding Rule, but without sourceIPRanges specified. Always empty if the current Forwarding Rule does not have sourceIPRanges specified. + * + * Generated from protobuf field optional string base_forwarding_rule = 524873104; + * @return string + */ + public function getBaseForwardingRule() + { + return isset($this->base_forwarding_rule) ? $this->base_forwarding_rule : ''; + } + + public function hasBaseForwardingRule() + { + return isset($this->base_forwarding_rule); + } + + public function clearBaseForwardingRule() + { + unset($this->base_forwarding_rule); + } + + /** + * [Output Only] The URL for the corresponding base Forwarding Rule. By base Forwarding Rule, we mean the Forwarding Rule that has the same IP address, protocol, and port settings with the current Forwarding Rule, but without sourceIPRanges specified. Always empty if the current Forwarding Rule does not have sourceIPRanges specified. + * + * Generated from protobuf field optional string base_forwarding_rule = 524873104; + * @param string $var + * @return $this + */ + public function setBaseForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->base_forwarding_rule = $var; + + return $this; + } + /** * [Output Only] Creation timestamp in RFC3339 text format. * @@ -1301,6 +1353,32 @@ public function setServiceName($var) return $this; } + /** + * If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each source_ip_range entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + * + * Generated from protobuf field repeated string source_ip_ranges = 111563210; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceIpRanges() + { + return $this->source_ip_ranges; + } + + /** + * If not empty, this Forwarding Rule will only forward the traffic when the source IP address matches one of the IP addresses or CIDR ranges set here. Note that a Forwarding Rule can only have up to 64 source IP ranges, and this field can only be used with a regional Forwarding Rule whose scheme is EXTERNAL. Each source_ip_range entry should be either an IP address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24). + * + * Generated from protobuf field repeated string source_ip_ranges = 111563210; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_ip_ranges = $arr; + + return $this; + } + /** * This field identifies the subnetwork that the load balanced IP should belong to for this Forwarding Rule, used in internal load balancing and network load balancing with IPv6. If the network specified is in auto subnet mode, this field is optional. However, a subnetwork must be specified if the network is in custom subnet mode or when creating external forwarding rule with IPv6. * diff --git a/Compute/src/V1/Gapic/AutoscalersGapicClient.php b/Compute/src/V1/Gapic/AutoscalersGapicClient.php index 595132e8c13..aa4e05883a9 100644 --- a/Compute/src/V1/Gapic/AutoscalersGapicClient.php +++ b/Compute/src/V1/Gapic/AutoscalersGapicClient.php @@ -405,7 +405,7 @@ public function delete($autoscaler, $project, $zone, array $optionalArgs = []) } /** - * Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request. + * Returns the specified autoscaler resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/BackendBucketsGapicClient.php b/Compute/src/V1/Gapic/BackendBucketsGapicClient.php index dc0df2067b0..2a6cdbc917f 100644 --- a/Compute/src/V1/Gapic/BackendBucketsGapicClient.php +++ b/Compute/src/V1/Gapic/BackendBucketsGapicClient.php @@ -476,7 +476,7 @@ public function deleteSignedUrlKey($backendBucket, $keyName, $project, array $op } /** - * Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request. + * Returns the specified BackendBucket resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/BackendServicesGapicClient.php b/Compute/src/V1/Gapic/BackendServicesGapicClient.php index 94846330ea3..2293a1ca394 100644 --- a/Compute/src/V1/Gapic/BackendServicesGapicClient.php +++ b/Compute/src/V1/Gapic/BackendServicesGapicClient.php @@ -576,7 +576,7 @@ public function deleteSignedUrlKey($backendService, $keyName, $project, array $o } /** - * Returns the specified BackendService resource. Gets a list of available backend services. + * Returns the specified BackendService resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/DiskTypesGapicClient.php b/Compute/src/V1/Gapic/DiskTypesGapicClient.php index acb3c516619..f6853f8bc4f 100644 --- a/Compute/src/V1/Gapic/DiskTypesGapicClient.php +++ b/Compute/src/V1/Gapic/DiskTypesGapicClient.php @@ -271,7 +271,7 @@ public function aggregatedList($project, array $optionalArgs = []) } /** - * Returns the specified disk type. Gets a list of available disk types by making a list() request. + * Returns the specified disk type. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/DisksGapicClient.php b/Compute/src/V1/Gapic/DisksGapicClient.php index 2015d991da6..f3ae67ac9b6 100644 --- a/Compute/src/V1/Gapic/DisksGapicClient.php +++ b/Compute/src/V1/Gapic/DisksGapicClient.php @@ -57,6 +57,7 @@ use Google\Cloud\Compute\V1\TestIamPermissionsDiskRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; +use Google\Cloud\Compute\V1\UpdateDiskRequest; use Google\Cloud\Compute\V1\ZoneOperationsClient; use Google\Cloud\Compute\V1\ZoneSetLabelsRequest; use Google\Cloud\Compute\V1\ZoneSetPolicyRequest; @@ -598,7 +599,7 @@ public function delete($disk, $project, $zone, array $optionalArgs = []) } /** - * Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request. + * Returns the specified persistent disk. * * Sample code: * ``` @@ -1202,4 +1203,94 @@ public function testIamPermissions($project, $resource, $testPermissionsRequestR $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); } + + /** + * Updates the specified disk with the data included in the request. The update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $disk = 'disk'; + * $diskResource = new Disk(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $disksClient->update($disk, $diskResource, $project, $zone); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // if creating/modifying, retrieve the target resource + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $disksClient->update($disk, $diskResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $disksClient->resumeOperation($operationName, 'update'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // if creating/modifying, retrieve the target resource + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $disksClient->close(); + * } + * ``` + * + * @param string $disk The disk name for this request. + * @param Disk $diskResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $paths + * @type string $requestId + * 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. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + * @type string $updateMask + * update_mask indicates fields to be updated as part of this request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function update($disk, $diskResource, $project, $zone, array $optionalArgs = []) + { + $request = new UpdateDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setDiskResource($diskResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['disk'] = $disk; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['paths'])) { + $request->setPaths($optionalArgs['paths']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } } diff --git a/Compute/src/V1/Gapic/FirewallPoliciesGapicClient.php b/Compute/src/V1/Gapic/FirewallPoliciesGapicClient.php index f80dcc5c56d..83bc439534b 100644 --- a/Compute/src/V1/Gapic/FirewallPoliciesGapicClient.php +++ b/Compute/src/V1/Gapic/FirewallPoliciesGapicClient.php @@ -836,7 +836,7 @@ public function insert($firewallPolicyResource, $parentId, array $optionalArgs = * of values will be returned. Any page token used here must have * been generated by a previous call to the API. * @type string $parentId - * Parent ID for this request. + * Parent ID for this request. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. * @type bool $returnPartialSuccess * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. * @type RetrySettings|array $retrySettings @@ -956,7 +956,7 @@ public function listAssociations(array $optionalArgs = []) * ``` * * @param string $firewallPolicy Name of the firewall policy to update. - * @param string $parentId The new parent of the firewall policy. + * @param string $parentId The new parent of the firewall policy. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. * @param array $optionalArgs { * Optional. * diff --git a/Compute/src/V1/Gapic/GlobalAddressesGapicClient.php b/Compute/src/V1/Gapic/GlobalAddressesGapicClient.php index 4fd98d7486e..8c9dc38e3aa 100644 --- a/Compute/src/V1/Gapic/GlobalAddressesGapicClient.php +++ b/Compute/src/V1/Gapic/GlobalAddressesGapicClient.php @@ -320,7 +320,7 @@ public function delete($address, $project, array $optionalArgs = []) } /** - * Returns the specified address resource. Gets a list of available addresses by making a list() request. + * Returns the specified address resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/GlobalNetworkEndpointGroupsGapicClient.php b/Compute/src/V1/Gapic/GlobalNetworkEndpointGroupsGapicClient.php index 86981198ab6..483de7593e3 100644 --- a/Compute/src/V1/Gapic/GlobalNetworkEndpointGroupsGapicClient.php +++ b/Compute/src/V1/Gapic/GlobalNetworkEndpointGroupsGapicClient.php @@ -475,7 +475,7 @@ public function detachNetworkEndpoints($globalNetworkEndpointGroupsDetachEndpoin } /** - * Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * Returns the specified network endpoint group. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/HealthChecksGapicClient.php b/Compute/src/V1/Gapic/HealthChecksGapicClient.php index 70eac1d2357..ec92036970d 100644 --- a/Compute/src/V1/Gapic/HealthChecksGapicClient.php +++ b/Compute/src/V1/Gapic/HealthChecksGapicClient.php @@ -400,7 +400,7 @@ public function delete($healthCheck, $project, array $optionalArgs = []) } /** - * Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + * Returns the specified HealthCheck resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/ImagesGapicClient.php b/Compute/src/V1/Gapic/ImagesGapicClient.php index f2dd496af1d..4bc71065267 100644 --- a/Compute/src/V1/Gapic/ImagesGapicClient.php +++ b/Compute/src/V1/Gapic/ImagesGapicClient.php @@ -406,7 +406,7 @@ public function deprecate($deprecationStatusResource, $image, $project, array $o } /** - * Returns the specified image. Gets a list of available images by making a list() request. + * Returns the specified image. * * Sample code: * ``` @@ -449,7 +449,7 @@ public function get($image, $project, array $optionalArgs = []) } /** - * Returns the latest image that is part of an image family and is not deprecated. + * Returns the latest image that is part of an image family and is not deprecated. For more information on image families, see Public image families documentation. * * Sample code: * ``` @@ -464,7 +464,7 @@ public function get($image, $project, array $optionalArgs = []) * ``` * * @param string $family Name of the image family to search for. - * @param string $project Project ID for this request. + * @param string $project The image project that the image belongs to. For example, to get a CentOS image, specify centos-cloud as the image project. * @param array $optionalArgs { * Optional. * diff --git a/Compute/src/V1/Gapic/InstanceGroupManagersGapicClient.php b/Compute/src/V1/Gapic/InstanceGroupManagersGapicClient.php index ad75ee5c261..972198bf7c4 100644 --- a/Compute/src/V1/Gapic/InstanceGroupManagersGapicClient.php +++ b/Compute/src/V1/Gapic/InstanceGroupManagersGapicClient.php @@ -828,7 +828,7 @@ public function deletePerInstanceConfigs($instanceGroupManager, $instanceGroupMa } /** - * Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request. + * Returns all of the details about the specified managed instance group. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/InstanceTemplatesGapicClient.php b/Compute/src/V1/Gapic/InstanceTemplatesGapicClient.php index 35537136a6e..b80e8897456 100644 --- a/Compute/src/V1/Gapic/InstanceTemplatesGapicClient.php +++ b/Compute/src/V1/Gapic/InstanceTemplatesGapicClient.php @@ -33,6 +33,7 @@ use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; +use Google\Cloud\Compute\V1\AggregatedListInstanceTemplatesRequest; use Google\Cloud\Compute\V1\DeleteInstanceTemplateRequest; use Google\Cloud\Compute\V1\GetIamPolicyInstanceTemplateRequest; use Google\Cloud\Compute\V1\GetInstanceTemplateRequest; @@ -40,6 +41,7 @@ use Google\Cloud\Compute\V1\GlobalSetPolicyRequest; use Google\Cloud\Compute\V1\InsertInstanceTemplateRequest; use Google\Cloud\Compute\V1\InstanceTemplate; +use Google\Cloud\Compute\V1\InstanceTemplateAggregatedList; use Google\Cloud\Compute\V1\InstanceTemplateList; use Google\Cloud\Compute\V1\ListInstanceTemplatesRequest; use Google\Cloud\Compute\V1\Operation; @@ -58,31 +60,19 @@ * ``` * $instanceTemplatesClient = new InstanceTemplatesClient(); * try { - * $instanceTemplate = 'instance_template'; * $project = 'project'; - * $operationResponse = $instanceTemplatesClient->delete($instanceTemplate, $project); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // if creating/modifying, retrieve the target resource - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) + * // Iterate over pages of elements + * $pagedResponse = $instanceTemplatesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } * } * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $instanceTemplatesClient->delete($instanceTemplate, $project); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $instanceTemplatesClient->resumeOperation($operationName, 'delete'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // if creating/modifying, retrieve the target resource - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) + * // Iterate through all elements + * $pagedResponse = $instanceTemplatesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); * } * } finally { * $instanceTemplatesClient->close(); @@ -252,6 +242,96 @@ public function __construct(array $options = []) $this->operationsClient = $this->createOperationsClient($clientOptions); } + /** + * Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project. + * + * Sample code: + * ``` + * $instanceTemplatesClient = new InstanceTemplatesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $instanceTemplatesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instanceTemplatesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instanceTemplatesClient->close(); + * } + * ``` + * + * @param string $project Name of the project scoping this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. + * @type bool $includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @type int $maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @type string $orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type bool $returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function aggregatedList($project, array $optionalArgs = []) + { + $request = new AggregatedListInstanceTemplatesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['includeAllScopes'])) { + $request->setIncludeAllScopes($optionalArgs['includeAllScopes']); + } + + if (isset($optionalArgs['maxResults'])) { + $request->setMaxResults($optionalArgs['maxResults']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['returnPartialSuccess'])) { + $request->setReturnPartialSuccess($optionalArgs['returnPartialSuccess']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, InstanceTemplateAggregatedList::class, $request); + } + /** * Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group. * @@ -325,7 +405,7 @@ public function delete($instanceTemplate, $project, array $optionalArgs = []) } /** - * Returns the specified instance template. Gets a list of available instance templates by making a list() request. + * Returns the specified instance template. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/InstancesGapicClient.php b/Compute/src/V1/Gapic/InstancesGapicClient.php index fb5f5b9a204..81e5d645b62 100644 --- a/Compute/src/V1/Gapic/InstancesGapicClient.php +++ b/Compute/src/V1/Gapic/InstancesGapicClient.php @@ -65,6 +65,7 @@ use Google\Cloud\Compute\V1\InstancesSetMachineResourcesRequest; use Google\Cloud\Compute\V1\InstancesSetMachineTypeRequest; use Google\Cloud\Compute\V1\InstancesSetMinCpuPlatformRequest; +use Google\Cloud\Compute\V1\InstancesSetNameRequest; use Google\Cloud\Compute\V1\InstancesSetServiceAccountRequest; use Google\Cloud\Compute\V1\InstancesStartWithEncryptionKeyRequest; use Google\Cloud\Compute\V1\ListInstancesRequest; @@ -89,6 +90,7 @@ use Google\Cloud\Compute\V1\SetMachineTypeInstanceRequest; use Google\Cloud\Compute\V1\SetMetadataInstanceRequest; use Google\Cloud\Compute\V1\SetMinCpuPlatformInstanceRequest; +use Google\Cloud\Compute\V1\SetNameInstanceRequest; use Google\Cloud\Compute\V1\SetSchedulingInstanceRequest; use Google\Cloud\Compute\V1\SetServiceAccountInstanceRequest; use Google\Cloud\Compute\V1\SetShieldedInstanceIntegrityPolicyInstanceRequest; @@ -969,7 +971,7 @@ public function detachDisk($deviceName, $instance, $project, $zone, array $optio } /** - * Returns the specified Instance resource. Gets a list of available instances by making a list() request. + * Returns the specified Instance resource. * * Sample code: * ``` @@ -2484,6 +2486,85 @@ public function setMinCpuPlatform($instance, $instancesSetMinCpuPlatformRequestR return $this->startOperationsCall('SetMinCpuPlatform', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); } + /** + * Sets name of an instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $instancesSetNameRequestResource = new InstancesSetNameRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->setName($instance, $instancesSetNameRequestResource, $project, $zone); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // if creating/modifying, retrieve the target resource + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $instancesClient->setName($instance, $instancesSetNameRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'setName'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // if creating/modifying, retrieve the target resource + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @param string $instance The instance name for this request. + * @param InstancesSetNameRequest $instancesSetNameRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + * @type 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function setName($instance, $instancesSetNameRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new SetNameInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setInstancesSetNameRequestResource($instancesSetNameRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('SetName', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + /** * Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM host maintenance policy. * diff --git a/Compute/src/V1/Gapic/MachineImagesGapicClient.php b/Compute/src/V1/Gapic/MachineImagesGapicClient.php index 60779779624..288bd9026ac 100644 --- a/Compute/src/V1/Gapic/MachineImagesGapicClient.php +++ b/Compute/src/V1/Gapic/MachineImagesGapicClient.php @@ -325,7 +325,7 @@ public function delete($machineImage, $project, array $optionalArgs = []) } /** - * Returns the specified machine image. Gets a list of available machine images by making a list() request. + * Returns the specified machine image. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/MachineTypesGapicClient.php b/Compute/src/V1/Gapic/MachineTypesGapicClient.php index 3bbba39f6bf..53e36f6ed62 100644 --- a/Compute/src/V1/Gapic/MachineTypesGapicClient.php +++ b/Compute/src/V1/Gapic/MachineTypesGapicClient.php @@ -271,7 +271,7 @@ public function aggregatedList($project, array $optionalArgs = []) } /** - * Returns the specified machine type. Gets a list of available machine types by making a list() request. + * Returns the specified machine type. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/NetworkEndpointGroupsGapicClient.php b/Compute/src/V1/Gapic/NetworkEndpointGroupsGapicClient.php index fdffac3dae9..0a65ed48006 100644 --- a/Compute/src/V1/Gapic/NetworkEndpointGroupsGapicClient.php +++ b/Compute/src/V1/Gapic/NetworkEndpointGroupsGapicClient.php @@ -571,7 +571,7 @@ public function detachNetworkEndpoints($networkEndpointGroup, $networkEndpointGr } /** - * Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * Returns the specified network endpoint group. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/NetworksGapicClient.php b/Compute/src/V1/Gapic/NetworksGapicClient.php index 2b5a28385e7..daf09d6e5f0 100644 --- a/Compute/src/V1/Gapic/NetworksGapicClient.php +++ b/Compute/src/V1/Gapic/NetworksGapicClient.php @@ -406,7 +406,7 @@ public function delete($network, $project, array $optionalArgs = []) } /** - * Returns the specified network. Gets a list of available networks by making a list() request. + * Returns the specified network. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/NodeTemplatesGapicClient.php b/Compute/src/V1/Gapic/NodeTemplatesGapicClient.php index 52f6b0e255d..95803c9dea9 100644 --- a/Compute/src/V1/Gapic/NodeTemplatesGapicClient.php +++ b/Compute/src/V1/Gapic/NodeTemplatesGapicClient.php @@ -410,7 +410,7 @@ public function delete($nodeTemplate, $project, $region, array $optionalArgs = [ } /** - * Returns the specified node template. Gets a list of available node templates by making a list() request. + * Returns the specified node template. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/NodeTypesGapicClient.php b/Compute/src/V1/Gapic/NodeTypesGapicClient.php index 4658e65f647..11034df2384 100644 --- a/Compute/src/V1/Gapic/NodeTypesGapicClient.php +++ b/Compute/src/V1/Gapic/NodeTypesGapicClient.php @@ -271,7 +271,7 @@ public function aggregatedList($project, array $optionalArgs = []) } /** - * Returns the specified node type. Gets a list of available node types by making a list() request. + * Returns the specified node type. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/RegionCommitmentsGapicClient.php b/Compute/src/V1/Gapic/RegionCommitmentsGapicClient.php index e37dbc180e4..7c769f7f5d3 100644 --- a/Compute/src/V1/Gapic/RegionCommitmentsGapicClient.php +++ b/Compute/src/V1/Gapic/RegionCommitmentsGapicClient.php @@ -327,7 +327,7 @@ public function aggregatedList($project, array $optionalArgs = []) } /** - * Returns the specified commitment resource. Gets a list of available commitments by making a list() request. + * Returns the specified commitment resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/RegionDiskTypesGapicClient.php b/Compute/src/V1/Gapic/RegionDiskTypesGapicClient.php index 2709bb04f5c..2445b65ca76 100644 --- a/Compute/src/V1/Gapic/RegionDiskTypesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionDiskTypesGapicClient.php @@ -169,7 +169,7 @@ public function __construct(array $options = []) } /** - * Returns the specified regional disk type. Gets a list of available disk types by making a list() request. + * Returns the specified regional disk type. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/RegionDisksGapicClient.php b/Compute/src/V1/Gapic/RegionDisksGapicClient.php index 8535b18af87..b91f042c951 100644 --- a/Compute/src/V1/Gapic/RegionDisksGapicClient.php +++ b/Compute/src/V1/Gapic/RegionDisksGapicClient.php @@ -58,6 +58,7 @@ use Google\Cloud\Compute\V1\TestIamPermissionsRegionDiskRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; +use Google\Cloud\Compute\V1\UpdateRegionDiskRequest; /** * Service Description: The RegionDisks API. @@ -1104,4 +1105,94 @@ public function testIamPermissions($project, $region, $resource, $testPermission $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); } + + /** + * Update the specified disk with the data included in the request. Update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $disk = 'disk'; + * $diskResource = new Disk(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionDisksClient->update($disk, $diskResource, $project, $region); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // if creating/modifying, retrieve the target resource + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $regionDisksClient->update($disk, $diskResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionDisksClient->resumeOperation($operationName, 'update'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // if creating/modifying, retrieve the target resource + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $regionDisksClient->close(); + * } + * ``` + * + * @param string $disk The disk name for this request. + * @param Disk $diskResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $paths + * @type string $requestId + * 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. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + * @type string $updateMask + * update_mask indicates fields to be updated as part of this request. + * @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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function update($disk, $diskResource, $project, $region, array $optionalArgs = []) + { + $request = new UpdateRegionDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setDiskResource($diskResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['disk'] = $disk; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['paths'])) { + $request->setPaths($optionalArgs['paths']); + } + + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } } diff --git a/Compute/src/V1/Gapic/RegionHealthChecksGapicClient.php b/Compute/src/V1/Gapic/RegionHealthChecksGapicClient.php index f89cde4d5f6..ac5081332c5 100644 --- a/Compute/src/V1/Gapic/RegionHealthChecksGapicClient.php +++ b/Compute/src/V1/Gapic/RegionHealthChecksGapicClient.php @@ -326,7 +326,7 @@ public function delete($healthCheck, $project, $region, array $optionalArgs = [] } /** - * Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + * Returns the specified HealthCheck resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/RegionInstanceTemplatesGapicClient.php b/Compute/src/V1/Gapic/RegionInstanceTemplatesGapicClient.php new file mode 100644 index 00000000000..a5385492d64 --- /dev/null +++ b/Compute/src/V1/Gapic/RegionInstanceTemplatesGapicClient.php @@ -0,0 +1,535 @@ +delete($instanceTemplate, $project, $region); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // if creating/modifying, retrieve the target resource + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $regionInstanceTemplatesClient->delete($instanceTemplate, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceTemplatesClient->resumeOperation($operationName, 'delete'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // if creating/modifying, retrieve the target resource + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $regionInstanceTemplatesClient->close(); + * } + * ``` + */ +class RegionInstanceTemplatesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionInstanceTemplates'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_instance_templates_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_instance_templates_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_instance_templates_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::getSupportedTransports. */ + private static function getSupportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an RegionOperationsClient object with the same endpoint as $this. + * + * @return RegionOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + 'getRegion', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ]; + } + + /** + * 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'] : $this->getDefaultOperationDescriptor(); + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'compute.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. At the moment, supports only + * `rest`. *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 = [ + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\RestTransport::build()} method 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); + } + + /** + * Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. + * + * Sample code: + * ``` + * $regionInstanceTemplatesClient = new RegionInstanceTemplatesClient(); + * try { + * $instanceTemplate = 'instance_template'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionInstanceTemplatesClient->delete($instanceTemplate, $project, $region); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // if creating/modifying, retrieve the target resource + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $regionInstanceTemplatesClient->delete($instanceTemplate, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceTemplatesClient->resumeOperation($operationName, 'delete'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // if creating/modifying, retrieve the target resource + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $regionInstanceTemplatesClient->close(); + * } + * ``` + * + * @param string $instanceTemplate The name of the instance template to delete. + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + * @type 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function delete($instanceTemplate, $project, $region, array $optionalArgs = []) + { + $request = new DeleteRegionInstanceTemplateRequest(); + $requestParamHeaders = []; + $request->setInstanceTemplate($instanceTemplate); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['instance_template'] = $instanceTemplate; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('Delete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified instance template. + * + * Sample code: + * ``` + * $regionInstanceTemplatesClient = new RegionInstanceTemplatesClient(); + * try { + * $instanceTemplate = 'instance_template'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionInstanceTemplatesClient->get($instanceTemplate, $project, $region); + * } finally { + * $regionInstanceTemplatesClient->close(); + * } + * ``` + * + * @param string $instanceTemplate The name of the instance template. + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param array $optionalArgs { + * 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 \Google\Cloud\Compute\V1\InstanceTemplate + * + * @throws ApiException if the remote call fails + */ + public function get($instanceTemplate, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionInstanceTemplateRequest(); + $requestParamHeaders = []; + $request->setInstanceTemplate($instanceTemplate); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['instance_template'] = $instanceTemplate; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', InstanceTemplate::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an instance template in the specified project and region using the global instance template whose URL is included in the request. + * + * Sample code: + * ``` + * $regionInstanceTemplatesClient = new RegionInstanceTemplatesClient(); + * try { + * $instanceTemplateResource = new InstanceTemplate(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionInstanceTemplatesClient->insert($instanceTemplateResource, $project, $region); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // if creating/modifying, retrieve the target resource + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $regionInstanceTemplatesClient->insert($instanceTemplateResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceTemplatesClient->resumeOperation($operationName, 'insert'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // if creating/modifying, retrieve the target resource + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $regionInstanceTemplatesClient->close(); + * } + * ``` + * + * @param InstanceTemplate $instanceTemplateResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * 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. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + * @type 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 \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function insert($instanceTemplateResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertRegionInstanceTemplateRequest(); + $requestParamHeaders = []; + $request->setInstanceTemplateResource($instanceTemplateResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves a list of instance templates that are contained within the specified project and region. + * + * Sample code: + * ``` + * $regionInstanceTemplatesClient = new RegionInstanceTemplatesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionInstanceTemplatesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionInstanceTemplatesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionInstanceTemplatesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the regions for this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. + * @type int $maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @type string $orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type bool $returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @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 \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function list($project, $region, array $optionalArgs = []) + { + $request = new ListRegionInstanceTemplatesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['maxResults'])) { + $request->setMaxResults($optionalArgs['maxResults']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['returnPartialSuccess'])) { + $request->setReturnPartialSuccess($optionalArgs['returnPartialSuccess']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('List', $optionalArgs, InstanceTemplateList::class, $request); + } +} diff --git a/Compute/src/V1/Gapic/RegionNetworkEndpointGroupsGapicClient.php b/Compute/src/V1/Gapic/RegionNetworkEndpointGroupsGapicClient.php index 4302ca0e871..64156d1e42b 100644 --- a/Compute/src/V1/Gapic/RegionNetworkEndpointGroupsGapicClient.php +++ b/Compute/src/V1/Gapic/RegionNetworkEndpointGroupsGapicClient.php @@ -324,7 +324,7 @@ public function delete($networkEndpointGroup, $project, $region, array $optional } /** - * Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * Returns the specified network endpoint group. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/RegionTargetHttpProxiesGapicClient.php b/Compute/src/V1/Gapic/RegionTargetHttpProxiesGapicClient.php index ced1bc002a0..9af7b0f69fc 100644 --- a/Compute/src/V1/Gapic/RegionTargetHttpProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionTargetHttpProxiesGapicClient.php @@ -326,7 +326,7 @@ public function delete($project, $region, $targetHttpProxy, array $optionalArgs } /** - * Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + * Returns the specified TargetHttpProxy resource in the specified region. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/RegionTargetHttpsProxiesGapicClient.php b/Compute/src/V1/Gapic/RegionTargetHttpsProxiesGapicClient.php index a631550f872..a4bcdbe478f 100644 --- a/Compute/src/V1/Gapic/RegionTargetHttpsProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/RegionTargetHttpsProxiesGapicClient.php @@ -329,7 +329,7 @@ public function delete($project, $region, $targetHttpsProxy, array $optionalArgs } /** - * Returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + * Returns the specified TargetHttpsProxy resource in the specified region. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/RegionUrlMapsGapicClient.php b/Compute/src/V1/Gapic/RegionUrlMapsGapicClient.php index 1d65662125f..d13929a28b4 100644 --- a/Compute/src/V1/Gapic/RegionUrlMapsGapicClient.php +++ b/Compute/src/V1/Gapic/RegionUrlMapsGapicClient.php @@ -329,7 +329,7 @@ public function delete($project, $region, $urlMap, array $optionalArgs = []) } /** - * Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. + * Returns the specified UrlMap resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/RegionsGapicClient.php b/Compute/src/V1/Gapic/RegionsGapicClient.php index ef61bfcfda5..e1f0ac721c5 100644 --- a/Compute/src/V1/Gapic/RegionsGapicClient.php +++ b/Compute/src/V1/Gapic/RegionsGapicClient.php @@ -168,7 +168,7 @@ public function __construct(array $options = []) } /** - * Returns the specified Region resource. Gets a list of available regions by making a list() request. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request. + * Returns the specified Region resource. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/RoutersGapicClient.php b/Compute/src/V1/Gapic/RoutersGapicClient.php index f0fbb8bb2cf..892786d90fe 100644 --- a/Compute/src/V1/Gapic/RoutersGapicClient.php +++ b/Compute/src/V1/Gapic/RoutersGapicClient.php @@ -411,7 +411,7 @@ public function delete($project, $region, $router, array $optionalArgs = []) } /** - * Returns the specified Router resource. Gets a list of available routers by making a list() request. + * Returns the specified Router resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/RoutesGapicClient.php b/Compute/src/V1/Gapic/RoutesGapicClient.php index a2c9f74b520..2849732e816 100644 --- a/Compute/src/V1/Gapic/RoutesGapicClient.php +++ b/Compute/src/V1/Gapic/RoutesGapicClient.php @@ -318,7 +318,7 @@ public function delete($project, $route, array $optionalArgs = []) } /** - * Returns the specified Route resource. Gets a list of available routes by making a list() request. + * Returns the specified Route resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/SnapshotsGapicClient.php b/Compute/src/V1/Gapic/SnapshotsGapicClient.php index 62150222563..f322db67d3c 100644 --- a/Compute/src/V1/Gapic/SnapshotsGapicClient.php +++ b/Compute/src/V1/Gapic/SnapshotsGapicClient.php @@ -327,7 +327,7 @@ public function delete($project, $snapshot, array $optionalArgs = []) } /** - * Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request. + * Returns the specified Snapshot resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/SslCertificatesGapicClient.php b/Compute/src/V1/Gapic/SslCertificatesGapicClient.php index 7d9a831ceae..4af966c9c4a 100644 --- a/Compute/src/V1/Gapic/SslCertificatesGapicClient.php +++ b/Compute/src/V1/Gapic/SslCertificatesGapicClient.php @@ -398,7 +398,7 @@ public function delete($project, $sslCertificate, array $optionalArgs = []) } /** - * Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request. + * Returns the specified SslCertificate resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/SslPoliciesGapicClient.php b/Compute/src/V1/Gapic/SslPoliciesGapicClient.php index 839d7db3437..ca3518067f6 100644 --- a/Compute/src/V1/Gapic/SslPoliciesGapicClient.php +++ b/Compute/src/V1/Gapic/SslPoliciesGapicClient.php @@ -444,7 +444,7 @@ public function get($project, $sslPolicy, array $optionalArgs = []) } /** - * Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request. + * Returns the specified SSL policy resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/SubnetworksGapicClient.php b/Compute/src/V1/Gapic/SubnetworksGapicClient.php index 66a3797626a..df84d828aaa 100644 --- a/Compute/src/V1/Gapic/SubnetworksGapicClient.php +++ b/Compute/src/V1/Gapic/SubnetworksGapicClient.php @@ -496,7 +496,7 @@ public function expandIpCidrRange($project, $region, $subnetwork, $subnetworksEx } /** - * Returns the specified subnetwork. Gets a list of available subnetworks list() request. + * Returns the specified subnetwork. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/TargetHttpProxiesGapicClient.php b/Compute/src/V1/Gapic/TargetHttpProxiesGapicClient.php index fddb39606d6..02fb32fe214 100644 --- a/Compute/src/V1/Gapic/TargetHttpProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/TargetHttpProxiesGapicClient.php @@ -401,7 +401,7 @@ public function delete($project, $targetHttpProxy, array $optionalArgs = []) } /** - * Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request. + * Returns the specified TargetHttpProxy resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/TargetHttpsProxiesGapicClient.php b/Compute/src/V1/Gapic/TargetHttpsProxiesGapicClient.php index 89534547b5c..acde76f2379 100644 --- a/Compute/src/V1/Gapic/TargetHttpsProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/TargetHttpsProxiesGapicClient.php @@ -409,7 +409,7 @@ public function delete($project, $targetHttpsProxy, array $optionalArgs = []) } /** - * Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request. + * Returns the specified TargetHttpsProxy resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/TargetInstancesGapicClient.php b/Compute/src/V1/Gapic/TargetInstancesGapicClient.php index 840a64988dc..85ba9049b8a 100644 --- a/Compute/src/V1/Gapic/TargetInstancesGapicClient.php +++ b/Compute/src/V1/Gapic/TargetInstancesGapicClient.php @@ -403,7 +403,7 @@ public function delete($project, $targetInstance, $zone, array $optionalArgs = [ } /** - * Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request. + * Returns the specified TargetInstance resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/TargetPoolsGapicClient.php b/Compute/src/V1/Gapic/TargetPoolsGapicClient.php index c8e30134d08..9f962be6789 100644 --- a/Compute/src/V1/Gapic/TargetPoolsGapicClient.php +++ b/Compute/src/V1/Gapic/TargetPoolsGapicClient.php @@ -588,7 +588,7 @@ public function delete($project, $region, $targetPool, array $optionalArgs = []) } /** - * Returns the specified target pool. Gets a list of available target pools by making a list() request. + * Returns the specified target pool. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/TargetSslProxiesGapicClient.php b/Compute/src/V1/Gapic/TargetSslProxiesGapicClient.php index ec628873586..94c06bb0ea8 100644 --- a/Compute/src/V1/Gapic/TargetSslProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/TargetSslProxiesGapicClient.php @@ -328,7 +328,7 @@ public function delete($project, $targetSslProxy, array $optionalArgs = []) } /** - * Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request. + * Returns the specified TargetSslProxy resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/TargetTcpProxiesGapicClient.php b/Compute/src/V1/Gapic/TargetTcpProxiesGapicClient.php index 3133bb3ab81..1d7a02e65bf 100644 --- a/Compute/src/V1/Gapic/TargetTcpProxiesGapicClient.php +++ b/Compute/src/V1/Gapic/TargetTcpProxiesGapicClient.php @@ -402,7 +402,7 @@ public function delete($project, $targetTcpProxy, array $optionalArgs = []) } /** - * Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request. + * Returns the specified TargetTcpProxy resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/TargetVpnGatewaysGapicClient.php b/Compute/src/V1/Gapic/TargetVpnGatewaysGapicClient.php index 65d7c6c4f3a..67c35830f5b 100644 --- a/Compute/src/V1/Gapic/TargetVpnGatewaysGapicClient.php +++ b/Compute/src/V1/Gapic/TargetVpnGatewaysGapicClient.php @@ -405,7 +405,7 @@ public function delete($project, $region, $targetVpnGateway, array $optionalArgs } /** - * Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request. + * Returns the specified target VPN gateway. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/UrlMapsGapicClient.php b/Compute/src/V1/Gapic/UrlMapsGapicClient.php index 4d56c59dbd4..67b89263ed7 100644 --- a/Compute/src/V1/Gapic/UrlMapsGapicClient.php +++ b/Compute/src/V1/Gapic/UrlMapsGapicClient.php @@ -405,7 +405,7 @@ public function delete($project, $urlMap, array $optionalArgs = []) } /** - * Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. + * Returns the specified UrlMap resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/VpnGatewaysGapicClient.php b/Compute/src/V1/Gapic/VpnGatewaysGapicClient.php index 8ca755807d4..6af06f43d89 100644 --- a/Compute/src/V1/Gapic/VpnGatewaysGapicClient.php +++ b/Compute/src/V1/Gapic/VpnGatewaysGapicClient.php @@ -410,7 +410,7 @@ public function delete($project, $region, $vpnGateway, array $optionalArgs = []) } /** - * Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request. + * Returns the specified VPN gateway. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/VpnTunnelsGapicClient.php b/Compute/src/V1/Gapic/VpnTunnelsGapicClient.php index a9cd14272b1..d6bb4e3131b 100644 --- a/Compute/src/V1/Gapic/VpnTunnelsGapicClient.php +++ b/Compute/src/V1/Gapic/VpnTunnelsGapicClient.php @@ -405,7 +405,7 @@ public function delete($project, $region, $vpnTunnel, array $optionalArgs = []) } /** - * Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request. + * Returns the specified VpnTunnel resource. * * Sample code: * ``` diff --git a/Compute/src/V1/Gapic/ZonesGapicClient.php b/Compute/src/V1/Gapic/ZonesGapicClient.php index 17f889b4a29..f635f1b57e6 100644 --- a/Compute/src/V1/Gapic/ZonesGapicClient.php +++ b/Compute/src/V1/Gapic/ZonesGapicClient.php @@ -168,7 +168,7 @@ public function __construct(array $options = []) } /** - * Returns the specified Zone resource. Gets a list of available zones by making a list() request. + * Returns the specified Zone resource. * * Sample code: * ``` diff --git a/Compute/src/V1/GetFromFamilyImageRequest.php b/Compute/src/V1/GetFromFamilyImageRequest.php index 09f78701c90..a1dd34df517 100644 --- a/Compute/src/V1/GetFromFamilyImageRequest.php +++ b/Compute/src/V1/GetFromFamilyImageRequest.php @@ -22,7 +22,7 @@ class GetFromFamilyImageRequest extends \Google\Protobuf\Internal\Message */ private $family = ''; /** - * Project ID for this request. + * The image project that the image belongs to. For example, to get a CentOS image, specify centos-cloud as the image project. * * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; */ @@ -37,7 +37,7 @@ class GetFromFamilyImageRequest extends \Google\Protobuf\Internal\Message * @type string $family * Name of the image family to search for. * @type string $project - * Project ID for this request. + * The image project that the image belongs to. For example, to get a CentOS image, specify centos-cloud as the image project. * } */ public function __construct($data = NULL) { @@ -72,7 +72,7 @@ public function setFamily($var) } /** - * Project ID for this request. + * The image project that the image belongs to. For example, to get a CentOS image, specify centos-cloud as the image project. * * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -83,7 +83,7 @@ public function getProject() } /** - * Project ID for this request. + * The image project that the image belongs to. For example, to get a CentOS image, specify centos-cloud as the image project. * * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; * @param string $var diff --git a/Compute/src/V1/GetRegionInstanceTemplateRequest.php b/Compute/src/V1/GetRegionInstanceTemplateRequest.php new file mode 100644 index 00000000000..8a7b23173a7 --- /dev/null +++ b/Compute/src/V1/GetRegionInstanceTemplateRequest.php @@ -0,0 +1,135 @@ +google.cloud.compute.v1.GetRegionInstanceTemplateRequest + */ +class GetRegionInstanceTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the instance template. + * + * Generated from protobuf field string instance_template = 309248228 [(.google.api.field_behavior) = REQUIRED]; + */ + private $instance_template = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + private $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + private $region = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_template + * The name of the instance template. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the instance template. + * + * Generated from protobuf field string instance_template = 309248228 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceTemplate() + { + return $this->instance_template; + } + + /** + * The name of the instance template. + * + * Generated from protobuf field string instance_template = 309248228 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceTemplate($var) + { + GPBUtil::checkString($var, True); + $this->instance_template = $var; + + return $this; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + +} + diff --git a/Compute/src/V1/GuestOsFeature.php b/Compute/src/V1/GuestOsFeature.php index 6245bcbfe5f..db523148d84 100644 --- a/Compute/src/V1/GuestOsFeature.php +++ b/Compute/src/V1/GuestOsFeature.php @@ -16,7 +16,7 @@ class GuestOsFeature extends \Google\Protobuf\Internal\Message { /** - * The ID of a supported feature. To add multiple values, use commas to separate values. Set to one or more of the following values: - VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET - UEFI_COMPATIBLE - GVNIC - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE - SEV_SNP_CAPABLE For more information, see Enabling guest operating system features. + * The ID of a supported feature. To add multiple values, use commas to separate values. Set to one or more of the following values: - VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET - UEFI_COMPATIBLE - GVNIC - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE - SEV_SNP_CAPABLE - TDX_CAPABLE For more information, see Enabling guest operating system features. * Check the Type enum for the list of possible values. * * Generated from protobuf field optional string type = 3575610; @@ -30,7 +30,7 @@ class GuestOsFeature extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $type - * The ID of a supported feature. To add multiple values, use commas to separate values. Set to one or more of the following values: - VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET - UEFI_COMPATIBLE - GVNIC - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE - SEV_SNP_CAPABLE For more information, see Enabling guest operating system features. + * The ID of a supported feature. To add multiple values, use commas to separate values. Set to one or more of the following values: - VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET - UEFI_COMPATIBLE - GVNIC - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE - SEV_SNP_CAPABLE - TDX_CAPABLE For more information, see Enabling guest operating system features. * Check the Type enum for the list of possible values. * } */ @@ -40,7 +40,7 @@ public function __construct($data = NULL) { } /** - * The ID of a supported feature. To add multiple values, use commas to separate values. Set to one or more of the following values: - VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET - UEFI_COMPATIBLE - GVNIC - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE - SEV_SNP_CAPABLE For more information, see Enabling guest operating system features. + * The ID of a supported feature. To add multiple values, use commas to separate values. Set to one or more of the following values: - VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET - UEFI_COMPATIBLE - GVNIC - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE - SEV_SNP_CAPABLE - TDX_CAPABLE For more information, see Enabling guest operating system features. * Check the Type enum for the list of possible values. * * Generated from protobuf field optional string type = 3575610; @@ -62,7 +62,7 @@ public function clearType() } /** - * The ID of a supported feature. To add multiple values, use commas to separate values. Set to one or more of the following values: - VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET - UEFI_COMPATIBLE - GVNIC - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE - SEV_SNP_CAPABLE For more information, see Enabling guest operating system features. + * The ID of a supported feature. To add multiple values, use commas to separate values. Set to one or more of the following values: - VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET - UEFI_COMPATIBLE - GVNIC - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE - SEV_SNP_CAPABLE - TDX_CAPABLE For more information, see Enabling guest operating system features. * Check the Type enum for the list of possible values. * * Generated from protobuf field optional string type = 3575610; diff --git a/Compute/src/V1/GuestOsFeature/Type.php b/Compute/src/V1/GuestOsFeature/Type.php index 873c48d272f..e6c1f27b026 100644 --- a/Compute/src/V1/GuestOsFeature/Type.php +++ b/Compute/src/V1/GuestOsFeature/Type.php @@ -7,7 +7,7 @@ use UnexpectedValueException; /** - * The ID of a supported feature. To add multiple values, use commas to separate values. Set to one or more of the following values: - VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET - UEFI_COMPATIBLE - GVNIC - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE - SEV_SNP_CAPABLE For more information, see Enabling guest operating system features. + * The ID of a supported feature. To add multiple values, use commas to separate values. Set to one or more of the following values: - VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET - UEFI_COMPATIBLE - GVNIC - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE - SEV_SNP_CAPABLE - TDX_CAPABLE For more information, see Enabling guest operating system features. * * Protobuf type google.cloud.compute.v1.GuestOsFeature.Type */ diff --git a/Compute/src/V1/Image.php b/Compute/src/V1/Image.php index 18a97b6eccc..842c9dd7f2b 100644 --- a/Compute/src/V1/Image.php +++ b/Compute/src/V1/Image.php @@ -53,7 +53,7 @@ class Image extends \Google\Protobuf\Internal\Message */ private $disk_size_gb = null; /** - * The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. + * The name of the image family to which this image belongs. The image family name can be from a publicly managed image family provided by Compute Engine, or from a custom image family you create. For example, centos-stream-9 is a publicly available image family. For more information, see Image family best practices. When creating disks, you can specify an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. * * Generated from protobuf field optional string family = 328751972; */ @@ -231,7 +231,7 @@ class Image extends \Google\Protobuf\Internal\Message * @type int|string $disk_size_gb * Size of the image when restored onto a persistent disk (in GB). * @type string $family - * The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. + * The name of the image family to which this image belongs. The image family name can be from a publicly managed image family provided by Compute Engine, or from a custom image family you create. For example, centos-stream-9 is a publicly available image family. For more information, see Image family best practices. When creating disks, you can specify an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. * @type array<\Google\Cloud\Compute\V1\GuestOsFeature>|\Google\Protobuf\Internal\RepeatedField $guest_os_features * A list of features to enable on the guest operating system. Applicable only for bootable images. To see a list of available options, see the guestOSfeatures[].type parameter. * @type int|string $id @@ -510,7 +510,7 @@ public function setDiskSizeGb($var) } /** - * The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. + * The name of the image family to which this image belongs. The image family name can be from a publicly managed image family provided by Compute Engine, or from a custom image family you create. For example, centos-stream-9 is a publicly available image family. For more information, see Image family best practices. When creating disks, you can specify an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. * * Generated from protobuf field optional string family = 328751972; * @return string @@ -531,7 +531,7 @@ public function clearFamily() } /** - * The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. + * The name of the image family to which this image belongs. The image family name can be from a publicly managed image family provided by Compute Engine, or from a custom image family you create. For example, centos-stream-9 is a publicly available image family. For more information, see Image family best practices. When creating disks, you can specify an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. * * Generated from protobuf field optional string family = 328751972; * @param string $var diff --git a/Compute/src/V1/InsertRegionInstanceTemplateRequest.php b/Compute/src/V1/InsertRegionInstanceTemplateRequest.php new file mode 100644 index 00000000000..748290c4524 --- /dev/null +++ b/Compute/src/V1/InsertRegionInstanceTemplateRequest.php @@ -0,0 +1,189 @@ +google.cloud.compute.v1.InsertRegionInstanceTemplateRequest + */ +class InsertRegionInstanceTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceTemplate instance_template_resource = 10679561 [(.google.api.field_behavior) = REQUIRED]; + */ + private $instance_template_resource = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + private $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + private $region = ''; + /** + * 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. 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 optional string request_id = 37109963; + */ + private $request_id = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstanceTemplate $instance_template_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $request_id + * 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. 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\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceTemplate instance_template_resource = 10679561 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceTemplate|null + */ + public function getInstanceTemplateResource() + { + return $this->instance_template_resource; + } + + public function hasInstanceTemplateResource() + { + return isset($this->instance_template_resource); + } + + public function clearInstanceTemplateResource() + { + unset($this->instance_template_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceTemplate instance_template_resource = 10679561 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceTemplate $var + * @return $this + */ + public function setInstanceTemplateResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceTemplate::class); + $this->instance_template_resource = $var; + + return $this; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + + /** + * 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. 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 optional string request_id = 37109963; + * @return string + */ + public function getRequestId() + { + return isset($this->request_id) ? $this->request_id : ''; + } + + public function hasRequestId() + { + return isset($this->request_id); + } + + public function clearRequestId() + { + unset($this->request_id); + } + + /** + * 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. 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 optional string request_id = 37109963; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/Compute/src/V1/InstanceGroupManagersApplyUpdatesRequest.php b/Compute/src/V1/InstanceGroupManagersApplyUpdatesRequest.php index 5ce98f77501..92da0365269 100644 --- a/Compute/src/V1/InstanceGroupManagersApplyUpdatesRequest.php +++ b/Compute/src/V1/InstanceGroupManagersApplyUpdatesRequest.php @@ -16,7 +16,7 @@ class InstanceGroupManagersApplyUpdatesRequest extends \Google\Protobuf\Internal\Message { /** - * Flag to update all instances instead of specified list of ���instances���. If the flag is set to true then the instances may not be specified in the request. + * Flag to update all instances instead of specified list of “instances”. If the flag is set to true then the instances may not be specified in the request. * * Generated from protobuf field optional bool all_instances = 403676512; */ @@ -49,7 +49,7 @@ class InstanceGroupManagersApplyUpdatesRequest extends \Google\Protobuf\Internal * Optional. Data for populating the Message object. * * @type bool $all_instances - * Flag to update all instances instead of specified list of ���instances���. If the flag is set to true then the instances may not be specified in the request. + * Flag to update all instances instead of specified list of “instances”. If the flag is set to true then the instances may not be specified in the request. * @type array|\Google\Protobuf\Internal\RepeatedField $instances * The list of URLs of one or more instances for which you want to apply updates. Each URL can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. * @type string $minimal_action @@ -66,7 +66,7 @@ public function __construct($data = NULL) { } /** - * Flag to update all instances instead of specified list of ���instances���. If the flag is set to true then the instances may not be specified in the request. + * Flag to update all instances instead of specified list of “instances”. If the flag is set to true then the instances may not be specified in the request. * * Generated from protobuf field optional bool all_instances = 403676512; * @return bool @@ -87,7 +87,7 @@ public function clearAllInstances() } /** - * Flag to update all instances instead of specified list of ���instances���. If the flag is set to true then the instances may not be specified in the request. + * Flag to update all instances instead of specified list of “instances”. If the flag is set to true then the instances may not be specified in the request. * * Generated from protobuf field optional bool all_instances = 403676512; * @param bool $var diff --git a/Compute/src/V1/InstanceTemplate.php b/Compute/src/V1/InstanceTemplate.php index f976cc6336d..ff14e5cd736 100644 --- a/Compute/src/V1/InstanceTemplate.php +++ b/Compute/src/V1/InstanceTemplate.php @@ -51,6 +51,12 @@ class InstanceTemplate extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional .google.cloud.compute.v1.InstanceProperties properties = 147688755; */ private $properties = null; + /** + * [Output Only] URL of the region where the instance template resides. Only applicable for regional resources. + * + * Generated from protobuf field optional string region = 138946292; + */ + private $region = null; /** * [Output Only] The URL for this instance template. The server defines this URL. * @@ -88,6 +94,8 @@ class InstanceTemplate extends \Google\Protobuf\Internal\Message * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. * @type \Google\Cloud\Compute\V1\InstanceProperties $properties * The instance properties for this instance template. + * @type string $region + * [Output Only] URL of the region where the instance template resides. Only applicable for regional resources. * @type string $self_link * [Output Only] The URL for this instance template. The server defines this URL. * @type string $source_instance @@ -317,6 +325,42 @@ public function setProperties($var) return $this; } + /** + * [Output Only] URL of the region where the instance template resides. Only applicable for regional resources. + * + * Generated from protobuf field optional string region = 138946292; + * @return string + */ + public function getRegion() + { + return isset($this->region) ? $this->region : ''; + } + + public function hasRegion() + { + return isset($this->region); + } + + public function clearRegion() + { + unset($this->region); + } + + /** + * [Output Only] URL of the region where the instance template resides. Only applicable for regional resources. + * + * Generated from protobuf field optional string region = 138946292; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + /** * [Output Only] The URL for this instance template. The server defines this URL. * diff --git a/Compute/src/V1/InstanceTemplateAggregatedList.php b/Compute/src/V1/InstanceTemplateAggregatedList.php new file mode 100644 index 00000000000..0290382f266 --- /dev/null +++ b/Compute/src/V1/InstanceTemplateAggregatedList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.InstanceTemplateAggregatedList + */ +class InstanceTemplateAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + private $id = null; + /** + * A list of InstanceTemplatesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + private $kind = null; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + * + * Generated from protobuf field optional string next_page_token = 79797525; + */ + private $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + private $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + private $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * [Output Only] Unique identifier for the resource; defined by the server. + * @type array|\Google\Protobuf\Internal\MapField $items + * A list of InstanceTemplatesScopedList resources. + * @type string $kind + * Type of resource. + * @type string $next_page_token + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + * @type string $self_link + * [Output Only] Server-defined URL for this resource. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + * @return string + */ + public function getId() + { + return isset($this->id) ? $this->id : ''; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * A list of InstanceTemplatesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InstanceTemplatesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceTemplatesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + * @return string + */ + public function getKind() + { + return isset($this->kind) ? $this->kind : ''; + } + + public function hasKind() + { + return isset($this->kind); + } + + public function clearKind() + { + unset($this->kind); + } + + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + * @param string $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkString($var, True); + $this->kind = $var; + + return $this; + } + + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + * + * Generated from protobuf field optional string next_page_token = 79797525; + * @return string + */ + public function getNextPageToken() + { + return isset($this->next_page_token) ? $this->next_page_token : ''; + } + + public function hasNextPageToken() + { + return isset($this->next_page_token); + } + + public function clearNextPageToken() + { + unset($this->next_page_token); + } + + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + * + * Generated from protobuf field optional string next_page_token = 79797525; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + * @return string + */ + public function getSelfLink() + { + return isset($this->self_link) ? $this->self_link : ''; + } + + public function hasSelfLink() + { + return isset($this->self_link); + } + + public function clearSelfLink() + { + unset($this->self_link); + } + + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + * @param string $var + * @return $this + */ + public function setSelfLink($var) + { + GPBUtil::checkString($var, True); + $this->self_link = $var; + + return $this; + } + + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + * @return \Google\Cloud\Compute\V1\Warning|null + */ + public function getWarning() + { + return $this->warning; + } + + public function hasWarning() + { + return isset($this->warning); + } + + public function clearWarning() + { + unset($this->warning); + } + + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + * @param \Google\Cloud\Compute\V1\Warning $var + * @return $this + */ + public function setWarning($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Warning::class); + $this->warning = $var; + + return $this; + } + +} + diff --git a/Compute/src/V1/InstanceTemplatesScopedList.php b/Compute/src/V1/InstanceTemplatesScopedList.php new file mode 100644 index 00000000000..51cfa182471 --- /dev/null +++ b/Compute/src/V1/InstanceTemplatesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstanceTemplatesScopedList + */ +class InstanceTemplatesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of instance templates that are contained within the specified project and zone. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceTemplate instance_templates = 459889679; + */ + private $instance_templates; + /** + * [Output Only] An informational warning that replaces the list of instance templates when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + private $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InstanceTemplate>|\Google\Protobuf\Internal\RepeatedField $instance_templates + * [Output Only] A list of instance templates that are contained within the specified project and zone. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] An informational warning that replaces the list of instance templates when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A list of instance templates that are contained within the specified project and zone. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceTemplate instance_templates = 459889679; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstanceTemplates() + { + return $this->instance_templates; + } + + /** + * [Output Only] A list of instance templates that are contained within the specified project and zone. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceTemplate instance_templates = 459889679; + * @param array<\Google\Cloud\Compute\V1\InstanceTemplate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstanceTemplates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceTemplate::class); + $this->instance_templates = $arr; + + return $this; + } + + /** + * [Output Only] An informational warning that replaces the list of instance templates when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + * @return \Google\Cloud\Compute\V1\Warning|null + */ + public function getWarning() + { + return $this->warning; + } + + public function hasWarning() + { + return isset($this->warning); + } + + public function clearWarning() + { + unset($this->warning); + } + + /** + * [Output Only] An informational warning that replaces the list of instance templates when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + * @param \Google\Cloud\Compute\V1\Warning $var + * @return $this + */ + public function setWarning($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Warning::class); + $this->warning = $var; + + return $this; + } + +} + diff --git a/Compute/src/V1/InstancesSetNameRequest.php b/Compute/src/V1/InstancesSetNameRequest.php new file mode 100644 index 00000000000..48c92f002e1 --- /dev/null +++ b/Compute/src/V1/InstancesSetNameRequest.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.InstancesSetNameRequest + */ +class InstancesSetNameRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The current name of this resource, used to prevent conflicts. Provide the latest name when making a request to change name. + * + * Generated from protobuf field optional string current_name = 394983825; + */ + private $current_name = null; + /** + * The name to be applied to the instance. Needs to be RFC 1035 compliant. + * + * Generated from protobuf field optional string name = 3373707; + */ + private $name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $current_name + * The current name of this resource, used to prevent conflicts. Provide the latest name when making a request to change name. + * @type string $name + * The name to be applied to the instance. Needs to be RFC 1035 compliant. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The current name of this resource, used to prevent conflicts. Provide the latest name when making a request to change name. + * + * Generated from protobuf field optional string current_name = 394983825; + * @return string + */ + public function getCurrentName() + { + return isset($this->current_name) ? $this->current_name : ''; + } + + public function hasCurrentName() + { + return isset($this->current_name); + } + + public function clearCurrentName() + { + unset($this->current_name); + } + + /** + * The current name of this resource, used to prevent conflicts. Provide the latest name when making a request to change name. + * + * Generated from protobuf field optional string current_name = 394983825; + * @param string $var + * @return $this + */ + public function setCurrentName($var) + { + GPBUtil::checkString($var, True); + $this->current_name = $var; + + return $this; + } + + /** + * The name to be applied to the instance. Needs to be RFC 1035 compliant. + * + * Generated from protobuf field optional string name = 3373707; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * The name to be applied to the instance. Needs to be RFC 1035 compliant. + * + * Generated from protobuf field optional string name = 3373707; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/Compute/src/V1/Interconnect.php b/Compute/src/V1/Interconnect.php index 74de37b71f8..1cbb5af3f55 100644 --- a/Compute/src/V1/Interconnect.php +++ b/Compute/src/V1/Interconnect.php @@ -139,7 +139,7 @@ class Interconnect extends \Google\Protobuf\Internal\Message */ private $requested_link_count = null; /** - * [Output Only] Set to true if the resource satisfies the zone separation organization policy constraints and false otherwise. Defaults to false if the field is not present. + * [Output Only] Reserved for future use. * * Generated from protobuf field optional bool satisfies_pzs = 480964267; */ @@ -208,7 +208,7 @@ class Interconnect extends \Google\Protobuf\Internal\Message * @type int $requested_link_count * Target number of physical links in the link bundle, as requested by the customer. * @type bool $satisfies_pzs - * [Output Only] Set to true if the resource satisfies the zone separation organization policy constraints and false otherwise. Defaults to false if the field is not present. + * [Output Only] Reserved for future use. * @type string $self_link * [Output Only] Server-defined URL for the resource. * @type string $state @@ -918,7 +918,7 @@ public function setRequestedLinkCount($var) } /** - * [Output Only] Set to true if the resource satisfies the zone separation organization policy constraints and false otherwise. Defaults to false if the field is not present. + * [Output Only] Reserved for future use. * * Generated from protobuf field optional bool satisfies_pzs = 480964267; * @return bool @@ -939,7 +939,7 @@ public function clearSatisfiesPzs() } /** - * [Output Only] Set to true if the resource satisfies the zone separation organization policy constraints and false otherwise. Defaults to false if the field is not present. + * [Output Only] Reserved for future use. * * Generated from protobuf field optional bool satisfies_pzs = 480964267; * @param bool $var diff --git a/Compute/src/V1/InterconnectAttachment.php b/Compute/src/V1/InterconnectAttachment.php index 5b975986e94..1cdb87d3b29 100644 --- a/Compute/src/V1/InterconnectAttachment.php +++ b/Compute/src/V1/InterconnectAttachment.php @@ -194,7 +194,7 @@ class InterconnectAttachment extends \Google\Protobuf\Internal\Message */ private $router = null; /** - * [Output Only] Set to true if the resource satisfies the zone separation organization policy constraints and false otherwise. Defaults to false if the field is not present. + * [Output Only] Reserved for future use. * * Generated from protobuf field optional bool satisfies_pzs = 480964267; */ @@ -227,7 +227,7 @@ class InterconnectAttachment extends \Google\Protobuf\Internal\Message */ private $type = null; /** - * The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. Only specified at creation time. + * The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4093. Only specified at creation time. * * Generated from protobuf field optional int32 vlan_tag8021q = 119927836; */ @@ -302,7 +302,7 @@ class InterconnectAttachment extends \Google\Protobuf\Internal\Message * @type string $router * URL of the Cloud Router to be used for dynamic routing. This router must be in the same region as this InterconnectAttachment. The InterconnectAttachment will automatically connect the Interconnect to the network & region within which the Cloud Router is configured. * @type bool $satisfies_pzs - * [Output Only] Set to true if the resource satisfies the zone separation organization policy constraints and false otherwise. Defaults to false if the field is not present. + * [Output Only] Reserved for future use. * @type string $self_link * [Output Only] Server-defined URL for the resource. * @type string $stack_type @@ -315,7 +315,7 @@ class InterconnectAttachment extends \Google\Protobuf\Internal\Message * The type of interconnect attachment this is, which can take one of the following values: - DEDICATED: an attachment to a Dedicated Interconnect. - PARTNER: an attachment to a Partner Interconnect, created by the customer. - PARTNER_PROVIDER: an attachment to a Partner Interconnect, created by the partner. * Check the Type enum for the list of possible values. * @type int $vlan_tag8021q - * The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. Only specified at creation time. + * The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4093. Only specified at creation time. * } */ public function __construct($data = NULL) { @@ -1346,7 +1346,7 @@ public function setRouter($var) } /** - * [Output Only] Set to true if the resource satisfies the zone separation organization policy constraints and false otherwise. Defaults to false if the field is not present. + * [Output Only] Reserved for future use. * * Generated from protobuf field optional bool satisfies_pzs = 480964267; * @return bool @@ -1367,7 +1367,7 @@ public function clearSatisfiesPzs() } /** - * [Output Only] Set to true if the resource satisfies the zone separation organization policy constraints and false otherwise. Defaults to false if the field is not present. + * [Output Only] Reserved for future use. * * Generated from protobuf field optional bool satisfies_pzs = 480964267; * @param bool $var @@ -1532,7 +1532,7 @@ public function setType($var) } /** - * The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. Only specified at creation time. + * The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4093. Only specified at creation time. * * Generated from protobuf field optional int32 vlan_tag8021q = 119927836; * @return int @@ -1553,7 +1553,7 @@ public function clearVlanTag8021Q() } /** - * The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. Only specified at creation time. + * The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4093. Only specified at creation time. * * Generated from protobuf field optional int32 vlan_tag8021q = 119927836; * @param int $var diff --git a/Compute/src/V1/InterconnectLocation.php b/Compute/src/V1/InterconnectLocation.php index dbf2bc13b2b..e41f7854a96 100644 --- a/Compute/src/V1/InterconnectLocation.php +++ b/Compute/src/V1/InterconnectLocation.php @@ -108,7 +108,7 @@ class InterconnectLocation extends \Google\Protobuf\Internal\Message */ private $status = null; /** - * [Output Only] Set to true for locations that support physical zone separation. Defaults to false if the field is not present. + * [Output Only] Reserved for future use. * * Generated from protobuf field optional bool supports_pzs = 83983214; */ @@ -153,7 +153,7 @@ class InterconnectLocation extends \Google\Protobuf\Internal\Message * [Output Only] The status of this InterconnectLocation, which can take one of the following values: - CLOSED: The InterconnectLocation is closed and is unavailable for provisioning new Interconnects. - AVAILABLE: The InterconnectLocation is available for provisioning new Interconnects. * Check the Status enum for the list of possible values. * @type bool $supports_pzs - * [Output Only] Set to true for locations that support physical zone separation. Defaults to false if the field is not present. + * [Output Only] Reserved for future use. * } */ public function __construct($data = NULL) { @@ -696,7 +696,7 @@ public function setStatus($var) } /** - * [Output Only] Set to true for locations that support physical zone separation. Defaults to false if the field is not present. + * [Output Only] Reserved for future use. * * Generated from protobuf field optional bool supports_pzs = 83983214; * @return bool @@ -717,7 +717,7 @@ public function clearSupportsPzs() } /** - * [Output Only] Set to true for locations that support physical zone separation. Defaults to false if the field is not present. + * [Output Only] Reserved for future use. * * Generated from protobuf field optional bool supports_pzs = 83983214; * @param bool $var diff --git a/Compute/src/V1/ListFirewallPoliciesRequest.php b/Compute/src/V1/ListFirewallPoliciesRequest.php index ebcb5c63a99..2569484ee2e 100644 --- a/Compute/src/V1/ListFirewallPoliciesRequest.php +++ b/Compute/src/V1/ListFirewallPoliciesRequest.php @@ -40,7 +40,7 @@ class ListFirewallPoliciesRequest extends \Google\Protobuf\Internal\Message */ private $page_token = null; /** - * Parent ID for this request. + * Parent ID for this request. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. * * Generated from protobuf field optional string parent_id = 459714768; */ @@ -67,7 +67,7 @@ class ListFirewallPoliciesRequest extends \Google\Protobuf\Internal\Message * @type string $page_token * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. * @type string $parent_id - * Parent ID for this request. + * Parent ID for this request. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. * @type bool $return_partial_success * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. * } @@ -222,7 +222,7 @@ public function setPageToken($var) } /** - * Parent ID for this request. + * Parent ID for this request. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. * * Generated from protobuf field optional string parent_id = 459714768; * @return string @@ -243,7 +243,7 @@ public function clearParentId() } /** - * Parent ID for this request. + * Parent ID for this request. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. * * Generated from protobuf field optional string parent_id = 459714768; * @param string $var diff --git a/Compute/src/V1/ListRegionInstanceTemplatesRequest.php b/Compute/src/V1/ListRegionInstanceTemplatesRequest.php new file mode 100644 index 00000000000..47c109e85e9 --- /dev/null +++ b/Compute/src/V1/ListRegionInstanceTemplatesRequest.php @@ -0,0 +1,321 @@ +google.cloud.compute.v1.ListRegionInstanceTemplatesRequest + */ +class ListRegionInstanceTemplatesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. + * + * Generated from protobuf field optional string filter = 336120696; + */ + private $filter = null; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * + * Generated from protobuf field optional uint32 max_results = 54715419; + */ + private $max_results = null; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * + * Generated from protobuf field optional string order_by = 160562920; + */ + private $order_by = null; + /** + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * + * Generated from protobuf field optional string page_token = 19994697; + */ + private $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + private $project = ''; + /** + * The name of the regions for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + private $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + private $return_partial_success = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filter + * A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. + * @type int $max_results + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @type string $order_by + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @type string $page_token + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the regions for this request. + * @type bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. + * + * Generated from protobuf field optional string filter = 336120696; + * @return string + */ + public function getFilter() + { + return isset($this->filter) ? $this->filter : ''; + } + + public function hasFilter() + { + return isset($this->filter); + } + + public function clearFilter() + { + unset($this->filter); + } + + /** + * A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. + * + * Generated from protobuf field optional string filter = 336120696; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * + * Generated from protobuf field optional uint32 max_results = 54715419; + * @return int + */ + public function getMaxResults() + { + return isset($this->max_results) ? $this->max_results : 0; + } + + public function hasMaxResults() + { + return isset($this->max_results); + } + + public function clearMaxResults() + { + unset($this->max_results); + } + + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * + * Generated from protobuf field optional uint32 max_results = 54715419; + * @param int $var + * @return $this + */ + public function setMaxResults($var) + { + GPBUtil::checkUint32($var); + $this->max_results = $var; + + return $this; + } + + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * + * Generated from protobuf field optional string order_by = 160562920; + * @return string + */ + public function getOrderBy() + { + return isset($this->order_by) ? $this->order_by : ''; + } + + public function hasOrderBy() + { + return isset($this->order_by); + } + + public function clearOrderBy() + { + unset($this->order_by); + } + + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * + * Generated from protobuf field optional string order_by = 160562920; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * + * Generated from protobuf field optional string page_token = 19994697; + * @return string + */ + public function getPageToken() + { + return isset($this->page_token) ? $this->page_token : ''; + } + + public function hasPageToken() + { + return isset($this->page_token); + } + + public function clearPageToken() + { + unset($this->page_token); + } + + /** + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * + * Generated from protobuf field optional string page_token = 19994697; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * The name of the regions for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * The name of the regions for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + * @return bool + */ + public function getReturnPartialSuccess() + { + return isset($this->return_partial_success) ? $this->return_partial_success : false; + } + + public function hasReturnPartialSuccess() + { + return isset($this->return_partial_success); + } + + public function clearReturnPartialSuccess() + { + unset($this->return_partial_success); + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + * @param bool $var + * @return $this + */ + public function setReturnPartialSuccess($var) + { + GPBUtil::checkBool($var); + $this->return_partial_success = $var; + + return $this; + } + +} + diff --git a/Compute/src/V1/MoveFirewallPolicyRequest.php b/Compute/src/V1/MoveFirewallPolicyRequest.php index fffc27bafff..6279eb98248 100644 --- a/Compute/src/V1/MoveFirewallPolicyRequest.php +++ b/Compute/src/V1/MoveFirewallPolicyRequest.php @@ -22,7 +22,7 @@ class MoveFirewallPolicyRequest extends \Google\Protobuf\Internal\Message */ private $firewall_policy = ''; /** - * The new parent of the firewall policy. + * The new parent of the firewall policy. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. * * Generated from protobuf field string parent_id = 459714768 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "parent_id"]; */ @@ -43,7 +43,7 @@ class MoveFirewallPolicyRequest extends \Google\Protobuf\Internal\Message * @type string $firewall_policy * Name of the firewall policy to update. * @type string $parent_id - * The new parent of the firewall policy. + * The new parent of the firewall policy. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. * @type string $request_id * 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. 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). * } @@ -80,7 +80,7 @@ public function setFirewallPolicy($var) } /** - * The new parent of the firewall policy. + * The new parent of the firewall policy. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. * * Generated from protobuf field string parent_id = 459714768 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "parent_id"]; * @return string @@ -91,7 +91,7 @@ public function getParentId() } /** - * The new parent of the firewall policy. + * The new parent of the firewall policy. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. * * Generated from protobuf field string parent_id = 459714768 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "parent_id"]; * @param string $var diff --git a/Compute/src/V1/NetworkInterface.php b/Compute/src/V1/NetworkInterface.php index 2da5673200a..a2f0391e31b 100644 --- a/Compute/src/V1/NetworkInterface.php +++ b/Compute/src/V1/NetworkInterface.php @@ -53,7 +53,7 @@ class NetworkInterface extends \Google\Protobuf\Internal\Message */ private $ipv6_access_type = null; /** - * An IPv6 internal network address for this network interface. + * An IPv6 internal network address for this network interface. To use a static internal IP address, it must be unused and in the same region as the instance's zone. If not specified, Google Cloud will automatically assign an internal IPv6 address from the instance's subnetwork. * * Generated from protobuf field optional string ipv6_address = 341563804; */ @@ -135,7 +135,7 @@ class NetworkInterface extends \Google\Protobuf\Internal\Message * [Output Only] One of EXTERNAL, INTERNAL to indicate whether the IP can be accessed from the Internet. This field is always inherited from its subnetwork. Valid only if stackType is IPV4_IPV6. * Check the Ipv6AccessType enum for the list of possible values. * @type string $ipv6_address - * An IPv6 internal network address for this network interface. + * An IPv6 internal network address for this network interface. To use a static internal IP address, it must be unused and in the same region as the instance's zone. If not specified, Google Cloud will automatically assign an internal IPv6 address from the instance's subnetwork. * @type string $kind * [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. * @type string $name @@ -352,7 +352,7 @@ public function setIpv6AccessType($var) } /** - * An IPv6 internal network address for this network interface. + * An IPv6 internal network address for this network interface. To use a static internal IP address, it must be unused and in the same region as the instance's zone. If not specified, Google Cloud will automatically assign an internal IPv6 address from the instance's subnetwork. * * Generated from protobuf field optional string ipv6_address = 341563804; * @return string @@ -373,7 +373,7 @@ public function clearIpv6Address() } /** - * An IPv6 internal network address for this network interface. + * An IPv6 internal network address for this network interface. To use a static internal IP address, it must be unused and in the same region as the instance's zone. If not specified, Google Cloud will automatically assign an internal IPv6 address from the instance's subnetwork. * * Generated from protobuf field optional string ipv6_address = 341563804; * @param string $var diff --git a/Compute/src/V1/NodeTemplate.php b/Compute/src/V1/NodeTemplate.php index 17277dd43c4..aa7c964c501 100644 --- a/Compute/src/V1/NodeTemplate.php +++ b/Compute/src/V1/NodeTemplate.php @@ -73,7 +73,7 @@ class NodeTemplate extends \Google\Protobuf\Internal\Message */ private $node_type = null; /** - * The flexible properties of the desired node type. Node groups that use this node template will create nodes of a type that matches these properties. This field is mutually exclusive with the node_type property; you can only define one or the other, but not both. + * Do not use. Instead, use the node_type property. * * Generated from protobuf field optional .google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility node_type_flexibility = 315257905; */ @@ -136,7 +136,7 @@ class NodeTemplate extends \Google\Protobuf\Internal\Message * @type string $node_type * The node type to use for nodes group that are created from this template. * @type \Google\Cloud\Compute\V1\NodeTemplateNodeTypeFlexibility $node_type_flexibility - * The flexible properties of the desired node type. Node groups that use this node template will create nodes of a type that matches these properties. This field is mutually exclusive with the node_type property; you can only define one or the other, but not both. + * Do not use. Instead, use the node_type property. * @type string $region * [Output Only] The name of the region where the node template resides, such as us-central1. * @type string $self_link @@ -480,7 +480,7 @@ public function setNodeType($var) } /** - * The flexible properties of the desired node type. Node groups that use this node template will create nodes of a type that matches these properties. This field is mutually exclusive with the node_type property; you can only define one or the other, but not both. + * Do not use. Instead, use the node_type property. * * Generated from protobuf field optional .google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility node_type_flexibility = 315257905; * @return \Google\Cloud\Compute\V1\NodeTemplateNodeTypeFlexibility|null @@ -501,7 +501,7 @@ public function clearNodeTypeFlexibility() } /** - * The flexible properties of the desired node type. Node groups that use this node template will create nodes of a type that matches these properties. This field is mutually exclusive with the node_type property; you can only define one or the other, but not both. + * Do not use. Instead, use the node_type property. * * Generated from protobuf field optional .google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility node_type_flexibility = 315257905; * @param \Google\Cloud\Compute\V1\NodeTemplateNodeTypeFlexibility $var diff --git a/Compute/src/V1/Quota/Metric.php b/Compute/src/V1/Quota/Metric.php index 399eddae981..4e99a79aa69 100644 --- a/Compute/src/V1/Quota/Metric.php +++ b/Compute/src/V1/Quota/Metric.php @@ -313,6 +313,10 @@ class Metric * Generated from protobuf enum NETWORKS = 485481477; */ const NETWORKS = 485481477; + /** + * Generated from protobuf enum NETWORK_ATTACHMENTS = 149028575; + */ + const NETWORK_ATTACHMENTS = 149028575; /** * Generated from protobuf enum NETWORK_ENDPOINT_GROUPS = 102144909; */ @@ -663,6 +667,7 @@ class Metric self::N2D_CPUS => 'N2D_CPUS', self::N2_CPUS => 'N2_CPUS', self::NETWORKS => 'NETWORKS', + self::NETWORK_ATTACHMENTS => 'NETWORK_ATTACHMENTS', self::NETWORK_ENDPOINT_GROUPS => 'NETWORK_ENDPOINT_GROUPS', self::NETWORK_FIREWALL_POLICIES => 'NETWORK_FIREWALL_POLICIES', self::NODE_GROUPS => 'NODE_GROUPS', diff --git a/Compute/src/V1/RegionInstanceGroupManagersApplyUpdatesRequest.php b/Compute/src/V1/RegionInstanceGroupManagersApplyUpdatesRequest.php index fedae02750b..29a0d043a67 100644 --- a/Compute/src/V1/RegionInstanceGroupManagersApplyUpdatesRequest.php +++ b/Compute/src/V1/RegionInstanceGroupManagersApplyUpdatesRequest.php @@ -16,7 +16,7 @@ class RegionInstanceGroupManagersApplyUpdatesRequest extends \Google\Protobuf\Internal\Message { /** - * Flag to update all instances instead of specified list of ���instances���. If the flag is set to true then the instances may not be specified in the request. + * Flag to update all instances instead of specified list of “instances”. If the flag is set to true then the instances may not be specified in the request. * * Generated from protobuf field optional bool all_instances = 403676512; */ @@ -49,7 +49,7 @@ class RegionInstanceGroupManagersApplyUpdatesRequest extends \Google\Protobuf\In * Optional. Data for populating the Message object. * * @type bool $all_instances - * Flag to update all instances instead of specified list of ���instances���. If the flag is set to true then the instances may not be specified in the request. + * Flag to update all instances instead of specified list of “instances”. If the flag is set to true then the instances may not be specified in the request. * @type array|\Google\Protobuf\Internal\RepeatedField $instances * The list of URLs of one or more instances for which you want to apply updates. Each URL can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. * @type string $minimal_action @@ -66,7 +66,7 @@ public function __construct($data = NULL) { } /** - * Flag to update all instances instead of specified list of ���instances���. If the flag is set to true then the instances may not be specified in the request. + * Flag to update all instances instead of specified list of “instances”. If the flag is set to true then the instances may not be specified in the request. * * Generated from protobuf field optional bool all_instances = 403676512; * @return bool @@ -87,7 +87,7 @@ public function clearAllInstances() } /** - * Flag to update all instances instead of specified list of ���instances���. If the flag is set to true then the instances may not be specified in the request. + * Flag to update all instances instead of specified list of “instances”. If the flag is set to true then the instances may not be specified in the request. * * Generated from protobuf field optional bool all_instances = 403676512; * @param bool $var diff --git a/Compute/src/V1/RegionInstanceTemplatesClient.php b/Compute/src/V1/RegionInstanceTemplatesClient.php new file mode 100644 index 00000000000..0b764b0a084 --- /dev/null +++ b/Compute/src/V1/RegionInstanceTemplatesClient.php @@ -0,0 +1,34 @@ +map resource_policies = 22220385; */ private $resource_policies; @@ -124,6 +126,7 @@ class Reservation extends \Google\Protobuf\Internal\Message * @type string $name * The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. * @type array|\Google\Protobuf\Internal\MapField $resource_policies + * Resource policies to be added to this reservation. The key is defined by user, and the value is resource policy url. This is to define placement policy with reservation. * @type \Google\Cloud\Compute\V1\AllocationResourceStatus $resource_status * [Output Only] Status information for Reservation resource. * @type bool $satisfies_pzs @@ -365,6 +368,8 @@ public function setName($var) } /** + * Resource policies to be added to this reservation. The key is defined by user, and the value is resource policy url. This is to define placement policy with reservation. + * * Generated from protobuf field map resource_policies = 22220385; * @return \Google\Protobuf\Internal\MapField */ @@ -374,6 +379,8 @@ public function getResourcePolicies() } /** + * Resource policies to be added to this reservation. The key is defined by user, and the value is resource policy url. This is to define placement policy with reservation. + * * Generated from protobuf field map resource_policies = 22220385; * @param array|\Google\Protobuf\Internal\MapField $var * @return $this diff --git a/Compute/src/V1/ResourcePolicyInstanceSchedulePolicy.php b/Compute/src/V1/ResourcePolicyInstanceSchedulePolicy.php index ee5347df759..3e98b853255 100644 --- a/Compute/src/V1/ResourcePolicyInstanceSchedulePolicy.php +++ b/Compute/src/V1/ResourcePolicyInstanceSchedulePolicy.php @@ -28,7 +28,7 @@ class ResourcePolicyInstanceSchedulePolicy extends \Google\Protobuf\Internal\Mes */ private $start_time = null; /** - * Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. + * Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: https://wikipedia.org/wiki/Tz_database. * * Generated from protobuf field optional string time_zone = 36848094; */ @@ -57,7 +57,7 @@ class ResourcePolicyInstanceSchedulePolicy extends \Google\Protobuf\Internal\Mes * @type string $start_time * The start time of the schedule. The timestamp is an RFC3339 string. * @type string $time_zone - * Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. + * Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: https://wikipedia.org/wiki/Tz_database. * @type \Google\Cloud\Compute\V1\ResourcePolicyInstanceSchedulePolicySchedule $vm_start_schedule * Specifies the schedule for starting instances. * @type \Google\Cloud\Compute\V1\ResourcePolicyInstanceSchedulePolicySchedule $vm_stop_schedule @@ -142,7 +142,7 @@ public function setStartTime($var) } /** - * Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. + * Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: https://wikipedia.org/wiki/Tz_database. * * Generated from protobuf field optional string time_zone = 36848094; * @return string @@ -163,7 +163,7 @@ public function clearTimeZone() } /** - * Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. + * Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: https://wikipedia.org/wiki/Tz_database. * * Generated from protobuf field optional string time_zone = 36848094; * @param string $var diff --git a/Compute/src/V1/RouterBgpPeer.php b/Compute/src/V1/RouterBgpPeer.php index 1d68aaa8766..726dd162334 100644 --- a/Compute/src/V1/RouterBgpPeer.php +++ b/Compute/src/V1/RouterBgpPeer.php @@ -22,7 +22,7 @@ class RouterBgpPeer extends \Google\Protobuf\Internal\Message */ private $advertise_mode = null; /** - * User-specified list of prefix groups to advertise in custom mode, which can take one of the following options: - ALL_SUBNETS: Advertises all available subnets, including peer VPC subnets. - ALL_VPC_SUBNETS: Advertises the router's own VPC subnets. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. + * User-specified list of prefix groups to advertise in custom mode, which currently supports the following option: - ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. * Check the AdvertisedGroups enum for the list of possible values. * * Generated from protobuf field repeated string advertised_groups = 21065526; @@ -131,7 +131,7 @@ class RouterBgpPeer extends \Google\Protobuf\Internal\Message * User-specified flag to indicate which mode to use for advertisement. * Check the AdvertiseMode enum for the list of possible values. * @type array|\Google\Protobuf\Internal\RepeatedField $advertised_groups - * User-specified list of prefix groups to advertise in custom mode, which can take one of the following options: - ALL_SUBNETS: Advertises all available subnets, including peer VPC subnets. - ALL_VPC_SUBNETS: Advertises the router's own VPC subnets. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. + * User-specified list of prefix groups to advertise in custom mode, which currently supports the following option: - ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. * Check the AdvertisedGroups enum for the list of possible values. * @type array<\Google\Cloud\Compute\V1\RouterAdvertisedIpRange>|\Google\Protobuf\Internal\RepeatedField $advertised_ip_ranges * User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These IP ranges are advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. @@ -211,7 +211,7 @@ public function setAdvertiseMode($var) } /** - * User-specified list of prefix groups to advertise in custom mode, which can take one of the following options: - ALL_SUBNETS: Advertises all available subnets, including peer VPC subnets. - ALL_VPC_SUBNETS: Advertises the router's own VPC subnets. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. + * User-specified list of prefix groups to advertise in custom mode, which currently supports the following option: - ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. * Check the AdvertisedGroups enum for the list of possible values. * * Generated from protobuf field repeated string advertised_groups = 21065526; @@ -223,7 +223,7 @@ public function getAdvertisedGroups() } /** - * User-specified list of prefix groups to advertise in custom mode, which can take one of the following options: - ALL_SUBNETS: Advertises all available subnets, including peer VPC subnets. - ALL_VPC_SUBNETS: Advertises the router's own VPC subnets. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. + * User-specified list of prefix groups to advertise in custom mode, which currently supports the following option: - ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. * Check the AdvertisedGroups enum for the list of possible values. * * Generated from protobuf field repeated string advertised_groups = 21065526; diff --git a/Compute/src/V1/SecurityPolicy.php b/Compute/src/V1/SecurityPolicy.php index 90341a526d1..e9653f5bf95 100644 --- a/Compute/src/V1/SecurityPolicy.php +++ b/Compute/src/V1/SecurityPolicy.php @@ -86,7 +86,7 @@ class SecurityPolicy extends \Google\Protobuf\Internal\Message */ private $self_link = null; /** - * The type indicates the intended use of the security policy. - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application. This field can be set only at resource creation time. + * The type indicates the intended use of the security policy. - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application. - CLOUD_ARMOR_NETWORK: Cloud Armor network policies can be configured to filter packets targeting network load balancing resources such as backend services, target pools, target instances, and instances with external IPs. They filter requests before the request is served from the application. This field can be set only at resource creation time. * Check the Type enum for the list of possible values. * * Generated from protobuf field optional string type = 3575610; @@ -122,7 +122,7 @@ class SecurityPolicy extends \Google\Protobuf\Internal\Message * @type string $self_link * [Output Only] Server-defined URL for the resource. * @type string $type - * The type indicates the intended use of the security policy. - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application. This field can be set only at resource creation time. + * The type indicates the intended use of the security policy. - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application. - CLOUD_ARMOR_NETWORK: Cloud Armor network policies can be configured to filter packets targeting network load balancing resources such as backend services, target pools, target instances, and instances with external IPs. They filter requests before the request is served from the application. This field can be set only at resource creation time. * Check the Type enum for the list of possible values. * } */ @@ -574,7 +574,7 @@ public function setSelfLink($var) } /** - * The type indicates the intended use of the security policy. - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application. This field can be set only at resource creation time. + * The type indicates the intended use of the security policy. - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application. - CLOUD_ARMOR_NETWORK: Cloud Armor network policies can be configured to filter packets targeting network load balancing resources such as backend services, target pools, target instances, and instances with external IPs. They filter requests before the request is served from the application. This field can be set only at resource creation time. * Check the Type enum for the list of possible values. * * Generated from protobuf field optional string type = 3575610; @@ -596,7 +596,7 @@ public function clearType() } /** - * The type indicates the intended use of the security policy. - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application. This field can be set only at resource creation time. + * The type indicates the intended use of the security policy. - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application. - CLOUD_ARMOR_NETWORK: Cloud Armor network policies can be configured to filter packets targeting network load balancing resources such as backend services, target pools, target instances, and instances with external IPs. They filter requests before the request is served from the application. This field can be set only at resource creation time. * Check the Type enum for the list of possible values. * * Generated from protobuf field optional string type = 3575610; diff --git a/Compute/src/V1/SecurityPolicy/Type.php b/Compute/src/V1/SecurityPolicy/Type.php index 812d8e98314..e66ec300cb6 100644 --- a/Compute/src/V1/SecurityPolicy/Type.php +++ b/Compute/src/V1/SecurityPolicy/Type.php @@ -7,7 +7,7 @@ use UnexpectedValueException; /** - * The type indicates the intended use of the security policy. - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application. This field can be set only at resource creation time. + * The type indicates the intended use of the security policy. - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application. - CLOUD_ARMOR_NETWORK: Cloud Armor network policies can be configured to filter packets targeting network load balancing resources such as backend services, target pools, target instances, and instances with external IPs. They filter requests before the request is served from the application. This field can be set only at resource creation time. * * Protobuf type google.cloud.compute.v1.SecurityPolicy.Type */ diff --git a/Compute/src/V1/SecurityPolicyRule.php b/Compute/src/V1/SecurityPolicyRule.php index 49692d5dcbf..0d177f5112b 100644 --- a/Compute/src/V1/SecurityPolicyRule.php +++ b/Compute/src/V1/SecurityPolicyRule.php @@ -16,7 +16,7 @@ class SecurityPolicyRule extends \Google\Protobuf\Internal\Message { /** - * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(): deny access to target, returns the HTTP response code specified (valid values are 403, 404, and 502). - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this. + * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this. * * Generated from protobuf field optional string action = 187661878; */ @@ -45,6 +45,12 @@ class SecurityPolicyRule extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165; */ private $match = null; + /** + * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027; + */ + private $preconfigured_waf_config = null; /** * If set to true, the specified action is not enforced. * @@ -77,7 +83,7 @@ class SecurityPolicyRule extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $action - * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(): deny access to target, returns the HTTP response code specified (valid values are 403, 404, and 502). - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this. + * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this. * @type string $description * An optional description of this resource. Provide this property when you create the resource. * @type \Google\Cloud\Compute\V1\SecurityPolicyRuleHttpHeaderAction $header_action @@ -86,6 +92,8 @@ class SecurityPolicyRule extends \Google\Protobuf\Internal\Message * [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules * @type \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcher $match * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + * @type \Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfig $preconfigured_waf_config + * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect. * @type bool $preview * If set to true, the specified action is not enforced. * @type int $priority @@ -102,7 +110,7 @@ public function __construct($data = NULL) { } /** - * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(): deny access to target, returns the HTTP response code specified (valid values are 403, 404, and 502). - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this. + * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this. * * Generated from protobuf field optional string action = 187661878; * @return string @@ -123,7 +131,7 @@ public function clearAction() } /** - * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(): deny access to target, returns the HTTP response code specified (valid values are 403, 404, and 502). - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this. + * The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this. * * Generated from protobuf field optional string action = 187661878; * @param string $var @@ -281,6 +289,42 @@ public function setMatch($var) return $this; } + /** + * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfig|null + */ + public function getPreconfiguredWafConfig() + { + return $this->preconfigured_waf_config; + } + + public function hasPreconfiguredWafConfig() + { + return isset($this->preconfigured_waf_config); + } + + public function clearPreconfiguredWafConfig() + { + unset($this->preconfigured_waf_config); + } + + /** + * Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig preconfigured_waf_config = 117805027; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfig $var + * @return $this + */ + public function setPreconfiguredWafConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfig::class); + $this->preconfigured_waf_config = $var; + + return $this; + } + /** * If set to true, the specified action is not enforced. * diff --git a/Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfig.php b/Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfig.php new file mode 100644 index 00000000000..f5a64f3ee92 --- /dev/null +++ b/Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfig.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfig + */ +class SecurityPolicyRulePreconfiguredWafConfig extends \Google\Protobuf\Internal\Message +{ + /** + * A list of exclusions to apply during preconfigured WAF evaluation. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusion exclusions = 208665701; + */ + private $exclusions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusion>|\Google\Protobuf\Internal\RepeatedField $exclusions + * A list of exclusions to apply during preconfigured WAF evaluation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of exclusions to apply during preconfigured WAF evaluation. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusion exclusions = 208665701; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExclusions() + { + return $this->exclusions; + } + + /** + * A list of exclusions to apply during preconfigured WAF evaluation. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusion exclusions = 208665701; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusion>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExclusions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusion::class); + $this->exclusions = $arr; + + return $this; + } + +} + diff --git a/Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfigExclusion.php b/Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfigExclusion.php new file mode 100644 index 00000000000..2936ce051c3 --- /dev/null +++ b/Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfigExclusion.php @@ -0,0 +1,246 @@ +google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusion + */ +class SecurityPolicyRulePreconfiguredWafConfigExclusion extends \Google\Protobuf\Internal\Message +{ + /** + * A list of request cookie names whose value will be excluded from inspection during preconfigured WAF evaluation. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams request_cookies_to_exclude = 156757878; + */ + private $request_cookies_to_exclude; + /** + * A list of request header names whose value will be excluded from inspection during preconfigured WAF evaluation. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams request_headers_to_exclude = 63230495; + */ + private $request_headers_to_exclude; + /** + * A list of request query parameter names whose value will be excluded from inspection during preconfigured WAF evaluation. Note that the parameter can be in the query string or in the POST body. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams request_query_params_to_exclude = 340692744; + */ + private $request_query_params_to_exclude; + /** + * A list of request URIs from the request line to be excluded from inspection during preconfigured WAF evaluation. When specifying this field, the query or fragment part should be excluded. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams request_uris_to_exclude = 90690846; + */ + private $request_uris_to_exclude; + /** + * A list of target rule IDs under the WAF rule set to apply the preconfigured WAF exclusion. If omitted, it refers to all the rule IDs under the WAF rule set. + * + * Generated from protobuf field repeated string target_rule_ids = 498430435; + */ + private $target_rule_ids; + /** + * Target WAF rule set to apply the preconfigured WAF exclusion. + * + * Generated from protobuf field optional string target_rule_set = 498440077; + */ + private $target_rule_set = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams>|\Google\Protobuf\Internal\RepeatedField $request_cookies_to_exclude + * A list of request cookie names whose value will be excluded from inspection during preconfigured WAF evaluation. + * @type array<\Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams>|\Google\Protobuf\Internal\RepeatedField $request_headers_to_exclude + * A list of request header names whose value will be excluded from inspection during preconfigured WAF evaluation. + * @type array<\Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams>|\Google\Protobuf\Internal\RepeatedField $request_query_params_to_exclude + * A list of request query parameter names whose value will be excluded from inspection during preconfigured WAF evaluation. Note that the parameter can be in the query string or in the POST body. + * @type array<\Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams>|\Google\Protobuf\Internal\RepeatedField $request_uris_to_exclude + * A list of request URIs from the request line to be excluded from inspection during preconfigured WAF evaluation. When specifying this field, the query or fragment part should be excluded. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_rule_ids + * A list of target rule IDs under the WAF rule set to apply the preconfigured WAF exclusion. If omitted, it refers to all the rule IDs under the WAF rule set. + * @type string $target_rule_set + * Target WAF rule set to apply the preconfigured WAF exclusion. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of request cookie names whose value will be excluded from inspection during preconfigured WAF evaluation. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams request_cookies_to_exclude = 156757878; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequestCookiesToExclude() + { + return $this->request_cookies_to_exclude; + } + + /** + * A list of request cookie names whose value will be excluded from inspection during preconfigured WAF evaluation. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams request_cookies_to_exclude = 156757878; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequestCookiesToExclude($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams::class); + $this->request_cookies_to_exclude = $arr; + + return $this; + } + + /** + * A list of request header names whose value will be excluded from inspection during preconfigured WAF evaluation. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams request_headers_to_exclude = 63230495; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequestHeadersToExclude() + { + return $this->request_headers_to_exclude; + } + + /** + * A list of request header names whose value will be excluded from inspection during preconfigured WAF evaluation. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams request_headers_to_exclude = 63230495; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequestHeadersToExclude($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams::class); + $this->request_headers_to_exclude = $arr; + + return $this; + } + + /** + * A list of request query parameter names whose value will be excluded from inspection during preconfigured WAF evaluation. Note that the parameter can be in the query string or in the POST body. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams request_query_params_to_exclude = 340692744; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequestQueryParamsToExclude() + { + return $this->request_query_params_to_exclude; + } + + /** + * A list of request query parameter names whose value will be excluded from inspection during preconfigured WAF evaluation. Note that the parameter can be in the query string or in the POST body. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams request_query_params_to_exclude = 340692744; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequestQueryParamsToExclude($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams::class); + $this->request_query_params_to_exclude = $arr; + + return $this; + } + + /** + * A list of request URIs from the request line to be excluded from inspection during preconfigured WAF evaluation. When specifying this field, the query or fragment part should be excluded. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams request_uris_to_exclude = 90690846; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequestUrisToExclude() + { + return $this->request_uris_to_exclude; + } + + /** + * A list of request URIs from the request line to be excluded from inspection during preconfigured WAF evaluation. When specifying this field, the query or fragment part should be excluded. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams request_uris_to_exclude = 90690846; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequestUrisToExclude($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams::class); + $this->request_uris_to_exclude = $arr; + + return $this; + } + + /** + * A list of target rule IDs under the WAF rule set to apply the preconfigured WAF exclusion. If omitted, it refers to all the rule IDs under the WAF rule set. + * + * Generated from protobuf field repeated string target_rule_ids = 498430435; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetRuleIds() + { + return $this->target_rule_ids; + } + + /** + * A list of target rule IDs under the WAF rule set to apply the preconfigured WAF exclusion. If omitted, it refers to all the rule IDs under the WAF rule set. + * + * Generated from protobuf field repeated string target_rule_ids = 498430435; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetRuleIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->target_rule_ids = $arr; + + return $this; + } + + /** + * Target WAF rule set to apply the preconfigured WAF exclusion. + * + * Generated from protobuf field optional string target_rule_set = 498440077; + * @return string + */ + public function getTargetRuleSet() + { + return isset($this->target_rule_set) ? $this->target_rule_set : ''; + } + + public function hasTargetRuleSet() + { + return isset($this->target_rule_set); + } + + public function clearTargetRuleSet() + { + unset($this->target_rule_set); + } + + /** + * Target WAF rule set to apply the preconfigured WAF exclusion. + * + * Generated from protobuf field optional string target_rule_set = 498440077; + * @param string $var + * @return $this + */ + public function setTargetRuleSet($var) + { + GPBUtil::checkString($var, True); + $this->target_rule_set = $var; + + return $this; + } + +} + diff --git a/Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams.php b/Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams.php new file mode 100644 index 00000000000..37e997bc0de --- /dev/null +++ b/Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams + */ +class SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams extends \Google\Protobuf\Internal\Message +{ + /** + * The match operator for the field. + * Check the Op enum for the list of possible values. + * + * Generated from protobuf field optional string op = 3553; + */ + private $op = null; + /** + * The value of the field. + * + * Generated from protobuf field optional string val = 116513; + */ + private $val = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $op + * The match operator for the field. + * Check the Op enum for the list of possible values. + * @type string $val + * The value of the field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The match operator for the field. + * Check the Op enum for the list of possible values. + * + * Generated from protobuf field optional string op = 3553; + * @return string + */ + public function getOp() + { + return isset($this->op) ? $this->op : ''; + } + + public function hasOp() + { + return isset($this->op); + } + + public function clearOp() + { + unset($this->op); + } + + /** + * The match operator for the field. + * Check the Op enum for the list of possible values. + * + * Generated from protobuf field optional string op = 3553; + * @param string $var + * @return $this + */ + public function setOp($var) + { + GPBUtil::checkString($var, True); + $this->op = $var; + + return $this; + } + + /** + * The value of the field. + * + * Generated from protobuf field optional string val = 116513; + * @return string + */ + public function getVal() + { + return isset($this->val) ? $this->val : ''; + } + + public function hasVal() + { + return isset($this->val); + } + + public function clearVal() + { + unset($this->val); + } + + /** + * The value of the field. + * + * Generated from protobuf field optional string val = 116513; + * @param string $var + * @return $this + */ + public function setVal($var) + { + GPBUtil::checkString($var, True); + $this->val = $var; + + return $this; + } + +} + diff --git a/Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams/Op.php b/Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams/Op.php new file mode 100644 index 00000000000..0d69d6fb9fe --- /dev/null +++ b/Compute/src/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams/Op.php @@ -0,0 +1,83 @@ +google.cloud.compute.v1.SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams.Op + */ +class Op +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_OP = 0; + */ + const UNDEFINED_OP = 0; + /** + * The operator matches if the field value contains the specified value. + * + * Generated from protobuf enum CONTAINS = 215180831; + */ + const CONTAINS = 215180831; + /** + * The operator matches if the field value ends with the specified value. + * + * Generated from protobuf enum ENDS_WITH = 490402221; + */ + const ENDS_WITH = 490402221; + /** + * The operator matches if the field value equals the specified value. + * + * Generated from protobuf enum EQUALS = 442201023; + */ + const EQUALS = 442201023; + /** + * The operator matches if the field value is any value. + * + * Generated from protobuf enum EQUALS_ANY = 337226060; + */ + const EQUALS_ANY = 337226060; + /** + * The operator matches if the field value starts with the specified value. + * + * Generated from protobuf enum STARTS_WITH = 139505652; + */ + const STARTS_WITH = 139505652; + + private static $valueToName = [ + self::UNDEFINED_OP => 'UNDEFINED_OP', + self::CONTAINS => 'CONTAINS', + self::ENDS_WITH => 'ENDS_WITH', + self::EQUALS => 'EQUALS', + self::EQUALS_ANY => 'EQUALS_ANY', + self::STARTS_WITH => 'STARTS_WITH', + ]; + + 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/Compute/src/V1/SecurityPolicyRuleRateLimitOptions.php b/Compute/src/V1/SecurityPolicyRuleRateLimitOptions.php index 13a6c904a87..8798c64b1d2 100644 --- a/Compute/src/V1/SecurityPolicyRuleRateLimitOptions.php +++ b/Compute/src/V1/SecurityPolicyRuleRateLimitOptions.php @@ -46,7 +46,7 @@ class SecurityPolicyRuleRateLimitOptions extends \Google\Protobuf\Internal\Messa */ private $enforce_on_key_name = null; /** - * Action to take for requests that are above the configured rate limit threshold, to either deny with a specified HTTP response code, or redirect to a different endpoint. Valid options are "deny(status)", where valid values for status are 403, 404, 429, and 502, and "redirect" where the redirect parameters come from exceedRedirectOptions below. + * Action to take for requests that are above the configured rate limit threshold, to either deny with a specified HTTP response code, or redirect to a different endpoint. Valid options are `deny(STATUS)`, where valid values for `STATUS` are 403, 404, 429, and 502, and `redirect`, where the redirect parameters come from `exceedRedirectOptions` below. * * Generated from protobuf field optional string exceed_action = 167159073; */ @@ -82,7 +82,7 @@ class SecurityPolicyRuleRateLimitOptions extends \Google\Protobuf\Internal\Messa * @type string $enforce_on_key_name * Rate limit key name applicable only for the following key types: HTTP_HEADER -- Name of the HTTP header whose value is taken as the key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key value. * @type string $exceed_action - * Action to take for requests that are above the configured rate limit threshold, to either deny with a specified HTTP response code, or redirect to a different endpoint. Valid options are "deny(status)", where valid values for status are 403, 404, 429, and 502, and "redirect" where the redirect parameters come from exceedRedirectOptions below. + * Action to take for requests that are above the configured rate limit threshold, to either deny with a specified HTTP response code, or redirect to a different endpoint. Valid options are `deny(STATUS)`, where valid values for `STATUS` are 403, 404, 429, and 502, and `redirect`, where the redirect parameters come from `exceedRedirectOptions` below. * @type \Google\Cloud\Compute\V1\SecurityPolicyRuleRedirectOptions $exceed_redirect_options * Parameters defining the redirect action that is used as the exceed action. Cannot be specified if the exceed action is not redirect. * @type \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptionsThreshold $rate_limit_threshold @@ -277,7 +277,7 @@ public function setEnforceOnKeyName($var) } /** - * Action to take for requests that are above the configured rate limit threshold, to either deny with a specified HTTP response code, or redirect to a different endpoint. Valid options are "deny(status)", where valid values for status are 403, 404, 429, and 502, and "redirect" where the redirect parameters come from exceedRedirectOptions below. + * Action to take for requests that are above the configured rate limit threshold, to either deny with a specified HTTP response code, or redirect to a different endpoint. Valid options are `deny(STATUS)`, where valid values for `STATUS` are 403, 404, 429, and 502, and `redirect`, where the redirect parameters come from `exceedRedirectOptions` below. * * Generated from protobuf field optional string exceed_action = 167159073; * @return string @@ -298,7 +298,7 @@ public function clearExceedAction() } /** - * Action to take for requests that are above the configured rate limit threshold, to either deny with a specified HTTP response code, or redirect to a different endpoint. Valid options are "deny(status)", where valid values for status are 403, 404, 429, and 502, and "redirect" where the redirect parameters come from exceedRedirectOptions below. + * Action to take for requests that are above the configured rate limit threshold, to either deny with a specified HTTP response code, or redirect to a different endpoint. Valid options are `deny(STATUS)`, where valid values for `STATUS` are 403, 404, 429, and 502, and `redirect`, where the redirect parameters come from `exceedRedirectOptions` below. * * Generated from protobuf field optional string exceed_action = 167159073; * @param string $var diff --git a/Compute/src/V1/SetNameInstanceRequest.php b/Compute/src/V1/SetNameInstanceRequest.php new file mode 100644 index 00000000000..8564ae59268 --- /dev/null +++ b/Compute/src/V1/SetNameInstanceRequest.php @@ -0,0 +1,223 @@ +google.cloud.compute.v1.SetNameInstanceRequest + */ +class SetNameInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The instance name for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + private $instance = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetNameRequest instances_set_name_request_resource = 272080980 [(.google.api.field_behavior) = REQUIRED]; + */ + private $instances_set_name_request_resource = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + private $project = ''; + /** + * 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. 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 optional string request_id = 37109963; + */ + private $request_id = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + private $zone = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * The instance name for this request. + * @type \Google\Cloud\Compute\V1\InstancesSetNameRequest $instances_set_name_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $request_id + * 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. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + * @type string $zone + * The name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The instance name for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * The instance name for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetNameRequest instances_set_name_request_resource = 272080980 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstancesSetNameRequest|null + */ + public function getInstancesSetNameRequestResource() + { + return $this->instances_set_name_request_resource; + } + + public function hasInstancesSetNameRequestResource() + { + return isset($this->instances_set_name_request_resource); + } + + public function clearInstancesSetNameRequestResource() + { + unset($this->instances_set_name_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetNameRequest instances_set_name_request_resource = 272080980 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstancesSetNameRequest $var + * @return $this + */ + public function setInstancesSetNameRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstancesSetNameRequest::class); + $this->instances_set_name_request_resource = $var; + + return $this; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * 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. 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 optional string request_id = 37109963; + * @return string + */ + public function getRequestId() + { + return isset($this->request_id) ? $this->request_id : ''; + } + + public function hasRequestId() + { + return isset($this->request_id); + } + + public function clearRequestId() + { + unset($this->request_id); + } + + /** + * 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. 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 optional string request_id = 37109963; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/Compute/src/V1/UpdateDiskRequest.php b/Compute/src/V1/UpdateDiskRequest.php new file mode 100644 index 00000000000..661c4ec885d --- /dev/null +++ b/Compute/src/V1/UpdateDiskRequest.php @@ -0,0 +1,304 @@ +google.cloud.compute.v1.UpdateDiskRequest + */ +class UpdateDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The disk name for this request. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + private $disk = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Disk disk_resource = 25880688 [(.google.api.field_behavior) = REQUIRED]; + */ + private $disk_resource = null; + /** + * Generated from protobuf field optional string paths = 106438894; + */ + private $paths = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + private $project = ''; + /** + * 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. 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 optional string request_id = 37109963; + */ + private $request_id = null; + /** + * update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + private $update_mask = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + private $zone = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * The disk name for this request. + * @type \Google\Cloud\Compute\V1\Disk $disk_resource + * The body resource for this request + * @type string $paths + * @type string $project + * Project ID for this request. + * @type string $request_id + * 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. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + * @type string $update_mask + * update_mask indicates fields to be updated as part of this request. + * @type string $zone + * The name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The disk name for this request. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * The disk name for this request. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisk($var) + { + GPBUtil::checkString($var, True); + $this->disk = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Disk disk_resource = 25880688 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Disk|null + */ + public function getDiskResource() + { + return $this->disk_resource; + } + + public function hasDiskResource() + { + return isset($this->disk_resource); + } + + public function clearDiskResource() + { + unset($this->disk_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Disk disk_resource = 25880688 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Disk $var + * @return $this + */ + public function setDiskResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Disk::class); + $this->disk_resource = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string paths = 106438894; + * @return string + */ + public function getPaths() + { + return isset($this->paths) ? $this->paths : ''; + } + + public function hasPaths() + { + return isset($this->paths); + } + + public function clearPaths() + { + unset($this->paths); + } + + /** + * Generated from protobuf field optional string paths = 106438894; + * @param string $var + * @return $this + */ + public function setPaths($var) + { + GPBUtil::checkString($var, True); + $this->paths = $var; + + return $this; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * 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. 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 optional string request_id = 37109963; + * @return string + */ + public function getRequestId() + { + return isset($this->request_id) ? $this->request_id : ''; + } + + public function hasRequestId() + { + return isset($this->request_id); + } + + public function clearRequestId() + { + unset($this->request_id); + } + + /** + * 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. 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 optional string request_id = 37109963; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + * @return string + */ + public function getUpdateMask() + { + return isset($this->update_mask) ? $this->update_mask : ''; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + * @param string $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkString($var, True); + $this->update_mask = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/Compute/src/V1/UpdateRegionDiskRequest.php b/Compute/src/V1/UpdateRegionDiskRequest.php new file mode 100644 index 00000000000..ba6cd964a53 --- /dev/null +++ b/Compute/src/V1/UpdateRegionDiskRequest.php @@ -0,0 +1,304 @@ +google.cloud.compute.v1.UpdateRegionDiskRequest + */ +class UpdateRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The disk name for this request. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + private $disk = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Disk disk_resource = 25880688 [(.google.api.field_behavior) = REQUIRED]; + */ + private $disk_resource = null; + /** + * Generated from protobuf field optional string paths = 106438894; + */ + private $paths = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + private $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + private $region = ''; + /** + * 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. 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 optional string request_id = 37109963; + */ + private $request_id = null; + /** + * update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + private $update_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * The disk name for this request. + * @type \Google\Cloud\Compute\V1\Disk $disk_resource + * The body resource for this request + * @type string $paths + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $request_id + * 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. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + * @type string $update_mask + * update_mask indicates fields to be updated as part of this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The disk name for this request. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * The disk name for this request. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDisk($var) + { + GPBUtil::checkString($var, True); + $this->disk = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Disk disk_resource = 25880688 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Disk|null + */ + public function getDiskResource() + { + return $this->disk_resource; + } + + public function hasDiskResource() + { + return isset($this->disk_resource); + } + + public function clearDiskResource() + { + unset($this->disk_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Disk disk_resource = 25880688 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Disk $var + * @return $this + */ + public function setDiskResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Disk::class); + $this->disk_resource = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string paths = 106438894; + * @return string + */ + public function getPaths() + { + return isset($this->paths) ? $this->paths : ''; + } + + public function hasPaths() + { + return isset($this->paths); + } + + public function clearPaths() + { + unset($this->paths); + } + + /** + * Generated from protobuf field optional string paths = 106438894; + * @param string $var + * @return $this + */ + public function setPaths($var) + { + GPBUtil::checkString($var, True); + $this->paths = $var; + + return $this; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + + /** + * 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. 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 optional string request_id = 37109963; + * @return string + */ + public function getRequestId() + { + return isset($this->request_id) ? $this->request_id : ''; + } + + public function hasRequestId() + { + return isset($this->request_id); + } + + public function clearRequestId() + { + unset($this->request_id); + } + + /** + * 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. 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 optional string request_id = 37109963; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + * @return string + */ + public function getUpdateMask() + { + return isset($this->update_mask) ? $this->update_mask : ''; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + * @param string $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkString($var, True); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/Compute/src/V1/VpnGateway.php b/Compute/src/V1/VpnGateway.php index af9ac8cb7b2..f594d568f09 100644 --- a/Compute/src/V1/VpnGateway.php +++ b/Compute/src/V1/VpnGateway.php @@ -40,7 +40,7 @@ class VpnGateway extends \Google\Protobuf\Internal\Message */ private $kind = null; /** - * A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an VpnGateway. + * A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a VpnGateway. * * Generated from protobuf field optional string label_fingerprint = 178124825; */ @@ -104,7 +104,7 @@ class VpnGateway extends \Google\Protobuf\Internal\Message * @type string $kind * [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. * @type string $label_fingerprint - * A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an VpnGateway. + * A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a VpnGateway. * @type array|\Google\Protobuf\Internal\MapField $labels * Labels for this resource. These can only be added or modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty. * @type string $name @@ -272,7 +272,7 @@ public function setKind($var) } /** - * A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an VpnGateway. + * A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a VpnGateway. * * Generated from protobuf field optional string label_fingerprint = 178124825; * @return string @@ -293,7 +293,7 @@ public function clearLabelFingerprint() } /** - * A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an VpnGateway. + * A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a VpnGateway. * * Generated from protobuf field optional string label_fingerprint = 178124825; * @param string $var diff --git a/Compute/src/V1/WafExpressionSetExpression.php b/Compute/src/V1/WafExpressionSetExpression.php index 13613c57617..74b9240b29c 100644 --- a/Compute/src/V1/WafExpressionSetExpression.php +++ b/Compute/src/V1/WafExpressionSetExpression.php @@ -20,6 +20,12 @@ class WafExpressionSetExpression extends \Google\Protobuf\Internal\Message * Generated from protobuf field optional string id = 3355; */ private $id = null; + /** + * The sensitivity value associated with the WAF rule ID. This corresponds to the ModSecurity paranoia level, ranging from 1 to 4. 0 is reserved for opt-in only rules. + * + * Generated from protobuf field optional int32 sensitivity = 27532959; + */ + private $sensitivity = null; /** * Constructor. @@ -29,6 +35,8 @@ class WafExpressionSetExpression extends \Google\Protobuf\Internal\Message * * @type string $id * Expression ID should uniquely identify the origin of the expression. E.g. owasp-crs-v020901-id973337 identifies Owasp core rule set version 2.9.1 rule id 973337. The ID could be used to determine the individual attack definition that has been detected. It could also be used to exclude it from the policy in case of false positive. required + * @type int $sensitivity + * The sensitivity value associated with the WAF rule ID. This corresponds to the ModSecurity paranoia level, ranging from 1 to 4. 0 is reserved for opt-in only rules. * } */ public function __construct($data = NULL) { @@ -72,5 +80,41 @@ public function setId($var) return $this; } + /** + * The sensitivity value associated with the WAF rule ID. This corresponds to the ModSecurity paranoia level, ranging from 1 to 4. 0 is reserved for opt-in only rules. + * + * Generated from protobuf field optional int32 sensitivity = 27532959; + * @return int + */ + public function getSensitivity() + { + return isset($this->sensitivity) ? $this->sensitivity : 0; + } + + public function hasSensitivity() + { + return isset($this->sensitivity); + } + + public function clearSensitivity() + { + unset($this->sensitivity); + } + + /** + * The sensitivity value associated with the WAF rule ID. This corresponds to the ModSecurity paranoia level, ranging from 1 to 4. 0 is reserved for opt-in only rules. + * + * Generated from protobuf field optional int32 sensitivity = 27532959; + * @param int $var + * @return $this + */ + public function setSensitivity($var) + { + GPBUtil::checkInt32($var); + $this->sensitivity = $var; + + return $this; + } + } diff --git a/Compute/src/V1/gapic_metadata.json b/Compute/src/V1/gapic_metadata.json index 6b181d2ff79..e1c5a37520e 100644 --- a/Compute/src/V1/gapic_metadata.json +++ b/Compute/src/V1/gapic_metadata.json @@ -338,6 +338,11 @@ "methods": [ "testIamPermissions" ] + }, + "Update": { + "methods": [ + "update" + ] } } } @@ -1073,6 +1078,11 @@ "grpc": { "libraryClient": "InstanceTemplatesGapicClient", "rpcs": { + "AggregatedList": { + "methods": [ + "aggregatedList" + ] + }, "Delete": { "methods": [ "delete" @@ -1267,6 +1277,11 @@ "setMinCpuPlatform" ] }, + "SetName": { + "methods": [ + "setName" + ] + }, "SetScheduling": { "methods": [ "setScheduling" @@ -2422,6 +2437,11 @@ "methods": [ "testIamPermissions" ] + }, + "Update": { + "methods": [ + "update" + ] } } } @@ -2633,6 +2653,35 @@ } } }, + "RegionInstanceTemplates": { + "clients": { + "grpc": { + "libraryClient": "RegionInstanceTemplatesGapicClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list" + ] + } + } + } + } + }, "RegionInstances": { "clients": { "grpc": { diff --git a/Compute/src/V1/resources/disks_client_config.json b/Compute/src/V1/resources/disks_client_config.json index cc04eda42b6..d13064dcb53 100644 --- a/Compute/src/V1/resources/disks_client_config.json +++ b/Compute/src/V1/resources/disks_client_config.json @@ -103,6 +103,11 @@ "timeout_millis": 600000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" + }, + "Update": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" } } } diff --git a/Compute/src/V1/resources/disks_descriptor_config.php b/Compute/src/V1/resources/disks_descriptor_config.php index ef8eefd6e6a..9f14ee564ff 100644 --- a/Compute/src/V1/resources/disks_descriptor_config.php +++ b/Compute/src/V1/resources/disks_descriptor_config.php @@ -115,6 +115,22 @@ 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, ], ], + 'Update' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + 'getZone', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + ], 'AggregatedList' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', diff --git a/Compute/src/V1/resources/disks_rest_client_config.php b/Compute/src/V1/resources/disks_rest_client_config.php index f47f5cb906d..6b531ba8da9 100644 --- a/Compute/src/V1/resources/disks_rest_client_config.php +++ b/Compute/src/V1/resources/disks_rest_client_config.php @@ -264,6 +264,28 @@ ], ], ], + 'Update' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}', + 'body' => 'disk_resource', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], ], 'google.cloud.compute.v1.ZoneOperations' => [ 'Delete' => [ diff --git a/Compute/src/V1/resources/instance_templates_client_config.json b/Compute/src/V1/resources/instance_templates_client_config.json index 0ae4a1caec1..7513d5d8dc9 100644 --- a/Compute/src/V1/resources/instance_templates_client_config.json +++ b/Compute/src/V1/resources/instance_templates_client_config.json @@ -39,6 +39,11 @@ } }, "methods": { + "AggregatedList": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "Delete": { "timeout_millis": 600000, "retry_codes_name": "no_retry_1_codes", diff --git a/Compute/src/V1/resources/instance_templates_descriptor_config.php b/Compute/src/V1/resources/instance_templates_descriptor_config.php index bc60f17c950..f0514123832 100644 --- a/Compute/src/V1/resources/instance_templates_descriptor_config.php +++ b/Compute/src/V1/resources/instance_templates_descriptor_config.php @@ -33,6 +33,16 @@ 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, ], ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + ], 'List' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', diff --git a/Compute/src/V1/resources/instance_templates_rest_client_config.php b/Compute/src/V1/resources/instance_templates_rest_client_config.php index 9e3ace20a3f..cafed04e8cb 100644 --- a/Compute/src/V1/resources/instance_templates_rest_client_config.php +++ b/Compute/src/V1/resources/instance_templates_rest_client_config.php @@ -3,6 +3,17 @@ return [ 'interfaces' => [ 'google.cloud.compute.v1.InstanceTemplates' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/instanceTemplates', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], 'Delete' => [ 'method' => 'delete', 'uriTemplate' => '/compute/v1/projects/{project}/global/instanceTemplates/{instance_template}', diff --git a/Compute/src/V1/resources/instances_client_config.json b/Compute/src/V1/resources/instances_client_config.json index c50611b6da5..d873b60a32f 100644 --- a/Compute/src/V1/resources/instances_client_config.json +++ b/Compute/src/V1/resources/instances_client_config.json @@ -189,6 +189,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "SetName": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "SetScheduling": { "timeout_millis": 600000, "retry_codes_name": "no_retry_1_codes", diff --git a/Compute/src/V1/resources/instances_descriptor_config.php b/Compute/src/V1/resources/instances_descriptor_config.php index 2e31ed3dd5a..dd355691f41 100644 --- a/Compute/src/V1/resources/instances_descriptor_config.php +++ b/Compute/src/V1/resources/instances_descriptor_config.php @@ -291,6 +291,22 @@ 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, ], ], + 'SetName' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + 'getZone', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + ], 'SetScheduling' => [ 'longRunning' => [ 'additionalArgumentMethods' => [ diff --git a/Compute/src/V1/resources/instances_rest_client_config.php b/Compute/src/V1/resources/instances_rest_client_config.php index 5ced3773a1e..0f3b736ca25 100644 --- a/Compute/src/V1/resources/instances_rest_client_config.php +++ b/Compute/src/V1/resources/instances_rest_client_config.php @@ -637,6 +637,28 @@ ], ], ], + 'SetName' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setName', + 'body' => 'instances_set_name_request_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], 'SetScheduling' => [ 'method' => 'post', 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setScheduling', diff --git a/Compute/src/V1/resources/region_disks_client_config.json b/Compute/src/V1/resources/region_disks_client_config.json index d64bb5bf4cc..d43983b46d0 100644 --- a/Compute/src/V1/resources/region_disks_client_config.json +++ b/Compute/src/V1/resources/region_disks_client_config.json @@ -98,6 +98,11 @@ "timeout_millis": 600000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" + }, + "Update": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" } } } diff --git a/Compute/src/V1/resources/region_disks_descriptor_config.php b/Compute/src/V1/resources/region_disks_descriptor_config.php index 383f0df8933..144d607dd9d 100644 --- a/Compute/src/V1/resources/region_disks_descriptor_config.php +++ b/Compute/src/V1/resources/region_disks_descriptor_config.php @@ -115,6 +115,22 @@ 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, ], ], + 'Update' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + 'getRegion', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + ], 'List' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', diff --git a/Compute/src/V1/resources/region_disks_rest_client_config.php b/Compute/src/V1/resources/region_disks_rest_client_config.php index 0922b3ab922..dca561ce4e8 100644 --- a/Compute/src/V1/resources/region_disks_rest_client_config.php +++ b/Compute/src/V1/resources/region_disks_rest_client_config.php @@ -253,6 +253,28 @@ ], ], ], + 'Update' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/{disk}', + 'body' => 'disk_resource', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], ], 'google.cloud.compute.v1.RegionOperations' => [ 'Delete' => [ diff --git a/Compute/src/V1/resources/region_instance_templates_client_config.json b/Compute/src/V1/resources/region_instance_templates_client_config.json new file mode 100644 index 00000000000..fb8e7b79d31 --- /dev/null +++ b/Compute/src/V1/resources/region_instance_templates_client_config.json @@ -0,0 +1,65 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionInstanceTemplates": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "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": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Delete": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Insert": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/Compute/src/V1/resources/region_instance_templates_descriptor_config.php b/Compute/src/V1/resources/region_instance_templates_descriptor_config.php new file mode 100644 index 00000000000..85dba76747f --- /dev/null +++ b/Compute/src/V1/resources/region_instance_templates_descriptor_config.php @@ -0,0 +1,50 @@ + [ + 'google.cloud.compute.v1.RegionInstanceTemplates' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + 'getRegion', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + 'getRegion', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + ], + ], + ], +]; diff --git a/Compute/src/V1/resources/region_instance_templates_rest_client_config.php b/Compute/src/V1/resources/region_instance_templates_rest_client_config.php new file mode 100644 index 00000000000..3a3a87d4b5d --- /dev/null +++ b/Compute/src/V1/resources/region_instance_templates_rest_client_config.php @@ -0,0 +1,164 @@ + [ + 'google.cloud.compute.v1.RegionInstanceTemplates' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceTemplates/{instance_template}', + 'placeholders' => [ + 'instance_template' => [ + 'getters' => [ + 'getInstanceTemplate', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceTemplates/{instance_template}', + 'placeholders' => [ + 'instance_template' => [ + 'getters' => [ + 'getInstanceTemplate', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceTemplates', + 'body' => 'instance_template_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceTemplates', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.RegionOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/Compute/tests/Unit/V1/DisksClientTest.php b/Compute/tests/Unit/V1/DisksClientTest.php index dde5518cf55..870a365e48b 100644 --- a/Compute/tests/Unit/V1/DisksClientTest.php +++ b/Compute/tests/Unit/V1/DisksClientTest.php @@ -1418,4 +1418,127 @@ public function testIamPermissionsExceptionTest() $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); } + + /** @test */ + public function updateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + '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('customOperations/updateTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updateTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $diskResource = new Disk(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->update($disk, $diskResource, $project, $zone); + $this->assertFalse($response->isDone()); + $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.compute.v1.Disks/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getDiskResource(); + $this->assertProtobufEquals($diskResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $expectedOperationsRequestObject = new GetZoneOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $expectedOperationsRequestObject->setZone($zone); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $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.cloud.compute.v1.ZoneOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + '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('customOperations/updateExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $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 + $disk = 'disk3083677'; + $diskResource = new Disk(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->update($disk, $diskResource, $project, $zone); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } } diff --git a/Compute/tests/Unit/V1/ForwardingRulesClientTest.php b/Compute/tests/Unit/V1/ForwardingRulesClientTest.php index 7d64c39a1a7..74baaa74630 100644 --- a/Compute/tests/Unit/V1/ForwardingRulesClientTest.php +++ b/Compute/tests/Unit/V1/ForwardingRulesClientTest.php @@ -276,6 +276,7 @@ public function getTest() $allPorts = true; $allowGlobalAccess = true; $backendService = 'backendService306946058'; + $baseForwardingRule = 'baseForwardingRule524873104'; $creationTimestamp = 'creationTimestamp567396278'; $description = 'description-1724546052'; $fingerprint = 'fingerprint-1375934236'; @@ -304,6 +305,7 @@ public function getTest() $expectedResponse->setAllPorts($allPorts); $expectedResponse->setAllowGlobalAccess($allowGlobalAccess); $expectedResponse->setBackendService($backendService); + $expectedResponse->setBaseForwardingRule($baseForwardingRule); $expectedResponse->setCreationTimestamp($creationTimestamp); $expectedResponse->setDescription($description); $expectedResponse->setFingerprint($fingerprint); diff --git a/Compute/tests/Unit/V1/GlobalForwardingRulesClientTest.php b/Compute/tests/Unit/V1/GlobalForwardingRulesClientTest.php index 5d57a272beb..5d2ccf5677d 100644 --- a/Compute/tests/Unit/V1/GlobalForwardingRulesClientTest.php +++ b/Compute/tests/Unit/V1/GlobalForwardingRulesClientTest.php @@ -194,6 +194,7 @@ public function getTest() $allPorts = true; $allowGlobalAccess = true; $backendService = 'backendService306946058'; + $baseForwardingRule = 'baseForwardingRule524873104'; $creationTimestamp = 'creationTimestamp567396278'; $description = 'description-1724546052'; $fingerprint = 'fingerprint-1375934236'; @@ -222,6 +223,7 @@ public function getTest() $expectedResponse->setAllPorts($allPorts); $expectedResponse->setAllowGlobalAccess($allowGlobalAccess); $expectedResponse->setBackendService($backendService); + $expectedResponse->setBaseForwardingRule($baseForwardingRule); $expectedResponse->setCreationTimestamp($creationTimestamp); $expectedResponse->setDescription($description); $expectedResponse->setFingerprint($fingerprint); diff --git a/Compute/tests/Unit/V1/InstanceTemplatesClientTest.php b/Compute/tests/Unit/V1/InstanceTemplatesClientTest.php index 5652da9e9c6..3eb7ebb80a5 100644 --- a/Compute/tests/Unit/V1/InstanceTemplatesClientTest.php +++ b/Compute/tests/Unit/V1/InstanceTemplatesClientTest.php @@ -30,8 +30,10 @@ use Google\Cloud\Compute\V1\GlobalOperationsClient; use Google\Cloud\Compute\V1\GlobalSetPolicyRequest; use Google\Cloud\Compute\V1\InstanceTemplate; +use Google\Cloud\Compute\V1\InstanceTemplateAggregatedList; use Google\Cloud\Compute\V1\InstanceTemplateList; use Google\Cloud\Compute\V1\InstanceTemplatesClient; +use Google\Cloud\Compute\V1\InstanceTemplatesScopedList; use Google\Cloud\Compute\V1\Operation; use Google\Cloud\Compute\V1\Operation\Status; use Google\Cloud\Compute\V1\Policy; @@ -68,6 +70,81 @@ private function createClient(array $options = []) return new InstanceTemplatesClient($options); } + /** @test */ + public function aggregatedListTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new InstanceTemplatesScopedList(), + ]; + $expectedResponse = new InstanceTemplateAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $response = $gapicClient->aggregatedList($project); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertArrayHasKey('itemsKey', $expectedResponse->getItems()); + $this->assertArrayHasKey('itemsKey', $resources); + $this->assertEquals($expectedResponse->getItems()['itemsKey'], $resources['itemsKey']); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InstanceTemplates/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListExceptionTest() + { + $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 + $project = 'project-309310695'; + try { + $gapicClient->aggregatedList($project); + // 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 deleteTest() { @@ -196,6 +273,7 @@ public function getTest() $id = 3355; $kind = 'kind3292052'; $name = 'name3373707'; + $region = 'region-934795532'; $selfLink = 'selfLink-1691268851'; $sourceInstance = 'sourceInstance-677426119'; $expectedResponse = new InstanceTemplate(); @@ -204,6 +282,7 @@ public function getTest() $expectedResponse->setId($id); $expectedResponse->setKind($kind); $expectedResponse->setName($name); + $expectedResponse->setRegion($region); $expectedResponse->setSelfLink($selfLink); $expectedResponse->setSourceInstance($sourceInstance); $transport->addResponse($expectedResponse); diff --git a/Compute/tests/Unit/V1/InstancesClientTest.php b/Compute/tests/Unit/V1/InstancesClientTest.php index 5a78bc2ee6e..8007c701a90 100644 --- a/Compute/tests/Unit/V1/InstancesClientTest.php +++ b/Compute/tests/Unit/V1/InstancesClientTest.php @@ -45,6 +45,7 @@ use Google\Cloud\Compute\V1\InstancesSetMachineResourcesRequest; use Google\Cloud\Compute\V1\InstancesSetMachineTypeRequest; use Google\Cloud\Compute\V1\InstancesSetMinCpuPlatformRequest; +use Google\Cloud\Compute\V1\InstancesSetNameRequest; use Google\Cloud\Compute\V1\InstancesSetServiceAccountRequest; use Google\Cloud\Compute\V1\InstancesStartWithEncryptionKeyRequest; use Google\Cloud\Compute\V1\Metadata; @@ -3223,6 +3224,129 @@ public function setMinCpuPlatformExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function setNameTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + '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('customOperations/setNameTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setNameTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesSetNameRequestResource = new InstancesSetNameRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setName($instance, $instancesSetNameRequestResource, $project, $zone); + $this->assertFalse($response->isDone()); + $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.compute.v1.Instances/SetName', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesSetNameRequestResource(); + $this->assertProtobufEquals($instancesSetNameRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $expectedOperationsRequestObject = new GetZoneOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $expectedOperationsRequestObject->setZone($zone); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $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.cloud.compute.v1.ZoneOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setNameExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + '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('customOperations/setNameExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $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 + $instance = 'instance555127957'; + $instancesSetNameRequestResource = new InstancesSetNameRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setName($instance, $instancesSetNameRequestResource, $project, $zone); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + 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 setSchedulingTest() { diff --git a/Compute/tests/Unit/V1/RegionDisksClientTest.php b/Compute/tests/Unit/V1/RegionDisksClientTest.php index 20e97833783..8184d37e11d 100644 --- a/Compute/tests/Unit/V1/RegionDisksClientTest.php +++ b/Compute/tests/Unit/V1/RegionDisksClientTest.php @@ -1341,4 +1341,127 @@ public function testIamPermissionsExceptionTest() $transport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); } + + /** @test */ + public function updateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + '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('customOperations/updateTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updateTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $diskResource = new Disk(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->update($disk, $diskResource, $project, $region); + $this->assertFalse($response->isDone()); + $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.compute.v1.RegionDisks/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getDiskResource(); + $this->assertProtobufEquals($diskResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $expectedOperationsRequestObject = new GetRegionOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $expectedOperationsRequestObject->setRegion($region); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $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.cloud.compute.v1.RegionOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + '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('customOperations/updateExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $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 + $disk = 'disk3083677'; + $diskResource = new Disk(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->update($disk, $diskResource, $project, $region); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } } diff --git a/Compute/tests/Unit/V1/RegionInstanceTemplatesClientTest.php b/Compute/tests/Unit/V1/RegionInstanceTemplatesClientTest.php new file mode 100644 index 00000000000..bea93c9829c --- /dev/null +++ b/Compute/tests/Unit/V1/RegionInstanceTemplatesClientTest.php @@ -0,0 +1,464 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionInstanceTemplatesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionInstanceTemplatesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + '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('customOperations/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceTemplate = 'instanceTemplate309248228'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($instanceTemplate, $project, $region); + $this->assertFalse($response->isDone()); + $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.compute.v1.RegionInstanceTemplates/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceTemplate(); + $this->assertProtobufEquals($instanceTemplate, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $expectedOperationsRequestObject = new GetRegionOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $expectedOperationsRequestObject->setRegion($region); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $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.cloud.compute.v1.RegionOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + '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('customOperations/deleteExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $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 + $instanceTemplate = 'instanceTemplate309248228'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($instanceTemplate, $project, $region); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + 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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $sourceInstance = 'sourceInstance-677426119'; + $expectedResponse = new InstanceTemplate(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSourceInstance($sourceInstance); + $transport->addResponse($expectedResponse); + // Mock request + $instanceTemplate = 'instanceTemplate309248228'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($instanceTemplate, $project, $region); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionInstanceTemplates/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceTemplate(); + $this->assertProtobufEquals($instanceTemplate, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getExceptionTest() + { + $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 + $instanceTemplate = 'instanceTemplate309248228'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($instanceTemplate, $project, $region); + // 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 insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + '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('customOperations/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceTemplateResource = new InstanceTemplate(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($instanceTemplateResource, $project, $region); + $this->assertFalse($response->isDone()); + $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.compute.v1.RegionInstanceTemplates/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceTemplateResource(); + $this->assertProtobufEquals($instanceTemplateResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $expectedOperationsRequestObject = new GetRegionOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $expectedOperationsRequestObject->setRegion($region); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $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.cloud.compute.v1.RegionOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + '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('customOperations/insertExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $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 + $instanceTemplateResource = new InstanceTemplate(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($instanceTemplateResource, $project, $region); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + 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 listTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new InstanceTemplate(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceTemplateList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->list($project, $region); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getItems()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionInstanceTemplates/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listExceptionTest() + { + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->list($project, $region); + // 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()); + } +}